Actors

Create an actor

Creates a new actor in the project named in the path.

post/v1/projects/{project_id}/actors

Request

  • Base URL: https://api.naturali.ai
  • URL: https://api.naturali.ai/v1/projects/{project_id}/actors
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)

Request body

namestring required
external_idstring

Optional external identifier (e.g. WhatsApp phone number). If provided and an actor with this externalId already exists in the project, the existing actor is returned (idempotent — 200 OK).

instructionsstring nullable

Persona-specific instructions composed into the effective system prompt during conversation generation.

agent_idstring

Agent to link this actor to. Mutually exclusive with chat_id.

chat_idstring

Chat to link this actor to. Mutually exclusive with agent_id.

Example request

{
  "name": "Alice",
  "external_id": "+15551234567",
  "agent_id": "agent_V1StGXR8Z5jdHi6B",
  "chat_id": "chat_V1StGXR8Z5jdHi6B"
}

Response

Actor already exists — returned when externalId matches an existing actor in this project (idempotent)

idstring

Actor ID

project_idstring

Project ID

namestring
external_idstring nullable

External identifier (e.g. WhatsApp phone number)

instructionsstring nullable

Persona-specific instructions composed into the effective system prompt during conversation generation.

agent_idstring nullable

Agent this actor is linked to (mutually exclusive with chatId).

chat_idstring nullable

Chat this actor is linked to (mutually exclusive with agentId).

tagsTagBag

Key-value labels on a resource. A flat object of string values — an array, a nested object or a number is rejected with 400 VALIDATION_FAILED, never coerced. Keys are opaque and stored verbatim, so cost_center and costCenter are two different tags. Matched by JSONB containment wherever tags are read: the ?tags= filter and knowledge search.

Keys beginning system. are reserved: the platform writes them to record which conversation, actor, agent and role a row came from, and a write naming one is refused with 400 RESERVED_TAG_KEY. They are read and filtered like any other tag.

The bag is bounded, because every pair reaches the IAM context of every access check on the resource: at most 50 keys, each key at most 128 characters and each value at most 256. A write past a bound — including a merge that would grow the stored bag past the key count — is 400 VALIDATION_FAILED with meta.limit naming the bound it crossed. system.* keys are the platform's and do not count against the 50.

created_atstring date-time
updated_atstring date-time

Example response

{
  "id": "actor_V1StGXR8Z5jdHi6B",
  "project_id": "proj_V1StGXR8Z5jdHi6B",
  "name": "Alice",
  "external_id": "+15551234567",
  "tags": {
    "team": "finance",
    "env": "prod"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.