Skip to content

Authentication

The Newtrition API uses API keys for authentication. Create, manage, and learn more about API keys in our dashboard .

API keys should be provided via HTTP Bearer authentication.

Authorization: Bearer NEWTRITION_HUB_API_KEY

If authentication fails, the API will return a 401 Unauthorized status code with the following error response:

{
"error": {
"message": "Unauthorized",
"details": "Invalid or expired token"
}
}

This error occurs when:

  • The API key is missing from the request
  • The API key is invalid or malformed
  • The API key has expired
  • The API key has been revoked or deleted

Make sure to check that your API key is correctly formatted and hasn’t expired. If you continue to experience issues, generate a new API key from the dashboard.