# Third-party clients

Source: https://www.pontive.com/docs/api-reference/management/third-party-clients

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.

## Get third-party clients setting

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

When third-party OAuth clients — clients identified by a client ID metadata document (CIMD) or registered dynamically (DCR), which the customer did not create — may connect, and the client profile every admitted one is held to. An instance that never changed it reads the defaults: everything off.

Operation ID: `GetAppSettings`

### Responses

- `200` OK: ThirdPartyClients
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Update third-party clients setting

```http
PATCH https://api.{region}.pontive.com/v1/apps/settings
```

Change the admission policy (cimd, dcr, allowlist) or the client profile; an absent field is left as it is. The allowlist and profile.apis, when present, replace the stored list wholesale, and null empties it. An allow-list entry is an exact client_id URL or https://host/*, at most 100; a profile API must be an API of the instance with third_party on, and scopes null covers all of its scopes. The profile's authentication fields (authflow_bindings, signin_config, signup_config, mfa_config, session_config) take the app routes' shapes and are every third-party app's, read when its user signs in: a present one replaces the profile's wholesale, validated as the app routes validate it, and null unsets it so third-party apps keep their own default.

Operation ID: `UpdateAppSettings`

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `If-Match` | string |  | The ETag the document was read with: a stale one is refused 412 precondition_failed (D42) |

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

Update payload

### Responses

- `200` OK: ThirdPartyClients
- `400` Invalid request, or third_party_clients_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` instance_unclaimed: the instance is unclaimed; claim this instance to admit third-party clients (pontive-spec 47): ErrResponse
- `412` precondition_failed: the document changed since it was read: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get the organization's client policy

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

Which of the clients the instance admits may act in the organization (pontive-spec 20 G2). mode all admits every client the instance admits but those the block-list names; allowlist admits only the third-party apps the allow-list names. The block-list always wins, and governs agents too. The instance's third-party client setting is the ceiling: third_party_in_organizations false means its client profile gives third-party apps no organization context at all. An organization that never set its policy reads the default, with updated_at null. Needs sys:agent:read on the organization.

Operation ID: `GetOrganizationClientPolicy`

### Path parameters

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

### Responses

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

## Set the organization's client policy

```http
PATCH https://api.{region}.pontive.com/v1/organizations/{organization}/client-policy
```

Replace the organization's client policy whole (pontive-spec 20 G2). An entry is an app id (app_…), an agent id (agt_…), an exact CIMD client_id URL, or https://host/*, at most 100 per list. A blocked or not-allowed third-party app is refused when the organization is chosen at /authorize (an error page, never a redirect), when consent would be given for it, at code exchange and at refresh; a blocked agent's token exchange in the organization is refused. The organization can only narrow what the instance admits. Needs sys:agent:install on the organization.

Operation ID: `UpdateOrganizationClientPolicy`

### Path parameters

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

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `If-Match` | string |  | The ETag the document was read with: a stale one is refused 412 precondition_failed (D42) |

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

The policy

### Responses

- `200` OK: OrganizationClientPolicy
- `400` organization_client_policy_invalid: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `412` precondition_failed: the document changed since it was read: ErrResponse
- `500` Internal Server Error: ErrResponse

## List the third-party apps acting for the organization's members

```http
GET https://api.{region}.pontive.com/v1/organizations/{organization}/third-party-clients
```

The CIMD and DCR apps a member of the organization has consented to (pontive-spec 20 G2), the most recently consented first: how many members did, the organization's policy on each (allowed, blocked, not_allowed), and whether the instance still admits it. Needs sys:agent:read on the organization.

Operation ID: `ListOrganizationThirdPartyClients`

### Path parameters

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

### Query parameters

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

### Responses

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

## Allow a third-party app in the organization again

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/third-party-clients/{app_id}/allow
```

Let a CIMD or DCR app act in the organization again (pontive-spec 20 G2): every block-list entry naming it exactly goes, and under allowlist mode its client_id joins the allow-list. 409 organization_client_blocked_by_pattern while an https://host/* entry on the block-list still names it: remove that entry with PUT /client-policy. Needs sys:agent:install on the organization.

Operation ID: `AllowOrganizationThirdPartyClient`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `app_id` | string | yes | The third-party app's id (app_…) |

### Responses

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

## Block a third-party app for the organization

```http
POST https://api.{region}.pontive.com/v1/organizations/{organization}/third-party-clients/{app_id}/block
```

Block a CIMD or DCR app for the organization (pontive-spec 20 G2): its client_id — a CIMD app's URL, which outlives the app's cleanup, or a DCR app's id — joins the block-list and leaves the allow-list. Its users are refused in the organization from their next authorization, code exchange or refresh. 404 for an app that is not a third-party app. Needs sys:agent:install on the organization.

