Share feedback
Answers are generated based on the documentation.

Get policy

GET/orgs/{org_name}/governance/policies/{policy_id}
Returns the full policy including its allowlist_v0 rule set.

Connection and access

API connection and authentication guidance

https://hub.docker.com/v2

Use one of these alternatives. Requirements within an alternative apply together.

  • bearerAuth

Parameters

org_name path Required

Docker Hub organization name.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

policy_id path Required

Unique policy identifier.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

Request and responses

Response 200

Full policy including its allowlist_v0 rule set.

application/json

Schema: Policy

default

{
  "allowlist_v0": {
    "domain": "network",
    "rules": [
      {
        "actions": [
          "connect:tcp",
          "connect:udp"
        ],
        "decision": "allow",
        "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
        "name": "allow research mirrors",
        "resources": [
          "research.mitre.org",
          "cve.mitre.org"
        ]
      }
    ]
  },
  "created_at": "2026-04-22T00:00:00Z",
  "id": "pol_06evsmp24r1pg71cm8500546pkbn",
  "name": "Security Research — hardened",
  "org": "my-org",
  "scope": {
    "teams": [
      "d290f1ee-6c54-4b01-90e6-d701748f0851"
    ]
  },
  "updated_at": "2026-04-22T00:00:00Z"
}

Response 401

Missing or invalid credentials

application/json

Schema: Error

default

{
  "error": {
    "code": "unauthenticated",
    "message": "unauthenticated"
  }
}

Response 403

Caller lacks the required permission for this org, or the org is not entitled to use governance.

application/json

Schema: Error

default

{
  "error": {
    "code": "permission_denied",
    "message": "permission denied"
  }
}

Response 404

Not found

application/json

Schema: Error

default

{
  "error": {
    "code": "not_found",
    "message": "policy not found"
  }
}

Response 500

Internal server error

application/json

Schema: Error

default

{
  "error": {
    "code": "internal",
    "message": "internal error"
  }
}

Referenced schemas

#/components/schemas/Policy

Complete operation contract
{
  "description": "Returns the full policy including its `allowlist_v0` rule set.",
  "operationId": "getPolicy",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "examples": {
            "default": {
              "value": {
                "allowlist_v0": {
                  "domain": "network",
                  "rules": [
                    {
                      "actions": [
                        "connect:tcp",
                        "connect:udp"
                      ],
                      "decision": "allow",
                      "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
                      "name": "allow research mirrors",
                      "resources": [
                        "research.mitre.org",
                        "cve.mitre.org"
                      ]
                    }
                  ]
                },
                "created_at": "2026-04-22T00:00:00Z",
                "id": "pol_06evsmp24r1pg71cm8500546pkbn",
                "name": "Security Research — hardened",
                "org": "my-org",
                "scope": {
                  "teams": [
                    "d290f1ee-6c54-4b01-90e6-d701748f0851"
                  ]
                },
                "updated_at": "2026-04-22T00:00:00Z"
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Policy"
          }
        }
      },
      "description": "Full policy including its `allowlist_v0` rule set."
    },
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    },
    "403": {
      "$ref": "#/components/responses/PermissionDenied"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    }
  },
  "summary": "Get policy",
  "tags": [
    "policies"
  ]
}