@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Credas API
@version v1
@auth ApiKey apikey in header
@common_fields {apikey: any # ApiKey supplied.}
@endpoints 37
@hint download_for_search
@toc api(37)

@endpoint POST /api/bank-accounts/verify
@desc Verifies bank account details.
@optional {request: map # Object containing data required to perform bank account verification.}
@returns(200) Success
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/companies
@desc Searches for a company based on its Company Number and returns its details.
@optional {companyNumber: any # The company registration number of the company that should be searched.}
@returns(200) Success
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: If the consumer doesn't have the required permission to use the endpoint., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/companies/{companyId}
@required {companyId: any}
@returns(200) Success
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: If the consumer doesn't have the required permission to use the endpoint., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/credit-status/perform
@desc Check includes identifying bankruptcy, insolvency, CCJ's or Company Directorship.
@optional {request: map # Object containing data required to perform the check.}
@returns(200) Success
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/datachecks
@desc Creates new data check against a specified registration.
@optional {dataCheck: map # Object containing data check details.}
@returns(200) Details of newly added data check.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/images/selfie/{registrationId}
@desc Retrieve the selfie image associated with a registration.
@required {registrationId: any # The id of the registration.}
@returns(200) Response containing the selfie image details.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/images/selfie
@desc Add a selfie image to the registration.
@optional {selfie: map # Object containing the selfie image and registration id.}
@returns(200) Result of uploading selfie image; including liveness check indicator.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/images/liveness/{registrationId}
@desc Retrieve the liveness action image (UAP) associated with a registration.
@required {registrationId: any # The id of the registration.}
@returns(200) Response containing Liveness image details.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/images/liveness
@desc Add a liveness image (UAP) to the specified registration.
@optional {liveness: map # Object containing the liveness image and registration id.}
@returns(200) OK response indicating a successful action.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/images/liveness-performed/{registrationId}
@desc Retrieve the liveness performed image associated with a registration.
@required {registrationId: any # The id of the registration.}
@returns(200) Response containing Liveness performed image details.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If the liveness performed image doesn't exist., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/images/id-document/{registrationId}
@desc Get all id document images associated with a registration.
@required {registrationId: any # The id of the registration.}
@returns(200) Details of the id documents associated with the registration.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/images/id-document
@desc Add an id document image to the specified registration.
@optional {idDocument: map # Object containing the id document image and registration id.}
@returns(200) Details of the processed id document.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/images/scan-report-pdf/{scanId}
@desc Returns a detailed report on the analysis that has taken place of a scanned document
@required {scanId: any # Id of the individual scanned document}
@returns(200) PDF document containing detail analysis of scanned documents as a byte stream.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If scan matching the scanId was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/property-register
@desc Creates new property registry check against the registration.
@optional {request: map # Object containing check details.}
@returns(200) Details of newly added data check.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/property-register/{id}
@desc Retrieves property registry check associated with the registration.
@required {id: any # Id of the registration.}
@returns(200) Details of the property register check.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 404: If registration does not have associated property register check., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/registrations/instant
@desc Creates new registration record, adds an ID document and optional selfie image in one go.
@optional {request: map # The Credas.Api.Models.Registrations.AddInstantRegistrationRequest object containing required data.}
@returns(200) OK response with object containing the document information.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/registrations
@desc Creates new registration.
@optional {registration: map # Object containing registration details.}
@returns(200) Details of newly added registration.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 402: Error code meaning that the operation was aborted due to insufficient credits., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/check-submitted-id-documents
@desc Checks if submitted documents are sufficient to complete registration.
@required {id: any # Id of the registration.}
@returns(200) OK response with object containing the result of the document check.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/referenceid/{referenceId}/summary
@desc Finds registrations by the ReferenceId.
@required {referenceId: any # ReferenceId - from external system to match Registrations on.}
@returns(200) Collection of Registration summary objects.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the RegCode was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/summary
@desc Finds a registration by the Id.
@required {id: any # Id of the registration.}
@returns(200) Registration summary object.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/regcode/{regCode}/summary
@desc Finds a registration by the RegCode.
@required {regCode: any # RegCode - short unique identifier.}
@returns(200) Registration summary object.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the RegCode was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/supported-id-documents
@desc Get a list of supported id document for the specified registration id.
@required {id: any # Id of the registration.}
@returns(200) List of supported id document objects.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint PUT /api/registrations/{id}/status
@desc Updates the status of the registration to one specified in the request.
@required {id: any # Id of the registration.}
@optional {request: map # Request object containing the details.}
@returns(200) Update was successful.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 404: If the registration was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/pdf-export
@desc Returns PDF export for a given registration.
@required {id: any # Id of the registration.}
@returns(200) PDF document containing registration extract as byte stream.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/pdf-export-sections
@desc Returns a PDF report for a given registration containing specified sections
@required {id: any # Id of the registration.}
@optional {Comments: any, ContactDetails: any, StandardChecks: any, PepSanctionChecks: any, ProofOfOwnership: any, BankAccountCheck: any, CreditStatusCheck: any, Liveness: any, ExcludeSelfie: any, ExcludeIDDocuments: any, DIATFSection: any, SafeHarbourSection: any}
@returns(200) PDF document containing registration extract as byte stream.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint PUT /api/registrations/{id}/override-check-status
@desc Sets an override for a specific check on the registration.
@required {id: any # Id of the registration.}
@optional {request: map # Request data.}
@returns(200) Status of the operation.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/registrations/{id}/resend-invitation
@desc Resends any invitation for the specified registration.
@required {id: any # Id of the registration.}
@returns(200) Invitation sent.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/settings
@desc Gets registration settings or nothing if there are no settings associated with the registration.
@required {id: any # Id of the registration.}
@returns(200) Registration settings updated.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint PUT /api/registrations/{id}/settings
@desc Updates registration settings.
@required {id: any # Id of the registration.}
@optional {settings: map # Object containing registration settings.}
@returns(200) Registration settings updated.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint PUT /api/registrations/{id}/contact-details
@desc Updates a registration's contact details.
@required {id: any # Id of the registration.}
@optional {details: map # Object containing contact details.}
@returns(200) Registration contact details updated.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/search
@desc Gets paged registration list by search criteria or nothing if there are no matching fields.
@optional {pageNum: any # Zero-based page number to retrieve., pageSize: any # Number of records to return on each request (Maximum value is 50)., forename: any # Search by forename., surname: any # Search by surname., email: any # Search by user email., dob: any # Date of birth in (yyyy-MM-dd) format}
@returns(200) Registration summary object list.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/registrations/{id}/pdf-settlement-status
@desc Returns settlement status PDF (Share Code) for a given registration.
@required {id: any # Id of the registration.}
@returns(200) PDF document containing settlement status information extract as byte stream.
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 403: If requesting entity have no permission to access the resource., 404: If registration matching the Id was not found., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint GET /api/reg-types
@desc Gets all available RegTypes.
@returns(200) A collection of available RegTypes.
@errors {401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/report-view/by-referenceid
@desc Retrieves secure links to registration details pages searching by the Reference Id.
@optional {request: map # Request object}
@returns(200) Results of the query
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/report-view/by-registrationid
@desc Retrieves secure link to registration details page searching by the Registration Id.
@optional {request: map # Request object}
@returns(200) Results of the query
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/web-verifications/by-referenceid
@desc Retrieves secure links to web verification pages searching by the Reference Id.
@optional {request: map}
@returns(200) Results of the query
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@endpoint POST /api/web-verifications/by-registrationid
@desc Retrieves secure link to web verification page searching by the Registration Id.
@optional {request: map}
@returns(200) Results of the query
@errors {400: If the service was supplied invalid data., 401: If credentials supplied were invalid., 500: If an unexpected exception occurred whilst processing the request.}

@end
