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

# Get Last Task Per Template

> Latest top-level task for each task template (at most one row per
template) — avoids paging through the full task history just to show
last-run status.



## OpenAPI

````yaml https://api.truestate.io/openapi.json get /tasks/last-per-template/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://www.truestate.io/dawn/docs) for internal an external
    authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://www.truestate.io/dawn/docs)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: https://www.truestate.io/dawn/docs
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.13.95
servers: []
security: []
paths:
  /tasks/last-per-template/:
    get:
      tags:
        - tasks
      summary: Get Last Task Per Template
      description: |-
        Latest top-level task for each task template (at most one row per
        template) — avoids paging through the full task history just to show
        last-run status.
      operationId: get_last_task_per_template_tasks_last_per_template__get
      parameters:
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskRead'
                title: >-
                  Response Get Last Task Per Template Tasks Last Per Template 
                  Get
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    TaskRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        group_id:
          type: string
          format: uuid
          title: Group Id
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        instruction:
          type: string
          title: Instruction
        assignee:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee
        plan:
          anyOf:
            - $ref: '#/components/schemas/Plan'
            - type: 'null'
        conversation_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Conversation Id
        cancel_requested:
          type: boolean
          title: Cancel Requested
          default: false
        context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Context
        task_template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Task Template Id
        task_template_version_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Task Template Version Id
        organisation_id:
          type: string
          title: Organisation Id
        result:
          anyOf:
            - type: string
            - type: 'null'
          title: Result
        effectiveness:
          anyOf:
            - $ref: '#/components/schemas/ResultEffectiveness'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - group_id
        - instruction
        - organisation_id
        - result
        - effectiveness
        - created_at
        - updated_at
      title: TaskRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Plan:
      properties:
        tool:
          type: string
          title: Tool
        rationale:
          type: string
          title: Rationale
        expectation:
          type: string
          title: Expectation
      type: object
      required:
        - tool
        - rationale
        - expectation
      title: Plan
    ResultEffectiveness:
      properties:
        assessment:
          type: string
          title: Assessment
        implications:
          type: string
          title: Implications
        is_complete:
          type: boolean
          title: Is Complete
          default: false
      type: object
      required:
        - assessment
        - implications
      title: ResultEffectiveness
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````