Skip to main content
POST
/
agents
/
{agent_id}
/
actions
Create agent action
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/agents/{agent_id}/actions \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data '
{
  "action_name": "Lookup Order",
  "action_type": "api",
  "description": "Fetch order details from the orders API",
  "invocation_mode": "foreground"
}
'
{
  "data": {
    "id": 200,
    "action_name": "Lookup Order",
    "action_type": "api",
    "agent_id": 101,
    "enabled": true
  }
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Path Parameters

agent_id
integer
required

Body

application/json
action_name
string
required
action_type
string
required
description
string
required
action_config
object
is_default
boolean
action_result_type
string
invocation_mode
string
meta
object

Response

201 - application/json

Create agent action.

data
object

A capability that an agent can invoke — an LLM call, API call, or webhook.