RefreshDocsConsole →

API reference

CLI

Command-line client for the Refresh HTTP API.

The CLI wraps the TypeScript client in sdk/f5send.ts. It adds no extra permission. A key that cannot act over curl cannot act here either.

Install

Ask support for the two files, cli/f5send.mts and sdk/f5send.ts. Keep the cli folder next to the sdk folder. Then run node cli/f5send.mts. Node 24 or newer runs the files with no extra flags.

Configuration

Set F5SEND_API_KEY to a bearer key. Pass --api-key to override that value.

Set F5SEND_BASE_URL to change the API root. Pass --base-url to override that value. The default root is https://api.f5send.com/api/v1.

Every command except openapi needs a key. openapi fetches /openapi.json from the base URL and sends no Authorization header.

Output

Success writes JSON to stdout. Pretty print is the default. Pass --compact for one line.

An API error writes { "error": { "status", "code", "message" } } to stderr and exits 1. A usage error writes help to stderr and exits 2.

--json body

--json sets the request body. Flags then override fields one by one.

Form Meaning
inline JSON Parse the argument as JSON.
@path Read the file at path.
- Read stdin.

emails batch needs --json and the value must be an array.

Flags

Pass --idempotency-key on emails send. The CLI sends it as the Idempotency-Key header through { idempotencyKey }. The value does not go in the body.

Pass one --to value as a string. Pass several --to values as an array.

--attach reads each file as bytes, base64-encodes the bytes, and sets filename to the basename. It omits content_type.

--text-file and --html-file read UTF-8 bodies from disk.

Commands

Command Example
emails send f5send emails send --from "Acme <hello@example.com>" --to jane@example.org --subject Welcome --text "Hi Jane" --idempotency-key welcome:jane
emails batch f5send emails batch --json -
emails get f5send emails get cmf9x1v0000018lfr6zot86p
emails list f5send emails list --status delivered --limit 25
emails cancel f5send emails cancel cmf9x1v0000018lfr6zot86p
broadcasts create f5send broadcasts create --name "August newsletter" --from "Acme <news@example.com>" --topic newsletter --subject "August news"
broadcasts list f5send broadcasts list
broadcasts get f5send broadcasts get cmg1broadcastid000000001
broadcasts send f5send broadcasts send cmg1broadcastid000000001 --scheduled-at 2026-09-01T09:00:00-04:00
broadcasts cancel f5send broadcasts cancel cmg1broadcastid000000001
contacts upsert f5send contacts upsert --email jane@example.org --first-name Jane --topic newsletter --property plan=pro
contacts get f5send contacts get jane@example.org
contacts delete f5send contacts delete jane@example.org
contacts subscribe f5send contacts subscribe jane@example.org --topic newsletter --topic product-updates
contacts unsubscribe f5send contacts unsubscribe jane@example.org --topic newsletter
events post f5send events post --name order.paid --email jane@example.org --data order_id=8812 --id order_8812
suppressions list f5send suppressions list --reason manual --limit 25
suppressions create f5send suppressions create --email dead@example.org --note "manual block"
suppressions delete f5send suppressions delete cmfasuppressionid0000001
openapi f5send openapi

The management commands need an ADMIN key:

Command Example
domains list f5send domains list
domains create f5send domains create --name mail.example.com --dns-provider manual --stream transactional
domains get f5send domains get cmg1domainid00000000001
domains verify f5send domains verify cmg1domainid00000000001
domains publish f5send domains publish cmg1domainid00000000001
domains register-identity f5send domains register-identity cmg1domainid00000000001
domains stream f5send domains stream cmg1domainid00000000001 --stream bulk
keys me f5send keys me
keys list f5send keys list
keys create f5send keys create --name shop-prod --permission send --mode live --domain-id cmg1domainid00000000001
keys revoke f5send keys revoke cmg1apikeyid000000000001
keys rotate f5send keys rotate cmg1apikeyid000000000001
webhooks list f5send webhooks list
webhooks create f5send webhooks create --url https://example.com/api/webhooks/f5send --event email.bounced --event email.complained
webhooks get f5send webhooks get cmg1webhookid00000000001
webhooks update f5send webhooks update cmg1webhookid00000000001 --enabled false
webhooks delete f5send webhooks delete cmg1webhookid00000000001
topics list f5send topics list
topics create f5send topics create --slug job-alerts --name "Job alerts" --default-opt-in false
topics delete f5send topics delete job-alerts
segments list f5send segments list
segments create f5send segments create --name "Active seekers" --filter '{"all":[{"status":"SUBSCRIBED"}]}'
segments delete f5send segments delete cmg1segmentid00000000001
organization get f5send organization get
organization update f5send organization update --postal-address "1 Main St, Lexington NC 27292"

Boolean flags take an explicit value, so a default stays off or on by intent: --tracking true, --default-opt-in false, --enabled false. Repeat --event and --domain-id to build a list. --filter takes JSON.

--json form of a send:

f5send emails send --json @msg.json --subject "New subject"

--json form of a batch from stdin:

f5send emails batch --json -

--compact form of a list:

f5send --compact emails list --status delivered --limit 5

Help at each level:

f5send --help
f5send emails --help
f5send emails send --help
f5send --version

Exit codes

Code When
0 Success, --help, or --version.
1 The API returned an error (F5sendError).
2 Usage error, unknown command, missing flag, or missing API key.