Automações
Consultar uma automação
Consulte uma automação do Instagram pelo ID com status, tipo de gatilho, carimbos de tempo e a configuração tipada completa.
GET
/
api
/
v1
/
automations
/
{automationId}
Get an automation
curl --request GET \
--url https://levios.app/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://levios.app/api/v1/automations/{automationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/automations/{automationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_automation_not_found",
"message": "The requested automation was not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_internal_error",
"message": "The request could not be completed.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_resolution_unavailable",
"message": "The reachable account set could not be read.",
"correlation_id": "<string>"
}
}Envie o ID da automação no caminho e o
Uma automação
account_id dela na query string. Sua
chave de API precisa de automations:read e de acesso a essa conta.
A resposta contém o name editável e a configuration completa, além de
status, trigger_type e carimbos de tempo. trigger_type informa que tipo
de atividade do Instagram a automação escuta e é derivado da configuração,
então você não o define diretamente.
Quando uma automação ativa tem edições ainda não publicadas,
has_unpublished_changes é true, draft_updated_at guarda a última
alteração do rascunho e a configuration devolvida é esse rascunho. Publique
com Ativar uma automação.
Leia o indicador de compatibilidade
authoring_compatibility diz se a automação pode ser editada pelo contrato
público:
| Valor | Significado |
|---|---|
public_v1 | configuration traz a configuração tipada completa e pode ser substituída. |
read_only_legacy | configuration é null. A automação é anterior ao contrato público. |
read_only_legacy continua informando id, name, status,
trigger_type e carimbos de tempo, e continua funcionando. Você pode renomeá-la
e pode convertê-la enviando uma configuration completa por
Atualizar uma automação.
Guarde a versão
Guarde o valor deupdated_at devolvido. Você precisa enviá-lo como
expected_updated_at ao atualizar, ativar, desativar ou excluir a automação.
Isso impede que um cliente sobrescreva uma alteração mais recente.
Esta é uma operação de leitura segura, então você pode repeti-la sem alterar a
automação.
Exemplo de requisição
curl --get \
--url "https://levios.app/api/v1/automations/${LEVIOS_AUTOMATION_ID}" \
--header "Authorization: Bearer ${LEVIOS_API_KEY}" \
--data-urlencode "account_id=${LEVIOS_ACCOUNT_ID}"
Exemplo de resposta de sucesso
IDs, horários e conteúdo ilustrativos. HTTP200.
{
"automation": {
"id": "00000000-0000-4000-8000-000000000002",
"account_id": "00000000-0000-4000-8000-000000000001",
"name": "Guide request",
"status": "draft",
"has_unpublished_changes": false,
"draft_updated_at": null,
"created_at": "2026-09-01T12:00:00.000000Z",
"updated_at": "2026-09-01T12:00:00.000000Z",
"trigger_type": "comment",
"configuration": {
"contact_filter": "anyone",
"trigger": {
"type": "comment",
"publication": {
"mode": "all"
},
"keywords": {
"mode": "specific",
"match_mode": "whole_word",
"values": [
"guide"
]
}
},
"opening": {
"public_reply": {
"enabled": false
},
"direct_message": {
"delay_seconds": 0,
"message": {
"text": "Here is the guide you asked for.",
"buttons": [
{
"type": "url",
"title": "Open the guide",
"url": "https://example.com/guide"
}
]
}
}
},
"follow_up": null,
"extras": {
"cooldown": {
"mode": "none"
}
}
},
"authoring_compatibility": "public_v1"
}
}
Get an automation
curl --request GET \
--url https://levios.app/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://levios.app/api/v1/automations/{automationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/automations/{automationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_automation_not_found",
"message": "The requested automation was not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_internal_error",
"message": "The request could not be completed.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_resolution_unavailable",
"message": "The reachable account set could not be read.",
"correlation_id": "<string>"
}
}
