# Agents

Source: https://www.pontive.com/docs/api-reference/management/agents

Base URL: `https://api.{region}.pontive.com/v1` (operations that name another server say so).

Authentication: send `Authorization: Bearer <token>` with a secret key (`pontive_sk_…`, which implies its instance) or an access token issued for this API. A token that can reach several instances also names one with `X-Pontive-Instance-ID: inst_…`. Secret keys are for servers only.

## List agents

```http
GET https://api.{region}.pontive.com/v1/agents
```

List the instance agents and organization agents the caller may read. A caller holding sys:agent:read only on some organizations lists those organizations' own agents.

Operation ID: `ListAgents`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner_type` | string |  | root or org |
| `owner_id` | string |  | The agents one definer defined: an org_ id, or the inst_ id |
| `sponsor` | string |  | The agents this user (usr_) sponsors |
| `no_sponsor` | boolean |  | The agents with no sponsor |
| `status` | string |  | active or deactivated |
| `search` | string |  | Search by name |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |
| `sort` | string |  | created_at, updated_at, name or status; prefix - for descending |

### Responses

- `200` OK: ListAgentsResponse
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create agent

```http
POST https://api.{region}.pontive.com/v1/agents
```

Define an agent (pontive-spec 45 §4): an instance agent (owner_type root; sys:agent:manage on the root) or an organization agent (owner_type org, owner_id its org_ id; sys:agent:manage on the organization). owner_type is the definer's resource-type key (D6, D44). An organization agent is installed in its organization at once, with its requested org roles approved by its creator.

Operation ID: `CreateAgent`

### Request body (`application/json`, required): CreateAgentRequest

Agent definition

### Responses

- `201` Created: Agent
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` agent_wrong_owner: an organization agent has no offer and no auto-install: ErrResponse
- `422` agent_limit_reached: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get agent

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}
```

Get an agent: its definition, requested roles, offer, secrets (previews), keys and sponsors.

Operation ID: `GetAgent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Responses

- `200` OK: Agent
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update agent

```http
PATCH https://api.{region}.pontive.com/v1/agents/{agent_id}
```

Change an agent's definition; an omitted field is left as it is. sponsors, requested_roles and org_access are fields of the agent (D22), each replaced whole when sent: adding a requested role leaves every installation of its type with a pending approval, removing one takes it off every installation at once. jwks_uri (D20) sets or, with null, clears where its keys are fetched from (sys:agent:secret). Turning auto_install on installs the agent, once, in every organization it is offered to.

Operation ID: `UpdateAgent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Request body (`application/json`, required): UpdateAgentRequest

Fields to change

### Responses

- `200` OK: Agent
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` instance_unclaimed: setting a jwks_uri on an unclaimed instance; claim it first (pontive-spec 47): ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete agent

```http
DELETE https://api.{region}.pontive.com/v1/agents/{agent_id}
```

Delete the agent with its installations, offer, sponsors and client grants. Tokens already issued live out their lifetime.

Operation ID: `DeleteAgent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List agent client secrets

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}/client-secrets
```

The agent's client secrets that still authenticate (D19), newest first: preview, label, status, created and expiry, never the value.

Operation ID: `ListAgentClientSecrets`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListClientSecretsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create agent client secret

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/client-secrets
```

Mint a client secret (D19); needs sys:agent:secret. Creating the agent mints none (D45). Its value is returned here only. Without expire_others_in the others are kept, and the create is refused (409 client_secret_limit_reached) while two that do not expire are held; with it, every other secret stops working that many seconds from now (0–604800; 0 at once), so a rotation is one call.

Operation ID: `CreateAgentClientSecret`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Request body (`application/json`): CreateClientSecretRequest

Label and the others' expiry

### Responses

- `201` Created: ClientSecretWithValue
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` client_secret_limit_reached: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete agent client secret

```http
DELETE https://api.{region}.pontive.com/v1/agents/{agent_id}/client-secrets/{secret_id}
```

