Typekit API error handling

When things go wrong HTTP status codes will be used to describe error conditions:

  • 400 for errors in the data provided by your application
  • 401 if authentication is needed to access the requested endpoint
  • 403 if your application has been rate limited
  • 404 if you are requesting a resource that doesn't exist
  • 500 if our servers are unable to process the request
  • 503 if the Typekit API is offline for maintenance

The response will be in the requested output format, the "errors" attribute will contain more information about what went wrong. For example:

$ curl -s https://typekit.com/api/v1/json/kits
  "errors": [
    "Not authorized"

If the API format you're requesting isn't recognized it will respond with a plain text 404:

$ curl -s https://typekit.com/api/v1/sgml
Not Found

Some objects, notably font families, have multiple identifiers. The Typekit API will issue a 302 redirect to the primary endpoint for the object if a request is made using a different identifier.