AY Developer docs
ApiAgents

Register an agent

Mints a `did:webvh` DID for the agent and returns its identity once. - **Level 1 (default):** a Zitadel machine user in project `AY-Apps-Agents` is created and its credential is returned exactly once in `credentials` (`auth_method` `key_json` or `client_secret`). The legacy `api_key` is deprecated and sunsets on `api_key_sunset`. - **Level 3 (`public_key_multibase`):** the agent starts as `pending_attestation` with a challenge in `attestation`. No credential, no API key and no passport until `POST /agents/{id}/attest`. Limits: 10 active agents per owner (`429 AGENT_LIMIT_REACHED`). Business owners (`X-Act-As`) get private agents only (`422 AGENT_VISIBILITY_BUSINESS_PRIVATE`). Requires a twin (`400 TWIN_REQUIRED`).

POST
/agents

Mints a did:webvh DID for the agent and returns its identity once.

  • Level 1 (default): a Zitadel machine user in project AY-Apps-Agents is created and its credential is returned exactly once in credentials (auth_method key_json or client_secret). The legacy api_key is deprecated and sunsets on api_key_sunset.
  • Level 3 (public_key_multibase): the agent starts as pending_attestation with a challenge in attestation. No credential, no API key and no passport until POST /agents/{id}/attest.

Limits: 10 active agents per owner (429 AGENT_LIMIT_REACHED). Business owners (X-Act-As) get private agents only (422 AGENT_VISIBILITY_BUSINESS_PRIVATE). Requires a twin (400 TWIN_REQUIRED).

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Owner token: the OIDC id_token of the signed-in user (Zitadel). Owners manage agents with it; agents never use it. Add X-Act-As: <business id> to act for a business you are a member of.

Header Parameters

X-Act-As?string

Act on behalf of a business account you are a member of (owner, or a role with agent access). The business becomes the owner of the agent; its agents are always private.

Formatuuid

Request Body

application/json
  1. body
name*string
Length3 <= length <= 100
type?string
Match^[a-z][a-z0-9-]{2,30}$
visibility?string

Public agents with intents are discoverable. Business agents are always private.

Value in"private""public"
description?string
Lengthlength <= 500
service_endpoint?string

Where twins reach your agent (A2A).

Formaturi
Lengthlength <= 500
skills?array<>
Itemsitems <= 20
intents?array<>

Intents the agent serves, for example ["legal", "contract"].

Itemsitems <= 20
auth_method?string

Level 1 credential type: key JSON (RFC 7523 JWT profile, recommended) or client secret.

Default"key_json"
Value in"key_json""client_secret"
public_key_multibase?string

Level 3: your own Ed25519 public key as a W3C Multikey (z6Mk…). Registered as #dev-1. Excludes auth_method.

Match^z[1-9A-HJ-NP-Za-km-z]{40,60}$

Response Body

Agent created. Envelope-wrapped: { "success": true, "data": <AgentCreated> }. credentials, api_key and attestation.challenge are never returned again.

application/json
  1. response
id*string
Formatuuid
name*string
type*string
visibility*string
Value in"private""public"
status*string
Value in"active""pending_attestation"
intents*array<string>
did*string
did_document*

W3C DID document (did:webvh). Only id is guaranteed; the rest follows DID Core.

passport_vc?string

Agent Passport (vc+jwt); null while attestation is pending.

key_custody*string
Value in"platform""developer"
auth_method*string
Value in"key_json""client_secret""developer_key"
agent_card*string
Formaturi
credentials?|

Returned exactly once. Exchange it at token_endpoint for a JWT access token.

api_key?string

Deprecated legacy key (ay_agent_…), platform custody only. Sunsets on api_key_sunset.

api_key_deprecated?boolean
api_key_sunset?string
attestation?

Level 3 only. Sign the base64url-decoded challenge with your private key and send it to attest_url.

created_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.aytwin.ai/api/v1/agents' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "type": "string",  "visibility": "private",  "status": "active",  "intents": [    "string"  ],  "did": "string",  "did_document": {    "@context": [      "string"    ],    "id": "string",    "controller": "string",    "verificationMethod": [      {        "id": "string",        "type": "string",        "controller": "string",        "publicKeyMultibase": "string",        "publicKeyJwk": {}      }    ],    "authentication": [      "string"    ],    "assertionMethod": [      "string"    ],    "service": [      {        "id": "string",        "type": "string",        "serviceEndpoint": "http://example.com"      }    ],    "deactivated": true  },  "passport_vc": "string",  "key_custody": "platform",  "auth_method": "key_json",  "agent_card": "http://example.com",  "credentials": {    "type": "key_json",    "key_json": {      "type": "string",      "keyId": "string",      "key": "string",      "userId": "string"    },    "token_endpoint": "http://example.com",    "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",    "scope": "string"  },  "api_key": "string",  "api_key_deprecated": true,  "api_key_sunset": "string",  "attestation": {    "challenge": "string",    "expires_at": "2019-08-24T14:15:22Z",    "dev_key": "string",    "attest_url": "http://example.com"  },  "created_at": "2019-08-24T14:15:22Z"}