CLI docs

Agents (VARS)Add Key

Agents (VARS)TAP specification

Add Key

Register an additional public signing key. A newly created key still needs activation.

Markdownllms.txt
POST/vars/v1/agents/{agentId}/keys

Related guide: Register an agent.

Authentication: the method you chose, X-Pay-Token or two-way TLS; see X-Pay-Token / mTLS. X-Pay uses the signed apiKey query.

Parameters

agentIdpath parameterrequired

string
The agent's ID, returned as id.

Request body

Required JSON body, with the fields below.

keyNamestringrequired

Human-readable / stable key name. Visa CLI sends the RFC 7638 thumbprint (JKT).

algorithmstringrequired

For Ed25519 keys, send lowercase ed25519. For any other value, check the current VARS schema, which needs authorized access.

publicKeystringrequired

Base64 of the complete UTF-8 SPKI PEM public key, including PEM markers and line breaks. This is a public signing key.

expirationDatestring · date-time

UTC expiry. Visa CLI requests now + 365 days. Always send it.

addressstring

Base58 of the raw 32-byte Ed25519 public key, up to 512 characters. It's per-key data from VARS 26.08, and Visa CLI sends it.

Responses

HTTPMeaningSchema
201Key created inactive; activation follows.KeyResponse
403Agent is deactivated.ErrorResponse
404Agent not found.ErrorResponse
422Invalid key fields.ValidationError

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

Sources: Current TAP API reference / endpoint catalog.

X-Pay-Token request template
base='https://sandbox.api.visa.com/vars/v1'
curl --request POST \
  "$base/agents/YOUR_AGENT_ID/keys?apiKey=YOUR_API_KEY" \
  --header 'Accept: application/json' \
  --header 'x-pay-token: TOKEN_FOR_THIS_EXACT_REQUEST' \
  --header 'Content-Type: application/json' \
  --data-binary @agent-key-create.json
agent-key-create.json — illustrative payload
{
  "keyName": "YOUR_PUBLIC_JWK_THUMBPRINT",
  "algorithm": "ed25519",
  "publicKey": "BASE64_ENCODED_SPKI_PEM_PUBLIC_KEY",
  "expirationDate": "2027-11-05T00:00:00Z"
}

Updated 9 Nov 2026