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

# Log time against a task

> Logs one entry per call. The server sets the id, the user and `created_at`, and ignores any value you send for them. There is no route to edit or delete a log: log a correcting entry instead. Returns the task's whole `time_tracking`.



## OpenAPI

````yaml /api-reference/endpoint/workspaces/openapi.json put /workspaces/task/{task_id}/time-log
openapi: 3.0.3
info:
  title: Workspaces Service API
  version: 1.0.0
  description: API for managing workspaces, tasks, and comments
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /workspaces/task/{task_id}/time-log:
    put:
      summary: Log time against a task
      description: >-
        Logs one entry per call. The server sets the id, the user and
        `created_at`, and ignores any value you send for them. There is no route
        to edit or delete a log: log a correcting entry instead. Returns the
        task's whole `time_tracking`.
      operationId: addTimeLog
      parameters:
        - name: task_id
          in: path
          required: true
          description: Task id.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TimeLog'
      responses:
        '200':
          description: The task's time tracking, with totals
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeTracking'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TimeLog:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          description: Server-minted, `tl_` followed by random characters.
        time_spent:
          type: object
          required:
            - time_in_seconds
          properties:
            time_in_seconds:
              type: integer
              minimum: 1
        started_at:
          type: string
          format: date-time
        description:
          type: string
        user:
          type: object
          readOnly: true
          properties:
            id:
              type: string
            name:
              type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - time_spent
        - started_at
    TimeTracking:
      type: object
      properties:
        estimate:
          type: object
          properties:
            time_in_seconds:
              type: integer
        logs:
          type: array
          items:
            $ref: '#/components/schemas/TimeLog'
        spent:
          type: object
          properties:
            time_in_seconds:
              type: integer
        remaining:
          type: object
          properties:
            time_in_seconds:
              type: integer
        progress_percent:
          type: number
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code. Branch on this, not on `error`.
      required:
        - error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

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