## Copy Template

`print_mail.templates.copy(strid, TemplateCopyParams**kwargs)  -> Template`

**post** `/print-mail/v1/templates/{id}/copy`

Copy a template, including its template editor design and format
settings. The template is found by ID in your organization, in whichever
mode it's in. By default the copy is created in your organization, in the
mode of your API key, so an empty body duplicates the template. The copy
keeps the template's description and metadata.

A test API key only finds test templates and can only copy into test
mode. A live API key can copy between test and live mode in either
direction.

A template that uses trackers or a custom envelope can only be copied
within your organization and the same mode, where the copy uses the same
trackers and envelope. Images keep their URLs.

### Parameters

- `id: str`

- `destination: Optional[Destination]`

  Where the copy is created.

  - `live: Optional[bool]`

    Create the copy in live mode. Defaults to the mode of your
    API key. `true` needs a live API key.

  - `organization: Optional[str]`

    The organization to copy the template into: yours (the
    default) or one of its sub-organizations. An ID: `org_…` or
    `sub_org_…`.

### Returns

- `class Template: …`

  - `id: str`

    A unique ID prefixed with template_

  - `created_at: datetime`

    The UTC time at which this resource was created.

  - `live: bool`

    `true` if this is a live mode resource else `false`.

  - `object: Literal["template"]`

    Always `template`.

    - `"template"`

  - `updated_at: datetime`

    The UTC time at which this resource was last updated.

  - `description: Optional[str]`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `html: Optional[str]`

    The HTML content of this template.

  - `metadata: Optional[Dict[str, object]]`

    See the section on Metadata.

### Example

```python
import os
from postgrid import PostGrid

client = PostGrid(
    print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"),  # This is the default and can be omitted
)
template = client.print_mail.templates.copy(
    id="id",
    destination={
        "organization": "sub_org_tBnVEzz878mXLbHQaz86j8"
    },
)
print(template.id)
```

#### Response

```json
{
  "id": "template_tBnVEzz878mXLbHQaz86j8",
  "object": "template",
  "live": false,
  "description": "Test",
  "html": "<b>Hello</b> {{to.firstName}}!",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z"
}
```
