---
title: "Send an ad-hoc billing email"
description: "Operator-initiated send (the per-record Email action) — the only create endpoint on this resource; every other email is produced by the engine."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/webhooks/send-an-ad-hoc-billing-email"
---
# Send an ad-hoc billing email

> Operator-initiated send (the per-record Email action) — the only create endpoint on this resource; every other email is produced by the engine.

<api-operation method="POST" path="/v1/businesses/{biz}/emails/send">
<template v-slot:docs="">

Operator-initiated send (the per-record `Email` action) — the only create endpoint on this resource; every other email is produced by the engine. Renders the chosen type against a real record and sends immediately through the resolved transport, bypassing the outbox. Deliberately NOT gated on `email_config.enabled`: that flag governs automatic mail, and an operator pressing Send has already decided for this one message. Which record id is required depends on `type`: `invoice` for `invoice_sent`/`payment_request`, `credit_note` for `credit_note_sent`, `customer` for `payment_method_request`. A missing one is a 400 rather than a half-filled send. A relay refusing the message is reported as `ok: false` with a 200.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The email type to send. One of <code>
        invoice_sent
      </code>
      
      , <code>
        payment_request
      </code>
      
      , <code>
        payment_method_request
      </code>
      
      , <code>
        credit_note_sent
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Customer id (cus_…). Required for <code>
        payment_method_request
      </code>
      
      ; derived from the record otherwise.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        invoice
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Invoice id (inv_…). Required for <code>
        invoice_sent
      </code>
      
       and <code>
        payment_request
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        credit_note
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Credit note id (cn_…). Required for <code>
        credit_note_sent
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        to
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Override the recipient. Defaults to the customer's billing email; does not change what is stored on the customer.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        note
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The operator's covering message, rendered as <binding value="note">
        
      </binding>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        email_send
      </code>
      
      . One of <code>
        email_send
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ok
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the email was sent.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Why sending failed, when it did.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        transport
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      How the email was sent. One of <code>
        console
      </code>
      
      , <code>
        smtp
      </code>
      
      , <code>
        esp
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email_id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The id of the email message that was created.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Send attempted
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Missing record, unknown type, or no recipient
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/emails/send" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "invoice_sent"
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "email_send",
  "ok": false,
  "error": null,
  "transport": "console",
  "email_id": "em_XXXXXXXXXXXX01"
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Missing record, unknown type, or no recipient"
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
