Buni.aiDocs

Errors

Every status code the Buni.ai public API returns, what the error body looks like, and whether to retry.

Errors are JSON with an error message. A few add fields: the version error adds code and supportedVersions, the quota error adds quota, and a failed sync run adds invocationId and status.

{ "error": "Insufficient token scope" }

Match on the status code, not the message text. Messages can be reworded.

Status codes

StatusExample errorCauseRetry?
200-Sync run finished, or a stored result was replayed (idempotentReplay: true).-
201-Polling trigger registered.-
202-Async run accepted, or an earlier run with the same idempotency key is still in progress.-
400Unsupported API versionPath version is not v1. Body also has code: "UNSUPPORTED_API_VERSION" and supportedVersions: ["v1"].No
400Bot message API is only available for chatbot projectsWrong project type for the endpoint. Also Automation projects must use the automation trigger API, Automation trigger API is only available for automation projects, External API access is not supported for this project type.No
400Provide either runAt or delaySeconds, not bothInvalid scheduling fields. See Scheduling.No
400pollKey is requiredMissing required field or query parameter.No
401Missing API tokenNo Authorization: Bearer or x-api-key header.No
401Invalid API tokenUnknown, revoked or expired token, or a token for another project.No
403Insufficient token scopeToken lacks the endpoint's scope.No
403External API access is disabled for this projectEnable External API is off.After it is switched on
403Token does not match invocationReading or changing a run another token started.No
403Unauthorizedapprove or reject sent with an API token.No
404Project not foundWrong orgId or projectId, or the project was deleted.No
404Invocation not foundWrong invocationId, or it belongs to another organization.No
404Polling state not foundNo polling trigger with that pollKey.No
409Only scheduled invocations can be modifiedCancel or reschedule on a run that is not SCHEDULED, or on a sync run.No
422Event has already been replayedDead-letter replay of an event already replayed, a missing event, or a replay that failed.Depends on error
429Rate limit exceededPer-token rate limit. See the X-RateLimit-* headers.Yes, after X-RateLimit-Reset
429Monthly API call quota exceededPlan quota used up. Body has quota.limit and quota.used.Next billing period
500Payload is missing required keys: customerIdSync run failed, including trigger validation. Body has invocationId and status: "FAILED".Fix the request first
500Flow sync trigger failedUnexpected server error.Yes, with the same idempotency key
502Failed to resume the automation after recording the decisionAn approval decision was recorded but the run did not resume. Dashboard only.-
503Unable to validate monthly API quotaQuota check unavailable.Yes, with backoff

The Webhook trigger URL has its own set of responses, including 405, 409, 410 and 413.

Retry safely

Only retry 429, 500 and 503, and network errors. Send an x-idempotency-key with every trigger call so that a retry after a timeout cannot start a second run. Back off exponentially: for example 1, 2, 4 and 8 seconds, capped at a few attempts.

A 500 from a sync endpoint that includes invocationId means the run itself failed. Read error, and see the run's steps with GET /external-invocations/{invocationId}, before sending it again.

Troubleshooting

Last reviewed 24 September 2026

On this page