---
title: "Create Custom Agent"
method: POST
path: "/api/agents/custom"
tags: ["agent-builder"]
---

# Create Custom Agent

`POST /api/agents/custom`

## Request

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

Create a tenant-scoped custom AgentDefinition from a validated draft.

## Headers

- `X-Tenant-Id` integer, nullable

## Request body

- SaveCustomIn
  - `builder_session_id` integer, nullable
  - `draft` AgentDraft: The builder's structured output: a complete, validatable definition.
    - `name` string, required
    - `description` string
    - `goal` string
    - `system_prompt` string, required
    - `tools` string[]
    - `model` string
    - `effort` string

## Response `200`

Successful Response

- AgentCardOut: One agent card = the global definition merged with this tenant's instance state (enabled?, last run, pending-question count).
  - `key` string, required
  - `name` string, required
  - `platform` string, required
  - `description` string, required
  - `placement_lock` object, required
  - `read_tools` string[], required
  - `write_tools` string[], required
  - `writes_enabled` boolean, required
  - `version` integer, required
  - `enabled` boolean, required
  - `instance` AgentInstanceOut, required: This tenant's enabled instance of a definition (present only once the tenant has hit /enable).
    - `id` integer, required
    - `display_name` string, required
    - `status` string, required
    - `health` string
    - `last_health_detail` string, nullable
    - `accounts` object
    - `anomaly_hold` boolean
    - `created_at` string, date-time, required
  - `last_run` RunSummaryOut, required: Compact last-run line shown on an agent card (full detail lives in RunOut on the task tab).
    - `id` integer, required
    - `status` string, required
    - `summary` string, nullable, required
    - `created_at` string, date-time, required
  - `pending_questions` integer, required
  - `is_custom` boolean
  - `status` string

## Other responses

- `422`: Validation Error

---

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