Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API 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. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: Hail Unsubscribe API
description: 'Give your AI agent a voice, a real phone number, and an inbox.
This file is the source of truth for the Go CLI. Regenerate it after
changing API routes — see docs/public/contributing.md.'
version: 0.1.0
servers:
- url: https://api.hail.so
description: Hail Cloud
tags:
- name: unsubscribe
paths:
/v1/unsubscribe:
post:
tags:
- unsubscribe
summary: Unsubscribe
description: 'One-click email opt-out (RFC 8058).
``GET`` is a person clicking the link in a sent email. ``POST`` is the
mailbox provider''s unsubscribe button (Gmail, Yahoo), which sends the
body ``List-Unsubscribe=One-Click``. The body is optional.
Public and unauthenticated — the signed token query param is the sole
credential, proving the caller holds a link Hail sent to that address.
On success, the address is added to the org''s suppression list and all
future outbound email to it is blocked. Returns an HTML page, not JSON.'
operationId: unsubscribe_v1_unsubscribe_post
parameters:
- name: token
in: query
required: true
schema:
type: string
title: Token
responses:
'200':
description: Successful Response
content:
text/html:
schema:
type: string
'400':
description: The token is invalid or has expired.
content:
text/html:
schema:
type: string
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
requestBody:
required: false
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
List-Unsubscribe:
type: string
enum:
- One-Click
get:
tags:
- unsubscribe
summary: Unsubscribe
description: 'One-click email opt-out (RFC 8058).
``GET`` is a person clicking the link in a sent email. ``POST`` is the
mailbox provider''s unsubscribe button (Gmail, Yahoo), which sends the
body ``List-Unsubscribe=One-Click``. The body is optional.
Public and unauthenticated — the signed token query param is the sole
credential, proving the caller holds a link Hail sent to that address.
On success, the address is added to the org''s suppression list and all
future outbound email to it is blocked. Returns an HTML page, not JSON.'
operationId: unsubscribe_v1_unsubscribe_get
parameters:
- name: token
in: query
required: true
schema:
type: string
title: Token
responses:
'200':
description: Successful Response
content:
text/html:
schema:
type: string
'400':
description: The token is invalid or has expired.
content:
text/html:
schema:
type: string
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
description: Path to the invalid field within the request, as a list of keys/indices (e.g. ['body', 'to']).
msg:
type: string
title: Message
description: Human-readable description of the validation failure.
type:
type: string
title: Error Type
description: Machine-readable error type code (e.g. 'missing', 'string_type').
input:
title: Input
description: The value that was actually provided and failed validation.
ctx:
type: object
title: Context
description: Additional machine-readable context for the error, when the error type provides one.
type: object
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
description: 'List of validation errors: each entry gives the field location (loc), the problem (msg), and the error type (type).'
type: object
title: HTTPValidationError