## Create Tracker

**post** `/print-mail/v1/trackers`

Create a Tracker.

### Body Parameters

- `redirectURLTemplate: string`

  The base template for URLs generated by this Tracker.

- `urlExpireAfterDays: 30 or 60 or 90 or 2 more`

  The number of days generated Tracker URLs remain valid.

  - `30`

  - `60`

  - `90`

  - `180`

  - `365`

- `description: optional string`

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

- `metadata: optional map[unknown]`

  See the section on Metadata.

### Returns

- `id: string`

  A unique ID prefixed with tracker_

- `createdAt: string`

  The UTC time at which this resource was created.

- `live: boolean`

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

- `object: "tracker"`

  Always `tracker`.

  - `"tracker"`

- `redirectURLTemplate: string`

  The base template for URLs generated by this Tracker.

- `uniqueVisitCount: number`

  The unique number of interactions the Tracker has had.

- `updatedAt: string`

  The UTC time at which this resource was last updated.

- `urlExpireAfterDays: 30 or 60 or 90 or 2 more`

  The number of days generated Tracker URLs remain valid.

  - `30`

  - `60`

  - `90`

  - `180`

  - `365`

- `visitCount: number`

  The total number of interactions the Tracker has had.

- `description: optional string`

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

- `metadata: optional map[unknown]`

  See the section on Metadata.

### Example

```http
curl https://api.postgrid.com/print-mail/v1/trackers \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
    -d '{
          "redirectURLTemplate": "https://postgrid.com?name={{to.firstName}}",
          "urlExpireAfterDays": 30
        }'
```

#### Response

```json
{
  "id": "tracker_123456789abcdefghijklmnopqrstuvwxyz",
  "object": "tracker",
  "live": false,
  "redirectURLTemplate": "https://postgrid.com?name={{to.firstName}}",
  "urlExpireAfterDays": 30,
  "visitCount": 0,
  "uniqueVisitCount": 0,
  "createdAt": "2020-11-12T23:30:12.581Z",
  "updatedAt": "2020-11-12T23:30:12.581Z"
}
```
