---
title: "Activate Key"
description: "Activate a registered key once the parent agent is active."
url: https://app.visacli.sh/docs/reference/vars/activate-key
updated: 2026-11-09
---

# Activate Key

> Activate a registered key once the parent agent is active.

Canonical: https://app.visacli.sh/docs/reference/vars/activate-key. Updated: 2026-11-09. Full index: /llms.txt.

```text
POST /vars/v1/agents/{agentId}/keys/{keyId}/activate
```

Related guide: [Register an agent](/docs/register-an-agent.md).

**Authentication:** the method you chose, X-Pay-Token or two-way TLS; see [X-Pay-Token / mTLS](/docs/reference/authentication.md). X-Pay uses the signed apiKey query.

## Parameters

| Parameter | Location | Required | Type / meaning |
| --- | --- | --- | --- |
| `agentId` | path | Yes | `string`<br>The agent's ID, returned as id. |
| `keyId` | path | Yes | `string`<br>The key's ID, returned as id. |

**Request body:** none.

## Responses

| HTTP | Meaning | Schema |
| --- | --- | --- |
| `200` | Key activated. | [`KeyResponse`](/docs/reference/schemas.md#vars-schema-KeyResponse) |
| `403` | Agent deactivated. | [`ErrorResponse`](/docs/reference/schemas.md#vars-schema-ErrorResponse) |
| `404` | Agent / key not found. | [`ErrorResponse`](/docs/reference/schemas.md#vars-schema-ErrorResponse) |

```json title="Illustrative response — not a live capture"
{
  "id": "a1b2c384-56c7-48d9-be0f-1e2d3c4b5a6f",
  "agentId": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
  "keyName": "YOUR_PUBLIC_JWK_THUMBPRINT",
  "status": "active",
  "algorithm": "ed25519",
  "publicKey": "BASE64_ENCODED_SPKI_PEM_PUBLIC_KEY",
  "expirationDate": "2027-11-05T00:00:00Z"
}
```

> [!NOTE] Integration detail
> The contract declares no request body. Afterwards, list the keys to confirm active status, the exact public-key bytes and a future expiry, as Visa CLI does.

```bash title="X-Pay-Token request template"
base='https://sandbox.api.visa.com/vars/v1'
curl --request POST \
  "$base/agents/YOUR_AGENT_ID/keys/YOUR_KEY_ID/activate?apiKey=YOUR_API_KEY" \
  --header 'Accept: application/json' \
  --header 'x-pay-token: TOKEN_FOR_THIS_EXACT_REQUEST'
```

The token covers this URL's exact query, so each request needs a new one. Replace the `YOUR_` values with your own.

Sources: [Current TAP API reference / endpoint catalog](https://developer.visa.com/api-reference/trusted-agent-protocol).
