The X API provides the following response and error codes to help understand and debug in the moment. Use the debugging guide and error index below for additional context.

Successful responses are indicated with a 200-series HTTP code and a JSON-based payload containing the object(s) requested, created, modified, or deleted along with an expression of the server’s interpretation of your request.

Error responses are served with a non-200-series HTTP code. Different error codes indicate different reasons for an error. The X API attempts to return appropriate HTTP status codes for every request.

X API v2 HTTP status codes

CodeTextDescriptionTroubleshooting tips
200OKThe request was successful!
400Bad RequestThe request was invalid or cannot be otherwise served. An accompanying error message will explain further. Requests without authentication or with invalid query parameters are considered invalid and will yield this response.Double check the format of your JSON query. For example, if your rule contains double-quote characters associated with an exact-match or other operator, you may need to escape them using a backslash to distinguish them from the structure of the JSON format.
401UnauthorizedThere was a problem authenticating your request. This could be due to missing or incorrect authentication credentials. This may also be returned in other undefined circumstances.Check that you are using the correct authentication method and that your credentials are correct.
403ForbiddenThe request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why.Check that your developer account includes access to the endpoint you’re trying to use. You may also need to get your App allowlisted (e.g. Engagement API or Ads API) or sign up for access.
404Not FoundThe URI requested is invalid or the resource requested, such as a user, does not exist.Check that you are using valid parameters and the correct URI for the endpoint you’re using.
409Connection ExceptionReturned when attempting to connect to a filtered stream that has no rules.Check that you have created at least one rule on the stream you are connecting to. Filtered stream will only return Posts that match an active rule. If there are no rules, the stream will not return any Posts.
429Too Many RequestsReturned when a request cannot be served due to the App’s rate limit or Post cap having been exhausted. See Rate Limiting.Check the number of requests per timeframe allowed with the endpoint you’re using. Wait for the timeframe to reset. Space out your requests to ensure you don’t hit rate limits or upgrade to the next available data plan.
500Internal Server ErrorSomething is broken. This is usually a temporary error, for example in a high load situation or if an endpoint is temporarily having issues.Check the X API status page or the developer community forum in case others are having similar issues, or simply wait and try again later.
501UnimplementedThe X API does not support this endpoint and cannot fulfill the request.
503Service UnavailableThe X servers are up, but overloaded with requests. Try again later.Check the X API status page or the developer community forum in case others are having similar issues, or simply wait and try again later.

When an error is incurred during a request, detailed information about the error is returned in the response body to aid in diagnosing the problem. A type field, which is a URI, indicates the nature of the problem, while additional fields provide details about the problem. The type, title, and detail fields will always be returned in these bodies (see table below). Any additional fields, as in the example below, will vary depending on the type of the error.

{
  "client_id": "101010101",
  "required_enrollment": "Standard Basic",
  "registration_url": "https://developer.twitter.com/en/account",
  "title": "Client Forbidden",
  "detail": "This request must be made using an approved developer account that is enrolled in the requested endpoint. Learn more by visiting our documentation.",
  "reason": "client-not-enrolled",
  "type": "https://api.x.com/2/problems/client-forbidden"
}

Partial errors

In some cases you may see the errors detailed above in a response that returned a 200 status code. In those cases, the endpoint is designed to return the data that it can, while providing detailed errors about what it could not return.

For example, the Posts lookup endpoint allows a X developer App to request more than one ID. If some of those Posts are available, but one of them has been deleted, the available Posts would be returned in the data field of the response. An additional errors field would be returned in the payload, indicating which requested Post(s) could not be returned. The same format is used as full request errors to make diagnosing issues easier.

Error information

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 X API attempts to return appropriate HTTP status codes for every request.

TitleTypeDescription
Generic Problemabout:blankA generic problem with no additional information beyond that provided by the HTTP status code.
Invalid Request Problemhttps://api.X.com/2/problems/invalid-requestA problem that indicates this request is invalid. If your request takes a POST body, ensure the contents is valid JSON and matches the OpenAPI spec.
Resource Not Found Problemhttps://api.X.com/2/problems/resource-not-foundA problem that indicates that a given Post, User, etc. does not exist.
Resource Unauthorized Problemhttps://api.X.com/2/problems/not-authorized-for-resourceA problem that indicates you are not allowed to see a particular Post, User, etc.
Client Forbidden Problemhttps://api.X.com/2/problems/client-forbiddenA problem that indicates your client is forbidden from making this request.
Disallowed Resource Problemhttps://api.X.com/2/problems/disallowed-resourceA problem that indicates that the resource requested violates the precepts of this API.
Unsupported Authentication Problemhttps://api.X.com/2/problems/unsupported-authenticationA problem that indicates that the authentication used is not supported.
Usage Capped Problemhttps://api.X.com/2/problems/usage-cappedA problem that indicates that a usage cap has been exceeded.
Connection Exception Problemhttps://api.X.com/2/problems/streaming-connectionA problem that indicates something is wrong with the connection.
Client Disconnected Problemhttps://api.X.com/2/problems/client-disconnectedYour client has gone away.
Operational Disconnect Problemhttps://api.X.com/2/problems/operational-disconnectYou have been disconnected for operational reasons.
Rule Cap Problemhttps://api.X.com/2/problems/rule-capYou have exceeded the maximum number of rules.
Rule Length Problemhttps://api.X.com/2/problems/rule-lengthYou have exceeded the maximum number of characters allowed on your query or rule based on your access level. See access levels.
Invalid Rules Problemhttps://api.X.com/2/problems/invalid-rulesThe rule you have submitted is invalid.
Duplicate Rules Problemhttps://api.X.com/2/problems/duplicate-rulesThe rule you have submitted is a duplicate.

Troubleshooting tips

Get help

The X community forum is available for you to ask technical questions about the X developer platform. This is a discussions forum where you will find questions by other developers and technical information on a variety of topics related to using the X API.

We encourage you to join the conversation by responding to questions and engaging in conversations on our forum. X employees are also there to provide support.

Before you post a question

  • Search the X developer documentation for information relating to your issue
  • Search the community forum for similar questions by other developers
  • Review the community forum guidelines

When you post a question, make sure to include the following information

  • A description of the problem
  • The API call being made (include headers, if possible)
  • The X response returned (include any error messages)
  • What you expected to receive instead
  • List of steps taken to troubleshoot the issue
  • List of steps required to reproduce the issue
  • If relevant, the time frame during which an issue occurred
  • If relevant, the App ID, Post ID, etc.
  • Any relevant code sample or screenshots

Please only include one topic/question per post.

If you have feature requests or feedback, please submit these through the X Developer Platform Feedback Form.

For Policy-related issues, such as App suspension, please contact Policy support.

For X-related issues, such as login and account support, please use the X Help Desk.