# IAM

Teams, access policies and their attachments, the action catalogue, the member baseline, members, effective access and the simulator.

Source: https://docs.pantechdynamics.com/api/iam

Create policies of allow and deny statements, attach them to members or teams, and check decisions with the simulator. Owners are always allowed; a matching deny wins over everything else; admins are allowed unless denied; members are allowed by a matching allow, or for reads by the baseline. See [teams and access policies](https://docs.pantechdynamics.com/iam/overview), [writing policies](https://docs.pantechdynamics.com/iam/policies) and the [action catalogue](https://docs.pantechdynamics.com/iam/actions).

Endpoints:

- `GET /public/v1/iam/actions`: List actions
- `GET /public/v1/iam/settings`: Get the access setting
- `PUT /public/v1/iam/settings`: Change the access setting
- `GET /public/v1/iam/teams`: List teams
- `POST /public/v1/iam/teams`: Create a team
- `GET /public/v1/iam/teams/{team_id}`: Get a team
- `PATCH /public/v1/iam/teams/{team_id}`: Rename a team
- `DELETE /public/v1/iam/teams/{team_id}`: Delete a team
- `GET /public/v1/iam/teams/{team_id}/members`: List a team's members
- `PUT /public/v1/iam/teams/{team_id}/members/{user_id}`: Add a member to a team
- `DELETE /public/v1/iam/teams/{team_id}/members/{user_id}`: Remove a member from a team
- `GET /public/v1/iam/members`: List members
- `GET /public/v1/iam/members/{user_id}/effective-access`: Get a member's effective access
- `POST /public/v1/iam/simulate`: Simulate an access decision
- `GET /public/v1/iam/policies`: List policies
- `POST /public/v1/iam/policies`: Create a policy
- `GET /public/v1/iam/policies/{policy_id}`: Get a policy
- `PUT /public/v1/iam/policies/{policy_id}`: Replace a policy
- `DELETE /public/v1/iam/policies/{policy_id}`: Delete a policy
- `GET /public/v1/iam/policies/{policy_id}/attachments`: List a policy's attachments
- `POST /public/v1/iam/policies/{policy_id}/attachments`: Attach a policy
- `DELETE /public/v1/iam/policies/{policy_id}/attachments/{principal_type}/{principal_id}`: Detach a policy

## The IAM team object

A named group of the organization's members.

- `id` (string, required)
- `name` (string, required): 1 to 64 characters, unique in the organization (case-insensitive).
- `description` (string, required)
- `member_count` (integer, required)
- `policy_ids` (array of string, required): The policies attached to the team.
- `created_at` (string, required)
- `updated_at` (string, required)
- `version` (integer, required)
## The IAM team member object



- `user_id` (string, required)
- `email` (string, required)
- `name` (string, required)
- `role` (string, required): One of `owner`, `admin`, `member`.
- `added_at` (string, required)
## The IAM member object

An active member of the organization.

- `user_id` (string, required)
- `email` (string, required)
- `name` (string, required)
- `role` (string, required): One of `owner`, `admin`, `member`.
- `team_ids` (array of string, required)
- `policy_count` (integer, required): Distinct policies that apply to the member, attached directly or through any of their teams.
## The IAM policy object

A named document of statements: the organization's own, or one of Pantech's managed policies (`managed: true`, id `pol_pantech_<name>`, read-only).

- `id` (string, required)
- `name` (string, required)
- `description` (string, required)
- `managed` (boolean, required)
- `statements` (array of IamStatement, required)
  - `sid` (string or null): Optional (null when absent), unique within the policy, 1 to 64 letters, digits, `_` or `-`.
  - `effect` (string, required): One of `allow`, `deny`.
  - `actions` (array of string, required): Actions from `GET /iam/actions`. `*` is a glob over the whole action string: `instances:*`, `*:Read`, `*`. `*:Delete` matches only verbs that are exactly `Delete`. At most 50 items.
  - `resources` (array of string, required): `*`, a resource id (`vm_…`, `dnsz_…`), or `name:<glob>` matched against the resource's name (`*` and `?`, case-insensitive). An action that creates something matches `*` or a `name:` glob against the name being created. At most 50 items.
  - `conditions` (object or null): All present conditions must hold for the statement to apply; null for none.
    - `source_ip` (array of string): The request's client address is in one of these IPv4 or IPv6 CIDR blocks (a bare address is its /32 or /128). Null for any address. At most 20 items.
    - `mfa` (boolean or null): `true`: applies only when the session authenticated with MFA. `false`: applies only when the request lacks MFA. API keys never carry MFA, so a deny with `mfa: false` blocks the action for keys too. Null or omitted: either way.
- `attachment_count` (integer, required)
- `created_at` (string, required)
- `updated_at` (string, required)
- `version` (integer, required): Send as `If-Match` to change the policy only if it has not changed since.
## The IAM statement object



- `sid` (string or null): Optional (null when absent), unique within the policy, 1 to 64 letters, digits, `_` or `-`.
- `effect` (string, required): One of `allow`, `deny`.
- `actions` (array of string, required): Actions from `GET /iam/actions`. `*` is a glob over the whole action string: `instances:*`, `*:Read`, `*`. `*:Delete` matches only verbs that are exactly `Delete`. At most 50 items.
- `resources` (array of string, required): `*`, a resource id (`vm_…`, `dnsz_…`), or `name:<glob>` matched against the resource's name (`*` and `?`, case-insensitive). An action that creates something matches `*` or a `name:` glob against the name being created. At most 50 items.
- `conditions` (object or null): All present conditions must hold for the statement to apply; null for none.
  - `source_ip` (array of string): The request's client address is in one of these IPv4 or IPv6 CIDR blocks (a bare address is its /32 or /128). Null for any address. At most 20 items.
  - `mfa` (boolean or null): `true`: applies only when the session authenticated with MFA. `false`: applies only when the request lacks MFA. API keys never carry MFA, so a deny with `mfa: false` blocks the action for keys too. Null or omitted: either way.
## The IAM attachment object



- `policy_id` (string, required)
- `principal_type` (string, required): One of `member`, `team`.
- `principal_id` (string, required): A member's user id (`usr_…`) or a team id (`team_…`).
- `attached_at` (string, required)
## The IAM action object

One action of the closed catalogue.

- `action` (string, required): `<service>:<verb>`.
- `service` (string, required)
- `description` (string, required)
- `resource_types` (array of string, required): What the action is on; empty for an account-wide action such as `billing:BuyCredit`.
- `read` (boolean, required): The action only reads. A `read` key may call it, and the `read` member baseline grants it (except `iam:Read`).
## The IAM settings object

The organization's access setting.

- `member_baseline` (string, required): What a member may do with no policy: `read` every Read action (the default), or `none`. One of `read`, `none`.
- `version` (integer, required): 0 until an owner first changes it.
- `updated_at` (string or null, required)
## The IAM effective access object



- `user_id` (string, required)
- `role` (string, required): One of `owner`, `admin`, `member`.
- `teams` (array of string, required)
- `policies` (array of IamEffectivePolicy, required)
  - `policy_id` (string, required)
  - `team_id` (string or null, required): The team that brought the policy; null when it is attached to the member directly.
- `member_baseline` (string, required): One of `read`, `none`.
## The IAM simulation object



- `allowed` (boolean, required)
- `decision` (string, required): One of `owner`, `admin`, `allow`, `baseline_read`, `explicit_deny`, `implicit_deny`.
- `policy_id` (string or null, required): The policy whose statement decided, for `allow` and `explicit_deny`.
- `sid` (string or null, required): That statement's sid, when it has one.
## List actions

```http
GET /public/v1/iam/actions
```

Every action a statement can name, with what it is on and whether it only reads. Any member.

Scope: `read`.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/actions" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "action": "instances:Stop",
      "service": "instances",
      "description": "description",
      "resource_types": [
        "resource-types"
      ],
      "read": true
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Get the access setting

```http
GET /public/v1/iam/settings
```

The organization's `member_baseline`. Owners and admins, and members with `iam:Read`.

Scope: `read`.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/settings" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "member_baseline": "read",
  "version": 1,
  "updated_at": "2026-10-03T09:30:00Z"
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Change the access setting

```http
PUT /public/v1/iam/settings
```

Sets `member_baseline`: `read` lets every member read everything (today's behaviour), `none` lets members do only what their policies allow. Owners only; owners are emailed a security notice when it changes.

**Idempotency:** requires an `Idempotency-Key`.

Scope: `write`. Send an `Idempotency-Key` header.

Body:

- `member_baseline` (string, required): One of `read`, `none`.

Example:

```sh
curl -X PUT "https://api.pantechdynamics.com/public/v1/iam/settings" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "member_baseline": "read"
  }'
```

Response `200`:

```json
{
  "member_baseline": "read",
  "version": 1,
  "updated_at": "2026-10-03T09:30:00Z"
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `412`: `VERSION_CONFLICT`: `If-Match` is not the current version.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `VALIDATION_FAILED`: `member_baseline` is not `read` or `none`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List teams

```http
GET /public/v1/iam/teams
```

The organization's teams, oldest first. Owners and admins, and members with `iam:Read`.

Scope: `read`.

Query parameters:

- `limit` (integer): Items per page, 1 to 100. Defaults to 50. From 1 to 100. Defaults to `50`.
- `cursor` (string): The previous page's `next_cursor`, to get the next page. Leave out for the first page; keep the other parameters the same.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/teams" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "id": "team_01jd8x2v3k",
      "name": "web-1",
      "description": "description",
      "member_count": 1,
      "policy_ids": [
        "policy-ids"
      ],
      "created_at": "2026-10-03T09:30:00Z",
      "updated_at": "2026-10-03T09:30:00Z",
      "version": 1
    }
  ],
  "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
}
```

Errors:

- `400`: `INVALID_PAGE`, `INVALID_CURSOR`.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Create a team

```http
POST /public/v1/iam/teams
```

At most 50 teams per organization. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`. A retry with the same key and request returns what the first request made, with the same status; the same key with a different request returns `409 IDEMPOTENCY_CONFLICT`.

Scope: `write`. Send an `Idempotency-Key` header.

Body:

- `name` (string, required): 1 to 64 characters, trimmed.
- `description` (string): At most 255 characters.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/iam/teams" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform"
  }'
```

Response `201`:

```json
{
  "id": "team_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "member_count": 1,
  "policy_ids": [
    "policy-ids"
  ],
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `409`: `IAM_TEAM_NAME_TAKEN`, `IDEMPOTENCY_CONFLICT`.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `VALIDATION_FAILED`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Get a team

```http
GET /public/v1/iam/teams/{team_id}
```

Owners and admins, and members with `iam:Read`.

Scope: `read`.

Path parameters:

- `team_id`

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "id": "team_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "member_count": 1,
  "policy_ids": [
    "policy-ids"
  ],
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Rename a team

```http
PATCH /public/v1/iam/teams/{team_id}
```

Changes the name or description; fields left out keep their value. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `team_id`

Body:

- `name` (string): A new name, 1 to 64 characters.
- `description` (string): A new description, at most 255 characters.

Example:

```sh
curl -X PATCH "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Response `200`:

```json
{
  "id": "team_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "member_count": 1,
  "policy_ids": [
    "policy-ids"
  ],
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`.
- `409`: `IAM_TEAM_NAME_TAKEN`.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `VALIDATION_FAILED`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Delete a team

```http
DELETE /public/v1/iam/teams/{team_id}
```

Removes the team, its memberships and its policy attachments. Only owners may delete a team that contains an admin. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`.

**Destructive:** an AI app's key also needs the `delete` scope.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `team_id`

Example:

```sh
curl -X DELETE "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `204`: Delete a team.

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List a team's members

```http
GET /public/v1/iam/teams/{team_id}/members
```

Owners and admins, and members with `iam:Read`.

Scope: `read`.

Path parameters:

- `team_id`

Query parameters:

- `limit` (integer): Items per page, 1 to 100. Defaults to 50. From 1 to 100. Defaults to `50`.
- `cursor` (string): The previous page's `next_cursor`, to get the next page. Leave out for the first page; keep the other parameters the same.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w/members" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "user_id": "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "email": "email",
      "name": "web-1",
      "role": "owner",
      "added_at": "2026-10-03T09:30:00Z"
    }
  ],
  "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
}
```

Errors:

- `400`: `INVALID_PAGE`, `INVALID_CURSOR`.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Add a member to a team

```http
PUT /public/v1/iam/teams/{team_id}/members/{user_id}
```

Takes no body. Adding someone already in the team answers them unchanged. Admins may add and remove members only, never an admin or owner.

**Idempotency:** requires an `Idempotency-Key`. Repeating it is safe: it answers the existing membership or attachment.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `team_id`
- `user_id`

Example:

```sh
curl -X PUT "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w/members/usr_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `200`:

