Skip to main content

Errors

The API uses conventional HTTP status codes and returns a single, consistent error envelope for every non-2xx response.

Error envelope

{
"type": "https://api.adbridge.ai/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Network 7Hb2Kp9QvL3mNx0R8tZ4 was not found"
}
FieldDescription
typeA URI identifying the error type.
titleA short, human-readable summary.
statusThe HTTP status code.
detailA human-readable explanation of this specific occurrence.

Status codes

StatusWhen it happens
400 Bad RequestInvalid input — a missing/blank required field, a bad enum value, or a malformed pagination cursor.
401 UnauthorizedMissing, malformed, invalid, revoked, or expired API key. See Authentication.
403 ForbiddenThe key is valid but not authorized for this network or at this role.
404 Not FoundThe resource does not exist — or is not visible to your key (ids are not leaked).
409 ConflictThe write conflicts with current state: an optimistic-lock version mismatch, or a guarded transition (e.g. removing the last active admin, or accepting an offer that is no longer open). Re-fetch and retry.
429 Too Many RequestsA rate limit was hit. Honor the Retry-After response header (seconds) before retrying.
500 Internal Server ErrorAn unexpected server error. Safe to retry idempotently.
502 Bad GatewayAn upstream dependency (e.g. voice synthesis) failed. Retry later.

Concurrency: optimistic locking

Writes are optimistically locked. If a resource changed between your read and your write, the update returns 409 Conflict. Re-fetch the resource and re-apply your change.

Idempotency

POST requests can be made idempotent by sending an Idempotency-Key header with a unique value (e.g. a UUID) per logical operation. If a request with the same key is retried (a network blip, a client timeout), the original response is replayed instead of performing the operation twice. A replayed response carries the Idempotent-Replayed header. Reuse the same key only for the exact same request.

curl -X POST https://api.adbridge.ai/v1/networks/7Hb2Kp9QvL3mNx0R8tZ4/campaigns \
-H "Authorization: Bearer $ADBRIDGE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name": "Spring Launch 2026", "advertiser_id": "7Hb2Kp9QvL3mNx0R8tZ4"}'