HTTP Statuses and Errors

HTTP statuses indicate if a request has been successful. The Datawrapper API responses will include standard HTTP statuses including error codes. You can find a great overview of HTTP status codes on https://httpstatuses.com.

To show you an example, the 418 client error is rather funny.

Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.

Since the Datawrapper API can not make tea (or coffee) you won't see this error code from its endpoints.

Others like 201 CREATED are very likely though, for example when creating a chart. Here are some of the status codes the Datawrapper API uses:

CodeNameTypeExample
200OKSuccessGET requests will return status 200 if everything was OK
201CreatedPOST requests that create new resources (like a chart) will return with 201.
204No ContentPUT requests usually don't return anything since they replace the complete resource.
301Moved permanentlyRedirectionThere is 1 permanent redirect where /3 gets redirected to /v3
400Bad requestClient errorSome invalid data was sent to the server. Additional information may be provided as error message.
401UnauthorisedThe API Access Token is invalid and authorisation failed. You can check if the token used has a typo or got revoked at some point. If you can't see it in app.datawrapper.de/account, it won't work.
403ForbiddenYou don't have access to the requested resource.
404Not foundThe requested resource was not found.
409ConflictThere is a conflict with the target resource. This can happen if you try to create a resource with a unique identifier that already exists.

If you see any statuses in the 5xx (eg. 500 Internal server error) range, we probably did something wrong and this is a bug. It could be that the server is unavailable. Please contact us [email protected] in this case.