---
title: "Register Agent"
description: "Register one agent and optionally its initial public keys. Retain the returned id before starting later activation work."
url: https://app.visacli.sh/docs/reference/vars/register-agent
updated: 2026-11-18
---

# Register Agent

> Register one agent and optionally its initial public keys. Retain the returned id before starting later activation work.

Canonical: https://app.visacli.sh/docs/reference/vars/register-agent. Updated: 2026-11-18. Full index: /llms.txt.

```text
POST /vars/v1/agents
```

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.

## Request body

Required JSON body, with the fields below.

| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| `name` | `string` | Required | Human-readable agent name. |
| `domain` | `string` | Required | Unique HTTP(S) agent domain. Visa CLI derives a stable, unique host per agent. |
| `description` | `string` | Required | Agent purpose. |
| `contactEmail` | `string · email` | Required | Routable contact, unique on your TRID: a duplicate answers `409`, which Basis Theory reports as `AGENT_CONTACT_EMAIL_CONFLICT`, and a plus-address counts as a different email. Visa CLI sends a stable plus-address alias of the verified contact. |
| `tokenRequestorId` | `string` | Required | Token requestor identifier. Visa CLI sends a label of its own for each agent, not the agent's ID; get the correct identifier for your VDP integration. |
| `keys` | array of [`KeyCreate`](/docs/reference/schemas.md#vars-schema-KeyCreate) | Optional | Optional initial public signing keys. |

```json title="agent-create.json — illustrative payload"
{
  "name": "Example Commerce Agent",
  "domain": "https://agent.example.com",
  "description": "An agent that browses and purchases for its users.",
  "contactEmail": "agent-team+tap-example@example.com",
  "tokenRequestorId": "YOUR_TOKEN_REQUESTOR_ID",
  "keys": [
    {
      "keyName": "YOUR_PUBLIC_JWK_THUMBPRINT",
      "algorithm": "ed25519",
      "publicKey": "BASE64_ENCODED_SPKI_PEM_PUBLIC_KEY",
      "expirationDate": "2027-11-05T00:00:00Z"
    }
  ]
}
```

## Responses

| HTTP | Meaning | Schema |
| --- | --- | --- |
| `201` | Agent created. Agents are active on creation, so there's no agent activation step. | [`AgentResponse`](/docs/reference/schemas.md#vars-schema-AgentResponse) |
| `409` | A conflict, such as a duplicate `domain`. One TRID covers many agents, so a shared `tokenRequestorId` isn't a duplicate. A `contactEmail` already used on your TRID is a conflict too. A plus-address counts as a different email. | [`ErrorResponse`](/docs/reference/schemas.md#vars-schema-ErrorResponse) |
| `422` | Invalid / extra input fields. | [`ValidationError`](/docs/reference/schemas.md#vars-schema-ValidationError) |

```json title="Illustrative response — not a live capture"
{
  "id": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
  "name": "Example Commerce Agent",
  "domain": "https://agent.example.com",
  "isActive": true,
  "tokenRequestorId": "YOUR_TOKEN_REQUESTOR_ID",
  "createdAt": "2026-11-05T00:00:00Z",
  "updatedAt": "2026-11-05T00:00:00Z",
  "keys": []
}
```

> [!NOTE] Integration detail
> Agents created through the API are active by default. A key that's added inactive is activated through the key endpoint. If you lose the create response, you don't know whether it worked. Find out before sending another POST, as Visa CLI does.

```bash title="X-Pay-Token request template"
curl --request POST \
  'https://sandbox.api.visa.com/vars/v1/agents?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-create.json
```

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](https://developer.visa.com/api-reference/trusted-agent-protocol).
