# Primitive Functions API

**Canonical:** https://apis.io/apis/primitive/primitive-functions-api/  
**Provider:** Primitive — https://apis.io/providers/primitive/  
**Base URL:** https://api.primitive.dev/v1

Primitive Functions API is one of 22 APIs that [Primitive](https://apis.io/providers/primitive/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include Functions. The published artifact set on APIs.io includes an OpenAPI specification.

Deploy JavaScript handlers that run on inbound mail. Each function is a single ESM module whose default export is an object with an async `fetch(request, env)` method, in the shape of a Workers-style handler. Primitive signs each delivery and forwards the `Primitive-Signature` header to the handler; verify the raw request body with `PRIMITIVE_WEBHOOK_SECRET` before trusting the parsed event. The `event` field is `email.received` for normal inbound mail, or a machine-mail type (`email.bounced`, `email.tls_report`, `email.dmarc_report`, `email.dmarc_failure`) for bounces and reports; the payload shape is otherwise identical. Code runs on Primitive's edge runtime; there is no infrastructure to manage. Secrets land in `env` as encrypted bindings and are refreshed on every redeploy.

## Machine-readable artifacts (1)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/primitive/refs/heads/main/openapi/primitive-functions-api-openapi.yml

## Other Primitive APIs (12)

- [Primitive Account API](https://apis.io/apis/primitive/primitive-account-api/)
- [Primitive Agent API](https://apis.io/apis/primitive/primitive-agent-api/)
- [Primitive CLI API](https://apis.io/apis/primitive/primitive-cli-api/)
- [Primitive Demo API](https://apis.io/apis/primitive/primitive-demo-api/)
- [Primitive Discovery API](https://apis.io/apis/primitive/primitive-discovery-api/)
- [Primitive Domains API](https://apis.io/apis/primitive/primitive-domains-api/)
- [Primitive Emails API](https://apis.io/apis/primitive/primitive-emails-api/)
- [Primitive Endpoints API](https://apis.io/apis/primitive/primitive-endpoints-api/)
- [Primitive Filters API](https://apis.io/apis/primitive/primitive-filters-api/)
- [Primitive Inbox API](https://apis.io/apis/primitive/primitive-inbox-api/)
- [Primitive Memories API](https://apis.io/apis/primitive/primitive-memories-api/)
- [Primitive Payments API](https://apis.io/apis/primitive/primitive-payments-api/)

## Tags

Functions

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/primitive/primitive-functions-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/primitive/.
