---
title: "Register (provision) a new agent"
method: POST
path: "/agents"
---

# Register (provision) a new agent

`POST /agents`

## Request

- Base URL: `https://getsanction.com/api/v1`
- URL: `https://getsanction.com/api/v1/agents`
- Auth: API key in header `x-mgmt-key`

Create an agent under a wallet and receive its API key once. Accepts seat fields: holder (who holds it) and expires_at (contractor auto-shutoff — the key fails closed past that instant). Management-plane (x-mgmt-key).

## Request body

- RegisterAgentRequest
  - `wallet_id` string, required
  - `name` string, required: Agent name. Carry your tenant id here (e.g. tenant_<id>) to map one agent per tenant.

## Response `201`

Agent created; api_key shown once

- AgentKeyResponse: Returned on register and rotate. api_key is shown once and never retrievable again.
  - `id` string
  - `name` string
  - `api_key` string: The agent key (pxy_...). Store it now — shown once.
  - `api_key_prefix` string
  - `wallet_id` string
  - `created_at` string, date-time
  - `warning` string

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid management key

---

[API](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api.md) · [All operations](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getsanction/apis/sanction-agent-governance-api/revisions/c645a9e4b72d?raw)