```json
{
  "user_id": "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "email": "email",
  "name": "web-1",
  "role": "owner",
  "added_at": "2026-10-03T09:30:00Z"
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`, `MEMBER_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Remove a member from a team

```http
DELETE /public/v1/iam/teams/{team_id}/members/{user_id}
```

Admins may remove members only.

**Idempotency:** requires an `Idempotency-Key`.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `team_id`
- `user_id`

Example:

```sh
curl -X DELETE "https://api.pantechdynamics.com/public/v1/iam/teams/team_06gk3x9tq7m2v8r4y1c5d0zp8w/members/usr_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `204`: Remove a member from a team.

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_TEAM_NOT_FOUND`, `MEMBER_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List members

```http
GET /public/v1/iam/members
```

The organization's active members with their teams and how many policies apply to each, by when they joined. Owners and admins, and members with `iam:Read`.

Scope: `read`.

Query parameters:

- `q` (string): Only members whose email or name contains this text (case-insensitive), at most 320 characters. At most 320 characters.
- `limit` (integer): Items per page, 1 to 100. Defaults to 50. From 1 to 100. Defaults to `50`.
- `cursor` (string): The previous page's `next_cursor`, to get the next page. Leave out for the first page; keep the other parameters the same.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/members" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "user_id": "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "email": "email",
      "name": "web-1",
      "role": "owner",
      "team_ids": [
        "team-ids"
      ],
      "policy_count": 1
    }
  ],
  "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
}
```

Errors:

- `400`: `INVALID_PAGE`, `INVALID_CURSOR`, `INVALID_FILTER`.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Get a member's effective access

```http
GET /public/v1/iam/members/{user_id}/effective-access
```

The member's role, teams and every policy that applies to them, with the team that brought each. Owners and admins, and members with `iam:Read`. Any member may read their own.

Scope: `read`.

Path parameters:

- `user_id`

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/members/usr_06gk3x9tq7m2v8r4y1c5d0zp8w/effective-access" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "user_id": "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "role": "owner",
  "teams": [
    "teams"
  ],
  "policies": [
    {
      "policy_id": "pol_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "team_id": "team_06gk3x9tq7m2v8r4y1c5d0zp8w"
    }
  ],
  "member_baseline": "read"
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `MEMBER_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Simulate an access decision

