API Reference Lettermint v#2.0.0

Copy Markdown View Source

Modules

The Lettermint client.

The API answered with an error status (4xx or 5xx) and a JSON or empty body. The per-status errors have the same fields.

The HTTP adapter behaviour.

The default adapter, based on Req.

HTTP 401: the token is missing, invalid or revoked.

The client configuration: tokens, base URL, timeout and HTTP adapter.

The SDK rejected a request before sending it, for example invalid message tags or a body that cannot be encoded as JSON. Unlike Lettermint.ValidationError, the API never saw this request.

The client was configured or called incorrectly: a missing or unrecognised token, a token that the called function cannot use, an invalid option or an invalid path parameter. Raised before any request is made.

HTTP 409: the request conflicts with the current state, for example an Idempotency-Key reused with a different body.

The request could not be sent or the connection failed (DNS, TLS, refused, reset). reason is the HTTP client's error, for example a Req.TransportError with reason: :econnrefused.

Sending domains. Needs :team_token.

An immutable email builder for the pipe operator. Start one with Lettermint.Emails.compose/2.

Sends email with the project sending token (x-lettermint-token).

The errors of the Lettermint SDK.

Sent and received messages. Needs :team_token; reschedule/4 and cancel/3 also accept the sending token when no team token is configured.

HTTP 404: the resource does not exist or is not visible to the token.

Every operation of the Sending and Team APIs, keyed by "<METHOD> <path>".

HTTP 403: the token may not perform this action, or the plan lacks the feature.

Projects. Needs :team_token. Report forwarding is in Lettermint.Projects.ReportForwarding, routes in Lettermint.Routes.

DMARC and complaint report forwarding of a project. Needs :team_token.

Serializes query maps to the API's bracket syntax, exactly as the Node SDK.

HTTP 429: too many requests.

The API answered with a redirect (3xx). The SDK never follows redirects, so that tokens are not sent to another location.

Routes of a project. Needs :team_token.

HTTP 5xx with a JSON or empty body.

Sending statistics. Needs :team_token.

The suppression list. Needs :team_token.

The team of the token. Needs :team_token. Members are in Lettermint.Team.Members.

Team members. Needs :team_token.

The request did not complete within the timeout. The timeout covers the whole request: connecting, sending, the response headers and the body. The API may still have processed the request.

The API types, and helpers to convert them.

Metric values for one group of dimension values.

schema:AnalyticsDimension |0.

schema:AnalyticsGroupDimension |0.

Metric values for the comparison period.

A catalogue dimension or tag:<case-sensitive name> to filter by. is_human, is_privacy, is_bot and is_scanner select an engagement class: filter them with the value 1 to restrict engagement metrics to that class.

A dimension filter.

A catalogue dimension or tag:<case-sensitive name> to group breakdown rows by. Engagement class dimensions (is_human, is_privacy, is_bot and is_scanner) can only filter.

A time-series bucket size.

The time window and data availability of the results.

Grain the requested boundaries were widened to: whole UTC hours, or whole UTC days for personal-data dimensions. Counts cover exactly from to effective_to.

schema:AnalyticsMeta .collection_completeness.

schema:AnalyticsMeta .comparison.

schema:AnalyticsMeta .time_basis.

A metric from the analytics catalogue.

Change of a metric against the comparison period.

Values of the selected metrics. Rates are fractions; null when not available.

Breakdown pagination.

An analytics query.

Numerator and denominator of a rate metric.

Numerators and denominators of the selected rate metrics.

Analytics results with their window metadata and pagination.

The selected result sections.

A breakdown sort order.

Ascending or descending order for the selected sort metric.

Metric values for the whole window.

Metric values for one time-series bucket.

Structured API error.

schema:ApiError .error.

schema:AttachmentDelivery.

File types that cannot be sent as email attachments.

schema:BuiltInTeamRole.

A page of a cursor-paginated list. Pass next_cursor back as the cursor query parameter to read the next page; it is nil on the last page.

DELETE /suppressions/{suppressionId} response 2xx.

