# Query certified emails (GET)

Endpoint: GET /v1/EviMail/Query
Version: 1.0
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Query parameters:

  - `WithUniqueIds` (string)

  - `WithLookupKeys` (string)

  - `WithLinkedId` (string)
    Filters by linked ID, such as a batch ID. Cannot be combined with affidavit or attachment inclusion flags.

  - `OnState` (string)

  - `WithOutcome` (string)

  - `OrderResultsBy` (string)

  - `Limit` (integer)
    Default and maximum of 100 for an ordinary query, 25 with affidavit or attachment metadata, or 1 with binary content.

  - `Offset` (integer)

  - `IncludeAffidavits` (boolean)

  - `IncludeAffidavitBlobs` (boolean)
    Deprecated. When true with IncludeAffidavits, includes Base64 affidavit PDFs in affidavits[].bytes and limits the query to one email. Set false for metadata-only results and use /AffidavitsDownload for new integrations.

  - `IncludeAttachments` (boolean)

  - `IncludeAttachmentBlobs` (boolean)
    With IncludeAttachments, includes Base64 file contents in attachments[].data and limits the query to one email. Set false explicitly for metadata-only results and use /AttachmentDownload for new integrations.

## Response 200:

  - `200` (unknown)
    Query executed successfully

## Response 200 fields (application/json):

  - `totalMatches` (integer)

  - `results` (array)

  - `results.uniqueId` (string)
    Unique identifier (EviId) of the certified email.

  - `results.linkedId` (string)
    Identifier of a related certified email, when this message is linked to another.

  - `results.lookupKey` (string)
    Locator assigned by the issuer at submission.

  - `results.issuer` (object)

  - `results.issuer.legalName` (string)

  - `results.issuer.emailAddress` (string)

  - `results.recipient` (object)

  - `results.recipient.legalName` (string)

  - `results.recipient.emailAddress` (string)

  - `results.carbonCopy` (array)

  - `results.carbonCopy.name` (string)

  - `results.carbonCopy.emailAddress` (string)

  - `results.subject` (string)

  - `results.body` (string)
    HTML body of the email.

  - `results.state` (string)
    Enum: "Draft", "New", "Ready", "Sent", "Dispatched", "Delivered", "Read", "Replied", "Closed", "Failed"

  - `results.outcome` (string)
    Enum: "None", "Certified", "Sent", "Delivered", "Read", "Accepted", "Rejected", "Failed"

  - `results.acceptOrRejectComments` (string)
    Comments provided by the recipient during acceptance or rejection.

  - `results.creationDate` (string)

  - `results.lastStateChangeDate` (string)

  - `results.newOn` (string)

  - `results.readyOn` (string)

  - `results.sentOn` (string)

  - `results.dispatchedOn` (string)

  - `results.deliveredOn` (string)

  - `results.readOn` (string)

  - `results.repliedOn` (string)

  - `results.acceptedOn` (string)

  - `results.rejectedOn` (string)

  - `results.failedOn` (string)

  - `results.expiredOn` (string)

  - `results.timeToLive` (integer)
    Minutes before the message tracking closes.

  - `results.onlineRetentionPeriod` (integer)
    Years of online retention.

  - `results.notaryRetentionPeriod` (integer)
    Years of notarial custody, when notarial retention is configured.

  - `results.notaryProfile` (string)
    Identifier of the notary profile applied for custody.

  - `results.sourceChannel` (string)
    Enum: "Web", "Api", "Smtp"

  - `results.allowRefusal` (boolean)
    Whether the recipient was allowed to refuse the message without opening it.

  - `results.costCentre` (string)

  - `results.affidavitKinds` (array)

  - `results.xmissionResult` (boolean)
    Whether the transmission was successful.

  - `results.xmissionSummary` (string)
    Human-readable summary of the transmission result.

  - `results.from` (string)
    From header value used in the email.

  - `results.customLayoutLogoUrl` (string)

  - `results.siteName` (string)

  - `results.affidavits` (array)
    Affidavit entries. Present when IncludeAffidavits is true. Set IncludeAffidavitBlobs to false explicitly to omit PDF bytes.

  - `results.affidavits.uniqueId` (string)
    Unique identifier of the affidavit.

  - `results.affidavits.date` (string)
    Timestamp when the affidavit was generated.

  - `results.affidavits.evidenceUniqueId` (string)
    Unique identifier of the email this affidavit belongs to.

  - `results.affidavits.partyUniqueId` (string)
    Identifier of the related delivery/party, when applicable.

  - `results.affidavits.bytes` (string)
    Base64-encoded affidavit PDF when binary content is included. Set IncludeAffidavitBlobs to false explicitly to omit it.

  - `results.affidavits.description` (string)
    Human-readable description of the affidavit.

  - `results.affidavits.kind` (string)
    Technical identifier of the affidavit kind, for example EviMail:Complete.

  - `results.affidavits.additionalData` (object)
    Additional affidavit metadata as key-value pairs.

  - `results.attachments` (array)
    Attachment metadata. Present only when IncludeAttachments is true on the request.

  - `results.attachments.uniqueId` (string)
    Unique identifier of the attachment.

  - `results.attachments.evidenceUniqueId` (string)
    Unique identifier of the email this attachment belongs to.

  - `results.attachments.filename` (string)
    File name including extension.

  - `results.attachments.displayName` (string)
    Human-readable label of the attachment.

  - `results.attachments.mimeType` (string)
    MIME type of the attachment.

  - `results.attachments.contentId` (string)
    Content-ID used to reference the attachment inline in the body.

  - `results.attachments.contentDescription` (string)
    Optional human-readable description of the attachment.

  - `results.attachments.contentDisposition` (string)
    Content-Disposition of the attachment (e.g. inline or attachment).

  - `results.attachments.contentLocation` (string)
    Content-Location header value for the attachment.

  - `results.attachments.contentEncoding` (string)
    Encoding of the attachment content.

  - `results.attachments.contentLength` (integer)
    Size of the attachment in bytes.

  - `results.attachments.hash` (string)
    Cryptographic hash of the attachment content.

  - `results.attachments.data` (string)
    Base64 file contents when attachment binary content is included. Set IncludeAttachmentBlobs to false explicitly to omit it.

## Response 401:

  - `401` (unknown)
    Authentication failed