```http
POST /public/v1/iam/simulate
```

Would this member be allowed this action on this resource? Changes nothing, so it needs only the `read` scope; an `Idempotency-Key`, if sent, is ignored. The answer may name the deciding policy. Owners and admins, and members with `iam:Read`.

Scope: `read`.

Body:

- `user_id` (string, required): The member to simulate.
- `action` (string, required)
- `resource` (string): A resource id, such as `vm_01jd…`.
- `resource_name` (string): The resource's name, for `name:` patterns.
- `source_ip` (string): The client address to simulate.
- `mfa` (boolean): Whether the session signed in with MFA; false when omitted.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/iam/simulate" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "action": "instances:Delete"
  }'
```

Response `200`:

```json
{
  "allowed": true,
  "decision": "owner",
  "policy_id": "pol_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "sid": "sid"
}
```

Errors:

- `400`: `INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `MEMBER_NOT_FOUND`.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `VALIDATION_FAILED`: `action`, `resource` or `source_ip` is invalid.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List policies

```http
GET /public/v1/iam/policies
```

Pantech's managed policies, then the organization's, oldest first. Owners and admins, and members with `iam:Read`.

Scope: `read`.

Query parameters:

- `managed` (boolean): `true` lists Pantech's managed policies only, `false` the organization's only; omit it for both.
- `limit` (integer): Items per page, 1 to 100. Defaults to 50. From 1 to 100. Defaults to `50`.
- `cursor` (string): The previous page's `next_cursor`, to get the next page. Leave out for the first page; keep the other parameters the same.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/policies" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "id": "pol_01jd8x2v3k",
      "name": "web-1",
      "description": "description",
      "managed": true,
      "statements": [
        {
          "sid": "RestartStaging",
          "effect": "allow",
          "actions": [
            "instances:Start",
            "instances:Stop"
          ],
          "resources": [
            "name:staging-*"
          ],
          "conditions": {
            "source_ip": [
              "<office-cidr>"
            ],
            "mfa": true
          }
        }
      ],
      "attachment_count": 1,
      "created_at": "2026-10-03T09:30:00Z",
      "updated_at": "2026-10-03T09:30:00Z",
      "version": 1
    }
  ],
  "next_cursor": "eyJhdCI6IjIwMjYtMTAtMDNUMDk6MzA6MDBaIiwiaWQiOiJ2bV8wNmdrIn0"
}
```

Errors:

- `400`: `INVALID_PAGE`, `INVALID_CURSOR`, `INVALID_FILTER`.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Create a policy

```http
POST /public/v1/iam/policies
```

1 to 20 statements; at most 100 policies per organization. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`. A retry with the same key and request returns what the first request made, with the same status; the same key with a different request returns `409 IDEMPOTENCY_CONFLICT`.

