Document types

Use these methods to manage document types that are used to group documents submitted by clients for passing a verification procedure.

GET[host]/api/v2/documents/types

Get a list of document types

GET[host]/v2/documents/types/{typeId}

Get document type details

POST[host]/v2/documents/types

Create a new document type

PUT[host]/v2/documents/types/{typeId}

PATCH[host]/v2/documents/types/{typeId}

Update a document type

DELETE[host]/v2/documents/types/{typeID}

Delete a document type

Get a list of document types

Use this method to obtain a list of document types created in the Back Office.

To obtain detailed information about a specific document type, use a separate method to get document type details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

The following filter parameter is available for this method:

enabled

If true, a document type can be used for verification; otherwise, false.

The following sorting parameters are available for this method:

createTime

The date and time when a document type was created.

priority

The priority index assigned to a document type.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/documents/types

curl --location -g --request GET 'https://host.name/api/v2/documents/types?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[enabled]=true' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of Document Type objects providing information about the document types that correspond to the query parameters included in the request.

Get document type details

Use this method to obtain detailed information about a specified document type.

To obtain a list of all document types created in the Back Office, use a separate method to get a list of document types.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

typeId required

The identifier of a document type.

GET[host]/v2/documents/types/{typeId}

curl --location --request GET 'https://host.name/api/v2/documents/types/1' \
--header 'Authorization: Bearer <token>'

Response

A response contains a Document Type object providing information about the specified document type.

Create a new document type

Use this method to create a new document type.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for a document type:

description string required

The localized description of a document type.

enabled boolean required

If true, a document type can be used for verification; otherwise, false.

example string required

The path to a sample document that can be uploaded for this document type.

groupID integer required

The identifier of a document group in which a document type is included.

maxFiles integer required

The maximum number of files that can be uploaded for a document type.

name string required

The localized name of a document type.

POST[host]/v2/documents/types

curl --location --request POST 'https://host.name/api/v2/documents/types' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "description": "Document types available for corporate clients",
  "enabled": true,
  "exаmple": "type",
  "groupId": 1,
  "maxFiles": 10,
  "name": "corporate"
}'

Response

A response includes a Document Type object providing information about the created document type.

Update a document type

Use this method to update a specified document type.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

typeId required

The identifier of a document type.

Body:

The following field values can be updated for a specified document type:

description string

The localized description of a document type.

enabled boolean

If true, a document type can be used for verification; otherwise, false.

example string

The path to a sample document that can be uploaded for this document type.

groupID integer

The identifier of a document group in which a document type is included.

maxFiles integer

The maximum number of files that can be uploaded for a document type.

name string

The localized name of a document type.

PUT[host]/v2/documents/groups/{groupId}

curl --location --request PUT 'https://host.name/api/v2/documents/types/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "description": "Document types available for corporate clients",
  "enabled": true,
  "exаmple": "example",
  "groupId": 1,
  "maxFiles": 10,
  "name": "corporate",
  "priority": 1
}'

Response

A response includes a Document Type object providing information about the document type that was updated.

Delete a document type

Use this method to delete a specified document type.

Note

A document type can’t be deleted if there is at least one client document associated with this type.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

typeId required

The identifier of a document type.

DELETE[host]/v2/documents/types/{typeID}

curl --location --request DELETE 'https://host.name/api/v2/documents/types/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.