{
  "openapi": "3.1.0",
  "info": {
    "title": "Amiqus SDK REST API",
    "version": "1.0",
    "description": "The Amiqus SDK API is used to undertake Amiqus requests on behalf of a data subject. All API requests require SDK Token authentication. SDK Tokens are generated using the Amiqus API, scoped to a single Record and are valid for 60 minutes.",
    "contact": {
      "email": "developers@amiqus.co",
      "name": "Amiqus Engineering",
      "url": "https://developers.amiqus.co/sdk/sdk-api-reference.html"
    }
  },
  "servers": [
    {
      "url": "https://id.amiqus.co/sdk/v1"
    }
  ],
  "paths": {
    "/status": {
      "get": {
        "summary": "SDK token status",
        "description": "Check validity of the SDK token and retrieve details of the scoped Record.",
        "operationId": "get-status",
        "security": [
          {
            "sdk_token": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordStatus-2"
                },
                "example": {
                  "object": "record_status",
                  "id": 983434,
                  "status": "pending",
                  "email": "marty@example.com",
                  "client": 73845,
                  "created_at": "2022-05-22T08:22:12Z",
                  "updated_at": "2022-05-22T08:22:12Z"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "default": "Unauthenticated"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell + Curl",
            "source": "curl --request GET \\\n  --url https://id.amiqus.co/sdk/v1/status \\\n  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
          },
          {
            "lang": "Node + Request",
            "source": "const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://id.amiqus.co/sdk/v1/status',\n  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"
          },
          {
            "lang": "Javascript + Xhr",
            "source": "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://id.amiqus.co/sdk/v1/status\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
          },
          {
            "lang": "Php + Http2",
            "source": "<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://id.amiqus.co/sdk/v1/status');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
          }
        ]
      }
    },
    "/steps": {
      "get": {
        "summary": "List all steps",
        "description": "List all steps on record.",
        "operationId": "get-steps",
        "security": [
          {
            "sdk_token": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number for pagination",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of items per page",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PaginatedList"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "description": "List of all steps for this record",
                          "minItems": 1,
                          "items": {
                            "$ref": "#/components/schemas/Step"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "object": "paginated_list",
                  "data": [
                    {
                      "object": "step",
                      "id": 2,
                      "type": "check.photo_id",
                      "completed_at": "2022-05-23T08:30:10Z"
                    },
                    {
                      "object": "step",
                      "id": 3,
                      "type": "document.request",
                      "completed_at": "2022-05-23T08:32:21Z"
                    },
                    {
                      "object": "step",
                      "id": 4,
                      "type": "form",
                      "completed_at": "2022-05-25T10:10:14Z"
                    }
                  ],
                  "total": 3,
                  "count": 3,
                  "limit": 100,
                  "current_page": 1,
                  "total_pages": 1,
                  "links": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "default": "Unauthenticated"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell + Curl",
            "source": "curl --request GET \\\n  --url 'https://id.amiqus.co/sdk/v1/steps?page=INTEGER_VALUE&limit=INTEGER_VALUE' \\\n  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
          },
          {
            "lang": "Node + Request",
            "source": "const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://id.amiqus.co/sdk/v1/steps',\n  qs: {page: 'INTEGER_VALUE', limit: 'INTEGER_VALUE'},\n  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"
          },
          {
            "lang": "Javascript + Xhr",
            "source": "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://id.amiqus.co/sdk/v1/steps?page=INTEGER_VALUE&limit=INTEGER_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
          },
          {
            "lang": "Php + Http2",
            "source": "<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://id.amiqus.co/sdk/v1/steps');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'page' => 'INTEGER_VALUE',\n  'limit' => 'INTEGER_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
          }
        ]
      }
    },
    "/steps/{id}": {
      "post": {
        "summary": "Submit a step",
        "description": "Submit a step.\n\n**Photo ID steps:** Before a Photo ID check step can be submitted, supporting photo ID documentation must first be uploaded using the Onfido SDK. See [Create an Onfido SDK token](#operation/post-providers-onfido-token) for further details.\n\nOnly Photo ID checks configured with the **standard report type** can be submitted using this operation. Checks configured with the biometric report type must be completed using a web browser and Amiqus mobile app.\n",
        "operationId": "post-steps-id",
        "security": [
          {
            "sdk_token": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/IdentityReport"
                  },
                  {
                    "$ref": "#/components/schemas/Dummy"
                  },
                  {
                    "$ref": "#/components/schemas/PhotoId"
                  }
                ]
              },
              "examples": {
                "identity_report": {
                  "summary": "Identity report",
                  "value": {
                    "title": "miss",
                    "dob": "1967-10-29",
                    "address_history": [
                      {
                        "address": {
                          "unit": "3rd Floor",
                          "house_name": "Citypoint",
                          "house_number": "65",
                          "street_name": "Haymarket Terrace",
                          "city": "Edinburgh",
                          "postcode": "EH12 5HD",
                          "country": "GB"
                        },
                        "start": "2019-08-24"
                      }
                    ],
                    "privacy_policy": true
                  }
                },
                "dummy": {
                  "summary": "Dummy",
                  "value": {
                    "state": "accepted",
                    "postcode": "EH12 5HD"
                  }
                },
                "photo_id": {
                  "summary": "Photo ID with share code",
                  "value": {
                    "share_code": "W9X6GY2S2"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "default": "Unauthenticated"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "default": "Step not found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "required_fields": {
                    "summary": "Errors returned for two required fields",
                    "value": {
                      "name.first_name": [
                        "The first name field is required"
                      ],
                      "name.last_name": [
                        "The last name field is required"
                      ]
                    }
                  },
                  "generic": {
                    "summary": "Generic error for a step that cannot yet be submitted",
                    "value": {
                      "errors": [
                        "Step 2 cannot be submitted until Step 1 has been completed"
                      ]
                    }
                  },
                  "completed": {
                    "summary": "Generic error for a step that has already been submitted",
                    "value": {
                      "errors": [
                        "Step 1 has already been completed"
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell + Curl",
            "source": "curl --request POST \\\n  --url https://id.amiqus.co/sdk/v1/steps/%7Bid%7D \\\n  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n  --header 'content-type: application/json' \\\n  --data '{\"title\":\"string\",\"dob\":\"2019-08-24\",\"address_history\":[{\"address\":{\"unit\":\"string\",\"house_name\":\"string\",\"house_number\":\"string\",\"street_name\":\"string\",\"second_street\":\"string\",\"district\":\"string\",\"city\":null,\"province\":null,\"postcode\":null,\"country\":\"AF\"},\"start\":\"2019-08-24\"}],\"privacy_policy\":true}'"
          },
          {
            "lang": "Node + Request",
            "source": "const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://id.amiqus.co/sdk/v1/steps/%7Bid%7D',\n  headers: {\n    Authorization: 'Bearer REPLACE_BEARER_TOKEN',\n    'content-type': 'application/json'\n  },\n  body: {\n    title: 'string',\n    dob: '2019-08-24',\n    address_history: [\n      {\n        address: {\n          unit: 'string',\n          house_name: 'string',\n          house_number: 'string',\n          street_name: 'string',\n          second_street: 'string',\n          district: 'string',\n          city: null,\n          province: null,\n          postcode: null,\n          country: 'AF'\n        },\n        start: '2019-08-24'\n      }\n    ],\n    privacy_policy: true\n  },\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"
          },
          {
            "lang": "Javascript + Xhr",
            "source": "const data = JSON.stringify({\n  \"title\": \"string\",\n  \"dob\": \"2019-08-24\",\n  \"address_history\": [\n    {\n      \"address\": {\n        \"unit\": \"string\",\n        \"house_name\": \"string\",\n        \"house_number\": \"string\",\n        \"street_name\": \"string\",\n        \"second_street\": \"string\",\n        \"district\": \"string\",\n        \"city\": null,\n        \"province\": null,\n        \"postcode\": null,\n        \"country\": \"AF\"\n      },\n      \"start\": \"2019-08-24\"\n    }\n  ],\n  \"privacy_policy\": true\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://id.amiqus.co/sdk/v1/steps/%7Bid%7D\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);"
          },
          {
            "lang": "Php + Http2",
            "source": "<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"title\":\"string\",\"dob\":\"2019-08-24\",\"address_history\":[{\"address\":{\"unit\":\"string\",\"house_name\":\"string\",\"house_number\":\"string\",\"street_name\":\"string\",\"second_street\":\"string\",\"district\":\"string\",\"city\":null,\"province\":null,\"postcode\":null,\"country\":\"AF\"},\"start\":\"2019-08-24\"}],\"privacy_policy\":true}');\n\n$request->setRequestUrl('https://id.amiqus.co/sdk/v1/steps/%7Bid%7D');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',\n  'content-type' => 'application/json'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
          }
        ]
      }
    },
    "/providers/onfido/token": {
      "post": {
        "summary": "Create an Onfido SDK token",
        "description": "Create an Onfido SDK token for use with a Photo ID check step (**standard report type only**). An Onfido SDK token allows you to embed a [Web, iOS, Android, React Native, or Flutter Onfido SDK](https://documentation.identity.entrust.com/sdk/) into your application.\n\nOnfido SDK tokens can only be used for the Photo ID check step that the Amiqus SDK token is scoped for and are valid for 90 minutes.\n\nAfter uploading supporting documentation using the Onfido SDK, use [Submit a step](#operation/post-steps-id) to submit the Photo ID check step.\n\n**Note:** Onfido Classic is deprecated. If your team has [Onfido Studio](https://documentation.identity.entrust.com/getting-started/workflow-studio-product/) enabled the response object will contain a `workflowRunId` property which should be used to initialise the React Native Onfido SDK in place of `flowSteps`.\n",
        "operationId": "post-providers-onfido-token",
        "tags": [
          "Other Resources"
        ],
        "security": [
          {
            "sdk_token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bundle_id": {
                    "type": "string",
                    "description": "The bundle ID (for Android \"application ID\") that was set up during application development. For iOS, this is usually in the form `com.your-company.app-name`. Make sure to use a valid `bundle_id` or you'll receive a 401 error from Onfido.\n\nIf no bundle ID is provided, a [web SDK](https://documentation.identity.entrust.com/sdk/web/) token will be issued.\n"
                  }
                }
              },
              "example": {
                "bundle_id": "com.your-company.app-name"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Onfido Classic",
                      "deprecated": true,
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "mobile",
                            "web"
                          ],
                          "description": "The platform the SDK token is valid for.\n"
                        },
                        "sdkToken": {
                          "type": "string",
                          "description": "The SDK token scoped to the Record's Photo ID check step. Onfido SDK tokens are valid for 90 minutes.\n"
                        },
                        "flowSteps": {
                          "type": "object",
                          "description": "An object containing basic configuration for the initialisation of the React Native, iOS or Android SDK. The values can be overridden or omitted to better suit your application's integration.\n",
                          "properties": {
                            "welcome": {
                              "type": "boolean"
                            },
                            "captureDocument": {
                              "type": "boolean"
                            },
                            "captureFace": {
                              "description": "`null` when \"facial similarity\" option has not been enabled for the Photo ID check step.\n",
                              "type": [
                                "null",
                                "object"
                              ],
                              "properties": {
                                "type": {
                                  "description": "Type is `MOTION` when motion liveness has been enabled (default), otherwise `PHOTO`.\n",
                                  "type": "string",
                                  "enum": [
                                    "MOTION",
                                    "PHOTO"
                                  ]
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Onfido Studio",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "mobile",
                            "web"
                          ],
                          "description": "The platform the SDK token is valid for.\n"
                        },
                        "sdkToken": {
                          "type": "string",
                          "description": "The SDK token scoped to the Record's Photo ID check step. Onfido SDK tokens are valid for 90 minutes.\n"
                        },
                        "workflowRunId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The workflow run ID associated with the `sdkToken`.\n"
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "classic": {
                    "summary": "Onfido Classic",
                    "value": {
                      "type": "mobile",
                      "sdkToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjQ5OTEzNzYwMCwiZXhwIjo0OTkxMzc2NjAsIm1hcnR5IjoiU291bmRzIHByZXR0eSBoZWF2eS4iLCJkb2MiOiJXZWlnaHQgaGFzIG5vdGhpbmcgdG8gZG8gd2l0aCBpdC4iLCLwn5GLIjoiVGhpcyBpcyBub3QgYSB2YWxpZCBTREsgVG9rZW4uIn0.j2jAeX_MpagkS7qvBjF9uYYIawP_uvEPqnftEW9wDe8",
                      "flowSteps": {
                        "welcome": false,
                        "captureDocument": true,
                        "captureFace": {
                          "type": "MOTION"
                        }
                      }
                    }
                  },
                  "studio": {
                    "summary": "Onfido Studio",
                    "value": {
                      "type": "web",
                      "sdkToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjQ5OTEzNzYwMCwiZXhwIjo0OTkxMzc2NjAsIm1hcnR5IjoiU291bmRzIHByZXR0eSBoZWF2eS4iLCJkb2MiOiJXZWlnaHQgaGFzIG5vdGhpbmcgdG8gZG8gd2l0aCBpdC4iLCLwn5GLIjoiVGhpcyBpcyBub3QgYSB2YWxpZCBTREsgVG9rZW4uIn0.j2jAeX_MpagkS7qvBjF9uYYIawP_uvEPqnftEW9wDe8",
                      "workflowRunId": "26bf7e7d-d67c-4ab5-929f-5954a064e491"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "422": {
            "$ref": "#/components/responses/422"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell + Curl",
            "source": "curl --request POST \\\n  --url https://id.amiqus.co/sdk/v1/providers/onfido/token \\\n  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n  --header 'content-type: application/json' \\\n  --data '{\"bundle_id\":\"string\"}'"
          },
          {
            "lang": "Node + Request",
            "source": "const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://id.amiqus.co/sdk/v1/providers/onfido/token',\n  headers: {\n    Authorization: 'Bearer REPLACE_BEARER_TOKEN',\n    'content-type': 'application/json'\n  },\n  body: {bundle_id: 'string'},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"
          },
          {
            "lang": "Javascript + Xhr",
            "source": "const data = JSON.stringify({\n  \"bundle_id\": \"string\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://id.amiqus.co/sdk/v1/providers/onfido/token\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);"
          },
          {
            "lang": "Php + Http2",
            "source": "<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"bundle_id\":\"string\"}');\n\n$request->setRequestUrl('https://id.amiqus.co/sdk/v1/providers/onfido/token');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',\n  'content-type' => 'application/json'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "RecordStatus": {
        "type": "string",
        "enum": [
          "pending",
          "started",
          "complete",
          "incomplete",
          "waiting",
          "failed",
          "empty",
          "paused",
          "amendments",
          "reviewed"
        ],
        "description": "The overall status of the record.\n\nStatus is determined by the combined states of a record's steps, expiry and review.\n"
      },
      "RecordStatus-2": {
        "title": "Record Status",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "object": {
            "type": "string",
            "readOnly": true,
            "const": "record_status"
          },
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "status": {
            "$ref": "#/components/schemas/RecordStatus"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "client": {
            "readOnly": true,
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PaginatedList": {
        "title": "Paginated List",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "object": {
            "type": "string",
            "const": "paginated_list"
          },
          "data": {
            "type": "array"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "maximum": 100,
            "minimum": 1
          },
          "current_page": {
            "type": "integer",
            "minimum": 1
          },
          "total_pages": {
            "type": "integer",
            "minimum": 1
          },
          "links": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "title": "Pagination links",
                "type": "object",
                "required": [
                  "next",
                  "previous"
                ],
                "properties": {
                  "next": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "format": "url"
                  },
                  "previous": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "format": "url"
                  }
                }
              }
            ]
          }
        }
      },
      "StepTypes": {
        "type": "string",
        "enum": [
          "check.credit",
          "check.criminal_record",
          "check.dummy",
          "check.hscni_access_ni",
          "check.identity",
          "check.nhs_esr",
          "check.banking_information",
          "check.photo_id",
          "check.employment_referencing",
          "check.reference",
          "check.thorntons_onboarding",
          "check.video",
          "check.watchlist",
          "document.request",
          "document.transfer",
          "form"
        ]
      },
      "Step": {
        "title": "Step",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "object": {
            "type": "string",
            "const": "step"
          },
          "id": {
            "type": "integer",
            "minimum": 1,
            "description": "Unique step identifier"
          },
          "type": {
            "$ref": "#/components/schemas/StepTypes"
          },
          "completed_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "Address": {
        "title": "Address",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "object": {
            "type": "string",
            "readOnly": true,
            "const": "address"
          },
          "unit": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unit, flat or apartment name or number."
          },
          "house_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "House or building name."
          },
          "house_number": {
            "type": [
              "null",
              "string"
            ],
            "description": "House or building number."
          },
          "street_name": {
            "type": [
              "null",
              "string"
            ],
            "description": "First line of the street name."
          },
          "second_street": {
            "type": [
              "null",
              "string"
            ],
            "description": "Second line of the street name if applicable."
          },
          "district": {
            "type": [
              "null",
              "string"
            ],
            "description": "District, town, village, suburb or equivalent."
          },
          "city": {
            "type": [
              "null",
              "string"
            ],
            "description": "City name if applicable."
          },
          "province": {
            "type": [
              "null",
              "string"
            ],
            "description": "Province, county, municipality, township or equivalent."
          },
          "postcode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Postcode, zip code or equivalent."
          },
          "country": {
            "type": [
              "null",
              "string"
            ],
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "HR",
              "CU",
              "CW",
              "CY",
              "CZ",
              "CI",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KP",
              "XK",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PS",
              "PW",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "CM",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SX",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "KR",
              "SS",
              "ES",
              "LK",
              "VC",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "YU",
              "ZM",
              "ZW"
            ],
            "description": "ISO3601 alpha-2 country code."
          }
        }
      },
      "IdentityReport": {
        "title": "Identity report",
        "type": "object",
        "required": [
          "address_history",
          "privacy_policy"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "The Client's name title.\n\nRequired unless provided when creating the Client.\n"
          },
          "dob": {
            "type": "string",
            "format": "date",
            "description": "The Client's date of birth.\n\nRequired unless provided when creating the Client.\n"
          },
          "address_history": {
            "type": "array",
            "minItems": 1,
            "description": "12 months of address history, most recent address country must be `GB`.",
            "items": {
              "title": "Address Period",
              "type": "object",
              "properties": {
                "address": {
                  "required": [
                    "country"
                  ],
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Address"
                    },
                    {
                      "properties": {
                        "postcode": {
                          "description": "Required if `country: \"GB\"`\n"
                        },
                        "unit": {
                          "maxLength": 30
                        },
                        "house_number": {
                          "maxLength": 12,
                          "description": "Required without any of `unit`, `house_name`"
                        },
                        "house_name": {
                          "maxLength": 50,
                          "description": "Required without any of `unit`, `house_number`"
                        },
                        "street_name": {
                          "maxLength": 50
                        },
                        "second_street": {
                          "maxLength": 50
                        },
                        "district": {
                          "maxLength": 25
                        }
                      }
                    }
                  ]
                },
                "start": {
                  "type": "string",
                  "format": "date"
                }
              },
              "required": [
                "address",
                "start"
              ]
            }
          },
          "privacy_policy": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Confirm the data subject has accepted <a href=\"https://www.transunion.co.uk/legal/privacy-centre?#pc-bureau\" target=\"_blank\" rel=\"noopener\">TransUnion's privacy notice</a>."
          }
        }
      },
      "Dummy": {
        "title": "Dummy",
        "type": "object",
        "required": [
          "state",
          "postcode"
        ],
        "properties": {
          "state": {
            "description": "The check will return this result state once submitted.",
            "type": "string",
            "enum": [
              "submitted",
              "accepted",
              "rejected",
              "refer",
              "failed",
              "paused"
            ]
          },
          "postcode": {
            "type": "string",
            "description": "An arbitrary piece of information that will be displayed on the check results."
          }
        }
      },
      "PhotoId": {
        "title": "Photo ID",
        "type": "object",
        "properties": {
          "share_code": {
            "type": "string",
            "description": "An optional share code used for right to work and rent in the UK checks where the applicant does not have a British or Irish passport."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Description of the error."
          }
        }
      }
    },
    "securitySchemes": {
      "sdk_token": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Bearer JWT authentication."
      }
    },
    "responses": {
      "401": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Unauthenticated."
            }
          }
        }
      },
      "403": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Description of the error."
                }
              }
            },
            "example": {
              "message": "This action is unauthorized."
            }
          }
        }
      },
      "422": {
        "description": "Unprocessable Content",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "minItems": 1,
                "description": "Each property may contain more than one validation error\n\nThe property name references to the property's dot-notated path within the request body:\n\n**Request body**\n```json\n{\n  \"fields\": {\n    \"type\": false\n  }\n}\n```\n\n**Response**\n```json\n{\n  \"fields.type\": ['Value must be a string']\n}\n```\n",
                "items": {
                  "type": "string"
                }
              }
            },
            "example": {
              "errors": [
                "At least one property is required"
              ]
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Description of the error."
                }
              }
            }
          }
        }
      },
      "503": {
        "description": "Service Unavailable",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Service Unavailable"
                }
              }
            }
          }
        }
      }
    }
  }
}