Scope: `write`. Send an `Idempotency-Key` header.

Body:

- `name` (string, required): 1 to 64 letters, digits, spaces, `.`, `_` or `-`, starting with a letter or digit, unique in the organization. Names starting with `pantech_` are reserved.
- `description` (string): At most 255 characters.
- `statements` (array of IamStatement, required): At most 20 items.
  - `sid` (string or null): Optional (null when absent), unique within the policy, 1 to 64 letters, digits, `_` or `-`.
  - `effect` (string, required): One of `allow`, `deny`.
  - `actions` (array of string, required): Actions from `GET /iam/actions`. `*` is a glob over the whole action string: `instances:*`, `*:Read`, `*`. `*:Delete` matches only verbs that are exactly `Delete`. At most 50 items.
  - `resources` (array of string, required): `*`, a resource id (`vm_…`, `dnsz_…`), or `name:<glob>` matched against the resource's name (`*` and `?`, case-insensitive). An action that creates something matches `*` or a `name:` glob against the name being created. At most 50 items.
  - `conditions` (object or null): All present conditions must hold for the statement to apply; null for none.
    - `source_ip` (array of string): The request's client address is in one of these IPv4 or IPv6 CIDR blocks (a bare address is its /32 or /128). Null for any address. At most 20 items.
    - `mfa` (boolean or null): `true`: applies only when the session authenticated with MFA. `false`: applies only when the request lacks MFA. API keys never carry MFA, so a deny with `mfa: false` blocks the action for keys too. Null or omitted: either way.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/iam/policies" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "staging-operators",
    "statements": [
      {
        "sid": "RestartStaging",
        "effect": "allow",
        "actions": [
          "instances:Start",
          "instances:Stop"
        ],
        "resources": [
          "name:staging-*"
        ],
        "conditions": {
          "source_ip": [
            "<office-cidr>"
          ],
          "mfa": true
        }
      }
    ]
  }'
