---
title: "Create Agent"
method: POST
path: "/v1/agent"
tags: ["agent"]
---

# Create Agent

`POST /v1/agent`

## Request

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

## Request body

- AgentPayload: Create / full-update body for an agent. `channel_id` is the dashboard channel the agent runs on (`ig-<id>`, `ig-business-<id>` or `fb-page-<id>`); the service unpacks it into the account id triple the row stores.
  - `name` string, required
  - `type` 'LIKE' | 'COMMENT_MODERATION', required
  - `channel_id` string, required
  - `media_selection_type` 'SPECIFIC' | 'ALL': Media selection type for triggers.
  - `media_ids` string[], nullable
  - `ai_prompt` string, required
  - `action_limit` 'UNLIMITED' | 'PER_DAY'
  - `action_limit_value` integer, nullable
  - `delay_in_seconds` integer, nullable
  - `delay_unit` 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS': Unit a user entered a wait duration in. Shared by the legacy automation step delays (`StepDelay.delay_unit`) and the flow builder's DELAY node / comment auto-reply delay. The backend always schedules with the canonical seconds value; this is what the UI round-trips so the editor can show the delay the way it was typed.
  - `is_active` boolean

## Response `200`

Successful Response

- ApiModelResponseSchema
  - `id` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
