Troubleshooting and Support for Conversion API
For questions about error codes after calling the API, please see the section below. For all the other questions, please do not hesitate to reach out to your Twitter representative and we will work on resolving them as soon as possible.
Error Handling and Explanation
A single request will only be successful when there are zero errors for all conversions contained within it. In the case of any error within an individual conversion, the endpoint will emit a list of all applicable errors.
Twitter Ads API Error Codes Overview
Here is an overall comprehensive list of error codes in Ads API:
https://developer.twitter.com/en/docs/twitter-ads-api/response-codes
Successful Conversion API responses are indicated with a 200-series HTTP code and a JSON-based payload containing the object requested.
When there is a 500-series HTTP code, it’s related to a server issue instead of your request or account set up. Please check the Twitter API status page or the developer community forum in case others are having similar issues.
When there is a 400-series HTTP code, the common cases are
400 Bad Request (request doesn’t fit standards)
401 Unauthorized (authentication issues)
403 Forbidden (API access issues associated with that Developer Account)
404 Not Found (URL or params might not be correct for the endpoint)
Conversion API error codes
400 Bad Request Scenarios
Reason |
Type |
Error Message |
---|---|---|
Missing Identifier Error (currently hashed email or Twitter click ID - twclid) |
400 Bad Request |
At least one user identifier must be provided |
Invalid hashed email |
400 Bad Request |
Hashed_email is not a valid SHA-256 hash |
The type of event_id is not a single event tag (SET) |
400 Bad Request |
Event_id (<event_id>) is not a single event tag (SET) |
Requested conversion events exceed the limit (currently 500 events per request) |
400 Bad Request |
Conversion count limit is 500 |
Missing Event ID |
400 Bad Request |
Event ID was not found |
JSON Error Code Example
Request:
POST '/11/measurement/conversions/o6dkt' --data '{"conversions":[{"conversion_time": "2022-06-16T01:14:00.603Z", "event_id":"o6dkt", "identifiers": [{"twclid": "23opevjt88psuo13lu8d020qkn"}]}]}' --header 'Content-Type: application/json'
Error message:
{"errors":[{"code":"INVALID_PARAMETER","message":"event_id (o6dkt) is not a single event tag (SET)","parameter":"event_id"}],"request":{"params":{"account_id":"18ce552mlaq"}}}
Request:
twurl_ads -X POST '/11/measurement/conversions/o6dkt' --data '{"conversions":[{"conversion_time": "2022-06-16T01:14:00.603Z", "event_id":"o6dl3", "identifiers": [{"twclid": ""}]}]}' --header 'Content-Type: application/json'
Error message:
{"errors":[{"code":"INVALID_PARAMETER","message":"At least one user identifier must be provided","parameter":""}],"request":{"params":{"account_id":"18ce552mlaq"}}}
Request:
twurl_ads -X POST '/11/measurement/conversions/o6dkt' --data '{"conversions":[{"conversion_time": "2022-06-16T01:14:00.603Z", "event_id":"o6dl3", "identifiers": [{"hashed_email": "abc"}]}]}' --header 'Content-Type: application/json'
Error message:
{"errors":[{"code":"INVALID_PARAMETER","message":"hashed_email (abc) is not a valid SHA-256 hash","parameter":"hashed_email"}],"request":{"params":{"account_id":"18ce552mlaq"}}}
Request:
twurl_ads -X POST '/11/measurement/conversions/o6dkt' --data '{"conversions":[{"conversion_time": "2022-06-16T01:14:00.603", "event_id":"o6dl3", "identifiers": [{"twclid": "23opevjt88psuo13lu8d020qkn"}]}]}' --header 'Content-Type: application/json'
Error message:
{"errors":[{"code":"INVALID_PARAMETER","message":"Expected Time in yyyy-MM-ddTHH:mm:ss.SSSZ, got \"2022-06-16T01:14:00.603\" for conversion_time","parameter":"conversion_time"}],"request":{"params":{"account_id":"18ce552mlaq"}}}
401 Unauthorized
Reason: Authentication credentials missing or incorrect
Solution: Follow the authentication steps in the Set Up documentation using one of the 3 authentication methods:
User Access Tokens for user handles other than the handle owning the Ads API application must be generated with a 3-legged OAuth flow. Options for generating the Access Token with 3-legged OAuth include
Any user tokens used with the Conversion API must be for users with AD_MANAGER or ACCOUNT_ADMIN access level*, which can be checked via the authenticated_user_access endpoint.
403 Access Forbidden
Reason |
Type |
Error Message |
---|---|---|
The developer account you're using does not have Ads API Access. Apply for access here. |
403 Unauthorized Client |
The client application with id <> making this request does not have access to Twitter Ads API. Ensure your application has advertiser-api access. Use 'twurl accounts' and 'twurl set default <username> <key>' to change the application you're using. |
404 Not Found
Reason |
Type |
Error Message |
---|---|---|
The request URL or params is not correct for the endpoint |
404 Route Not Found |
The requested resource could not be found |
You do not have access to the account that owns the pixel_id/Universal website tag |
404 Not Found |
User <user_id> does not have access to account <account_id>. Type 'sn <user_id>’ to get the handle of the user. Use 'twurl accounts' and 'twurl set default \u003Cusername\u003E' to change the user you're using. |
The event id does not belong to the provided account associated with the pixel ID (UWT ID) |
404 Not Found |
event_id <event_id> does not belong to provided account |
JSON Error Code Example
Request:
twurl_ads -X POST '/11/measurement/conversions/o8z6j' --data '{"conversions":[{"conversion_time": "2022-06-16T01:14:00.603Z", "event_id":"abc", "identifiers": [{"twclid": "23opevjt88psuo13lu8d020qkn"}]}]}' --header 'Content-Type: application/json'
Error message:
{"errors":[{"code":"NOT_FOUND","message":"event_id (abc) does not belong to provided account","parameter":"event_id"},{"code":"INVALID_PARAMETER","message":"event_id (abc) is not a single event tag (SET)","parameter":"event_id"}],"request":{"params":{"account_id":"18ce55gze09"}}}