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

# Deny a timesheet

> Deny a timesheet with a mandatory comment.

Can only be performed on a timesheet with a `pending` status.



## OpenAPI

````yaml /openapi-specs/timmi-timesheet.yaml post /timmi-timesheet/api/timesheets/{id}/deny
openapi: 3.1.0
info:
  title: Lucca Timesheet API (not v3)
  version: '1.0'
  description: The latest documentation for Lucca Timesheet API.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: TimeEntries
    description: TimeEntries are the actual working hours observed by a user.
  - name: Workflow
    description: All actions regarding the approval process of timesheets.
paths:
  /timmi-timesheet/api/timesheets/{id}/deny:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - schema:
          type: integer
        name: id
        in: path
        required: true
        description: timesheet id
    post:
      tags:
        - Workflow
      summary: Deny a timesheet
      description: |-
        Deny a timesheet with a mandatory comment.

        Can only be performed on a timesheet with a `pending` status.
      operationId: post-timmi-timesheet-api-timesheets-deny
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
                  minLength: 1
                  description: A comment to explain why this timesheet is denied.
              required:
                - comment
          application/xml:
            schema:
              type: object
              properties:
                comment:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkflowItem'
              examples: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
              examples: {}
        '500':
          description: Internal Server Error
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    WorkflowItem:
      title: WorkflowItem
      type: object
      description: >-
        A WorkflowItem is an individual workflow action performed by a user.


        The expectedNextActor object is a User. [See API
        reference.](reference/Directory-v3.yaml/components/schemas/User)
      properties:
        id:
          type: integer
          description: Unique id of the WorkflowItem.
        exceptionMessage:
          type: string
          description: Any human readable error message.
        startsOn:
          type: string
          pattern: yyyy-MM-dd
          format: date
          description: >-
            The Timesheet the WorkflowItem is related on starting date
            (included).
        endsOn:
          type: string
          format: date
          pattern: yyyy-MM-dd
          description: The Timesheet the WorkflowItem is related on ending date (excluded).
        expectedNextActor:
          type: object
          description: A Directory 'User'. See API reference for up-to-date attributes.
        status:
          type: string
          description: >-
            - "success" for a succesfull workflow operation.

            - "error" if any error was met, and therefore an excetion message is
            set.

            - "noAction" if the workflow operation was not performed. 

````