See Stacksync in action with a solution architect. Book a demo ↗

Errors

The error bodies and HTTP statuses of the Stacksync API, and which errors to retry

A failed request answers a 4xx status and a JSON body that names the problem.

Error body

Operations of the current conventions answer:

{ "error": "<kind of error>", "msg": "<what went wrong>", "field": "<parameter or field at fault, or null>" }
FieldMeaning
errorThe kind of error, stable enough to branch on
msgWhat went wrong, in plain words, for logs and people
fieldThe parameter or body field at fault, when there is one

The older operations of syncs, sync triggers, sync webhooks, sync issues and connection creation answer a body with at least error, holding the message:

{ "error": "<what went wrong>" }

Each operation's page lists the statuses it answers and their body.

Statuses

StatusMeaningWhat to do
400The request is invalid: a parameter or body field is missing, of the wrong type or out of range. With error Unexpected Error, Stacksync could not complete a valid requestFix the request; field names the culprit. Unexpected Error is temporary: retry later
403Authentication or permission failure. The API never answers 401See Authentication
404The resource doesn't exist in this workspace and regionCheck the id and the region
409The request conflicts with the resource's state, or a request with the same Idempotency-Key is still runningRead the resource, or wait and retry
422The Idempotency-Key was already used with a different request. Some older operations also answer 422 when the request fails validation; their pages list itUse a new key for a new request, or fix the request

Most answers, errors included, carry an X-Request-Id header. Quote it when you contact support.

When to retry

Retry the same request, with an increasing delay between attempts, only when:

  • the answer is 400 with error Unexpected Error: a temporary failure on Stacksync's side;
  • the answer is 409 because a request with the same Idempotency-Key is still running.

For creates, retry with the same Idempotency-Key, so a retry never creates the resource twice. Every other error answers the same until the request changes: fix the request, the key or the region instead of retrying.

No rate limit is published.

On this page