Remove one of the agent's client secrets (D8, D19); it stops working at once.

Operation ID: `DeleteAgentClientSecret`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |
| `secret_id` | string | yes | Client secret ID |

### Responses

- `204` No Content
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` client_secret_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Deactivate agent

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/deactivate
```

Deactivate an agent: every installation is suspended and its token requests are refused (invalid_client). Its credentials are kept.

Operation ID: `DeactivateAgent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Responses

- `200` OK: Agent
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List agent federated credentials

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}/federated-credentials
```

Every federated credential of the agent (at most 20). Needs sys:agent:read on its definer (the instance root or its organization).

Operation ID: `ListAgentFederatedCredentials`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID (agt_) |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page, 1 to 100 |

### Responses

- `200` OK: ListFederatedCredentialsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create agent federated credential

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/federated-credentials
```

Let the agent authenticate at the token endpoint with a token a trusted issuer signed, with no secret or key of its own (workload identity federation, pontive-spec 20 B7). The workload sends its token as client_assertion, with client_assertion_type urn:ietf:params:oauth:client-assertion-type:jwt-bearer and client_id the agent's id; it is accepted when its iss is the credential's trusted issuer (enabled), its aud one the issuer accepts, exp at most the issuer's max_token_lifetime_seconds (default 3600) ahead and at most that long after iat, its signature the issuer's, its jti unused (unless the issuer has allow_reuse, which accepts the same token until it expires), its sub matches subject and every required claim is present with exactly its value. subject is exact by default; a '*' matches one or more characters within one ':' or '/' segment, and '**' or a '*' in the first segment is refused, so repo:acme/api:environment:* matches every environment of acme/api and nothing else. At most 20 per agent, the name once. Needs sys:agent:secret on its definer (the instance root or its organization).

Operation ID: `CreateAgentFederatedCredential`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID (agt_) |

### Request body (`application/json`, required): CreateFederatedCredentialRequest

Credential

### Responses

- `201` Created: FederatedCredential
- `400` federated_credential_invalid, federated_credential_limit_reached: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` federated_credential_not_found (no such agent), trusted_issuer_not_found: ErrResponse
- `409` federated_credential_conflict: the name is taken: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get agent federated credential

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}/federated-credentials/{credential_id}
```

Needs sys:agent:read on its definer (the instance root or its organization).

Operation ID: `GetAgentFederatedCredential`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID (agt_) |
| `credential_id` | string | yes | Federated credential ID (fic_) |

### Responses

- `200` OK: FederatedCredential
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` federated_credential_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update agent federated credential

```http
PATCH https://api.{region}.pontive.com/v1/agents/{agent_id}/federated-credentials/{credential_id}
```

Change the name, description, subject or required claims; an absent field is left as it is, and required_claims, when present, replaces the map. The trusted issuer never changes. Needs sys:agent:secret on its definer (the instance root or its organization).

Operation ID: `UpdateAgentFederatedCredential`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID (agt_) |
| `credential_id` | string | yes | Federated credential ID (fic_) |

### Request body (`application/json`, required): UpdateFederatedCredentialRequest

Changes

### Responses

- `200` OK: FederatedCredential
- `400` federated_credential_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` federated_credential_not_found: ErrResponse
- `409` federated_credential_conflict: ErrResponse
- `500` Internal Server Error: ErrResponse

## Delete agent federated credential

```http
DELETE https://api.{region}.pontive.com/v1/agents/{agent_id}/federated-credentials/{credential_id}
```

The credential stops authenticating at once; tokens already issued live out their lifetime. Needs sys:agent:secret on its definer (the instance root or its organization).

Operation ID: `DeleteAgentFederatedCredential`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID (agt_) |
| `credential_id` | string | yes | Federated credential ID (fic_) |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` federated_credential_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List agent installations

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}/installations
```

Every installation of the agent — on the root, organizations and resources — with its approved roles, pending approval and status. Each is managed by its id under its home (D21).

Operation ID: `ListAgentInstallations`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListInstallationsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List an agent's offer

```http
GET https://api.{region}.pontive.com/v1/agents/{agent_id}/organizations
```

The organizations an instance agent's selected offer admits (pontive-spec 45 §5.1): its allow-list edge (D22). org_access (all or selected) is a field of the agent.

Operation ID: `ListAgentOrganizations`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListAgentOrganizationsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Add organizations to an agent's offer

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/organizations
```