DELETE /suppressions/{suppressionId} response 2xx .status.

schema:DeliveryMode.

schema:DkimMode.

schema:DmarcPolicy.

schema:DnsRecordPurpose.

A DNS record that did not pass verification, with the verification details.

Why a DNS record did not pass verification.

A DNS record that did not pass verification.

One or more required DNS records of the domain did not pass verification.

schema:DnsVerificationResultData.

schema:DnsVerificationResultData .dmarc_spf_alignment_issue.

schema:DnsVerificationScope.

All required DNS records of the domain passed verification.

schema:DomainData.

schema:DomainData .projects[].

schema:DomainDnsRecordData.

schema:DomainListData.

The domain after a change, with a confirmation message.

Error with only a message.

Query parameters of GET /domains/{domainId} (getDomain).

GET /domains/{domainId} param query include [].

Query parameters of GET /projects/{projectId} (getProject).

GET /projects/{projectId} param query include [].

GET /projects/{projectId}/report-forwarding response 200.

Query parameters of GET /routes/{routeId} (getRoute).

GET /routes/{routeId} param query include [].

Query parameters of GET /stats (getStats).

Query parameters of GET /team (getTeam).

GET /team param query include [].

Whether the inbound domain MX records point to Lettermint. The MX record lists are only returned when verification fails.

The result of an inbound domain MX verification.

schema:InitialRoutes.

Query parameters of GET /domains (listDomains).

GET /domains param query sort [].

GET /domains response 200: a page of Lettermint.Types.DomainListData.t().

Query parameters of GET /messages/{messageId}/events (listMessageEvents).

GET /messages/{messageId}/events param query sort [].

GET /messages/{messageId}/events response 200: a page of Lettermint.Types.MessageEventData.t().

Query parameters of GET /messages (listMessages).

GET /messages param query filter.

GET /messages param query filter .tags[].

GET /messages param query sort [].

GET /messages response 200: a page of Lettermint.Types.MessageListData.t().

Query parameters of GET /projects (listProjects).

GET /projects param query sort [].

GET /projects response 200: a page of Lettermint.Types.ProjectListData.t().

Query parameters of GET /projects/{projectId}/routes (listRoutes).

GET /projects/{projectId}/routes param query sort [].

GET /projects/{projectId}/routes response 200: a page of Lettermint.Types.RouteListData.t().

Query parameters of GET /suppressions (listSuppressions).

GET /suppressions param query sort [].

GET /suppressions response 200: a page of Lettermint.Types.SuppressedRecipientData.t().

Query parameters of GET /team/members (listTeamMembers).

GET /team/members response 200: a page of Lettermint.Types.TeamMemberData.t().

Query parameters of GET /webhooks/{webhookId}/deliveries (listWebhookDeliveries).

GET /webhooks/{webhookId}/deliveries param query sort [].

GET /webhooks/{webhookId}/deliveries response 200: a page of Lettermint.Types.WebhookDeliveryListData.t().

Query parameters of GET /webhooks (listWebhooks).

GET /webhooks param query sort [].

GET /webhooks response 200: a page of Lettermint.Types.WebhookListData.t().

schema:MessageAttachmentData.

A file attached to the message.

schema:MessageData.

schema:MessageEventData.

schema:MessageEventType.

schema:MessageListData.

schema:MessageRecipientData.

Confirmation that a request succeeded.

schema:MessageStatsData.

schema:MessageStatus.

schema:MessageData .tags[].

A reusable exact-match tag with a name and a value.

schema:MessageType.

An accepted message that is queued for delivery.

schema:Plan.

POST /messages/{messageId}/process response 409 |0.

POST /messages/{messageId}/process response 409 |0.error.

POST /messages/{messageId}/process response 409 |0.error.code.

The queued release of a quarantined inbound message.

A quarantined inbound message that was queued for webhook delivery.

schema:ProjectAccessScope.

schema:ProjectCreatedData.

schema:ProjectData.

schema:ProjectListData.

The project after a change, with a confirmation message.

