Faults

Example

Invalid Request to POST /patientfiles

{
    "gender": "martian",
    "name": {
        "first": "@@"
    }
}

Fault Response

{
   "object" : "fault",
   "name" : "validation",
   "code" : "kValidationError",
   "status" : 400,   
   "faults" :
      [
         {
            "object" : "fault",
            "name" : "validation",
            "code" : "kRequired",
            "status" : 400,
            "reason" : "Required property",            
            "message" : "Please enter a value",
            "path" : "dob"
         },
         {
            "object" : "fault",
            "name" : "validation",
            "code" : "kRequired",
            "status" : 400,
            "reason" : "Required property",                        
            "path" : "name.last"
         },
         {
            "object" : "fault",
            "name" : "validation",
            "code" : "kEnumValue",
            "status" : 400,
            "reason" : "One of: m, f",                        
            "path" : "gender"
         },
         {
            "object" : "fault",
            "name" : "fault",
            "code" : "kInvalidString",
            "status" : 500,
            "reason" : "Enter text between 1 and 100 characters in length",                        
            "path" : "name.first"
         }
      ]   
}

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 some faults, such as kNewLocation and kMediaNotReady, whose HTTP statuses are in the 2XX range. In these cases, clients must handle a seemingly successful response as a fault.

SourceError CodeStatusMeaning
accountkAccountNotActivated403Account is not yet activated.
accountkAccountNotVerified403Account connections can't occur until an account has been verified.
accountkProviderRegistrationDisabled403Provider registration is not enabled.
accountkSelfRegistrationDisabled403Self registration is not enabled.
authkInvalidRequestSignature400Invalid request signature.
authkStaleRequestSignature400Stale request signature.
authkAccountLocked403Your account access has been disabled.
authkInvalidCredentials403Invalid email/password combination.
authkNoCredentialsSupplied403No access credentials were supplied.
errorkIllegalExpansion400This property cannot be expanded.
errorkInvalidArgument400Invalid Argument. Typically accompanied by a reason and path.
errorkInvalidObject400Invalid or Unknown Object.
errorkAccessDenied403Access to this resource is denied.
errorkNotDeletable404Resource cannot be deleted.
errorkNotFound404Resource not found.
errorkNotPullable404Removal from collection not supported.
errorkNotWritable404Resource is not writable.
errorkTimeout408Timeout.
errorkExists409Resource already exists.
errorkStaleDocument409Stale document. Versioning error.
errorkExpired410Resource expired.
errorkRequestTooLarge413Request too large.
errorkThrottled429Request throttled. Too many requests from the client.
errorkError500Error. General error, accompanied by a "reason", and possible child faults.
errorkNotImplemented501Not implemented. An unimplemented, undocumented and/or planned feature is part of the api, but not ready for release.
errorkUnsupportedOperation501Unsupported Operation.
errorkTooBusy503Too Busy. The server cannot respond to requests. Clients should scale back requests for a while.
fileskMediaNotReady202File not ready. Not really an error. File processing occurs asynchronously, and depends on the file size, type, and facet processors.
fileskMismatchedMediaContentType400Uploaded file content type must match the source. Occurs during processing if the uploaded file doesn't match the facet's expected content type.
fileskMissingMediaSource400A file source is missing from the upload. Occurs when a File is configured with required facets that were not included in the upload request.
fileskMediaTypeNotAllowed415This file type is not allowed. For example, a File facet expecting an image/png will produce this error if the uploaded type doesn't match.
locationkNewLocation200A new location has been added to the account. 2FA is triggered. A subsequent sign in must use the location verification token.
locationkCouldNotReadCookies400Could not read cookies. Cookies are required for sessions.
locationkFingerprintMismatch400Fingerprint doesn't match session.
locationkInvalidFingerprint400Invalid location fingerprint.
locationkLocationAlreadyVerified400Location already verified.
locationkLocationAccessRevoked403Access from this location has been revoked.
locationkLocationClientMismatch403Location/Access client mismatch. Occurs if location jiggery pokery is attempted.
locationkUnverifiedLocation403Access by this location is pending account holder verification. This occurs when a user signs in from a new location and attempts a login while the 2fA is still in progress.
registrationkAccountActivationRequired403The account must be activated to login.
registrationkRegistrationInvitationRequired403Registration requires a valid invitation.
sessionskCSRFTokenMismatch403CSRF token mismatch. This occurs is the client is configured to use CSRF protection and the client has not sent the correct Medable-CSRF-Token header.
sessionskLoggedInElsewhere403Logged in elsewhere. This can occur is the org is configure to sign out other client sessions.
sessionskNotLoggedIn403You must be logged in to access this resource.
sessionskSessionExpired403Your session has expired.
sessionskSessionOrgMismatch403The application and session Orgs don't match.
sessionskUnsafeGoodsDetected403Authorization security failure.
sessionskSessionRequired500A session is required to access the resource.
validationkCastError400Cast error. A request value could not be sanely converted.
validationkCreatableOnly400Property is only writable on creation.
validationkEnumValue400Please enter a value from the list.
validationkInvalidDateOfBirth400Invalid date of birth.
validationkInvalidDomainFormat400Invalid domain format.
validationkInvalidEmailFormat400Invalid email address format.
validationkInvalidFormat400Generic validation string format error.
validationkInvalidIPv4AddrOrCidr400Enter a valid IPv4 address or IPv4 CIDR range.
validationkInvalidJSON400Please enter valid JSON.
validationkInvalidJSONSchema400Please enter a valid JSON schema.
validationkInvalidNPI400Invalid NPI format.
validationkInvalidPhoneNumberFormat400Invalid phone number format.
validationkMaxAllowed400Too many documents in a document array.
validationkMaxItems400Too many items in a property array.
validationkMinItems400Not enough items in a property array.
validationkMinRequired400Not enough documents were provided for a document array.
validationkRequired400A required value is missing from the request.
validationkScriptCompilationError400Script compilation error. An uploaded script has failed to compile.
validationkValidationError400A validation error has occured. Typically, validation errors will have 1 or more child faults.