Add one or more organizations to an instance agent's selected offer (D22); one already offered is not an error. With auto_install on, an organization added is installed.

Operation ID: `CreateAgentOrganizations`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Request body (`application/json`, required): AddAgentOrganizationsRequest

Organizations to add

### Responses

- `200` OK: Organizations
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` agent_wrong_owner: an organization agent has no offer: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Remove an organization from an agent's offer

```http
DELETE https://api.{region}.pontive.com/v1/agents/{agent_id}/organizations/{organization_id}
```

Take one organization off an instance agent's selected offer (D22), which suspends its installations there.

Operation ID: `DeleteAgentOrganization`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |
| `organization_id` | string | yes | Organization ID |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Add agent public key

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/public-keys
```

Add a public JWK to the agent's inline keys, for private_key_jwt (pontive-spec 45 §7.2). The body is the JWK itself, with its public members only: RSA 2048 bits or more, or EC P-256, with a kid. At most three; refused while the agent has a jwks_uri (409 key_source_conflict). Rotate by overlap: add the new key, move over to it, then remove the old one.

Operation ID: `CreateAgentPublicKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Request body (`application/json`, required): JWK

The public JWK

### Responses

- `201` Created: Agent
- `400` public_key_invalid, public_key_limit_reached: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` public_key_conflict: the kid is taken; key_source_conflict: the agent has a jwks_uri: ErrResponse
- `500` Internal Server Error: ErrResponse

## Remove agent public key

```http
DELETE https://api.{region}.pontive.com/v1/agents/{agent_id}/public-keys/{key_id}
```

Remove one of the agent's inline keys by kid. Assertions signed with it are refused from now on.

Operation ID: `DeleteAgentPublicKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |
| `key_id` | string | yes | Key ID |

### Responses

- `200` OK: Agent
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` public_key_not_found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Reactivate agent

```http
POST https://api.{region}.pontive.com/v1/agents/{agent_id}/reactivate
```

Reactivate a deactivated agent: its installations return to active.

Operation ID: `ReactivateAgent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes | Agent ID |

### Responses

- `200` OK: Agent
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List every agent installation in the organization

```http
GET https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations
```

The agents installed on the organization and on each of its resources (pontive-spec 20 G2, D21), with their approved roles, pending approvals and status; filterable by agent, resource and status. Needs sys:agent:read on the organization; an organization's owners and admins hold it, and an end user's token with pontive:org:agent:read reaches it for their own organization.

Operation ID: `ListOrganizationAgentInstallations`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  | One agent's installations (agt_) |
| `resource_id` | string |  | The installations on one of the organization's resources (res_) |
| `status` | string |  | active or suspended |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListInstallationsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Install an agent on the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations
```

Install an agent in the organization — on the organization itself, or on the resource resource_id names, which must be the organization's (D21) — with roles approved: any of those it requests for the target's type, or none (sys:agent:install on the organization, or on the root). The roles are also held to what the caller could grant there. With delegated_only true, the roles act only as the agent's side of a delegation: a token the agent exchanged to act for a user is allowed what both hold, while the agent's own token holds none of them.

Operation ID: `CreateOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |

### Request body (`application/json`, required): InstallRequest

Agent and approved roles

### Responses

- `201` Created: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` agent_not_offered, agent_wrong_owner: ErrResponse
- `404` Not Found: ErrResponse
- `409` agent_already_installed: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get an agent's installation on the organization

```http
GET https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}
```

One installation in the organization — on the organization or one of its resources — with its pending approval (D21). 404 for an installation in another organization or in none.

