# Diia document sharing

Use this endpoint to get the applicant's documents from the Diia app and start a verification. The applicant does not need to take a photo of a document. Diia sends digital copies of the documents and their data.
By default, our system requests these documents: internal passport (ID card), foreign passport, and taxpayer card.
**How it works**
1. You send a request with the ID of a form that has Diia settings and the ID of the applicant.
2. Our system returns
`confirmation_url`
 and
`verification_id`
.
`confirmation_url`
 is a deep link to the Diia app.
3. You show the link to the applicant. The applicant opens it and confirms the sharing in Diia.
4. Our system updates the applicant profile (name, date of birth, gender, residence country), adds the identity document, the tax ID number document, and the registered address.
5. Our system creates a verification with the verification types of the form and sends the "
**Verification completed**
" callback when the verification is completed.

To check the progress of the sharing on the Diia side, use [Diia document sharing status](#operation/ua-diia-sharing-status).

Endpoint: POST /services/ua/diia/sharing
Version: 1.0
Security: API-Key

## Security:

  - `API-Key` (unknown)
    apiKey in header API-Key

## Request fields (application/json):

  - `form_id` (string, required)
    ID of the form that has Diia settings. Our system uses the verification types, callback URL, and redirect URL of this form
    Example: a1b2c3d4e5f60718293a4b5c6d7e8f901234

  - `applicant_id` (string, required)
    ID of an existing applicant
    Example: 0f1e2d3c4b5a69788796a5b4c3d2e1f00123

  - `redirect_url` (string)
    Optional. URL that Diia opens after the sharing. If you do not send it, our system uses the redirect URL of the form
    Example: https://example.com/diia/done

## Response 200:

  - `200` (unknown)
    **OK**
The request was processed. Check the `status` field: when our system cannot create a Diia session or a deep link, it returns `200` with `status` set to `error`.

## Response 200 fields (application/json):

  - `status` (string)
    Example: ok

  - `data` (object)

  - `data.applicant_id` (string)
    Example: 0f1e2d3c4b5a69788796a5b4c3d2e1f00123

  - `data.verification_id` (string)
    ID of the verification that our system creates after the sharing
    Example: 9a8b7c6d5e4f30211203f4e5d6c7b8a90123

  - `data.confirmation_url` (string)
    Deep link to the Diia app
    Example: https://diia.example.com/deep-link/00000000

  - `errors` (array)

  - `errors.parameter` (string)
    Example: *

  - `errors.message` (string)
    Enum: "DIIA session was not created", "DIIA deep link was not created"

## Response 404:

  - `404` (unknown)
    **Not Found**
The applicant or the form is not found.

## Response 404 fields (application/json):

  - `type` (string)
    Example: not_found

  - `errors` (array)

  - `errors.parameter` (string)
    Example: applicant_id

  - `errors.message` (string)
    Example: Applicant was not found

  - `status` (string)
    Example: error

## Response 422:

  - `422` (unknown)
    **Unprocessable Entity**
One or more parameters are not valid.

## Response 422 fields (application/json):

  - `type` (string)
    Example: validation

  - `errors` (array)

  - `errors.parameter` (string)
    Example: applicant_id

  - `errors.message` (string)
    Example: Applicant ID is not valid

## Response 500:

  - `500` (unknown)
    **Internal Server Error**
This response indicates that our system encountered an unexpected condition that prevented it from fulfilling the request.

## Response 500 fields (application/json):

  - `type` (string)
    Example: internal_server

  - `errors` (array)

