query
latestAuthCodeReturns the most recently extracted one-time code (OTP) from emails sent to this alias. Fails with PAYMENT_REQUIRED when the account has no remaining credits. Optional since (ISO-8601 or epoch milliseconds; a number below 1e11 is epoch seconds) and afterMessageId return only a code stored strictly after that cutoff. since is compared to storedAt, the server clock when the message was inserted, not receivedAt (Mailgun's whole-second webhook time).
Authentication
Required: x-api-key header or Authorization: Bearer <token>
Arguments
| Name | Type | Description |
|---|---|---|
| projectId* | ID! | - |
| aliasId* | ID! | - |
| since | String | ISO-8601 timestamp or epoch milliseconds (a number below 1e11 is epoch seconds). Only a code with storedAt strictly after this time is returned. |
| afterMessageId | ID | Only a code whose message id sorts after this id (ObjectId order). The id itself is excluded. |
GraphQL
POST to /graphql
query LatestAuthCode($projectId: ID!, $aliasId: ID!, $since: String) {
latestAuthCode(projectId: $projectId, aliasId: $aliasId, since: $since) {
messageId
authCode
confidence
extractedData { key humanReadableName value }
receivedAt
storedAt
}
}Don't have an API key? Sign up to the dashboard to get one for free.
