# Create a template and submit it for Meta review

Canonical: https://docs.bluehola.com/docs/templates-flows-media/post-v1-templates
OpenAPI: https://docs.bluehola.com/openapi.yaml

<div class="endpoint"><span class="endpoint-method endpoint-method--post">POST</span><code class="endpoint-path">/v1/templates</code></div>

Create a template and submit it for Meta review.

:::note[Authentication]

Send `Authorization: Bearer <API_KEY>` in the request headers; required scope: `templates:manage`. Which resources an API Key can reach is determined by its current authorization scope.

:::

## Request

Base URL: `https://api.bluehola.com`

### Request body
A request body is required.
### Request body fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `wabaId` | string | Yes | The platform's WABA ID |
| `name` | string | Yes | Lowercase letters, digits and underscores |
| `language` | string | Yes | For example en_US, zh_CN |
| `category` | MARKETING \| UTILITY \| AUTHENTICATION | Yes | The template category |
| `components` | object[] | Yes | Meta template components |
| `parameterFormat` | positional \| named | No | The parameter format |
| `optimizationSpec` | object | No | Max Price for MARKETING templates; see “Max Price” below |

Content-Type: `application/json`
Schema:

```json
{
  "type": "object",
  "properties": {
    "wabaId": {
      "type": "string",
      "description": "string · required — The platform's WABA ID"
    },
    "name": {
      "type": "string",
      "description": "string · required — Lowercase letters, digits and underscores"
    },
    "language": {
      "type": "string",
      "description": "string · required — For example en_US, zh_CN"
    },
    "category": {
      "type": "string",
      "description": "MARKETING | UTILITY | AUTHENTICATION · required — The template category"
    },
    "components": {
      "type": "string",
      "description": "object[] · required — Meta template components"
    },
    "parameterFormat": {
      "type": "string",
      "description": "positional | named · optional — The parameter format"
    },
    "optimizationSpec": {
      "type": "string",
      "description": "object · optional — Max Price (MARKETING only): `{ bidAmount, bidStrategy: LOWEST_COST_WITH_BID_CAP, bidCountryMultiplierOverrides? }`. bidAmount is the maximum price per 1,000 deliveries in the smallest unit of the Messaging account currency ($0.05 per delivery = 5000). It may be below, equal to, or above the rate card; Meta charges no more than the effective bid. When editing, pass null for both bid fields to clear Max Price and return to rate-card billing."
    }
  },
  "required": [
    "wabaId",
    "name",
    "language",
    "category",
    "components"
  ]
}
```

## Response

| Status | Description |
| --- | --- |
| `201` | Created |
| `4xx` | Client error |

For the common error envelope and how to handle it, see [Error Codes](../guides/error-codes.md).

## Notes

#### Max Price (optional)

Set `optimizationSpec` only on a `MARKETING` template:

```json
{
  "optimizationSpec": {
    "bidAmount": 5000,
    "bidStrategy": "LOWEST_COST_WITH_BID_CAP",
    "bidCountryMultiplierOverrides": { "IN": 1.2 }
  }
}
```

- `bidAmount` is a positive integer: the maximum price **per 1,000 deliveries**, in the smallest unit of the Messaging account currency. For USD, `5000` means $0.05 per delivery. The platform passes this value to Meta unchanged; it does not multiply it by 1,000 or convert currency.
- `bidStrategy` must be `LOWEST_COST_WITH_BID_CAP`. The bid may be below, equal to or above the rate card; the platform does not impose a rate-card-relative limit. Meta charges no more than the effective bid, but may reject an excessively low bid.
- `bidCountryMultiplierOverrides` maps ISO 3166-1 alpha-2 country codes to multipliers greater than 0 and at most 10, with at most 240 entries. Unlisted countries use 1.0. Template reads return the normalized snapshot in this same map shape.
- Omit `optimizationSpec` for ordinary rate-card billing. A new or changed bid can take up to one hour to take effect.

Creation does a local pre-check for duplicates on name+language+wabaId, to avoid submitting the same thing to Meta twice; `components` is forwarded to Meta as-is with no secondary validation — a formatting mistake is rejected during Meta's review, not reported at creation time. The review outcome is not returned synchronously — the `status` in the creation response is only whatever initial value Meta happened to return at that moment (usually PENDING); the real APPROVED/REJECTED outcome is filled in asynchronously by the status update webhook. You need to poll `GET /v1/templates/{id}` or subscribe to the webhook to get the final state; review is usually completed within 24 hours.
