---
title: "Create Agent"
method: POST
path: "/v2/agents"
tags: ["v2 - Agents"]
---

# Create Agent

`POST /v2/agents`

## Request

- Base URL: `https://api.jubjubapp.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jubjubapp.com/v2/agents`
- Auth: HTTP bearer

Create a new agent key.

Returns the raw secret once — caller must store it securely.
Publish scopes are off by default and require a paid plan.
The splits permission may be set by the signed-in owner, never by an agent key.

## Headers

- `Authorization` string
- `X-JubJub-Service-Key` string
- `X-JubJub-Agent-Key` string
- `X-JubJub-Platform-Key` string
- `Origin` string
- `Referer` string
- `X-JubJub-Trial-Token` string

## Request body

- CreateAgentRequest
  - `name` string, required
  - `scopes` object, nullable: Scope overrides. Missing keys use defaults. Publish scopes default to false.
  - `is_trusted_publish` boolean: Allow this agent to use publish:execute and publish:schedule scopes.

## Response `201`

Successful Response

- CreateAgentResponse
  - `agent_id` string, required
  - `name` string, required
  - `owner_profile_id` string, required
  - `status` string, required
  - `scopes` object, required
  - `is_trusted_publish` boolean, required
  - `raw_key` string, required: The raw secret key. Store it securely — it will NOT be shown again.
  - `created_at` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jubjubapp/apis/jubjub-api.md) - [All operations](https://skmtc.dev/jubjubapp/apis/jubjub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jubjubapp/apis/jubjub-api/revisions/353157b296f2?raw)
