> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Primitive

> Inbound email infrastructure for AI agents -- receive emails on a custom domain and get structured webhook payloads with parsed content, attachments, and authentication results (SPF/DKIM/DMARC).

Inbound email infrastructure for AI agents -- receive emails on a custom domain and get structured webhook payloads with parsed content, attachments, and authentication results (SPF/DKIM/DMARC). Best for agent workflows that need to process incoming emails programmatically. Unlike outbound email services (SendGrid, Mailgun), Primitive handles the receiving side with webhook delivery and automatic retries.

1 example endpoint available through Lava's AI Gateway. See the [Primitive API docs](https://www.primitive.dev/docs) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://api.primitive.dev` is supported. Inbound email API. Construct URL as [https://api.primitive.dev/\&#123;path\&#125](https://api.primitive.dev/\&#123;path\&#125);. The endpoints below are curated examples.</Info>

## Endpoints

### Webhook payload delivered when email is received (configure your endpoint URL in dashboard)

**POST** `https://api.primitive.dev/webhooks` — Free / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.primitive.dev/webhooks', {
      body: {
    "event": "email.received",
    "email": {
      "subject": "Hello",
      "from": "sender@example.com"
    }
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.primitive.dev%2Fwebhooks" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"event":"email.received","email":{"subject":"Hello","from":"sender@example.com"}}'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
