# Query certified SMS messages (GET)

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

## Query parameters:

  - `WithUniqueIds` (string)

  - `WithLookupKeys` (string)

  - `WithLinkedId` (string)

  - `OnState` (string)
    Filters results by the current EviSMS state. Replied is not part of the current public EviSMS lifecycle.
    Enum: "Draft", "New", "Ready", "Sent", "Dispatched", "Delivered", "Read", "Closed", "Failed"

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

  - `OrderResultsBy` (string)
    Enum: "CreationDate"

  - `Limit` (integer)
    Maximum results to return. Defaults to 100; drops to 25 when affidavit metadata is included.

  - `Offset` (integer)

  - `IncludeAffidavits` (boolean)

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

## Response 200 fields (application/json):

  - `totalMatches` (integer)

  - `results` (array)

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

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

  - `results.text` (string)
    Content of the SMS message.

  - `results.issuer` (object)

  - `results.issuer.legalName` (string)

  - `results.issuer.phoneNumber` (string)

  - `results.recipient` (object)

  - `results.recipient.legalName` (string)

  - `results.recipient.phoneNumber` (string)

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

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

  - `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.failedOn` (string)

  - `results.expiredOn` (string)

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

  - `results.costCentre` (string)
    Cost-centre label recorded with the transaction for internal billing allocation.

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

  - `results.notaryRetentionPeriod` (integer)
    Years of retention at the notary office.

  - `results.notaryProfile` (string)
    Notary identifier for custody.

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

  - `results.deliveryChannels` (array)
    Channels used to deliver the SMS (e.g., RCS, SMS).

  - `results.affidavitKinds` (array)

  - `results.affidavits` (array)
    Affidavit entries. Present when IncludeAffidavits is true; bytes is populated only when the deprecated IncludeAffidavitBlobs option is also true.

  - `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 SMS this affidavit belongs to.

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

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

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

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

  - `results.affidavits.bytes` (string,null)
    Base64-encoded affidavit PDF. Populated only when the deprecated IncludeAffidavitBlobs option is true.


## Response 401 fields
