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
error | Status, and when |
|---|---|
invalid_request | 400. The query or the body failed its checks. issues lists each problem. |
invalid_json | 400. The body isn’t JSON. |
invalid_range | 400. Bookings asked for over more than 92 days, or with to not after from. max says 92. |
destination_refused | 400. A short link’s address was refused. field names it, and reason says why: loop, blocked or unsafe, with threats. |
domain_unknown | 400. A new short link’s domain is neither wtude.com nor your own short domain. |
invalid_api_key | 401. No key, or a key that doesn’t work: unknown, revoked, or of a deleted page. |
missing_scope | 403. The key lacks the route’s scope, which scope names. |
plan_limit | 403. The plan doesn’t include what the request needs. feature names it, with limit and plan. |
workspace_suspended | 403. The page is suspended. |
message_not_found, booking_not_found, link_not_found | 404. The key’s workspace has no item with that ID. |
not_found | 404. No route has that method and path. |
slug_unavailable | 409. A short link’s ending can’t be taken. reason says why: invalid, reserved or taken. |
domain_not_live | 409. A new short link on your own short domain before the domain is live. |
link_blocked | 409. A change to a short link that Worktude turned off after a report. |
too_many_requests | 429. Past the rate limit. retryAfter says how many seconds to wait: 60. |
internal_error | 500. Worktude failed on its side. Try again later. |
A 403 plan_limit names in feature what the plan lacks:
feature | When |
|---|---|
api | Any request, while the plan doesn’t include the API. |
links.month | A new short link past the plan’s short links a month, which limit gives. |
links.custom_domain | A new short link on your own short domain, on a plan without one. |
links.rules | A short link with rules, on a plan without them. |
A 400 invalid_request lists each problem in issues, so that your tool can point at the field:
{
"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 API checks each request in this order, and answers the first error it finds:
- The key: 401
invalid_api_key, or 429 once an IP address sends more than 20 such requests a minute. - The key’s rate limit: 429
too_many_requests. - The page: 403
workspace_suspendedwhile it is suspended. - The plan: 403
plan_limit, withfeatureapi. - The route: 404
not_foundwhen there is none, then 403missing_scopewhen the key lacks its scope. - The query and the body: 400, as above.
- What should my tool do with a 429?
Wait the seconds that
Retry-Aftergives, 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.