# Secret Keys

Source: https://www.pontive.com/docs/api-reference/platform/secret-keys

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

## List secret keys

```http
GET https://api.pontive.com/v1/instances/{instance_id}/secret-keys
```

List the instance's secret keys. Revoked keys stay listed for 30 days. Needs instance:read.

Operation ID: `ListSecretKeys`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer |  | Page number |
| `limit` | integer |  | Page size (default 25, at most 100) |

### Responses

- `200` OK: ListSecretKeysResponse
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Create a secret key

```http
POST https://api.pontive.com/v1/instances/{instance_id}/secret-keys
```

Create a secret key for the instance's management API. The answer carries its value once; it is never shown again. Needs instance:secret_keys.manage. An instance holds at most 10 active keys (secret_key_limit_reached); a deleted instance takes none (instance_deleted).

Operation ID: `CreateSecretKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |

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

Create Secret Key Request

### Responses

- `201` Created: SecretKey
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Get a secret key

```http
GET https://api.pontive.com/v1/instances/{instance_id}/secret-keys/{secret_key_id}
```

One of the instance's secret keys. Needs instance:read.

Operation ID: `GetSecretKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |
| `secret_key_id` | string | yes | Secret key ID |

### Responses

- `200` OK: SecretKey
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Update a secret key

```http
PATCH https://api.pontive.com/v1/instances/{instance_id}/secret-keys/{secret_key_id}
```

Change a secret key's name, description or role. A role change takes effect within 30 seconds. Needs instance:secret_keys.manage.

Operation ID: `UpdateSecretKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |
| `secret_key_id` | string | yes | Secret key ID |

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

Update Secret Key Request

### Responses

- `200` OK: SecretKey
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Revoke a secret key

```http
POST https://api.pontive.com/v1/instances/{instance_id}/secret-keys/{secret_key_id}/revoke
```

End a secret key and any still-valid previous value at once. Final: a revoked key cannot be reactivated. Needs instance:secret_keys.manage.

Operation ID: `RevokeSecretKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |
| `secret_key_id` | string | yes | Secret key ID |

### Responses

- `200` OK: SecretKey
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Rotate a secret key

```http
POST https://api.pontive.com/v1/instances/{instance_id}/secret-keys/{secret_key_id}/rotate
```

Replace a secret key's value, keeping the key. The answer carries the new value once. The current value keeps working for expire_previous_in seconds (0 to 604800, default 86400). Needs instance:secret_keys.manage.

Operation ID: `RotateSecretKey`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `instance_id` | string | yes | Instance ID |
| `secret_key_id` | string | yes | Secret key ID |

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

Rotate Secret Key Request

### Responses

- `200` OK: SecretKey
- `400` Bad Request: ErrResponse
- `403` Forbidden: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse
- `500` Internal Server Error: ErrResponse
- `503` Service Unavailable: ErrResponse

## Schemas

### ListSecretKeysResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | SecretKey[] |  | The keys |
| `object` | string |  | Always "list" |
| `pagination` | Pagination |  | Pagination information |

### ErrResponse

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

### CreateSecretKeyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | What the key is for (0–500 characters); null or absent for none |
| `expires_at` | string |  | When the key stops working; null for never. Must be in the future. |
| `name` | string |  | Names the caller, e.g. billing-worker (1–100 characters) required: true |
| `role` | "admin" \| "developer" \| "support" \| "viewer" |  | The key's authority on its instance required: true enum: admin,developer,support,viewer |

### SecretKey

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `created_by` | SecretKeyCreator |  | Who created it |
| `description` | string |  | What the key is for |
| `environment` | "production" \| "non_production" |  | The instance's environment |
| `expires_at` | string |  | When the key stops working; null for never |
| `id` | string |  | The key's id; safe to log |
| `instance_id` | string |  | The only instance the key works on |
| `last_used_at` | string |  | Updated at most once a minute |
| `leak` | SecretKeyLeak |  | Set while a leaked value still works |
| `name` | string |  | Names the caller |
| `object` | string |  | Always "secret_key" |
| `preview` | string |  | The value, masked |
| `previous_expires_at` | string |  | When the rolled-out value stops working |
| `previous_preview` | string |  | The rolled-out value's preview while it still works |
| `region` | string |  | The project's region |
| `revoked_at` | string |  |  |
| `role` | "admin" \| "developer" \| "support" \| "viewer" |  | The key's authority on its instance |
| `status` | "active" \| "revoked" \| "expired" |  | active, revoked or expired |
| `updated_at` | string |  |  |
| `value` | string |  | The full value: on create and roll answers only. It is never shown again. |

### UpdateSecretKeyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | A new description; null clears it, and leaving it out keeps it |
| `name` | string |  | A new name (1–100 characters) |
| `role` | "admin" \| "developer" \| "support" \| "viewer" |  | A new role enum: admin,developer,support,viewer |

### RotateSecretKeyRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expire_previous_in` | integer |  | How long the current value keeps working, in seconds: 0 (ends it now) to 604800 (7 days). Defaults to 86400 (24 hours). |

### Pagination

Pagination information

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Number of records per page |
| `page` | integer |  | Current page number |
| `total` | integer |  | Total number of records |
| `total_pages` | integer |  | Total number of pages |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is a stable machine-readable identifier for this error: the domain code where one exists (e.g. slug_conflict, instance_not_found, confirmation_required), else the spec's generic code (invalid_request, permission_denied, not_found, conflict, internal_error). |
| `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` | string |  | Type is the error's category, from its HTTP status: validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error or internal_error. |

### SecretKeyCreator

Who created it

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

### SecretKeyLeak

Set while a leaked value still works

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detected_at` | string |  | When it was found |
| `evidence` | Record<string, string> |  | Where it was found: {"url": …} for GitHub, {"origin": …} for a browser |
| `source` | "github_secret_scanning" \| "browser_use" |  | github_secret_scanning or browser_use |
| `value_preview` | string |  | Which value leaked: the current one's or the previous one's preview |
