Each problem type indicates the nature of the problem encountered. A full list of problems that you can run into can be found in our API specification as well. The following error types can be returned by every endpoint.
This type is used when there is no additional information beyond that provided by the HTTP status code.
Invalid request is used to indicate a problem with the parameters you've sent to the endpoint. These are commonly invalid request parameters.
If the parameter for querying fields on a Tweet or User is mistyped or doesn't exist (for example
tweet.fields=language), an error message with the following message structure is returned:
[language] is not one of [attachments,author_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,source,text,withheld]"
Not Found Error
This error is returned when a given Tweet, User, etc. does not exist. Extra fields in the error indicate the ID of the resource that could not be found.
This occurs when your client App and/or user are not allowed to see a particular Tweet, private metric on a specific Tweet, etc. This may happen because a user is protected, among other things.
This error is returned when the Tweet requested with the metrics endpoint is either older than 30 days or is a Retweet. Requests of this type are not permitted on this endpoint.
This error is returned when two-legged OAuth is used instead of 3-legged OAuth. For example, this error is returned if two-legged OAuth is used with the metrics endpoint, which is private at this time.
The Client Forbidden problem type indicates your Twitter developer App is forbidden from making this request. Usually this is because the App is not associated with an activated Labs preview.