A response from the API has a data field, an errors field, or both. Check errors in every response.
The error format
Each item in errors has a message. Most items also have path and locations. The path names the field that failed.
This response comes from a query that has no token. The failed field is null in data.
{
"data": {
"attendeesConnection": null
},
"errors": [
{
"message": "unauthenticated",
"path": ["attendeesConnection"],
"locations": [{ "line": 2, "column": 3 }]
}
]
}
A query can partly succeed. In that case data holds the fields that worked, and errors lists the fields that failed. Read both.
If the GraphQL engine finds a problem in the query itself, the response has no data field. The message names the problem. For example:
{
"errors": [
{
"message": "Cannot query field \"noSuchField\" on type \"RootQueryType\".",
"locations": [{ "line": 1, "column": 2 }]
}
]
}
HTTP status codes
The API answers HTTP 200 when it runs a query or mutation. The response can still hold errors. These other codes exist.
| Code | Cause | Body |
|---|---|---|
400 |
The request has no query. | {"errors":[{"message":"No query document supplied"}]} |
401 |
The token is not valid or has expired. | {"errors":[{"message":"invalid_token"}]} |
405 |
A mutation came in a GET request. |
An errors list. |
To fix a 401, call the login mutation again. Send the login request without an Authorization header. A request that carries the old token gets the same 401. Then use the new token.
Error messages
| Message | Cause | What to do |
|---|---|---|
unauthenticated |
The request has no Authorization header, or the header does not start with Bearer. |
Send Authorization: Bearer <token>. See Getting started. |
Invalid client id or token |
The login mutation got a client id or client token that does not match an API user. |
Copy both values again from the page of the API user in the CMS. |
Unauthorized gathering id |
The event (gathering in the schema, selected with gatheringId) does not exist, or the API user cannot reach it. |
Check the id that you sent. Check that the API user can reach the event. |
Unauthorized app id |
The app does not exist, or the API user cannot reach it. A restricted API user always gets this error for gatherings and createGathering. |
Check the value of appId. Use an organization-wide API user. |
first cannot exceed 1000 or last cannot exceed 1000 |
The page size is more than 1000. | Use a smaller value. See Pagination. |
The API gives the same message when an event does not exist and when the API user cannot reach it.
Errors in arguments
The GraphQL engine checks each argument before it runs a query. It rejects a missing required argument and a value of the wrong type. The message names the argument.
{
"errors": [
{
"message": "Argument \"filters\" has invalid value {createdAfter: \"2026-06-01\"}.\nIn field \"createdAfter\": Expected type \"Datetime\", found \"2026-06-01\".",
"locations": [{ "line": 1, "column": 33 }]
}
]
}
See Scalars for the format of each scalar.
Rejected changes
A create, update, or delete mutation can fail after the API accepts the arguments. Touchpoint then returns the error with two fields:
codeis the HTTP status of the failed step.messageholds the body of the failed step. The body is a JSON object, not a text.
{
"data": {
"createAttendee": null
},
"errors": [
{
"code": 403,
"message": {
"status": {
"code": 403,
"message": "Attendee not valid: [\"<reason>\"]"
}
},
"path": ["createAttendee"],
"locations": [{ "line": 2, "column": 3 }]
}
]
}
For a record that is not valid, the reason is in message.status.message. Correct the input and send the mutation again.
This article is a copy of Errors in the Touchpoint API documentation.
Comments
0 comments
Please sign in to leave a comment.