---
title: "Register a new agent"
method: POST
path: "/v1/agents"
tags: ["agents"]
---

# Register a new agent

`POST /v1/agents`

## Request

- Base URL: `https://api.spendnod.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.spendnod.com/v1/agents`
- Auth: none declared

Creates a new agent and returns its API key. The API key is only returned once — store it securely.

## Request body

- AgentCreate
  - `name` string, required
  - `metadata` object

## Response `201`

Successful Response

- AgentCreateResponse
  - `id` string, uuid, required
  - `name` string, required
  - `api_key_prefix` string, required
  - `status` 'active' | 'paused' | 'revoked', required
  - `metadata` object, required
  - `created_at` string, date-time, required
  - `api_key` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/spendnod/apis/spendnod-api.md) · [All operations](https://skmtc.dev/spendnod/apis/spendnod-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spendnod/apis/spendnod-api/revisions/170dc867d036?raw)
