Skip to main content
POST
/
agents
/
import
Import agents
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/agents/import \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data '
{
  "application": {
    "ref_name": "customer-support",
    "name": "Customer Support"
  },
  "source": "openai-agents-sdk",
  "on_conflict": "error",
  "agents": [
    {
      "name": "Onboarding Agent",
      "description": "Guides new users through account setup",
      "instructions": "Always verify identity before proceeding.",
      "execution_mode": "reasoning",
      "actions": [
        {
          "action_name": "lookup_order",
          "action_type": "api_call",
          "description": "Fetch order details",
          "action_config": {
            "parameters": {
              "order_id": {
                "type": "string",
                "required": true
              }
            }
          }
        }
      ],
      "handoffs": [
        "KYC Agent"
      ]
    },
    {
      "name": "KYC Agent",
      "description": "Verifies user identity",
      "actions": []
    }
  ]
}
'
{
  "data": {
    "application_id": 42,
    "agents": [
      {
        "name": "Onboarding Agent",
        "id": 101,
        "status": "created",
        "action_ids": [
          200
        ],
        "subagent_links": [
          "KYC Agent"
        ],
        "warnings": []
      },
      {
        "name": "KYC Agent",
        "id": 102,
        "status": "created",
        "action_ids": [],
        "subagent_links": [],
        "warnings": []
      }
    ],
    "warnings": []
  }
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Body

application/json
application
object
required
agents
object[]
required
source
string
on_conflict
string
prune
boolean

Response

200 - application/json

Import agents.

data
any