Operation ID: `BlockOrganizationThirdPartyClient`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organization` | string | yes | The organization's id, or its slug |
| `app_id` | string | yes | The third-party app's id (app_…) |

### Responses

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

## Schemas

### ThirdPartyClients

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_delegation_enabled` | boolean |  | AgentDelegationEnabled is whether an agent may exchange a user's token, or a delegation grant, for a token acting for that user (pontive-spec 20 C2 profile (b)). Off by default. |
| `allowlist` | string[] |  | Allowlist holds CIMD client_id URLs, exact or https://host/*. At most 100. Applies when cimd is allowlist. |
| `cimd` | "off" \| "allowlist" \| "open" |  | CIMD is when a client identified by its client ID metadata document may start authorization: never, when its client_id URL matches the allowlist, or always once its document validates. |
| `dcr` | "off" \| "on" |  | DCR is whether POST /oauth2/register accepts registrations from public clients. |
| `object` | string |  |  |
| `profile` | Profile |  |  |
| `updated_at` | string |  | UpdatedAt is omitted while the instance has never changed the setting. |

### ErrResponse

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

### UpdateThirdPartyClientsRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_delegation_enabled` | boolean |  | AgentDelegationEnabled, when present, turns agent delegation on or off. |
| `allowlist` | string[] |  | Allowlist, when present, replaces the allow-list. |
| `cimd` | "off" \| "allowlist" \| "open" |  |  |
| `dcr` | "off" \| "on" |  |  |
| `profile` | ProfilePatch |  |  |

### OrganizationClientPolicy

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowlist` | string[] |  | Allowlist and Blocklist hold entries: an app id (app_…), an agent id (agt_…), an exact CIMD client_id URL, or https://host/*. At most 100 each. |
| `blocklist` | string[] |  |  |
| `mode` | "all" \| "allowlist" |  | Mode all admits every client the instance admits but those the block-list names; allowlist admits only the third-party apps the allow-list names (none when it is empty). The block-list always wins. Agents are governed by the block-list only: an installation is already the organization's approval of an agent. |
| `object` | string |  |  |
| `organization_id` | string |  |  |
| `third_party_in_organizations` | boolean |  | ThirdPartyInOrganizations is the instance's ceiling: false while its client profile gives third-party apps no organization context, so none acts in any organization whatever this policy says. |
| `updated_at` | string |  | UpdatedAt is null while the organization has never set its policy. |

### SetOrganizationClientPolicyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowlist` | string[] |  |  |
| `blocklist` | string[] |  |  |
| `mode` | "all" \| "allowlist" |  | Mode is all (the default when empty) or allowlist. |

### ListOrganizationClientsResponse

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

### Profile

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apis` | ProfileAPI[] |  | APIs are the registered APIs third-party clients may request, each with third_party on. At most 50. |
| `authflow_bindings` | AuthflowBindings |  | AuthflowBindings, when non-nil, fully replaces the app's flow bindings (nil = leave untouched, per the app's partial-update convention). Only published flows are bindable; identity-svc validates each non-empty side. |
| `mfa_config` | MFAConfig |  |  |
| `offline_access` | boolean |  | OfflineAccess is whether offline_access may be granted, with consent. |
| `organizations` | "none" \| "all" |  | Organizations is whether a third-party client may receive an organization context. |
| `refresh_token_ttl` | integer |  | RefreshTokenTTL is a third-party client's refresh-token lifetime in seconds, 3600 to 7776000. |
| `session_config` | SessionConfig |  |  |
| `signin_config` | SigninConfig |  | Optional per-app configs. A non-nil config fully replaces that config on the app; nested platforms/sections left out are cleared. |
| `signup_config` | SignupConfig |  |  |

### 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. |

### ProfilePatch

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apis` | ProfileAPI[] |  | APIs, when present, replace the profile's APIs. |
| `authflow_bindings` | AuthflowBindings |  | AuthflowBindings, when non-nil, fully replaces the app's flow bindings (nil = leave untouched, per the app's partial-update convention). Only published flows are bindable; identity-svc validates each non-empty side. |
| `mfa_config` | MFAConfig |  |  |
| `offline_access` | boolean |  |  |
| `organizations` | "none" \| "all" |  |  |
| `refresh_token_ttl` | integer |  |  |
| `session_config` | SessionConfig |  |  |
| `signin_config` | SigninConfig |  | Optional per-app configs. A non-nil config fully replaces that config on the app; nested platforms/sections left out are cleared. |
| `signup_config` | SignupConfig |  |  |