schema:RbacConflictCode.

Role or project-access state conflict

response:RbacConflictException .error.

schema:RbacPermission.

schema:RecordType.

schema:ReportForwardingRequest.

schema:ReportForwardingResource.

schema:RescheduleMessageRequest.

POST /projects/{projectId}/report-forwarding/resend-code response 200.

The project and its new legacy Project API token.

schema:RouteData.

Route settings available for this route type and team feature access

schema:RouteListData.

The route after it was created or changed, with a confirmation message.

schema:RouteStatisticData.

schema:RouteType.

schema:SandboxResult.

The schedule state of a message after it was rescheduled or canceled.

An accepted message that is scheduled for later delivery.

schema:SendBatchMailRequest.

POST /send/batch response 202.

schema:SendMailRequest.

Per-email settings that override the selected route settings for this email only.

POST /send response 202.

schema:SpamSymbol.

schema:StatsDailyData.

schema:StatsData.

schema:StatsInboundData.

schema:StatsTotalsData.

schema:StatsTypeData.

schema:StoreDomainData.

schema:StoreProjectData.

schema:StoreRouteData.

schema:StoreSuppressionData.

schema:StoreWebhookData.

schema:SuppressedRecipientData.

Mail category blocked by the suppression. all blocks transactional and broadcast mail. broadcast blocks broadcast mail only.

Reason that the recipient is suppressed. The disposable_email reason is reserved for route policies.

Where the suppression applies. The global and subscription_group scopes cannot be created through the API.

Confirmation that a suppression was removed.

Reason that the recipient is suppressed.

A suppression that stays active while a support ticket reviews its removal.

schema:SuppressionReviewResponse .status.

Where the suppression applies.

schema:SuppressionSourceMessageData.

The outcome of adding addresses to the suppression list.

The addresses that were added and the addresses that were already suppressed.

schema:SuppressionType.

schema:TeamAddonData.

schema:TeamData.

schema:TeamMemberData.

schema:TeamMemberData .role.

schema:TeamMemberProjectAccessData.

schema:TeamMemberProjectAccessData .projects[].

The team after a settings change, with a confirmation message.

schema:TeamRoleData.

The reusable roles of the team.

schema:TeamType.

schema:TeamUsageDetailData.

schema:TeamUsagePeriodData.

Confirmation that a test delivery was queued.

schema:TlsPolicy.

schema:UpdateDomainProjectsData.

schema:UpdateProjectData.

PUT /projects/{projectId}/report-forwarding response 200.

schema:UpdateRouteData.

schema:UpdateRouteInboundSettingsData.

schema:UpdateRouteSettingsData.

schema:UpdateTeamData.

schema:UpdateTeamMemberAssignmentData.

schema:UpdateTeamMemberAssignmentData .project_access.

schema:UpdateWebhookData.

schema:ValidationError.

schema:VerifyReportForwardingRequest.

POST /projects/{projectId}/report-forwarding/verify response 200.

schema:WebhookBasicAuthData.

schema:WebhookData.

schema:WebhookDeliveryData.

schema:WebhookDeliveryListData.

schema:WebhookDeliveryModeFilter.

schema:WebhookDeliveryStatus.

schema:WebhookEvent.

schema:WebhookListData.

The webhook after a change, with a confirmation message.

schema:WebhookScope.

schema:WebhookSecretData.

The webhook with its signing secret, which is only returned when the secret is created or regenerated.

The response could not be decoded: an empty or non-JSON body where JSON was expected, or an error status with a non-JSON body such as a proxy's HTML page. body_excerpt holds the first 200 characters of the body.

HTTP 422: the API rejected the request data.

Verifies Lettermint webhook deliveries.

A verified webhook delivery.

A webhook delivery could not be verified. Reject the request and do not process its payload.

Webhook endpoints. Needs :team_token. Delivery attempts are in Lettermint.Webhooks.Deliveries. To verify incoming deliveries, use Lettermint.Webhook.

Delivery attempts of a webhook. Needs :team_token.