Faults

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.

📘

Note

There 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.

codestatusCodeDefault message
kNewLocation200A new location has been added to the account. Please verify it
kMediaNotReady202The resource has been created but is not ready for streaming.
kAuthScope400Invalid authentication scope
kInvalidArgument400Automatic connections must target an account identifier.
kInvalidArgument400Invalid query expression and/or value.
kCastError400Cast error.
kInvalidFormat400The certificate/key format is invalid
kInvalidArgument400Invalid connection target.
kInvalidArgument400Invalid connection token
kCreatableOnly400Property is only writable on creation
kInvalidDateOfBirth400Invalid date of birth
kInvalidArgument400Dollar ($) prefixed fields are not valid for storage
kInvalidArgument400Dotted field names are not valid for storage
kInvalidEmailFormat400Invalid email address format
kEnumValue400Please enter a value from the list
kOrgDisabled400Org is not active
kFingerprintMismatch400Fingerprint doesn't match session
kIllegalExpansion400This property cannot be expanded
kInvalidArgument400Resource is inactive
kInvalidArgument400Deployment target is inactive
kInvalidApiVersion400Invalid API Version
kInvalidArgument400Invalid deployment identifier
kInvalidJSON400Please enter valid JSON
kInvalidIPv4AddrOrCidr400Enter a valid IPv4 address or IPv4 CIDR range
kInvalidJSONSchema400Please enter a valid JSON schema
kInvalidArgument400JSON schema validation failed
kLocationAlreadyVerified400Location already verified
kInvalidFingerprint400Invalid location fingerprint
kInvalidArgument400Invalid location verification token
kMaxAllowed400Too many items of this type in the collection
kMaxItems400Too many items in the collection/array
kInvalidArgument400Max length exceeded
kMinItems400Not enough items in the collection/array
kMinRequired400Not enough items of this type in the collection
kMismatchedMediaContentType400Uploaded file content type must match the source.
kInvalidArgument400Invalid or missing organization environment code
kInvalidArgument400Connections must be created within the context of an application.
kInvalidArgument400No connection targets were specified
kInvalidNPI400Invalid NPI
kInvalidObject400Invalid or Unknown Object
kInvalidPhoneNumberFormat400Invalid phone number format
kInvalidArgument400Invalid query arguments
kInvalidArgument400Connections cannot be auto-created for this object.
kRequired400Please enter a value
kScriptCompilationError400Script compilation error
kStaleRequestSignature400Stale request signature. Use the Medable-Server-Time response header to correct drift.
kInvalidArgument400Invalid object state
kInvalidArgument400String expected
kRequestTooLarge400Value too large
kInvalidArgument400Invalid Argument
kInvalidArgument400Unsupported content encoding
kValidationError400Validation error
kInvalidArgument400Invalid acl arguments
kAccountActivationRequired403Account must be activated to login.
kAccountLocked403Account access has been disabled
kAccountNotActivated403Account is not yet activated
kAccessDenied403App client access denied
kAccessDenied403App disabled
kAccessDenied403App is read only
kAccessDenied403App suspended
kAccessDenied403An automatic connection cannot be made unless the caller has the required access level to the connection target
kInvalidCredentials403Invalid password
kAccountNotVerified403Account must be verified before connections can be made
kAccessDenied403Connections are disabled for object
kCSRFTokenMismatch403CSRF token mismatch
kAccessDenied403This organization environment is not configured for deployments
kDeployment403A deployment is in progress.
kAccessDenied403Invalid Deployment Credentials
kDuplicate403Your new password must be different than the old one.
kAccessDenied403The resource is in use and cannot be removed
kInvalidCredentials403Invalid email/password combination
kInvalidCredentials403Invalid Deployment Credentials
kInvalidCredentials403Invalid access token
kInvalidCredentials403Invalid access token app
kInvalidRequestSignature403Invalid request signature
kLocationAccessRevoked403Access from this location has been revoked
kLocationClientMismatch403Location/Access client mismatch
kLoggedInElsewhere403Logged in elsewhere
kMaintenance403The API is currently undergoing maintenance
kMaxAllowed403The user account quota has been exceeded
kMaxAllowed403Max jobs per day quota exceeded
kAccessDenied403Maximum number of tokens reached for this subject.
kNoCredentialsSupplied403No access credentials were supplied
kNotDeletable403Resource cannot be deleted
kNotLoggedIn403You must be logged in to access this resource
kNotPullable403Removal from collection not supported
kNotWritable403Resource/Property is not writable
kPasswordExpired403Your password has expired.
kAccessDenied403Access denied to principal
kAccessDenied403Access to private facet is only allowed by the creator.
kAccessDenied403Property read access denied
kProviderRegistrationDisabled403Provider registration is not enabled
kRegistrationInvitationRequired403Registration requires a valid invitation.
kAccessDenied403Insufficient role access
kAccessDenied403Route access denied
kAccessDenied403Missing a required JWT auth scope.
kAccessDenied403Call by JWT scoped principal not permitted.
kAccessDenied403Scripts are disabled in this environment
kSelfRegistrationDisabled403Self registration is not enabled
kSessionExpired403Your session has expired
kSessionOrgMismatch403The application and session Orgs don't match
kAccessDenied403Share access is required
kAccessDenied403Support login is disabled
kAccessDenied403Support login is pinned to another account
kAccessDenied403Support login requires a reason for the login
kAccessDenied403Access denied
kUnverifiedLocation403Access by this location is pending account holder verification
kWriteOnce403Property cannot be overwritten.
kAccessDenied403Insufficient script access.
kNotFound404Account not found
kNotFound404Invalid account token
kNotFound404App not found
kNotFound404App does not have a valid RSA key pair
kNotFound404Cache key not found
kNotFound404Deployment target was not found
kNotFound404Document not found
kOrgControlInvalidOrg404Unrecognized organization environment
kNotFound404Facet not found
kNotFound404File not found
kNotFound404Instance not found
kMissingMediaSource404A file source is missing from the upload.
kNotFound404Object not found
kNotFound404Invalid password reset token
kNotFound404Property not found
kNotFound404Property node not found
kNotFound404Role not found
kNotFound404Route not found
kNotFound404Script not found
kNotFound404Service account not found
kNotFound404Storage location not found
kNotFound404Resource not found
kNotFound404View not found
kScriptError404Cursor not found
kTimeout408APNs notification timeout
kTimeout408The query took too long to complete and was aborted
kTimeout408Gave up waiting for environment activity to cease
kSmsTimeout408SMS Timeout
kTimeout408Timeout
kTimeout408Script execution timed out.
kExists409Account already activated
kExists409Account already verified
kActivationAlreadySent409An account activation email has already been sent to this address
kExists409Connection already exists
kExists409An account with this email address already exists
kDuplicateKey409Duplicate value for unique index
kExists409Resource already exists
kSequencingError409Sequencing error. Device contention on a document could not be resolved.
kStaleDocument409Stale document
kDuplicateKey409Duplicate value found in the collection
kConflict409The version is out of date
kExpired410App key expired
kExpired410Expired deployment token
kTokenExpired410Expired access token
kExpired410Expired location verification token
kExpired410Resource expired
kTooLarge413Breached maximum config storage limit.
kTooLarge413Too many connection targets
kRequestTooLarge413Request too large
kMediaTypeNotAllowed415The file type does not match allowed mime types for facet
kRequired428Versioned object requires version to update.
kThrottled429Policy throttled request
kThrottled429Request throttled
kTooBusy429Sandbox too busy
kTooBusy429Server too busy
kCancelled500Operation aborted.
kCouldNotReadCookies500Could not read cookies
kError500A database error occured.
kError500Deployment last-run identifier does not match.
kScriptError500File facet has errors
kInvalidResponseStatus500Result received with invalid http response code
kMissingResponse500"Missing response. Expected a ""fault"" or ""result""'"
kMissingResult500Missing result
kError500Session failed to initialize
kSessionRequired500A session is required
kSmsError500SMS Error
kError500Error
kCancelled500Script execution was cancelled.
kError500The script context is not available.
kScriptError500A script did not complete.
kScriptError500Headers cannot be set once data has been written.
kError500Script marshalling error. A data object could not be converted for transport. It's possible a value may contain enumerable getters.
kOutOfMemory500Script out of memory.
kScriptError500Max script ops exceeded.
kError500Script api calls are not stackable. It's possible an api call was made in a nested require.
kScriptError500An unspecified script error occured.
kNotImplemented501Indexed array updates are not yet supported.
kNotImplemented501Streaming from URL not implemented for storage location.
kNotImplemented501Not implemented
kUnsupportedOperation501Direct acl write
kUnsupportedOperation501Exact array/object property matching is unsupported
kUnsupportedOperation501Unsupported or missing patch operation (op) property
kUnsupportedOperation501setOwner operation cannot set ownership of contexts without an owner
kUnsupportedOperation501Properties in objects with multiple types that share a name cannot be included in some combinations of expressions
kUnsupportedOperation501Unsupported Operation