Status 200 - OK
GraphQL does not return status codes in the same way that REST APIs do. For example, GraphQL can return a 200 OK in cases where a REST API would return a 5xx or 4xx status code. Due to this fact, GraphQL can return a 200 OK even when an action at the application level fails.
Error Handling
To check for errors, you need to check for the 'errors' object within the response, which contains additional information about what caused the issue. Some mutations also have a "Success" boolean as a return field, that will return true or false, depending on the success or failure of the action. To check the return fields of all mutations and queries, check our API Docs.
In the event of an error, in addition to the error messages returned within the 'errors' object, we provide an 'extensions' object. This object will display details about the error that occurred, identified by the 'code' key (refer to the Error Table below), along with a 'correlation_id' hash to facilitate issue analysis with our support team.
{
"data": {
"deleteCard": null
},
"errors": [
{
"message": "Card not found with id: 00000000",
"locations": [
{
"line": 32,
"column": 3
}
],
"path": [
"deleteCard"
],
"extensions": {
"code": "RESOURCE_NOT_FOUND",
"correlation_id": "fcc162735121ac9f71ceba9fb58a639e"
}
}
]
}
{
"data": {
"updateFieldsValues": {
"success": false
}
}
}
Error codes
See below those errors and an explanation of them
Error | Explaining |
---|---|
INVALID_INPUT | Indicates that the provided input data is not valid or improperly formatted. |
RECORD_INVALID | Points to an error related to the validation or integrity of record data |
ANOTHER_IMPORTATION_ALREADY_RUNNING | Indicates that another importation or similar process is already running and cannot be started simultaneously. |
ENABLED_APP | Occurs when there is an issue with the activation or use of a specific application |
FEATURE_NOT_ALLOWED_BY_ORGANIZATION_PLAN | Denotes that the requested feature is not available in the current organization plan. |
FIELD_EDITABLE_ONLY_ON_ITS_ORIGINAL_PHASE | Signals that a field can only be edited in its original phase and not in other phases. |
ORGANIZATION_IN_BLOCKLIST | Indicates that the organization is in the blocklist, preventing certain actions. |
PERMISSION_DENIED | Represents the denial of necessary permissions to perform a specific operation. |
RECORD_NOT_DESTROYED | Refers to a failure in destroying or deleting a record. |
RESOURCE_NOT_FOUND | Occurs when a specific resource could not be found or does not exist. |
UNIQUE_RESOURCE_ALREADY_EXISTS | Indicates that a unique resource already exists and cannot be duplicated. |
USAGE_LIMIT_EXCEEDED | Indicates that a usage limit has been exceeded, such as the maximum number of requests per period. |
USER_TO_ASSIGN_ROLE | Points to an error when trying to assign a role or function to a specific user. |
PROVIDER_NOT_IDENTIFIED | This exception is thrown whenever it's not possible to find the provider through the user's email domain. |
4XX and 5XX Status Codes
As mentioned above, in most cases GraphQL will return a 200 OK response when a REST API would return a 4xx or 5xx status code. But in some specific cases, a 4xx or 5xx status code can be returned. See below those cases and an explanation of them.
Status Code | Explaining |
---|---|
401 | Unauthorized. A valid token was not passed within the request header. |
404 | Not found. The resource is not available. |
422 | Unprocessable Entity. Pipefy is not able to process the request. |
429 | Too many requests. This error occurs when you reach the rate limit for API Calls. Check the 'Request Limits' section of this article to understand limits. |
5xx | Internal error within Pipefy |