Automations
Delete an automation
Archive an Instagram automation by ID so it stops processing new activity, without removing its historical metrics or contact interactions.
DELETE
/
api
/
v1
/
automations
/
{automationId}
Delete an automation
curl --request DELETE \
--url https://levios.app/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', 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.delete(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_automation_version_conflict",
"message": "The automation changed after the supplied version.",
"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>"
}
}Delete an automation by passing its ID in the path. Pass
account_id and the
latest updated_at value as expected_updated_at in the query string. Your
API key needs automations:write.
The API archives the automation instead of removing its stored history. An
archived automation no longer processes new Instagram activity. A successful
request returns 204 with no response body.
Protect concurrent changes
Read the automation immediately before deleting it. Ifexpected_updated_at is stale, the API returns 409 with
api_automation_version_conflict. Read the automation again and send another
delete request built on the value it returns.
Example request
curl --get \
--request DELETE \
--url "https://levios.app/api/v1/automations/${LEVIOS_AUTOMATION_ID}" \
--header "Authorization: Bearer ${LEVIOS_API_KEY}" \
--data-urlencode "account_id=${LEVIOS_ACCOUNT_ID}" \
--data-urlencode "expected_updated_at=${EXPECTED_UPDATED_AT}"
Query Parameters
Required string length:
20 - 32Pattern:
^(?:(?:(?!0000)\d{4})-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|02-(?:0[1-9]|1\d|2[0-8]))|(?:(?!0000)(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,6})?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$Response
Successful response.
Delete an automation
curl --request DELETE \
--url https://levios.app/api/v1/automations/{automationId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', 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.delete(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_automation_version_conflict",
"message": "The automation changed after the supplied version.",
"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>"
}
}
