--- title: "POST | Activate SSH key" slug: "api-v2-post-activate-ssh-key" updated: 2026-11-03T14:47:51Z published: 2026-11-03T14:47:51Z canonical: "docs.senhasegura.io/api-v2-post-activate-ssh-key" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.senhasegura.io/llms.txt > Use this file to discover all available pages before exploring further. # POST | Activate SSH key ## Description Activate an SSH key in PAM Core. An active key can be used for remote access, and it accepts the write operations that an inactive key rejects. This action is the only way to set an SSH key as active. The `ssh_key.active` field is read-only on every other endpoint of this resource. --- ## Prerequisites - Authorization with **read and write** permission to PAM Core, granted by the administrator in A2A. For more information, access [How to manage authorizations in A2A](/v4-2/docs/api-v2-how-to-manage-authorizations-in-a2a). - A valid OAuth 2.0 access token. For more information, access [How to authenticate an application in A2A](/v4-2/docs/how-to-authenticate-an-application-in-a2a). - The SSH key must be inactive. Activating an already active key returns `409`. --- ## Request `POST` `/api/v2/pam/ssh-keys/{id}/activate` ### Path parameters | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | string | Yes | Unique identification code of the SSH key, assigned by Segura™. | The request has no body. --- ### Example request `POST` `{{url}}/api/v2/pam/ssh-keys/2267/activate` --- ## Response ``` HTTP/1.1 204 No Content ``` The response has no body. To confirm the new state, retrieve the key with [GET | List an SSH key by [id]](/v4-2/docs/api-v2-get-list-an-ssh-key) and check `ssh_key.active`. --- ## Errors API v2 returns a structured `code` in the response body, alongside a human-readable `message`. | HTTP code | Message | Possible cause | Solution | | --- | --- | --- | --- | | `401` | `api.auth.token.invalid` | The access token is missing, expired, or invalid. | Request a new access token and resend the request. | | `403` | `api.permission.denied` | The authorization does not have write permission to PAM Core resources. | Ask the administrator to check the authorization permissions in A2A, then generate a new token. | | `404` | `api.resource.not_found` | The SSH key does not exist, or it is outside the scope of the authorization. | Check the identification code sent in the path. | | `409` | `api.resource.conflict.already_active` | The SSH key is already active. | No action is needed. The key is already in the requested state. | | `429` | `rate_limit_exceeded` | The request rate limit was exceeded. | Reduce the request rate and try again. | | `500` | `api.internal.error` | Internal server error. | Contact the Segura™ support team. | ### Example error response `409` the key is already active: ``` { "code": "api.resource.conflict.already_active", "message": "SSH key is already active.", "details": null } ``` Info This action is not idempotent. Repeating it on a key that is already active returns `409` rather than `204`. Retrieve the current state of the key before retrying a request whose outcome you are unsure of. For authentication error messages and the `403` versus `404` policy, access [API v2 - Conventions and shared behaviors](/v4-2/docs/api-v2-conventions-and-shared-behaviors). --- ## Related documents - [POST | Deactivate SSH key](/v4-2/docs/api-v2-post-deactivate-ssh-key) - [GET | List an SSH key by [id]](/v4-2/docs/api-v2-get-list-an-ssh-key) - [API v2 - Conventions and shared behaviors](/v4-2/docs/api-v2-conventions-and-shared-behaviors)