# Introduction

- Page: https://bytesms.com/docs (markdown: https://bytesms.com/docs.md)
- API base URL: https://api.bytesms.com/api (public resources under /api/v1)
- Auth: `Authorization: Bearer tp_live_…` — an API key from Dashboard → API Keys; keep it server-side (e.g. `BYTESMS_API_KEY`)
- All docs in one file: https://bytesms.com/llms-full.txt · OpenAPI 3.1: https://bytesms.com/openapi.json

Bytesms is an email API for developers. Send transactional email from your code, send marketing broadcasts to audiences, and track every message with delivery events and webhooks — over a REST API, SMTP or an MCP server for AI agents.

## Base URL

Every REST endpoint lives under the `/api` prefix of the API host. The public, API-key authenticated resources are under `/api/v1`:

**cURL**

```bash
# All requests go to
curl -X GET 'https://api.bytesms.com/api/v1/domains' \
  -H 'Authorization: Bearer tp_live_xxxxxxxxx'
```

**Node.js**

```js
// All requests go to
const res = await fetch("https://api.bytesms.com/api/v1/domains", {
  method: "GET",
  headers: {
    Authorization: "Bearer tp_live_xxxxxxxxx",
  },
});
console.log(await res.json());
```

**Python**

```python
import requests

# All requests go to
res = requests.get(
    "https://api.bytesms.com/api/v1/domains",
    headers={"Authorization": "Bearer tp_live_xxxxxxxxx"},
)
print(res.json())
```

The base URL is `https://api.bytesms.com/api`. Requests and responses are JSON (`Content-Type: application/json`); timestamps are ISO 8601 strings in UTC. The API is Resend-style — field names are snake_case, list responses are `{ object: "list", has_more, data }` and the Node.js and Python Resend SDKs can send through it (see [Quickstart](https://bytesms.com/docs/quickstart#resend-sdk)) — but only the parameters documented here are accepted.

## What you can do

- [Quickstart](https://bytesms.com/docs/quickstart): API key → verified domain → first email.
- [Emails](https://bytesms.com/docs/emails): Send, batch, schedule, retrieve and cancel.
- [Domains](https://bytesms.com/docs/domains): DKIM, return path, SPF and DMARC setup.
- [Webhooks](https://bytesms.com/docs/webhooks): Delivery events with signed payloads.
- [Templates](https://bytesms.com/docs/templates): Reusable content with variables.
- [Broadcasts](https://bytesms.com/docs/broadcasts): Marketing email to an audience.
- [WhatsApp](https://bytesms.com/docs/whatsapp): OTP verification and template messages.
- [SMTP](https://bytesms.com/docs/smtp): Send from any SMTP-capable app or library.
- [MCP server](https://bytesms.com/docs/mcp): Let AI agents send and manage domains.
- [AI assistants](https://bytesms.com/docs/ai): Copy-paste prompt, markdown docs, MCP setup.

## Key concepts

- **Workspace** — everything (API keys, domains, emails, audiences, billing) belongs to a workspace. An API key always acts on the workspace that created it.
- **Domain** — you send from addresses on a domain you have verified in the workspace. Until then you can send from `onboarding@mail.bytesms.com` to your own account email only.
- **Email** — one message with up to 50 recipients across `to`, `cc` and `bcc`. Quotas count recipients, not API calls.
- **Events** — each email moves through `email.sent`, `email.delivered`, `email.bounced`, … which you can poll or receive by [webhook](https://bytesms.com/docs/webhooks).

## Machine-readable docs

- [OpenAPI 3.1 spec](https://bytesms.com/openapi.json) of the public `/v1` API, including webhook payload schemas.
- [llms.txt](https://bytesms.com/llms.txt): a short index of these docs for AI agents.
- [llms-full.txt](https://bytesms.com/llms-full.txt): every page as one markdown file. Each page is also available on its own at `/docs/<page>.md`, e.g. [/docs/emails.md](https://bytesms.com/docs/emails.md).
- Using ChatGPT, Claude or Cursor? See [AI assistants](https://bytesms.com/docs/ai) for a copy-paste prompt and MCP setup.

> **Note: Testing without a domain**
>
> Send to `delivered@test.bytesms.com`, `bounced@test.bytesms.com`, `complained@test.bytesms.com` or `suppressed@test.bytesms.com` (a `+label` is allowed) to simulate each outcome. Test addresses are always allowed as recipients, never reach a real mailbox, and still fire the matching events and webhooks.
