# `bird email templates versions submit`

## Usage

```bash
bird email templates versions submit <template-id> <version-id> [flags]
```

## Description

Submit an email template version

Freeze the draft as a new immutable, numbered version and make it the version sends use; the draft stays editable. Every language the draft carries needs a subject and a body, and the draft's default language must be one of them: a submit is all or nothing, and the response names every problem across every language so you can fix them together. Send `validate_only: true` to run the same checks without freezing anything, and `expected_revision` to have the submit refused if the draft changed since you read it. A submit that would change nothing is refused. The response already reflects the final outcome, and a returned version is immediately live.

Build the request from flags, a JSON EmailTemplateSubmit body via --body-file ("-" reads
stdin), or both — a flag overrides the matching body field. Run --example to
print a ready-to-edit body, or --dry-run to print the resolved request without
sending it.

## Procedure

Step 3 of 3 of "Author a template and make it sendable". Previous: bird email templates versions languages set.

## Examples

```bash
# print the body shape (no credentials needed)
bird email templates versions submit --example

# the body it prints:
```

```json
{
  "expected_revision": 3
}
```

## Options

#### Request

| Name                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `--body-file`       | Read the JSON request body from this file; "-" reads stdin   |
| `--example`         | Print a complete example request body, then exit             |
| `--dry-run`         | Print the resolved request without sending it, then exit     |
| `--idempotency-key` | Deduplication key; a retry with the same key won't act twice |

#### Options

| Name                      | Description                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--validate-only`         | Validate the version without submitting it. Every language is checked and every problem reported, but nothing is frozen and no version is created. Give a validation run a different Idempotency-Key from the submit that follows it, or none at all: the two requests carry different bodies, so reusing one key is rejected as key reuse. |
| `--expected-revision <n>` | The draft revision you last read (from the template's revision field). A stale value returns a conflict so you can reload and retry.                                                                                                                                                                                                        |
| `--response-schema`       | Print the fields this command returns, then exit                                                                                                                                                                                                                                                                                            |

## Related

| Name                                                                                              | Description                   |
| ------------------------------------------------------------------------------------------------- | ----------------------------- |
| [`bird email templates versions delete`](/docs/cli/reference/email-templates-versions-delete)     | Discard the draft's changes   |
| [`bird email templates versions get`](/docs/cli/reference/email-templates-versions-get)           | Get an email template version |
| [`bird email templates versions list`](/docs/cli/reference/email-templates-versions-list)         | List email template versions  |
| [`bird email templates versions rollback`](/docs/cli/reference/email-templates-versions-rollback) | Roll back an email template   |