mailfixture Sms API
Received texts — extraction shapes are byte-identical to email.
Received texts — extraction shapes are byte-identical to email.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/mailfixture-com:mailfixture-com-sms-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
contact:
email: support@mailfixture.com
name: mailfixture support
description: 'REST API for mailfixture: create inboxes, trigger your app''s email flow, then read messages back and assert on extracted OTPs, links, SPF/DKIM/DMARC verdicts, and a SpamAssassin score. Paid plans add dedicated US phone numbers with the same loop for SMS.
Conventions:
- Every request needs `Authorization: Bearer mfx_`.
- Errors are RFC 7807 `application/problem+json` (`{type, title, status, detail}`); `type` is always `about:blank`. 404 uniformly covers both missing and not-owned resources.
- Rate limiting is a per-key token bucket: 2 requests/second sustained, burst 60 (policy `requests`). Refusals are 429 with a `Retry-After` header (integer seconds). Inbox, phone-number, and capture-hook creation draw on a shared second per-key bucket (burst 10, refills 10/minute; policy `creates`).
- Every authenticated response carries rate-limit headers: `RateLimit-Policy: "requests";q=60;w=30` and `RateLimit: "requests";r=;t=` (draft-ietf-httpapi-ratelimit-headers syntax) plus `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` integers. A 429 reports the bucket that refused with `r=0`.
- A 401 carries `WWW-Authenticate: Bearer realm="mailfixture"` (`error="invalid_token"` when a key was presented but rejected).
- Timestamps are RFC 3339 UTC strings; ids are UUIDs. Nullable fields serialize as JSON `null`, never omitted (except where a schema notes otherwise).
- List responses wrap the array in an object key (`{"messages": [...]}`) and are not paginated; message lists take a `since` cursor instead.
- Long-polling: message list endpoints accept `wait` (clamped to 60 s) and hold the request until a match arrives or the window closes. An empty window is a 200 with an empty array, never 204 or 408.'
summary: 'Programmatic email inboxes (and SMS numbers) for automated testing. Receive-only: mailfixture never sends.'
termsOfService: https://mailfixture.com/terms
title: mailfixture Sms API
version: 0.1.0
servers:
- description: Canonical API origin
url: https://api.mailfixture.com
security:
- apiKey: []
tags:
- description: Received texts — extraction shapes are byte-identical to email.
name: SMS
paths:
/v1/phone-numbers/{id}/messages:
get:
description: Summaries ordered oldest-first by `received_at`, at most 100 per response; summaries include the full `text` (the body is the message). Long-poll semantics match the email endpoint.
operationId: list_sms
parameters:
- description: Phone number id.
in: path
name: id
required: true
schema:
format: uuid
type: string
- $ref: '#/components/parameters/Since'
- description: 'Filter expression: `from:<term>`, `to:<term>`, or `body:<term>`; a bare term (or unknown prefix) matches the body — SMS has no subject. Case-insensitive substring match.'
in: query
name: match
required: false
schema:
type: string
- $ref: '#/components/parameters/Wait'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SmsList'
description: Matching texts — empty array when nothing matched within the wait window.
'400':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: '`match` has an empty term after its field prefix.'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: No such phone number on this account.
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
summary: List or long-poll texts
tags:
- SMS
/v1/sms/{id}:
get:
operationId: get_sms
parameters:
- description: SMS id.
in: path
name: id
required: true
schema:
format: uuid
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SmsDetail'
description: The text with its extraction results.
'401':
$ref: '#/components/responses/Unauthorized'
'404':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: No such SMS on this account.
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
summary: Get a text
tags:
- SMS
/v1/sms/{id}/links:
get:
description: Byte-identical shape to the email links endpoint.
operationId: get_sms_links
parameters:
- description: SMS id.
in: path
name: id
required: true
schema:
format: uuid
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/LinkList'
description: Classified links; empty array when none were extracted.
'401':
$ref: '#/components/responses/Unauthorized'
'404':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: No such SMS on this account.
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
summary: Get the extracted links
tags:
- SMS
/v1/sms/{id}/links/follow:
post:
description: 'The email follow endpoint''s SMS twin: same selectors, same SSRF-guarded follow, same outcome shape.'
operationId: follow_sms_link
parameters:
- description: SMS id.
in: path
name: id
required: true
schema:
format: uuid
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FollowRequest'
required: false
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/FollowOutcome'
description: The follow outcome.
'400':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: More than one of `url`/`class`/`index` was passed, or the selected link itself is not followable.
'401':
$ref: '#/components/responses/Unauthorized'
'404':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: No such SMS, or no extracted link matches the selector.
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
'502':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: 'The remote misbehaved: unreachable, a redirect hop was guard-refused, more than 5 redirects, or the chain exceeded 15 seconds.'
summary: Follow an extracted link server-side
tags:
- SMS
/v1/sms/{id}/otp:
get:
description: Byte-identical shape to the email OTP endpoint.
operationId: get_sms_otp
parameters:
- description: SMS id.
in: path
name: id
required: true
schema:
format: uuid
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractedOtp'
description: Ranked OTP candidates and the best pick.
'401':
$ref: '#/components/responses/Unauthorized'
'404':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: No such SMS on this account.
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
summary: Get the extracted OTP
tags:
- SMS
components:
schemas:
Extracted:
description: Extraction results computed at receipt. `text`, `auth`, and `spam` are conditionally present keys — see their descriptions.
properties:
auth:
$ref: '#/components/schemas/ExtractedAuth'
links:
items:
$ref: '#/components/schemas/ExtractedLink'
type: array
otp:
$ref: '#/components/schemas/ExtractedOtp'
spam:
$ref: '#/components/schemas/ExtractedSpam'
text:
description: Plain-text rendering of the HTML part; present only when the message had no text/plain part.
type: string
required:
- otp
- links
type: object
DkimAuth:
properties:
domain:
type: string
error:
description: Present only for non-pass results — e.g. a body-hash mismatch reports `neutral` with the reason here (RFC 6376 §6.1).
type: string
result:
$ref: '#/components/schemas/AuthResult'
selector:
type: string
required:
- result
- domain
- selector
type: object
SmsSummary:
description: Unlike email summaries, SMS summaries carry the full `text` — the body is the message.
properties:
from_number:
type: string
id:
format: uuid
type: string
phone_number_id:
format: uuid
type: string
received_at:
format: date-time
type: string
text:
type: string
to_number:
type: string
required:
- id
- phone_number_id
- received_at
- from_number
- to_number
- text
type: object
DmarcAuth:
properties:
domain:
description: RFC5322.From domain; present only when non-empty.
type: string
policy:
description: Present only when a DMARC record exists.
enum:
- none
- quarantine
- reject
type: string
result:
$ref: '#/components/schemas/AuthResult'
required:
- result
type: object
ExtractedSpam:
description: 'SpamAssassin content analysis (local rules only — no network/RBL tests, so scores are deterministic). The whole key is absent when scoring is disabled, the daemon was unreachable, or the message exceeded the scoring size cap — absence means "not scored", never "failed". Observation only: the verdict never affects acceptance.'
properties:
rules:
description: The rules that fired, with their individual score contributions; empty when nothing matched.
items:
$ref: '#/components/schemas/SpamRule'
type: array
score:
description: Total SpamAssassin score; higher is spammier. May be negative.
type: number
threshold:
description: The score at or above which the message is classed spam (default 5.0).
type: number
verdict:
description: 'SpamAssassin''s own decision (its `Spam: True/False`), not a client-side threshold recomputation.'
enum:
- spam
- ham
type: string
required:
- score
- threshold
- verdict
- rules
type: object
AuthResult:
description: RFC 8601 result vocabulary. DNS trouble degrades to `temperror`.
enum:
- pass
- fail
- softfail
- neutral
- none
- temperror
- permerror
type: string
ExtractedAuth:
description: 'Receive-side SPF/DKIM/DMARC verdicts (RFC 8601 vocabulary). The whole key is absent when verification is disabled on the deployment — absence means "not verified", never "failed". Observation only: verdicts never affect acceptance.'
properties:
dkim:
description: One entry per DKIM signature; unsigned mail is an empty array.
items:
$ref: '#/components/schemas/DkimAuth'
type: array
dmarc:
$ref: '#/components/schemas/DmarcAuth'
spf:
$ref: '#/components/schemas/SpfAuth'
required:
- spf
- dkim
- dmarc
type: object
ExtractedOtp:
properties:
best:
description: Top-ranked code, or null when no candidate scores above the confidence threshold.
type:
- string
- 'null'
candidates:
description: At most 5, sorted by descending score.
items:
$ref: '#/components/schemas/OtpCandidate'
type: array
required:
- best
- candidates
type: object
SpamRule:
properties:
description:
description: Human-readable rule description, when spamd supplied one.
type:
- string
- 'null'
name:
description: SpamAssassin rule symbol, e.g. `MISSING_HEADERS`.
type: string
score:
description: This rule's contribution to the total; may be negative.
type: number
required:
- name
- score
type: object
Problem:
description: 'RFC 7807 problem document — every error response uses this shape with `Content-Type: application/problem+json`.'
properties:
detail:
description: Human-readable specifics; null on 500.
type:
- string
- 'null'
status:
description: The HTTP status, duplicated in the body.
type: integer
title:
description: Fixed short phrase for the status class, e.g. `bad request`, `not found`.
type: string
type:
const: about:blank
type: string
required:
- type
- title
- status
- detail
type: object
LinkList:
properties:
links:
items:
$ref: '#/components/schemas/ExtractedLink'
type: array
required:
- links
type: object
FollowRequest:
description: Selects which extracted link to follow. Pass at most one field; with none, the first `verify`-classed link is followed.
properties:
class:
description: First link of this class.
enum:
- verify
- reset
- unsubscribe
- other
type: string
index:
description: Zero-based index into the extracted links.
minimum: 0
type: integer
url:
description: Exact match against a URL in the extracted links.
type: string
type: object
FollowOutcome:
properties:
final_url:
description: URL of the final, non-redirect response.
type: string
ok:
description: True when `status` is 2xx.
type: boolean
redirects:
description: Redirect hops followed (max 5).
type: integer
requested_url:
type: string
status:
description: HTTP status of the final response — reported, not judged.
type: integer
required:
- requested_url
- final_url
- status
- redirects
- ok
type: object
SmsDetail:
properties:
expires_at:
format: date-time
type: string
extracted:
$ref: '#/components/schemas/Extracted'
from_number:
type: string
id:
format: uuid
type: string
phone_number_id:
format: uuid
type: string
received_at:
format: date-time
type: string
text:
type: string
to_number:
type: string
required:
- id
- phone_number_id
- received_at
- from_number
- to_number
- text
- extracted
- expires_at
type: object
OtpCandidate:
properties:
score:
description: Keyword-proximity score, one decimal.
type: number
value:
description: The digit sequence.
type: string
required:
- value
- score
type: object
ExtractedLink:
properties:
class:
description: Class guess from URL path + anchor keywords; magic-link/login URLs class as `verify`.
enum:
- verify
- reset
- unsubscribe
- other
type: string
text:
description: Anchor text; null for bare-text URLs.
type:
- string
- 'null'
url:
type: string
required:
- url
- text
- class
type: object
SpfAuth:
properties:
domain:
description: The identity checked (MAIL FROM, falling back to HELO); may be empty.
type: string
result:
$ref: '#/components/schemas/AuthResult'
required:
- result
- domain
type: object
SmsList:
properties:
messages:
items:
$ref: '#/components/schemas/SmsSummary'
type: array
required:
- messages
type: object
responses:
ServerError:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Unexpected server error. `detail` is null — internals are never leaked.
Unauthorized:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Missing bearer token, malformed key, or unknown/revoked/invalid API key.
headers:
WWW-Authenticate:
description: 'RFC 6750 Bearer challenge: `Bearer realm="mailfixture"` when no token was sent, with `error="invalid_token"` when one was sent but rejected.'
schema:
type: string
RateLimited:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Per-key rate limit exceeded. `Retry-After` says when the next request will be admitted; the RateLimit headers name the bucket that refused (`requests` or `creates`) with `r=0`.
headers:
RateLimit:
description: 'Live bucket state: `"<bucket>";r=<remaining>;t=<seconds until full>`. Present on every authenticated response, not only 429s.'
schema:
type: string
RateLimit-Limit:
description: Bucket size (legacy integer form).
schema:
type: integer
RateLimit-Policy:
description: 'Quota policy, draft-ietf-httpapi-ratelimit-headers syntax: `"<bucket>";q=<size>;w=<seconds to refill fully>`.'
schema:
type: string
RateLimit-Remaining:
description: Whole tokens left (legacy integer form).
schema:
type: integer
RateLimit-Reset:
description: Seconds until the bucket is full (legacy integer form).
schema:
type: integer
Retry-After:
description: Seconds until the next token is available.
schema:
type: integer
parameters:
Wait:
description: Long-poll window in seconds; default 0 answers immediately. Clamped to 60 — larger values are accepted and treated as 60. The request returns as soon as a matching item arrives; an empty window still answers 200 with an empty list.
in: query
name: wait
required: false
schema:
minimum: 0
type: integer
Since:
description: Only items (messages, SMS, or captured requests) received strictly after this RFC 3339 timestamp. Feed back the last summary's `received_at` as a cursor — the row carrying that exact timestamp is not repeated.
in: query
name: since
required: false
schema:
format: date-time
type: string
securitySchemes:
apiKey:
description: mailfixture API key (`mfx_…`) as a Bearer token. Create one in the dashboard (/app/keys) or via POST /v1/keys.
scheme: bearer
type: http
externalDocs:
description: Hand-written API reference
url: https://mailfixture.com/docs/api