ai_agents.publish
Publicar alterações do agente. Congela a configuração atual (chave, modelo, temperatura, persona, ferramentas e regras de escalonamento) como a versão em uso: soma 1 à versão, grava publishedAt e zera dirty. Um rascunho vira paused (ative com ai_agents.status_set). Regras de escalonamento sem gatilho ou sem ação impedem a publicação. A chave precisa estar válida.
- Endpoint:
POST https://app.atomiks.com.br/api/v1/ai_agents.publish(corpo JSON) - Quem pode chamar: administrador da conta
- Escopo da chave:
crm:write - Grava dados: sim
- Pela chave de API: sim
- Ferramenta MCP:
ai_agents_publish - Ficha em JSON:
https://app.atomiks.com.br/api/v1/openapi.json(operationIdai_agents.publish)
Entrada
| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
id | string (uuid) | sim |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"id"
]
}Exemplo
curl -X POST https://app.atomiks.com.br/api/v1/ai_agents.publish \
-H "Authorization: Bearer $ATOMIKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"00000000-0000-0000-0000-000000000000"}'CLI:
node cli/atomiks.mjs ai_agents.publish --json '{"id":"00000000-0000-0000-0000-000000000000"}'MCP: ferramenta ai_agents_publish com a mesma entrada.
Saída
Sucesso: {"data": ...} com o formato abaixo.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"ownerId": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"purpose": {
"type": [
"string",
"null"
]
},
"avatarPreset": {
"type": [
"string",
"null"
]
},
"avatarUrl": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"draft",
"active",
"paused"
]
},
"provider": {
"type": "string",
"enum": [
"openai",
"anthropic"
]
},
"credentialId": {
"type": "string"
},
"modelId": {
"type": "string"
},
"temperature": {
"type": "number"
},
"persona": {
"type": "string"
},
"tools": {
"type": "array",
"items": {
"type": "string"
}
},
"escalation": {
"type": "array",
"items": {
"type": "object",
"properties": {
"trigger": {
"type": "string",
"maxLength": 300
},
"action": {
"type": "string",
"maxLength": 300
},
"enabled": {
"default": true,
"type": "boolean"
}
},
"required": [
"trigger",
"action",
"enabled"
],
"additionalProperties": false
}
},
"knowledgeStoreId": {
"type": [
"string",
"null"
]
},
"primaryRole": {
"type": "string",
"enum": [
"sdr_inbound",
"sdr_outbound",
"support"
]
},
"version": {
"type": "number"
},
"publishedAt": {
"type": [
"string",
"null"
]
},
"dirty": {
"type": "boolean"
},
"conversationsCount": {
"type": "number"
},
"resolvedCount": {
"type": "number"
},
"scheduledCount": {
"type": "number"
},
"escalatedCount": {
"type": "number"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"id",
"ownerId",
"name",
"purpose",
"avatarPreset",
"avatarUrl",
"status",
"provider",
"credentialId",
"modelId",
"temperature",
"persona",
"tools",
"escalation",
"knowledgeStoreId",
"primaryRole",
"version",
"publishedAt",
"dirty",
"conversationsCount",
"resolvedCount",
"scheduledCount",
"escalatedCount",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}Erros
{"error": {"code", "message", "requestId"}}. Códigos: invalid_input (400), unauthorized (401), forbidden / account_pending / scope_missing (403), not_found (404), limit_reached (409), internal (500).