> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a project template

> Creates a project template, as the app's template page does, and returns it with 201. `name` is required; `due_within` (days from a project's start it is due) defaults to 0. `assignee_role` is an account role by key (the app's Assignee Role): a project made from the template is assigned to the account's person in it. `tasks` is the whole list, in order: a task left out is removed. A task naming a stored `id` keeps all it holds (its tags and custom values) and changes only what is sent; one without starts as the app's form starts one (a task, low priority, due when the template is). A new task may take an `id` of your own so others name it as `parent` or in `depends_on`. A milestone takes no parent; a parent or a dependency must be a task of the template, under the same parent, with no loops, or it is a 422. A template answers with its `tasks` (each with `id`, `title`, `type` task or milestone, `parent`, `priority`, `start_day` (days from the project's start it starts) and `due_within` (days after it starts that it is due), `assignee_role`, the `status` a project's task starts in, and `depends_on`, the tasks it waits for), the status templates its projects and its tasks use (`project_status_template`, `task_status_template`; null: the workspace's global one), and `missing_fields`, custom fields it names that no longer exist. A template `synced` from another tool is read only.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/project_templates
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/project_templates:
    post:
      tags:
        - project_templates
      summary: Create a project template
      description: >-
        Creates a project template, as the app's template page does, and returns
        it with 201. `name` is required; `due_within` (days from a project's
        start it is due) defaults to 0. `assignee_role` is an account role by
        key (the app's Assignee Role): a project made from the template is
        assigned to the account's person in it. `tasks` is the whole list, in
        order: a task left out is removed. A task naming a stored `id` keeps all
        it holds (its tags and custom values) and changes only what is sent; one
        without starts as the app's form starts one (a task, low priority, due
        when the template is). A new task may take an `id` of your own so others
        name it as `parent` or in `depends_on`. A milestone takes no parent; a
        parent or a dependency must be a task of the template, under the same
        parent, with no loops, or it is a 422. A template answers with its
        `tasks` (each with `id`, `title`, `type` task or milestone, `parent`,
        `priority`, `start_day` (days from the project's start it starts) and
        `due_within` (days after it starts that it is due), `assignee_role`, the
        `status` a project's task starts in, and `depends_on`, the tasks it
        waits for), the status templates its projects and its tasks use
        (`project_status_template`, `task_status_template`; null: the
        workspace's global one), and `missing_fields`, custom fields it names
        that no longer exist. A template `synced` from another tool is read
        only.
      operationId: project_templates_create
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                account_specific:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Account Specific
                assignee_role:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: >-
                    An account role by key (a user field of the account, such as
                    `csm__c_`): projects made from the template are assigned to
                    the account's person in it. null: no role
                  title: Assignee Role
                cascade_dates:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Cascade Dates
                description:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Description
                due_within:
                  anyOf:
                    - maximum: 3650
                      minimum: 0
                      type: integer
                    - type: 'null'
                  default: null
                  title: Due Within
                name:
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
                project_status_template:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: >-
                    A status template's id (GET /v1/status_templates) for its
                    projects; null: the global one
                  title: Project Status Template
                task_status_template:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: 'A status template''s id for its tasks; null: the global one'
                  title: Task Status Template
                tasks:
                  anyOf:
                    - items:
                        $ref: '#/components/schemas/TaskBody'
                      maxItems: 1000
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    The template's tasks, all of them, in order: a task left out
                    is removed
                  title: Tasks
              required:
                - name
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectTemplateRecord'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    TaskBody:
      additionalProperties: false
      properties:
        assignee_role:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Assignee Role
        depends_on:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Depends On
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Description
        due_within:
          anyOf:
            - maximum: 3650
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          title: Due Within
        id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            An existing task's id keeps that task and changes only what is sent.
            A new task may take an id of your own (unique in the template) for
            others to name as `parent` or in `depends_on`; left out, one is made
          title: Id
        parent:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Parent
        priority:
          anyOf:
            - enum:
                - low
                - medium
                - high
              type: string
            - type: 'null'
          default: null
          title: Priority
        start_day:
          anyOf:
            - maximum: 3650
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          title: Start Day
        title:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Required for a new task
          title: Title
        type:
          anyOf:
            - enum:
                - task
                - milestone
              type: string
            - type: 'null'
          default: null
          title: Type
      title: TaskBody
      type: object
    ProjectTemplateRecord:
      properties:
        account_specific:
          description: 'For an account''s projects: a create from it then needs an account'
          title: Account Specific
          type: boolean
        assignee_role:
          anyOf:
            - type: string
            - type: 'null'
          description: The account role (a user field, by key) a project is assigned to
          title: Assignee Role
        cascade_dates:
          description: Whether moving a task's dates moves the tasks that wait for it
          title: Cascade Dates
          type: boolean
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        due_within:
          description: Days from the project's start the project is due
          title: Due Within
          type: integer
        id:
          title: Id
          type: string
        missing_fields:
          description: Custom fields the template names that no longer exist
          items:
            $ref: '#/components/schemas/MissingField'
          title: Missing Fields
          type: array
        name:
          title: Name
          type: string
        project_fields:
          description: The custom fields its projects have, by key
          items:
            type: string
          title: Project Fields
          type: array
        project_status_template:
          anyOf:
            - $ref: '#/components/schemas/StatusTemplateRef'
            - type: 'null'
          description: >-
            The status template its projects use; null: the workspace's global
            one
        synced:
          description: >-
            Synced from another tool, which owns it: it cannot be changed or
            deleted here
          title: Synced
          type: boolean
        task_fields:
          description: The custom fields its projects' tasks have, by key
          items:
            type: string
          title: Task Fields
          type: array
        task_status_template:
          anyOf:
            - $ref: '#/components/schemas/StatusTemplateRef'
            - type: 'null'
          description: 'The status template its tasks use; null: the workspace''s global one'
        tasks:
          items:
            $ref: '#/components/schemas/TemplateTask'
          title: Tasks
          type: array
      required:
        - id
        - name
        - account_specific
        - due_within
        - cascade_dates
        - assignee_role
        - project_status_template
        - task_status_template
        - tasks
        - project_fields
        - task_fields
        - synced
      title: ProjectTemplateRecord
      type: object
    MissingField:
      properties:
        custom_field_id:
          title: Custom Field Id
          type: integer
        label:
          default: ''
          title: Label
          type: string
        location:
          description: >-
            Where the template names it, such as `assignee_role` or
            `task[<id>].assignee_role`
          title: Location
          type: string
      required:
        - location
        - custom_field_id
      title: MissingField
      type: object
    StatusTemplateRef:
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
        - id
        - name
      title: StatusTemplateRef
      type: object
    TemplateTask:
      properties:
        assignee_role:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The account role (a user field of the account, by key) whose person
            a project's task is assigned to
          title: Assignee Role
        depends_on:
          description: Ids of the template tasks it waits for
          items:
            type: string
          title: Depends On
          type: array
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        due_within:
          description: >-
            Days after the task starts that it is due (a project's task is due
            on day start_day + due_within)
          title: Due Within
          type: integer
        id:
          description: The task's id within the template
          title: Id
          type: string
        parent:
          anyOf:
            - type: string
            - type: 'null'
          description: The id of the template task it sits under, or null
          title: Parent
        position:
          anyOf:
            - type: string
            - type: 'null'
          title: Position
        priority:
          anyOf:
            - enum:
                - low
                - medium
                - high
              type: string
            - type: 'null'
          title: Priority
        start_day:
          description: Days from the project's start the task starts on
          title: Start Day
          type: integer
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: The status a project's task starts in
          title: Status
        title:
          title: Title
          type: string
        type:
          description: task, or milestone (a top-level task other tasks sit under)
          enum:
            - task
            - milestone
          title: Type
          type: string
      required:
        - id
        - title
        - type
        - parent
        - start_day
        - due_within
        - assignee_role
        - status
      title: TemplateTask
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.