Example
Invalid Request to POST /accounts/register
{
"gender": "martian",
"name": {
"first": "@@"
}
}Fault Response
{
"object": "fault",
"name": "error",
"code": "kValidationError",
"errCode": "cortex.invalidArgument.unspecified",
"status": 400,
"message": "Invalid Argument",
"faults": [
{
"object": "fault",
"name": "validation",
"code": "kRequired",
"errCode": "cortex.validation.required",
"status": 400,
"message": "Please enter a value",
"path": "account.password",
"reason": "Required property"
},
{
"object": "fault",
"name": "validation",
"code": "kRequired",
"errCode": "cortex.validation.required",
"status": 400,
"message": "Please enter a value",
"path": "account.name.last",
"reason": "Required property"
},
{
"object": "fault",
"name": "validation",
"code": "kRequired",
"errCode": "cortex.validation.required",
"status": 400,
"message": "Please enter a value",
"path": "account.email",
"reason": "Required property"
},
{
"object": "fault",
"name": "validation",
"code": "kEnumValue",
"errCode": "cortex.validation.enumValue",
"status": 400,
"message": "Please enter a value from the list",
"path": "account.gender",
"reason": "One of: m, f, t, o, n, u"
},
{
"object": "fault",
"name": "error",
"code": "kInvalidString",
"errCode": "cortex.error.unspecified",
"status": 500,
"message": "Error",
"path": "account.name.first",
"reason": "Enter text between 1 and 100 characters in length"
},
{
"object": "fault",
"name": "validation",
"code": "kRequired",
"errCode": "cortex.validation.required",
"status": 400,
"message": "Please enter a value",
"path": "account.mobile",
"reason": "A mobile number is required."
}
]
}Faults generated from api requests are json documents with fault as the object property value.
When reading and writing context properties, a path property will usually be available, representing the full property path. A fault may also have children, especially in the case of kValidationError, where property validation errors are represented as children, whose path property can be examined to pinpoint the error source.
NoteThere are two faults, cortex.success.newLocation and cortex.accepted.mediaNotReady, whose HTTP statuses are in the 2XX range. In these cases, clients must handle a seemingly successful response as a fault.
| code | statusCode | Default message |
|---|---|---|
| kNewLocation | 200 | A new location has been added to the account. Please verify it |
| kMediaNotReady | 202 | The resource has been created but is not ready for streaming. |
| kAuthScope | 400 | Invalid authentication scope |
| kInvalidArgument | 400 | Automatic connections must target an account identifier. |
| kInvalidArgument | 400 | Invalid query expression and/or value. |
| kCastError | 400 | Cast error. |
| kInvalidFormat | 400 | The certificate/key format is invalid |
| kInvalidArgument | 400 | Invalid connection target. |
| kInvalidArgument | 400 | Invalid connection token |
| kCreatableOnly | 400 | Property is only writable on creation |
| kInvalidDateOfBirth | 400 | Invalid date of birth |
| kInvalidArgument | 400 | Dollar ($) prefixed fields are not valid for storage |
| kInvalidArgument | 400 | Dotted field names are not valid for storage |
| kInvalidEmailFormat | 400 | Invalid email address format |
| kEnumValue | 400 | Please enter a value from the list |
| kOrgDisabled | 400 | Org is not active |
| kFingerprintMismatch | 400 | Fingerprint doesn't match session |
| kIllegalExpansion | 400 | This property cannot be expanded |
| kInvalidArgument | 400 | Resource is inactive |
| kInvalidArgument | 400 | Deployment target is inactive |
| kInvalidApiVersion | 400 | Invalid API Version |
| kInvalidArgument | 400 | Invalid deployment identifier |
| kInvalidJSON | 400 | Please enter valid JSON |
| kInvalidIPv4AddrOrCidr | 400 | Enter a valid IPv4 address or IPv4 CIDR range |
| kInvalidJSONSchema | 400 | Please enter a valid JSON schema |
| kInvalidArgument | 400 | JSON schema validation failed |
| kLocationAlreadyVerified | 400 | Location already verified |
| kInvalidFingerprint | 400 | Invalid location fingerprint |
| kInvalidArgument | 400 | Invalid location verification token |
| kMaxAllowed | 400 | Too many items of this type in the collection |
| kMaxItems | 400 | Too many items in the collection/array |
| kInvalidArgument | 400 | Max length exceeded |
| kMinItems | 400 | Not enough items in the collection/array |
| kMinRequired | 400 | Not enough items of this type in the collection |
| kMismatchedMediaContentType | 400 | Uploaded file content type must match the source. |
| kInvalidArgument | 400 | Invalid or missing organization environment code |
| kInvalidArgument | 400 | Connections must be created within the context of an application. |
| kInvalidArgument | 400 | No connection targets were specified |
| kInvalidNPI | 400 | Invalid NPI |
| kInvalidObject | 400 | Invalid or Unknown Object |
| kInvalidPhoneNumberFormat | 400 | Invalid phone number format |
| kInvalidArgument | 400 | Invalid query arguments |
| kInvalidArgument | 400 | Connections cannot be auto-created for this object. |
| kRequired | 400 | Please enter a value |
| kScriptCompilationError | 400 | Script compilation error |
| kStaleRequestSignature | 400 | Stale request signature. Use the Medable-Server-Time response header to correct drift. |
| kInvalidArgument | 400 | Invalid object state |
| kInvalidArgument | 400 | String expected |
| kRequestTooLarge | 400 | Value too large |
| kInvalidArgument | 400 | Invalid Argument |
| kInvalidArgument | 400 | Unsupported content encoding |
| kValidationError | 400 | Validation error |
| kInvalidArgument | 400 | Invalid acl arguments |
| kAccountActivationRequired | 403 | Account must be activated to login. |
| kAccountLocked | 403 | Account access has been disabled |
| kAccountNotActivated | 403 | Account is not yet activated |
| kAccessDenied | 403 | App client access denied |
| kAccessDenied | 403 | App disabled |
| kAccessDenied | 403 | App is read only |
| kAccessDenied | 403 | App suspended |
| kAccessDenied | 403 | An automatic connection cannot be made unless the caller has the required access level to the connection target |
| kInvalidCredentials | 403 | Invalid password |
| kAccountNotVerified | 403 | Account must be verified before connections can be made |
| kAccessDenied | 403 | Connections are disabled for object |
| kCSRFTokenMismatch | 403 | CSRF token mismatch |
| kAccessDenied | 403 | This organization environment is not configured for deployments |
| kDeployment | 403 | A deployment is in progress. |
| kAccessDenied | 403 | Invalid Deployment Credentials |
| kDuplicate | 403 | Your new password must be different than the old one. |
| kAccessDenied | 403 | The resource is in use and cannot be removed |
| kInvalidCredentials | 403 | Invalid email/password combination |
| kInvalidCredentials | 403 | Invalid Deployment Credentials |
| kInvalidCredentials | 403 | Invalid access token |
| kInvalidCredentials | 403 | Invalid access token app |
| kInvalidRequestSignature | 403 | Invalid request signature |
| kLocationAccessRevoked | 403 | Access from this location has been revoked |
| kLocationClientMismatch | 403 | Location/Access client mismatch |
| kLoggedInElsewhere | 403 | Logged in elsewhere |
| kMaintenance | 403 | The API is currently undergoing maintenance |
| kMaxAllowed | 403 | The user account quota has been exceeded |
| kMaxAllowed | 403 | Max jobs per day quota exceeded |
| kAccessDenied | 403 | Maximum number of tokens reached for this subject. |
| kNoCredentialsSupplied | 403 | No access credentials were supplied |
| kNotDeletable | 403 | Resource cannot be deleted |
| kNotLoggedIn | 403 | You must be logged in to access this resource |
| kNotPullable | 403 | Removal from collection not supported |
| kNotWritable | 403 | Resource/Property is not writable |
| kPasswordExpired | 403 | Your password has expired. |
| kAccessDenied | 403 | Access denied to principal |
| kAccessDenied | 403 | Access to private facet is only allowed by the creator. |
| kAccessDenied | 403 | Property read access denied |
| kProviderRegistrationDisabled | 403 | Provider registration is not enabled |
| kRegistrationInvitationRequired | 403 | Registration requires a valid invitation. |
| kAccessDenied | 403 | Insufficient role access |
| kAccessDenied | 403 | Route access denied |
| kAccessDenied | 403 | Missing a required JWT auth scope. |
| kAccessDenied | 403 | Call by JWT scoped principal not permitted. |
| kAccessDenied | 403 | Scripts are disabled in this environment |
| kSelfRegistrationDisabled | 403 | Self registration is not enabled |
| kSessionExpired | 403 | Your session has expired |
| kSessionOrgMismatch | 403 | The application and session Orgs don't match |
| kAccessDenied | 403 | Share access is required |
| kAccessDenied | 403 | Support login is disabled |
| kAccessDenied | 403 | Support login is pinned to another account |
| kAccessDenied | 403 | Support login requires a reason for the login |
| kAccessDenied | 403 | Access denied |
| kUnverifiedLocation | 403 | Access by this location is pending account holder verification |
| kWriteOnce | 403 | Property cannot be overwritten. |
| kAccessDenied | 403 | Insufficient script access. |
| kNotFound | 404 | Account not found |
| kNotFound | 404 | Invalid account token |
| kNotFound | 404 | App not found |
| kNotFound | 404 | App does not have a valid RSA key pair |
| kNotFound | 404 | Cache key not found |
| kNotFound | 404 | Deployment target was not found |
| kNotFound | 404 | Document not found |
| kOrgControlInvalidOrg | 404 | Unrecognized organization environment |
| kNotFound | 404 | Facet not found |
| kNotFound | 404 | File not found |
| kNotFound | 404 | Instance not found |
| kMissingMediaSource | 404 | A file source is missing from the upload. |
| kNotFound | 404 | Object not found |
| kNotFound | 404 | Invalid password reset token |
| kNotFound | 404 | Property not found |
| kNotFound | 404 | Property node not found |
| kNotFound | 404 | Role not found |
| kNotFound | 404 | Route not found |
| kNotFound | 404 | Script not found |
| kNotFound | 404 | Service account not found |
| kNotFound | 404 | Storage location not found |
| kNotFound | 404 | Resource not found |
| kNotFound | 404 | View not found |
| kScriptError | 404 | Cursor not found |
| kTimeout | 408 | APNs notification timeout |
| kTimeout | 408 | The query took too long to complete and was aborted |
| kTimeout | 408 | Gave up waiting for environment activity to cease |
| kSmsTimeout | 408 | SMS Timeout |
| kTimeout | 408 | Timeout |
| kTimeout | 408 | Script execution timed out. |
| kExists | 409 | Account already activated |
| kExists | 409 | Account already verified |
| kActivationAlreadySent | 409 | An account activation email has already been sent to this address |
| kExists | 409 | Connection already exists |
| kExists | 409 | An account with this email address already exists |
| kDuplicateKey | 409 | Duplicate value for unique index |
| kExists | 409 | Resource already exists |
| kSequencingError | 409 | Sequencing error. Device contention on a document could not be resolved. |
| kStaleDocument | 409 | Stale document |
| kDuplicateKey | 409 | Duplicate value found in the collection |
| kConflict | 409 | The version is out of date |
| kExpired | 410 | App key expired |
| kExpired | 410 | Expired deployment token |
| kTokenExpired | 410 | Expired access token |
| kExpired | 410 | Expired location verification token |
| kExpired | 410 | Resource expired |
| kTooLarge | 413 | Breached maximum config storage limit. |
| kTooLarge | 413 | Too many connection targets |
| kRequestTooLarge | 413 | Request too large |
| kMediaTypeNotAllowed | 415 | The file type does not match allowed mime types for facet |
| kRequired | 428 | Versioned object requires version to update. |
| kThrottled | 429 | Policy throttled request |
| kThrottled | 429 | Request throttled |
| kTooBusy | 429 | Sandbox too busy |
| kTooBusy | 429 | Server too busy |
| kCancelled | 500 | Operation aborted. |
| kCouldNotReadCookies | 500 | Could not read cookies |
| kError | 500 | A database error occured. |
| kError | 500 | Deployment last-run identifier does not match. |
| kScriptError | 500 | File facet has errors |
| kInvalidResponseStatus | 500 | Result received with invalid http response code |
| kMissingResponse | 500 | "Missing response. Expected a ""fault"" or ""result""'" |
| kMissingResult | 500 | Missing result |
| kError | 500 | Session failed to initialize |
| kSessionRequired | 500 | A session is required |
| kSmsError | 500 | SMS Error |
| kError | 500 | Error |
| kCancelled | 500 | Script execution was cancelled. |
| kError | 500 | The script context is not available. |
| kScriptError | 500 | A script did not complete. |
| kScriptError | 500 | Headers cannot be set once data has been written. |
| kError | 500 | Script marshalling error. A data object could not be converted for transport. It's possible a value may contain enumerable getters. |
| kOutOfMemory | 500 | Script out of memory. |
| kScriptError | 500 | Max script ops exceeded. |
| kError | 500 | Script api calls are not stackable. It's possible an api call was made in a nested require. |
| kScriptError | 500 | An unspecified script error occured. |
| kNotImplemented | 501 | Indexed array updates are not yet supported. |
| kNotImplemented | 501 | Streaming from URL not implemented for storage location. |
| kNotImplemented | 501 | Not implemented |
| kUnsupportedOperation | 501 | Direct acl write |
| kUnsupportedOperation | 501 | Exact array/object property matching is unsupported |
| kUnsupportedOperation | 501 | Unsupported or missing patch operation (op) property |
| kUnsupportedOperation | 501 | setOwner operation cannot set ownership of contexts without an owner |
| kUnsupportedOperation | 501 | Properties in objects with multiple types that share a name cannot be included in some combinations of expressions |
| kUnsupportedOperation | 501 | Unsupported Operation |