Skip to main content

Error codes

Errors are returned in the standard GraphQL errors array. The machine-readable code is in extensions.code:

{
"errors": [
{
"message": "<human-readable description>",
"extensions": { "code": "INVALID_JOB_STATE" }
}
],
"data": null
}

Branch on extensions.code, not message. Message text may change.

MPX uses the following codes in addition to the Apollo Server built-in error codes.

Authentication​

CodeMeaning
INVALID_AUTHORIZATION_SCOPE_ERRORThe access token is missing, invalid, expired, or doesn't have the mpx:vendor scope.
AUTHORIZATION_VENDOR_NOT_FOUNDThe access token is valid but isn't linked to a vendor.

Jobs​

CodeMeaning
INVALID_JOB_IDThe job ID is invalid. This usually means it's an empty string.
JOB_NOT_FOUNDThe job doesn't exist, or your vendor doesn't have permission to see it.
INVALID_VENDOR_ERRORThe job (or technician) belongs to another vendor.
JOB_NETWORK_ERRORYour vendor isn't in the job's network. Only checked while the job is AVAILABLE.
INVALID_JOB_STATEThe job's status doesn't allow this mutation. See Allowed states per mutation.
INVALID_JOB_ERRORunassignJob was called on a job with no assignee.
JOB_ALREADY_CLAIMEDdeclineJob was called on a job that already belongs to your vendor.
INVALID_JOB_ASSIGNEEThe assignee doesn't exist, isn't a technician, or doesn't belong to your vendor.
INVALID_REASON_NOTEcompleteJob was called with an empty note and a reason other than Sample_Completely_Obtained_and_Shipped.
INVALID_OTHER_NOTEcancelJob was called with reason Other and no note.
INVALID_SHIPPING_CARRIERaddJobTrackingNumber was called with carrier OTHER but no other value.
INVALID_START_TIMEThe startTime passed to scheduleJob is invalid.
INVALID_END_TIMEThe endTime passed to scheduleJob is invalid.
SLOT_UNAVAILABLEThe requested schedule time is no longer available.
JOB_CONNECTION_ERRORjobConnection failed. Check your arguments.

Technicians​

CodeMeaning
TECHNICIAN_NOT_FOUNDThe technician doesn't exist.
USER_ALREADY_CREATED_ERRORA user with that email already exists.
ZIP_CODE_NOT_FOUNDMPX doesn't recognize the ZIP code.
ERROR_ACTIVATING_TECHNICIAN / ERROR_DEACTIVATING_TECHNICIANThe technician's status couldn't be changed.
TECHNICIAN_CONNECTION_ERRORtechnicianConnection failed. Check your arguments.

Webhooks​

CodeMeaning
WEBHOOK_NOT_FOUNDNo webhook is registered for that action.
CREATE_WEBHOOK_ERROR / UPDATE_WEBHOOK_ERROR / DELETE_WEBHOOK_ERRORThe webhook couldn't be saved or removed.

General​

CodeMeaning
VALIDATION_ERRORAn input failed validation. For example, first is out of range, a phone number is invalid, or a webhook URL isn't https. extensions.validationErrors lists the failing fields.
INTERNAL_SERVER_ERRORUnknown error. If it persists, contact MPX support.

For REST attachment upload errors, see Attachments.