# Access keys

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

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 access keys

```http
GET https://api.{region}.pontive.com/v1/access-keys
```

List access keys with filtering and pagination.

Operation ID: `ListAccessKeys`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `service_account_id` | string |  | Filter by service account id (svc_…) |
| `confidentiality` | string |  | Filter by confidentiality (secret\|publishable) |
| `status` | string |  | Filter by status (active\|revoked) |
| `sort` | string |  | Sort field; prefix with - for descending (e.g. -created_at). Allowed: created_at, updated_at, name, status. Default: -created_at |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

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

## Create access key

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

Mint an access key bound to a service account. The credential value is returned only here (and later via reveal for revealable keys).

Operation ID: `CreateAccessKey`

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

Create access key payload

### Responses

- `201` Created: AccessKeyWithSecret
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `500` Internal Server Error: ErrResponse

## Get access key

```http
GET https://api.{region}.pontive.com/v1/access-keys/{access_key_id}
```

Get an access key by ID.

Operation ID: `GetAccessKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `access_key_id` | string | yes | Access Key ID |

### Responses

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

## Update access key

```http
PATCH https://api.{region}.pontive.com/v1/access-keys/{access_key_id}
```

Update mutable fields (name, description, metadata).

Operation ID: `UpdateAccessKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `access_key_id` | string | yes | Access Key ID |

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

Update payload

### Responses

- `200` OK: AccessKey
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse

## Reveal access key

```http
GET https://api.{region}.pontive.com/v1/access-keys/{access_key_id}/key
```

Return the full plaintext credential value; only for a key minted revealable.

Operation ID: `GetAccessKeyValue`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `access_key_id` | string | yes | Access Key ID |

### Responses

- `200` OK: RevealAccessKeyResponse
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse

## Revoke access key

```http
POST https://api.{region}.pontive.com/v1/access-keys/{access_key_id}/revoke
```

Revoke an access key immediately and irreversibly.

Operation ID: `RevokeAccessKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `access_key_id` | string | yes | Access Key ID |

### Responses

- `204` No Content
- `401` Unauthorized: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse

## Schemas

### ListAccessKeysResponse

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

### ErrResponse

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

### CreateAccessKeyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confidentiality` | "secret" \| "publishable" | yes |  |
| `description` | string |  |  |
| `expires_at` | string |  |  |
| `metadata` | Metadata |  |  |
| `name` | string | yes |  |
| `revealable` | boolean |  |  |
| `service_account_id` | string | yes |  |

### AccessKeyWithSecret

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confidentiality` | "secret" \| "publishable" |  |  |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `expires_at` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `key` | string |  |  |
| `key_preview` | string |  |  |
| `last_used_at` | string |  |  |
| `metadata` | Metadata |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `revealable` | boolean |  |  |
| `service_account_id` | string |  |  |
| `status` | "active" \| "revoked" \| "deleted" \| "expired" |  |  |
| `updated_at` | string |  |  |

### AccessKey

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confidentiality` | "secret" \| "publishable" |  |  |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `expires_at` | string |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `key_preview` | string |  |  |
| `last_used_at` | string |  |  |
| `metadata` | Metadata |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `revealable` | boolean |  |  |
| `service_account_id` | string |  |  |
| `status` | "active" \| "revoked" \| "deleted" \| "expired" |  |  |
| `updated_at` | string |  |  |

### UpdateAccessKeyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  |  |
| `metadata` | Metadata |  |  |
| `name` | string |  |  |

### RevealAccessKeyResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string |  |  |

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

### Metadata

Type: Record<string, 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. |
