Assistants V2Api reference
API de Versões
Endpoints para listar, visualizar e comparar versões publicadas
Base URL
https://services.antonnia.com/assistants/api/v2/assistants/{assistant_id}/versionsListar versões
GET /assistants/{assistant_id}/versionsLista todas as versões (commits) publicadas do assistente, da mais recente para a mais antiga.
Query parameters
| Parâmetro | Tipo | Padrão | Descrição |
|---|---|---|---|
limit | integer | 20 | Quantidade máxima de resultados |
offset | integer | 0 | Deslocamento para paginação |
branch_name | string | — | Filtrar por branch name (opcional) |
Resposta 200
{
"commits": [
{
"id": "e5f6a1b2c3d4",
"assistant_id": "a1b2c3d4e5f6",
"parent_commit_id": "c3d4e5f6a1b2",
"message": "Adicionou classificador de intenção",
"author_type": "human",
"created_at": "2026-03-24T11:30:00Z"
},
{
"id": "c3d4e5f6a1b2",
"assistant_id": "a1b2c3d4e5f6",
"parent_commit_id": null,
"message": "Versão inicial",
"author_type": "system",
"created_at": "2026-03-24T10:05:00Z"
}
]
}Obter versão específica
GET /assistants/{assistant_id}/versions/{commit_id}Retorna os detalhes de um commit e a lista de arquivos associados.
Resposta 200
{
"commit": {
"id": "c3d4e5f6a1b2",
"assistant_id": "a1b2c3d4e5f6",
"parent_commit_id": null,
"message": "Versão inicial",
"author_type": "system",
"created_at": "2026-03-24T10:05:00Z"
},
"files": [
{
"id": "f1a2b3c4d5e6",
"commit_id": "c3d4e5f6a1b2",
"path": "context",
"content_hash": "sha256_abc..."
},
{
"id": "f2b3c4d5e6a1",
"commit_id": "c3d4e5f6a1b2",
"path": "config",
"content_hash": "sha256_def..."
},
{
"id": "f3c4d5e6a1b2",
"commit_id": "c3d4e5f6a1b2",
"path": "nodes/greeting",
"content_hash": "sha256_ghi..."
}
]
}Comparar versões (diff)
GET /assistants/{assistant_id}/versions/diffCompara dois commits e retorna as diferenças arquivo por arquivo.
Query parameters
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
commit_a | string | Sim | ID do commit antigo (base) |
commit_b | string | Sim | ID do commit novo (comparação) |
Exemplo
curl -X GET "https://services.antonnia.com/assistants/api/v2/assistants/$ASSISTANT_ID/versions/diff?commit_a=c3d4e5f6a1b2&commit_b=e5f6a1b2c3d4" \
-H "Authorization: Bearer sk_live_YOUR_TOKEN"response = httpx.get(
f"{BASE_URL}/assistants/{assistant_id}/versions/diff",
headers=HEADERS,
params={
"commit_a": "c3d4e5f6a1b2",
"commit_b": "e5f6a1b2c3d4",
},
)Resposta 200
{
"diffs": [
{
"path": "nodes/greeting",
"status": "modified",
"old_content": {
"name": "Saudação",
"config": { "instructions": "Olá!" }
},
"new_content": {
"name": "Saudação",
"config": { "instructions": "Olá! Como posso ajudar?" }
},
"changes": {
"config": {
"old": { "instructions": "Olá!" },
"new": { "instructions": "Olá! Como posso ajudar?" }
}
}
},
{
"path": "nodes/classifier",
"status": "added",
"old_content": null,
"new_content": {
"name": "Classificador de Intenção",
"type": "classifier"
}
}
]
}Status possíveis
| Status | Descrição |
|---|---|
added | Arquivo existe em commit_b mas não em commit_a |
modified | Arquivo existe em ambos, com conteúdo diferente |
removed | Arquivo existe em commit_a mas não em commit_b |
Para arquivos modified, o campo changes mostra um diff superficial das propriedades de primeiro nível que mudaram.