Operation ID: `GetOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Change an agent's roles on the organization

```http
PATCH https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}
```

Replace the roles approved for the agent on the organization, within what it requests (sys:agent:install on the organization, or on the root). delegated_only, when present, turns delegation-only on or off.

Operation ID: `UpdateOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): UpdateInstallationRequest

Approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Uninstall an agent from the organization

```http
DELETE https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}
```

Delete the installation. The agent's next token request for the organization is refused; a token already issued lives out its lifetime.

Operation ID: `DeleteOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Approve an agent's requested roles on the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}/approve
```

Approve the agent's requested roles up to version, after the installation's approved_version and at most the agent's; roles are the approved roles from now on — typically what it holds plus pending_roles (sys:agent:install on the organization, or on the root).

Operation ID: `ApproveOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): ApproveInstallationRequest

Version and approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested, agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Decline an agent's requested roles on the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}/decline
```

Mark version seen without adding its roles; the installation keeps working with the roles it has.

Operation ID: `DeclineOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): DeclineInstallationRequest

Version

### Responses

- `200` OK: Installation
- `400` agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resume an agent on the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}/resume
```

Lift an admin's suspension. An installation suspended for another cause (the agent deactivated, the organization suspended or not offered) stays suspended until that ends.

Operation ID: `ResumeOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Suspend an agent on the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/agent-installations/{installation_id}/suspend
```

Suspend the installation: its roles are withdrawn and the agent's tokens for the organization refused until it is resumed.

Operation ID: `SuspendOrganizationAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List an organization's agents

```http
GET https://api.{region}.pontive.com/v1/organizations/{organization}/agents
```

The organization's agents page (pontive-spec 45 §13; api-route-review D43): every agent installed in it, offered to it, or its own, each with its installation there or null. relation narrows it, repeated for any of several: installed (an installation here), offered (an instance agent offered to the organization, installed or not), own (defined by the organization). Organization-scoped tokens with pontive:org:agent:read reach it.

Operation ID: `ListOrganizationAgents`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `relation` | string[] |  | installed, offered or own |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListOrganizationAgentsResponse
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List the resource's agent installations

```http
GET https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations
```

The agents installed on the resource, with their approved roles, pending approvals and status; filterable by agent and status (D21).

Operation ID: `ListResourceAgentInstallations`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  | One agent's installations (agt_) |
| `status` | string |  | active or suspended |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListInstallationsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Install an agent on the resource

```http
POST https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations
```

Install an agent on the resource with roles approved: any of those it requests for the resource's type, or none (sys:agent:install on the resource's organization, or on the root for a resource in none — never on the resource itself). The roles are also held to what the caller could grant there. With delegated_only true, the roles act only as the agent's side of a delegation: a token the agent exchanged to act for a user is allowed what both hold, while the agent's own token holds none of them.

Operation ID: `CreateResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |

### Request body (`application/json`, required): InstallRequest

Agent and approved roles

### Responses

- `201` Created: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` agent_not_offered, agent_wrong_owner: ErrResponse
- `404` Not Found: ErrResponse
- `409` agent_already_installed: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get an agent's installation on the resource

```http
GET https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}
```

One installation on the resource, a resource in no organization (D21), with its pending approval. An installation in an organization is under /organizations/{organization}/agent-installations.

Operation ID: `GetResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Change an agent's roles on the resource

```http
PATCH https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}
```

Replace the roles approved for the agent on the resource, within what it requests (sys:agent:install on the resource's organization, or on the root for a resource in none — never on the resource itself). delegated_only, when present, turns delegation-only on or off.

Operation ID: `UpdateResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): UpdateInstallationRequest

Approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Uninstall an agent from the resource

```http
DELETE https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}
```

Delete the installation. The agent's next token request for the resource is refused; a token already issued lives out its lifetime.

Operation ID: `DeleteResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Approve an agent's requested roles on the resource

```http
POST https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}/approve
```

