# Request an on-demand affidavit

The original submitting account can request an affidavit for a submitted `Letter` or `LetterLite` before it closes. At Submit, enable `AffidavitsOnDemandEnabled` and use `AdvancedContentOnSubmit`, `AdvancedContentOnClose`, or `AdvancedContentOnSubmitAndOnClose`. Generation is asynchronous and a configurable limit applies per communication. `Registered` accepts the flag at Submit but cannot use this operation. The platform skips a queued request if the communication closes or earlier requests reach the limit before processing. In these cases no AffidavitPublished callback is sent for the request.

Endpoint: POST /v1/EviPost/AffidavitRequest
Version: 1.0
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Request fields (application/json):

  - `UniqueId` (string, required)
    Unique ID of the EviPost to generate an affidavit for.

  - `IncludeDocument` (boolean)
    If true, the document is included in the affidavit.

  - `IncludeEvents` (boolean)
    If true, detailed event information is included in the affidavit.

## Response 200:

  - `200` (unknown)
    Affidavit request queued. Use Query to check which affidavits were generated.

## Response 200 fields (application/json):

  - `requestId` (string, required)
    Identifier of the affidavit generation request, serialized as 32 hexadecimal characters without dashes.

## Response 400:

  - `400` (unknown)
    Invalid request or business rule failure

## Response 400 fields (application/json):

  - `responseStatus` (object)

  - `responseStatus.errorCode` (string)

  - `responseStatus.message` (string)

  - `responseStatus.errors` (array)

## Response 401:

  - `401` (unknown)
    Authentication failed

## Response 403:

  - `403` (unknown)
    The authenticated account lacks the required API or EviPost permissions.

