Step 1: Initiate Registration
Endpoint
Request Body
Base64-encoded Ed25519 public key (32 bytes). This becomes the agent’s permanent identity.
Array of scope IDs the agent wants access to. Must be non-empty and contain only valid scope IDs from the discovery document.
Optional blockchain wallet address for x402 payments (required if service uses x402)
Optional metadata about the agent
Response (201 Created)
Newly assigned agent ID (format:
ag_*). Save this - you’ll need it for verification.Challenge that must be signed to complete registration
Example Request
Example Response
Error Responses
400 - invalid_request
Missing or invalid required fields (public_key, scopes_requested)
400 - invalid_scopes
One or more requested scopes are not available. Response includes
available_scopes array.409 - already_registered
An agent with this public key already exists. Response includes the existing
agent_id.429 - rate_limit_exceeded
Registration rate limit exceeded. Check
retry_after in response.Step 2: Verify Signature
Endpoint
- Sign the
challenge.messagestring with their Ed25519 private key - Base64-encode the signature (64 bytes)
- Submit the signature for verification
Request Body
The agent_id returned from step 1
Base64-encoded Ed25519 signature of the challenge message (64 bytes)
Response (200 OK)
The agent’s ID
API key for authentication (format:
agk_live_* or agk_test_*). This is only returned once - save it securely!Array of scopes granted to this agent (may differ from requested scopes)
JWT token for immediate use
ISO 8601 timestamp when the token expires
Rate limit configuration for this agent
x402 payment information (only present when x402 is enabled)
Example Request
Example Response
Error Responses
400 - invalid_request
Missing or invalid agent_id or signature
400 - invalid_signature
Signature verification failed. Ensure you signed the exact challenge message with the correct private key.
404 - not_found
No pending registration found for this agent_id. The challenge may have expired.
410 - challenge_expired
The registration challenge has expired. Start over at step 1.
Complete Registration Flow
Challenge Message Format
The challenge message follows this exact format:- Prefix: Always
agentdoor:register - Agent ID: The ID assigned in step 1
- Timestamp: Unix timestamp in seconds when the challenge was created
- Nonce: Base64-encoded random nonce for uniqueness
Security Considerations
- Challenge Expiry: Challenges expire after 5 minutes by default to prevent replay attacks
- One-time Use: Each challenge can only be verified once
- Rate Limiting: Registration endpoint is rate-limited (typically 10 requests/hour per IP)
- Public Key Uniqueness: Each public key can only register once
- API Key Security: The API key is only shown once - store it securely
Next Steps
After successful registration:- Save Credentials: Store both the API key and JWT token securely
- Start Making Requests: Use either token for authentication
- Refresh Tokens: When JWT expires, use the authentication endpoint to get a new one