Approve the agent's requested roles up to version, after the installation's approved_version and at most the agent's; roles are the approved roles from now on — typically what it holds plus pending_roles (sys:agent:install on the resource's organization, or on the root for a resource in none — never on the resource itself).

Operation ID: `ApproveResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): ApproveInstallationRequest

Version and approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested, agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Decline an agent's requested roles on the resource

```http
POST https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}/decline
```

Mark version seen without adding its roles; the installation keeps working with the roles it has.

Operation ID: `DeclineResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): DeclineInstallationRequest

Version

### Responses

- `200` OK: Installation
- `400` agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resume an agent on the resource

```http
POST https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}/resume
```

Lift an admin's suspension. An installation suspended for another cause (the agent deactivated, the organization suspended or not offered) stays suspended until that ends.

Operation ID: `ResumeResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Suspend an agent on the resource

```http
POST https://api.{region}.pontive.com/v1/resources/{resource_id}/agent-installations/{installation_id}/suspend
```

Suspend the installation: its roles are withdrawn and the agent's tokens for the resource refused until it is resumed.

Operation ID: `SuspendResourceAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_id` | string | yes | Resource ID |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## List the installations in no organization

```http
GET https://api.{region}.pontive.com/v1/root/agent-installations
```

The installations in no organization (D21): on the instance root and on resources in none, with their approved roles, pending approvals and status; filterable by agent, resource and status.

Operation ID: `ListRootAgentInstallations`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  | One agent's installations (agt_) |
| `resource_id` | string |  | The installations on one resource in no organization (res_) |
| `status` | string |  | active or suspended |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListInstallationsResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Install an agent on the instance root

```http
POST https://api.{region}.pontive.com/v1/root/agent-installations
```

Install an agent in no organization — on the instance root, or on the resource resource_id names, a resource in none (D21) — with roles approved: any of those it requests for the target's type, or none (sys:agent:install on the root). The roles are also held to what the caller could grant there. With delegated_only true, the roles act only as the agent's side of a delegation: a token the agent exchanged to act for a user is allowed what both hold, while the agent's own token holds none of them.

Operation ID: `CreateRootAgentInstallation`

### Request body (`application/json`, required): InstallRequest

Agent and approved roles

### Responses

- `201` Created: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` agent_not_offered, agent_wrong_owner: ErrResponse
- `404` Not Found: ErrResponse
- `409` agent_already_installed: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get an agent's installation on the instance root

```http
GET https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}
```

One installation in no organization — on the instance root or on a resource in none (D21) — with its pending approval.

Operation ID: `GetRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Change an agent's roles on the instance root

```http
PATCH https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}
```

Replace the roles approved for the agent on the instance root, within what it requests (sys:agent:install on the root). delegated_only, when present, turns delegation-only on or off.

Operation ID: `UpdateRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): UpdateInstallationRequest

Approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Uninstall an agent from the instance root

```http
DELETE https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}
```

Delete the installation. The agent's next token request for the instance root is refused; a token already issued lives out its lifetime.

Operation ID: `DeleteRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Approve an agent's requested roles on the instance root

```http
POST https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}/approve
```

Approve the agent's requested roles up to version, after the installation's approved_version and at most the agent's; roles are the approved roles from now on — typically what it holds plus pending_roles (sys:agent:install on the root).

Operation ID: `ApproveRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): ApproveInstallationRequest

Version and approved roles

### Responses

- `200` OK: Installation
- `400` agent_role_not_requested, agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Decline an agent's requested roles on the instance root

```http
POST https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}/decline
```

Mark version seen without adding its roles; the installation keeps working with the roles it has.

Operation ID: `DeclineRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Request body (`application/json`, required): DeclineInstallationRequest

Version

### Responses

- `200` OK: Installation
- `400` agent_version_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Resume an agent on the instance root

```http
POST https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}/resume
```

Lift an admin's suspension. An installation suspended for another cause (the agent deactivated, the organization suspended or not offered) stays suspended until that ends.

Operation ID: `ResumeRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Suspend an agent on the instance root