```

Response `201`:

```json
{
  "id": "pol_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "managed": true,
  "statements": [
    {
      "sid": "RestartStaging",
      "effect": "allow",
      "actions": [
        "instances:Start",
        "instances:Stop"
      ],
      "resources": [
        "name:staging-*"
      ],
      "conditions": {
        "source_ip": [
          "<office-cidr>"
        ],
        "mfa": true
      }
    }
  ],
  "attachment_count": 1,
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `409`: `IAM_POLICY_NAME_TAKEN`, `IDEMPOTENCY_CONFLICT`.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `INVALID_POLICY`: `errors` names each bad field, such as `statements[0].actions[2]` or `statements[1].conditions.source_ip[0]`. `VALIDATION_FAILED`: `name` or `description`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Get a policy

```http
GET /public/v1/iam/policies/{policy_id}
```

Owners and admins, and members with `iam:Read`.

Scope: `read`.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "id": "pol_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "managed": true,
  "statements": [
    {
      "sid": "RestartStaging",
      "effect": "allow",
      "actions": [
        "instances:Start",
        "instances:Stop"
      ],
      "resources": [
        "name:staging-*"
      ],
      "conditions": {
        "source_ip": [
          "<office-cidr>"
        ],
        "mfa": true
      }
    }
  ],
  "attachment_count": 1,
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Replace a policy

```http
PUT /public/v1/iam/policies/{policy_id}
```

Replaces the name, description and statements. Pantech's policies cannot be changed. Only owners may change a policy that applies to an admin. Owners are emailed when the change gives a member a write action they did not have. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.

Body:

- `name` (string, required): 1 to 64 letters, digits, spaces, `.`, `_` or `-`, starting with a letter or digit, unique in the organization. Names starting with `pantech_` are reserved.
- `description` (string): At most 255 characters.
- `statements` (array of IamStatement, required): At most 20 items.
  - `sid` (string or null): Optional (null when absent), unique within the policy, 1 to 64 letters, digits, `_` or `-`.
  - `effect` (string, required): One of `allow`, `deny`.
  - `actions` (array of string, required): Actions from `GET /iam/actions`. `*` is a glob over the whole action string: `instances:*`, `*:Read`, `*`. `*:Delete` matches only verbs that are exactly `Delete`. At most 50 items.
  - `resources` (array of string, required): `*`, a resource id (`vm_…`, `dnsz_…`), or `name:<glob>` matched against the resource's name (`*` and `?`, case-insensitive). An action that creates something matches `*` or a `name:` glob against the name being created. At most 50 items.
  - `conditions` (object or null): All present conditions must hold for the statement to apply; null for none.
    - `source_ip` (array of string): The request's client address is in one of these IPv4 or IPv6 CIDR blocks (a bare address is its /32 or /128). Null for any address. At most 20 items.
    - `mfa` (boolean or null): `true`: applies only when the session authenticated with MFA. `false`: applies only when the request lacks MFA. API keys never carry MFA, so a deny with `mfa: false` blocks the action for keys too. Null or omitted: either way.

Example:

```sh
curl -X PUT "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "staging-operators",
    "statements": [
      {
        "sid": "RestartStaging",
        "effect": "allow",
        "actions": [
          "instances:Start",
          "instances:Stop"
        ],
        "resources": [
          "name:staging-*"
        ],
        "conditions": {
          "source_ip": [
            "<office-cidr>"
          ],
          "mfa": true
        }
      }
    ]
  }'
```

Response `200`:

```json
{
  "id": "pol_01jd8x2v3k",
  "name": "web-1",
  "description": "description",
  "managed": true,
  "statements": [
    {
      "sid": "RestartStaging",
      "effect": "allow",
      "actions": [
        "instances:Start",
        "instances:Stop"
      ],
      "resources": [
        "name:staging-*"
      ],
      "conditions": {
        "source_ip": [
          "<office-cidr>"
        ],
        "mfa": true
      }
    }
  ],
  "attachment_count": 1,
  "created_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "version": 1
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`.
- `409`: `IAM_MANAGED_POLICY`, `IAM_POLICY_NAME_TAKEN`.
- `412`: `VERSION_CONFLICT`: `If-Match` is not the current version.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `INVALID_POLICY`, `VALIDATION_FAILED`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Delete a policy

```http
DELETE /public/v1/iam/policies/{policy_id}
```

Deletes the policy and detaches it everywhere. Pantech's policies cannot be deleted. Only owners may delete a policy that applies to an admin. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`.

**Destructive:** an AI app's key also needs the `delete` scope.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.

Example:

```sh
curl -X DELETE "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `204`: Delete a policy.

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`.
- `409`: `IAM_MANAGED_POLICY`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List a policy's attachments

```http
GET /public/v1/iam/policies/{policy_id}/attachments
```

Owners and admins, and members with `iam:Read`.

Scope: `read`.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w/attachments" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "policy_id": "pol_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "principal_type": "member",
      "principal_id": "principal-id",
      "attached_at": "2026-10-03T09:30:00Z"
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `read` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Attach a policy

```http
POST /public/v1/iam/policies/{policy_id}/attachments
```

Attaches the policy to a member or a team: `201` with the new attachment, or `200` with the existing one when it is already attached. At most 10 policies per member and per team. Only owners may attach to an admin or a team containing an admin. Owners are emailed when it gives a member write access. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`. Repeating it is safe: it answers the existing membership or attachment.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.

Body:

- `principal_type` (string, required): One of `member`, `team`.
- `principal_id` (string, required): A member's user id or a team id.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w/attachments" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "principal_type": "member",
    "principal_id": "principal-id"
  }'
```

Response `200`:

```json
{
  "policy_id": "pol_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "principal_type": "member",
  "principal_id": "principal-id",
  "attached_at": "2026-10-03T09:30:00Z"
}
```

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
`INVALID_REQUEST_BODY`: the body is not a single valid JSON object.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`, `IAM_TEAM_NOT_FOUND`, `MEMBER_NOT_FOUND`.
- `413`: `REQUEST_TOO_LARGE`: the body is larger than 256 KiB.
- `422`: `VALIDATION_FAILED`: `principal_type`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Detach a policy

```http
DELETE /public/v1/iam/policies/{policy_id}/attachments/{principal_type}/{principal_id}
```

Only owners may detach from an admin or a team containing an admin. Owners and admins. A key with a key policy cannot change IAM.

**Idempotency:** requires an `Idempotency-Key`.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `policy_id`: A policy id, `pol_…` or `pol_pantech_<name>`.
- `principal_type`
- `principal_id`

Example:

```sh
curl -X DELETE "https://api.pantechdynamics.com/public/v1/iam/policies/pol_06gk3x9tq7m2v8r4y1c5d0zp8w/attachments/team/team_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `204`: Detach a policy.

Errors:

- `400`: `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_IDEMPOTENCY_KEY`: send one `Idempotency-Key` of at most 255 characters with every write.
- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the `write` scope. Use a key with that scope.
`ACCESS_DENIED`: the key's member lacks `iam:Read`; `detail` names the action.
`FORBIDDEN`: the key's member is not an owner or admin (owners only for the access setting), or the key has a key policy.
`IAM_ADMIN_TARGET`: only owners act on admins, or on teams containing an admin.
`IAM_TEAM_LIMIT_REACHED`, `IAM_POLICY_LIMIT_REACHED`, `IAM_ATTACHMENT_LIMIT_REACHED`: 50 teams, 100 policies, 10 per member or team.
`AI_APPS_DISABLED`: the organization has turned AI app access off for this key or client.
- `404`: `IAM_POLICY_NOT_FOUND`, `IAM_ATTACHMENT_NOT_FOUND`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `IAM_UNAVAILABLE`: teams and access policies are not available on this deployment yet.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
