Menu

Errors

When the Worktude API can’t do what a request asks, it answers an HTTP status and a JSON body whose error names the reason, such as {"error": "missing_scope", "scope": "messages:read"}. Some errors add fields that say more, which the table names.

On this page

The errors

errorStatus, and when
invalid_request400. The query or the body failed its checks. issues lists each problem.
invalid_json400. The body isn’t JSON.
invalid_range400. Bookings asked for over more than 92 days, or with to not after from. max says 92.
destination_refused400. A short link’s address was refused. field names it, and reason says why: loop, blocked or unsafe, with threats.
domain_unknown400. A new short link’s domain is neither wtude.com nor your own short domain.
invalid_api_key401. No key, or a key that doesn’t work: unknown, revoked, or of a deleted page.
missing_scope403. The key lacks the route’s scope, which scope names.
plan_limit403. The plan doesn’t include what the request needs. feature names it, with limit and plan.
workspace_suspended403. The page is suspended.
message_not_found, booking_not_found, link_not_found404. The key’s workspace has no item with that ID.
not_found404. No route has that method and path.
slug_unavailable409. A short link’s ending can’t be taken. reason says why: invalid, reserved or taken.
domain_not_live409. A new short link on your own short domain before the domain is live.
link_blocked409. A change to a short link that Worktude turned off after a report.
too_many_requests429. Past the rate limit. retryAfter says how many seconds to wait: 60.
internal_error500. Worktude failed on its side. Try again later.

Plan limits

A 403 plan_limit names in feature what the plan lacks:

featureWhen
apiAny request, while the plan doesn’t include the API.
links.monthA new short link past the plan’s short links a month, which limit gives.
links.custom_domainA new short link on your own short domain, on a plan without one.
links.rulesA short link with rules, on a plan without them.

Invalid requests

A 400 invalid_request lists each problem in issues, so that your tool can point at the field:

json
{
  "error": "invalid_request",
  "issues": [{ "path": "expiresAt", "code": "too_small", "message": "Must be in the future" }]
}

path is the field, with dots between its parts, such as rules.routes.0.to, and empty for the whole body. code says what kind of problem it is, and message describes it, in English.

The order of the checks

The API checks each request in this order, and answers the first error it finds:

  1. The key: 401 invalid_api_key, or 429 once an IP address sends more than 20 such requests a minute.
  2. The key’s rate limit: 429 too_many_requests.
  3. The page: 403 workspace_suspended while it is suspended.
  4. The plan: 403 plan_limit, with feature api.
  5. The route: 404 not_found when there is none, then 403 missing_scope when the key lacks its scope.
  6. The query and the body: 400, as above.

Questions

What should my tool do with a 429?

Wait the seconds that Retry-After gives, 60, then try again. Each key can make 120 requests a minute.

Why does a key that worked now answer 401?

Someone revoked it, the person who made it left the page’s team or deleted their account, or the page was deleted. Make a new key on the API page.