```http
POST https://api.{region}.pontive.com/v1/root/agent-installations/{installation_id}/suspend
```

Suspend the installation: its roles are withdrawn and the agent's tokens for the instance root refused until it is resumed.

Operation ID: `SuspendRootAgentInstallation`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | string | yes | Installation ID (ain_) |

### Responses

- `200` OK: Installation
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse

## Schemas

### ListAgentsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Agent[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### ErrResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | ErrBody |  |  |

### CreateAgentRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `auto_install` | boolean |  |  |
| `description` | string |  |  |
| `domain_id` | string |  | DomainID is the auth domain its tokens are issued by; omitted is the instance's default. |
| `logo_url` | string |  |  |
| `metadata` | Record<string, string> |  |  |
| `name` | string | yes |  |
| `org_access` | "all" \| "selected" |  | OrgAccess is an instance agent's offer: all (the default) or selected, with no organization listed yet (POST /agents/{agent_id}/organizations). |
| `owner_id` | string |  | OwnerID is the definer: the organization's org_ id for org; the instance's inst_ id, or omitted, for root. |
| `owner_type` | "root" \| "org" | yes | OwnerType is the definer's resource-type key (D6, D44): root, or org. |
| `requested_roles` | RequestedRole[] |  |  |
| `sponsors` | string[] |  | Sponsors are usr_ ids, each holding sys:agent:read on the definer. |
| `token_ttl` | integer |  | TokenTTL is in seconds, 60–3600; omitted is 900. |

### Agent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `auto_install` | boolean |  | AutoInstall installs an instance agent, with its requested org roles, in every organization it is offered to. |
| `client_secrets` | ClientSecret[] |  | ClientSecrets are the secrets that still authenticate, previews only (GET /agents/{agent_id}/client-secrets, D19). A secret's value is shown once, when it is created. |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `domain_id` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `issuer` | string |  |  |
| `jwks_uri` | string |  |  |
| `last_used_at` | string |  |  |
| `logo_url` | string |  |  |
| `metadata` | Record<string, string> |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `org_access` | "all" \| "selected" |  | OrgAccess is an instance agent's offer: every organization, or the selected ones (GET /agents/{agent_id}/organizations, D22). Empty for an organization agent. |
| `owner_id` | string |  | OwnerID is the definer's prefixed id: the instance's inst_ id, or the organization's org_ id. |
| `owner_type` | "root" \| "org" |  | OwnerType is the definer's resource-type key (D6, D44): root, or org for an organization. |
| `public_keys` | PublicKey[] |  | PublicKeys are the inline keys the agent signs private_key_jwt assertions with; JWKSURI is where they are fetched from instead. At most one is set. |
| `requested_roles` | RequestedRole[] |  | RequestedRoles are the agent's ceiling everywhere: an installation approves these or fewer, never more. Each carries the version that added it. |
| `requested_roles_version` | integer |  | RequestedRolesVersion grows each time a role is added to requested_roles; installations approved below it have a pending approval. |
| `sponsors` | string[] |  | Sponsors are the users (usr_) accountable for the agent. |
| `status` | "active" \| "deactivated" |  |  |
| `token_ttl` | integer |  | TokenTTL is its access tokens' lifetime in seconds, 60–3600. |
| `updated_at` | string |  |  |

### UpdateAgentRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `auto_install` | boolean |  |  |
| `description` | string |  |  |
| `jwks_uri` | string |  | JWKSURI is where the agent's keys are fetched from (D20); null clears it. Refused while inline public keys exist. |
| `logo_url` | string |  |  |
| `metadata` | Record<string, string> |  | Metadata, when sent, replaces the metadata; {} clears it. |
| `name` | string |  |  |
| `org_access` | "all" \| "selected" |  | OrgAccess is an instance agent's offer: all or selected. |
| `requested_roles` | RequestedRole[] |  | RequestedRoles, when sent, replace the roles the agent requests: adding one increments requested_roles_version and leaves every installation of its type with a pending approval; removing one takes it off every installation at once. |
| `sponsors` | string[] |  | Sponsors, when sent, replace the sponsors: at most ten usr_ ids, each holding sys:agent:read on the definer; [] clears them. |
| `token_ttl` | integer |  |  |

### ListClientSecretsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | ClientSecret[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### CreateClientSecretRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expire_others_in` | integer |  |  |
| `label` | string |  |  |

### ClientSecretWithValue

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `expires_at` | string |  |  |
| `id` | string |  |  |
| `label` | string |  |  |
| `last_used_at` | string |  |  |
| `object` | string |  |  |
| `preview` | string |  |  |
| `secret` | string |  |  |
| `status` | "active" \| "rotating" |  |  |

### ListFederatedCredentialsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | FederatedCredential[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### CreateFederatedCredentialRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  |  |
| `name` | string | yes | Name is unique among the client's credentials. |
| `required_claims` | Record<string, string> |  | RequiredClaims, at most 10, such as repository, ref or environment for GitHub Actions; iss, sub, aud, exp, nbf, iat and jti cannot be required. |
| `subject` | string | yes | Subject is exact by default. A '*' matches one or more characters within one ':' or '/' segment; '**' and a '*' in the first segment are refused. |
| `trusted_issuer_id` | string | yes |  |

### FederatedCredential

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_id` | string |  | ClientID is the service account (svc_) or agent (agt_). |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `required_claims` | Record<string, string> |  | RequiredClaims must be in the assertion with exactly these values. |
| `subject` | string |  | Subject is the assertion's sub: exact, or a pattern where '*' matches one or more characters within one ':' or '/' segment. |
| `trusted_issuer_id` | string |  |  |
| `updated_at` | string |  |  |

### UpdateFederatedCredentialRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  |  |
| `name` | string |  |  |
| `required_claims` | Record<string, string> |  | RequiredClaims, when present, replaces the map; {} requires none. |
| `subject` | string |  |  |

### ListInstallationsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Installation[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### ListAgentOrganizationsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | AgentOrganization[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### AddAgentOrganizationsRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `organization_ids` | string[] | yes | OrganizationIDs are the organizations to add, at most 100. Adding one already offered is not an error. |

### Organizations

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  |  |
| `object` | string |  |  |
| `org_access` | "all" \| "selected" |  |  |
| `organization_ids` | string[] |  | OrganizationIDs are the organizations a selected offer lists. |

### JWK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alg` | "RS256" \| "PS256" \| "ES256" |  |  |
| `crv` | "P-256" |  |  |
| `e` | string |  |  |
| `kid` | string | yes |  |
| `kty` | "RSA" \| "EC" | yes |  |
| `n` | string |  |  |
| `use` | string |  |  |
| `x` | string |  |  |
| `y` | string |  |  |

### InstallRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | yes |  |
| `delegated_only` | boolean |  | DelegatedOnly lends the roles only to the agent's side of a delegation: the agent's own token holds none of them here. Default false. |
| `resource_id` | string |  | ResourceID installs on this resource instead of the path's container. |
| `roles` | string[] |  |  |

### Installation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  |  |
| `approved_by` | Actor |  | CreatedBy is who created the grant, or last replaced it. |
| `approved_version` | integer |  | ApprovedVersion is the requested_roles_version last approved or declined. PendingVersion is the agent's version when it is newer, else 0, and PendingRoles what it asks for here: the pending approval. |
| `created_at` | string |  |  |
| `delegated_only` | boolean |  | DelegatedOnly lends Roles only to the agent's side of a delegation (pontive-spec 20 C3, agent-intersection scenarios OQ-2): a token the agent exchanged to act for a user is allowed what both hold, while the agent's own token, and a check of the agent alone, ignore them. |
| `id` | string |  |  |
| `installed_by` | Actor |  | CreatedBy is who created the grant, or last replaced it. |
| `instance_id` | string |  |  |
| `object` | string |  |  |
| `organization_id` | string |  | OrganizationID is the target's organization: itself, or the resource's; empty for the root and for a resource in none. |
| `pending_roles` | string[] |  |  |
| `pending_version` | integer |  |  |
| `resource_type` | string |  | ResourceType is the target's type: the roles are of it. |
| `roles` | string[] |  |  |
| `status` | "active" \| "suspended" |  |  |
| `suspended_at` | string |  |  |
| `suspended_reasons` | string[] |  | SuspendedReasons are why it is suspended: agent_deactivated, organization_suspended, not_offered, admin. |
| `target_id` | string |  | TargetID is the instance id, the org_ id or the res_ id. |
| `target_type` | "root" \| "org" \| "resource" |  |  |
| `updated_at` | string |  |  |

### UpdateInstallationRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `delegated_only` | boolean |  | DelegatedOnly, when present, lends the roles only to the agent's side of a delegation (true), or to the agent's own token too (false). |
| `roles` | string[] |  |  |

### ApproveInstallationRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `roles` | string[] |  |  |
| `version` | integer | yes |  |

### DeclineInstallationRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | integer | yes |  |

### ListOrganizationAgentsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | OrganizationAgent[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### Pagination

Pagination is the page answered (api-route-review D9).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Limit is the maximum number of items per page. |
| `page` | integer |  | Page is the 1-based index of the returned page. |
| `total` | integer |  | Total is the total number of items across all pages. |
| `total_pages` | integer |  | TotalPages is the total number of pages available. |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is the spec's machine-readable code for this error, in snake case: a domain code such as seat_limit_reached where the refusal has one, otherwise a generic one such as permission_denied, not_found, conflict, invalid_request or service_unavailable. |
| `details` | ErrDetail[] |  | Details are per-field findings, present only on a refusal that has them, e.g. a 422 invalid_theme names each invalid value by its path, a 422 package_invalid each problem, and a 409 capability_in_use each count by its name. |
| `doc_url` | string |  | DocURL links to documentation about this error, when available. |
| `message` | string |  | Message is a human-readable description of what went wrong. |
| `object` | string |  | Object is the discriminator; always "error". |
| `param` | string |  | Param names the request parameter this error refers to, when applicable. |
| `type` | "validation_error" \| "authentication_error" \| "authorization_error" \| "not_found" \| "conflict_error" \| "rate_limit_error" \| "internal_error" |  | Type is the error's category, set by its HTTP status: one of validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error, internal_error. |

### RequestedRole

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resource_type` | string |  |  |
| `role` | string |  |  |
| `version` | integer |  | Version is the requested_roles_version that added it; ignored on input. |

### ClientSecret

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `expires_at` | string |  |  |
| `id` | string |  |  |
| `label` | string |  |  |
| `last_used_at` | string |  |  |
| `object` | string |  |  |
| `preview` | string |  |  |
| `status` | "active" \| "rotating" |  |  |

### PublicKey

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alg` | "RS256" \| "PS256" \| "ES256" |  | Alg, when the key names one, is the only algorithm it verifies. |
| `created_at` | string |  | CreatedAt is when the key was added. |
| `crv` | "P-256" |  | Crv, X and Y are an EC key's curve and point, base64url. |
| `e` | string |  |  |
| `kid` | string |  |  |
| `kty` | "RSA" \| "EC" |  |  |
| `n` | string |  | N and E are an RSA key's modulus and exponent, base64url. |
| `object` | string |  |  |
| `use` | string |  |  |
| `x` | string |  |  |
| `y` | string |  |  |

### AgentOrganization

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string |  |  |
| `object` | string |  |  |
| `organization_id` | string |  |  |

### Actor

CreatedBy is who created the grant, or last replaced it.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string |  |  |
| `name` | string |  |  |
| `type` | string |  |  |

### OrganizationAgent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent` | Agent |  |  |
| `installation` | Installation |  |  |
| `object` | string |  |  |

### ErrDetail

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `field` | string |  | Field is where the finding is: for a theme, its dotted path. |
| `message` | string |  | Message is what is wrong there. |
