FlaresendDocs
Admin API

Create a project

Create a project, the unit that owns API keys, sending domains, emails and settings.

POST/v1/admin/projectsAdmin key

A project is one app or team that sends email. It has its own API keys, allowed sending domains, daily limit, webhooks, templates and contacts. After you create one, create an API key for it. See Projects for how the settings affect sending.

Body parameters

slugstringrequired

The project's permanent identifier: lowercase letters, digits and dashes, starting with a letter or digit, at most 63 characters. Used in admin URLs and by Workers that send over RPC (rpcClient(env.MAILER, { project: 'acme' })). Must be unique.

namestringrequired

A display name, 1 to 200 characters.

allowedDomainsstring[]required

The domains this project may send from, at least one. Values are trimmed and lowercased, and duplicates are removed. A from address on any other domain fails with 403 invalid_sender.

The sender used when a send request has no from, as "Name <address>" or a bare address. Must be on one of allowedDomains. The address is stored lowercased.

Restrict from to these exact addresses. When this is not set, any address on the allowed domains may send.

domainSendersRecord<string, string>

A default sender per domain, for example { "acme.com": "Acme <hello@acme.com>" }. Each key must be one of allowedDomains and each sender must be an address on that key's domain. The dashboard uses these when it sends from a domain; see Domains.

rpcEnabledbooleandefault: true

Whether Workers may send for this project over the MailerRpc service binding. When false, RPC calls fail with 403 rpc_disabled.

dailyLimitintegerdefault: 5000

The most live emails the project may send per UTC day. 0 means no limit. Once used up, sends fail with 429 daily_limit_exceeded until 00:00 UTC.

trackOpensbooleandefault: false

Add an open-tracking pixel to HTML emails by default. A send can override it with trackOpens.

trackClicksbooleandefault: false

Rewrite links in HTML emails to count clicks by default. A send can override it with trackClicks.

broadcastsEnabledbooleandefault: false

Allow broadcasts for this project. Cloudflare Email Service is for transactional email, so only turn this on for small, opted-in lists.

Response

Status 201 with the new project.

Errors

StatusCodeWhen
400invalid_bodyA field is missing or malformed, or defaultFrom / a domainSenders value is not on an allowed domain. param names the field.
409slug_takenA project with this slug already exists.