---
title: "POST /ticket/{ticketId}/templates"
method: POST
path: "/ticket/{ticketId}/templates"
tags: ["TicketTemplateRelation"]
---

# POST /ticket/{ticketId}/templates

`POST /ticket/{ticketId}/templates`

## Request

- Base URL: `https://api.c1st.com/api`
- URL: `https://api.c1st.com/api/ticket/{ticketId}/templates`
- Auth: HTTP bearer

## Request body

- SetTicketTemplateRelation
  - `content` TicketTemplateRelation
    - `id` integer: An id for the relation.
    - `ticketid` integer: Task Id for the relation
    - `templateid` integer
    - `template` TicketTemplate
      - `id` integer: A unique ticket ID
      - `label` string
      - `expected_minutes` integer, nullable: Expected work time in minutes for this task. Null means no estimate has been given; 0 means the task takes no time. Omitting it on update keeps the current value.
      - `groupid` integer: Which TicketTemplateGroup this TicketTemplate applies to
      - `created_at` string, nullable
      - `updated_at` string, nullable
      - `handle` string, nullable: Unique handle for tasktemplates. Will be set automatically if not set
      - `position` number: Number used to determine the order of the TaskTemplate
      - `note` string, nullable
      - `duedate` string, nullable
    - `note` string, nullable
    - `duedate` string, nullable
    - `updated_at` string, nullable
    - `created_at` string, nullable
    - `notified_at` string, nullable
    - `status` 'initialized' | 'completed'
    - `status_changed_by_userid` integer, nullable: The ID of the employee who last check-marked the task template.
    - `timespent` integer, nullable: Allocated time on task
    - `expected_minutes` integer, nullable: Expected work time in minutes, copied from the task template when it was added to the ticket. Use this rather than template.expected_minutes, which reflects the current template.
    - `position` number: Number used to determine the order of the TaskTemplate
    - `label` string: use template.label
    - `handle` string: use template.handle
    - `groupid` integer: use template.groupid
  - `positionAfterId` number, nullable: If this is set, the position of this TicketTemplateRelation will be between positionaftermaterialid and the TicketTemplateRelation below if (if it exists)
  - `positionBeforeId` number, nullable: If this is set, the position of this TicketTemplateRelation will be between positionbeforematerialid and the TicketTemplateRelation above if (if it exists)

## Response `200`

Ok

- SearchTicketTemplateRelationResponse
  - `content` TicketTemplateRelation[]
    - `id` integer: An id for the relation.
    - `ticketid` integer: Task Id for the relation
    - `templateid` integer
    - `template` TicketTemplate
      - `id` integer: A unique ticket ID
      - `label` string
      - `expected_minutes` integer, nullable: Expected work time in minutes for this task. Null means no estimate has been given; 0 means the task takes no time. Omitting it on update keeps the current value.
      - `groupid` integer: Which TicketTemplateGroup this TicketTemplate applies to
      - `created_at` string, nullable
      - `updated_at` string, nullable
      - `handle` string, nullable: Unique handle for tasktemplates. Will be set automatically if not set
      - `position` number: Number used to determine the order of the TaskTemplate
      - `note` string, nullable
      - `duedate` string, nullable
    - `note` string, nullable
    - `duedate` string, nullable
    - `updated_at` string, nullable
    - `created_at` string, nullable
    - `notified_at` string, nullable
    - `status` 'initialized' | 'completed'
    - `status_changed_by_userid` integer, nullable: The ID of the employee who last check-marked the task template.
    - `timespent` integer, nullable: Allocated time on task
    - `expected_minutes` integer, nullable: Expected work time in minutes, copied from the task template when it was added to the ticket. Use this rather than template.expected_minutes, which reflects the current template.
    - `position` number: Number used to determine the order of the TaskTemplate
    - `label` string: use template.label
    - `handle` string: use template.handle
    - `groupid` integer: use template.groupid
  - `materialsChanged` boolean

---

[API](https://skmtc.dev/c1st/apis/customers-1st-api.md) - [All operations](https://skmtc.dev/c1st/apis/customers-1st-api/llms.txt) - [OpenAPI document](https://skmtc.dev/c1st/apis/customers-1st-api/revisions/4250bb326f2a?raw)
