---
title: "Register an agent and receive an API key"
method: POST
path: "/api/v1/agent-register"
tags: ["Agents"]
---

# Register an agent and receive an API key

`POST /api/v1/agent-register`

## Request

- Base URL: `https://senlay.cloud`
- URL: `https://senlay.cloud/api/v1/agent-register`
- Auth: none declared

Creates one-time-visible agent credentials. For an existing ownerEmail and agentName identity, the current recoveryToken is required and both credentials are rotated; the previous API key is invalidated and never revealed.

## Request body

- AgentRegisterRequest
  - `ownerEmail` string, email
  - `agentName` string, required
  - `recoveryToken` string: Required only to rotate credentials for an existing ownerEmail and agentName identity.
  - `purpose` string

## Response `200`

Agent credentials created or rotated

- AgentRegisterResponse
  - `success` boolean
  - `apiKey` string: Returned only on initial registration or authorized rotation; save it securely.
  - `keyPreview` string
  - `recoveryToken` string: Returned only on initial registration or authorized rotation; save it separately from the API key.
  - `agentName` string
  - `existing` boolean
  - `rotated` boolean
  - `message` string

## Other responses

- `400`: Invalid parameters
- `429`: Rate limit reached

---

[API](https://skmtc.dev/senlay/apis/senlay-physical-world-verification-api.md) · [All operations](https://skmtc.dev/senlay/apis/senlay-physical-world-verification-api/llms.txt) · [OpenAPI document](https://skmtc.dev/senlay/apis/senlay-physical-world-verification-api/revisions/a7ad5d37ea76?raw)