### OrganizationThirdPartyClient

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `app_id` | string |  |  |
| `client_id` | string |  | ClientID is its client_id on the wire: a CIMD app's URL, a DCR app's id. |
| `client_id_url` | string |  | ClientIDURL is a CIMD app's client_id URL; empty for a DCR app. |
| `instance_admitted` | boolean |  | InstanceAdmitted is whether the instance's admission policy admits it: a CIMD app the instance no longer admits is refused whatever the organization says. |
| `last_consented_at` | string |  |  |
| `logo_url` | string |  |  |
| `members` | integer |  | Members is how many of the organization's members have consented to it. |
| `name` | string |  |  |
| `object` | string |  |  |
| `origin` | "cimd" \| "dcr" |  |  |
| `status` | "allowed" \| "blocked" \| "not_allowed" |  | Status is the organization's policy on it. |

### 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. |

### ProfileAPI

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `api_id` | string |  | APIID is an api_ id of the instance whose third_party is on. |
| `scopes` | string[] |  | Scopes null is every scope the API defines, now and later; a list is those of its scope keys only. |

### AuthflowBindings

AuthflowBindings, when non-nil, fully replaces the app's flow bindings
(nil = leave untouched, per the app's partial-update convention). Only
published flows are bindable; identity-svc validates each non-empty side.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `signin` | string |  |  |
| `signup` | string |  |  |

### MFAConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `enforcement` | string |  |  |
| `grace_period_days` | integer |  |  |
| `methods` | MFAMethods |  |  |
| `remember_device_days` | integer |  |  |

### SessionConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `absolute_lifetime_seconds` | integer |  | AbsoluteLifetimeSeconds is the hard cap, fixed when the session is created and never extended by use. NIST SP 800-63B puts this at 12h for AAL2, which is the default a new app is given. |
| `idle_timeout_seconds` | integer |  | IdleTimeoutSeconds is how long the session may sit unused before it dies, sliding forward as it is used. Zero disables the inactivity cap, leaving only the absolute one — a deliberate choice, not a default to fall into. |

### SigninConfig

Optional per-app configs. A non-nil config fully replaces that config on
the app; nested platforms/sections left out are cleared.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `consents` | Consent[] |  |  |
| `passkey` | PasskeyConfig |  |  |
| `password` | PasswordConfig |  |  |
| `passwordless` | PasswordlessConfig |  |  |

### SignupConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `consents` | SignupConsent[] |  |  |
| `fields` | SignupFields |  |  |
| `verification` | SignupVerification |  |  |

### 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. |

### MFAMethods

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | EmailConfig |  |  |
| `recovery_codes` | RecoveryCodesConfig |  |  |
| `sms` | SMSConfig |  |  |
| `totp` | TOTPConfig |  |  |

### Consent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `consent_id` | string |  |  |
| `label` | string |  |  |
| `required` | boolean |  |  |
| `url` | string |  |  |
| `version` | string |  |  |

### PasskeyConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authenticator_attachment` | string |  |  |
| `auto_fill` | boolean |  |  |
| `conditional_create` | boolean |  |  |
| `enabled` | boolean |  |  |
| `local_enrollment` | boolean |  |  |
| `passkey_button` | boolean |  |  |
| `progressive_enrollment` | boolean |  |  |
| `user_verification` | string |  |  |

### PasswordConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | SigninMethod |  |  |
| `phone` | SigninMethod |  |  |
| `username` | SigninMethod |  |  |

### PasswordlessConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email_otp` | OTPConfig |  |  |
| `magic_link` | MagicLinkConfig |  |  |
| `phone_otp` | OTPConfig |  |  |

### SignupConsent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `consent_id` | string |  |  |
| `label` | string |  |  |
| `required` | boolean |  |  |
| `url` | string |  |  |
| `version` | string |  |  |

### SignupFields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `identifiers` | IdentifierFields |  |  |
| `profile` | ProfileFields |  |  |

### SignupVerification

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | EmailVerification |  |  |
| `phone` | PhoneVerification |  |  |

### EmailConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |

### RecoveryCodesConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `count` | integer |  |  |
| `enabled` | boolean |  |  |

### SMSConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |

### TOTPConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `issuer` | string |  |  |

### SigninMethod

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |

### OTPConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `expiration` | integer |  |  |

### MagicLinkConfig

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `expiration` | integer |  |  |

### IdentifierFields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |
| `phone` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |
| `username` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |

### ProfileFields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date_of_birth` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |
| `family_name` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |
| `gender` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |
| `given_name` | SignupField |  | Email is always collected and required: every Pontive user has an email. Whatever is sent here is stored as {enabled: true, required: true}. |

### EmailVerification

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  | Enabled is whether sign-up asks for the address before it completes. Omitted means on. Off, the new user is signed in at once with an unverified email, and every later sign-in asks them to verify it. |
| `expiration` | integer |  |  |
| `method` | string |  |  |

### PhoneVerification

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `expiration` | integer |  |  |

### SignupField

Email is always collected and required: every Pontive user has an
email. Whatever is sent here is stored as {enabled: true, required: true}.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean |  |  |
| `required` | boolean |  |  |
