openapi: 3.0.3
info:
  title: 'Intratime Company Apps API'
  description: 'Public API reference for the Intratime Company Apps V2 integration.'
  version: 1.0.0
servers:
  -
    url: 'https://apicompanies.intratime.es'
tags:
  -
    name: Clients
    description: ''
  -
    name: 'Clocking Requests'
    description: ''
  -
    name: Clockings
    description: ''
  -
    name: Companies
    description: ''
  -
    name: Employees
    description: ''
  -
    name: Expenses
    description: ''
  -
    name: Projects
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: 'Contact your Intratime account manager to obtain an API token. No self-service token endpoint exists. See the **Migration Guide** section for full token onboarding instructions.'
security:
  -
    default: []
paths:
  /company-apps/api/v2/client:
    get:
      summary: 'List all clients.'
      operationId: listAllClients
      description: 'Returns all clients belonging to the authenticated company as a JSON array.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    CLIENT_ID:
                      type: integer
                      example: 10
                    CLIENT_COMPANY:
                      type: string
                      example: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME:
                      type: string
                      example: 'Beta Solutions Ltd.'
                    CLIENT_COUNTRY:
                      type: string
                      example: ES
                    CLIENT_REGION:
                      type: string
                      example: Catalonia
                    CLIENT_CITY:
                      type: string
                      example: Barcelona
                    CLIENT_ADDRESS:
                      type: string
                      example: 'Passeig de Gracia 100'
                    CLIENT_CP:
                      type: string
                      example: '08008'
                    CLIENT_COORDINATES:
                      type: string
                      example: '41.396041,2.161047'
                    CID_OLD:
                      type: string
                      example: null
                      nullable: true
                example:
                  -
                    CLIENT_ID: 10
                    CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME: 'Beta Solutions Ltd.'
                    CLIENT_COUNTRY: ES
                    CLIENT_REGION: Catalonia
                    CLIENT_CITY: Barcelona
                    CLIENT_ADDRESS: 'Passeig de Gracia 100'
                    CLIENT_CP: '08008'
                    CLIENT_COORDINATES: '41.396041,2.161047'
                    CID_OLD: null
                  -
                    CLIENT_ID: 11
                    CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME: 'Gamma Industries S.A.'
                    CLIENT_COUNTRY: ES
                    CLIENT_REGION: Valencia
                    CLIENT_CITY: Valencia
                    CLIENT_ADDRESS: 'Avinguda del Regne de Valencia 25'
                    CLIENT_CP: '46005'
                    CLIENT_COORDINATES: '39.469903,-0.376288'
                    CID_OLD: null
      tags:
        - Clients
    post:
      summary: 'Create a new client.'
      operationId: createANewClient
      description: 'All address fields are required. Returns the created client on success.'
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  CLIENT_ID: 12
                  CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME: 'Delta Corp'
                  CLIENT_COUNTRY: ES
                  CLIENT_REGION: Andalusia
                  CLIENT_CITY: Seville
                  CLIENT_ADDRESS: 'Calle Sierpes 5'
                  CLIENT_CP: '41004'
                  CLIENT_COORDINATES: '37.388050,-5.982409'
                  CID_OLD: null
                properties:
                  CLIENT_ID:
                    type: integer
                    example: 12
                  CLIENT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME:
                    type: string
                    example: 'Delta Corp'
                  CLIENT_COUNTRY:
                    type: string
                    example: ES
                  CLIENT_REGION:
                    type: string
                    example: Andalusia
                  CLIENT_CITY:
                    type: string
                    example: Seville
                  CLIENT_ADDRESS:
                    type: string
                    example: 'Calle Sierpes 5'
                  CLIENT_CP:
                    type: string
                    example: '41004'
                  CLIENT_COORDINATES:
                    type: string
                    example: '37.388050,-5.982409'
                  CID_OLD:
                    type: string
                    example: null
                    nullable: true
      tags:
        - Clients
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "The client's display name."
                  example: 'Delta Corp'
                country:
                  type: string
                  description: 'ISO 3166-1 alpha-2 country code.'
                  example: ES
                region:
                  type: string
                  description: 'Region or province.'
                  example: Andalusia
                city:
                  type: string
                  description: 'City name.'
                  example: Seville
                address:
                  type: string
                  description: 'Street address.'
                  example: 'Calle Sierpes 5'
                cp:
                  type: string
                  description: 'Postal/ZIP code.'
                  example: '41004'
                coordinates:
                  type: string
                  description: 'Latitude and longitude pair separated by a comma.'
                  example: '37.388050,-5.982409'
              required:
                - name
                - country
                - region
                - city
                - address
                - cp
                - coordinates
  '/company-apps/api/v2/client/{CLIENT_ID}':
    get:
      summary: 'Get a single client.'
      operationId: getASingleClient
      description: ''
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  CLIENT_ID: 10
                  CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME: 'Beta Solutions Ltd.'
                  CLIENT_COUNTRY: ES
                  CLIENT_REGION: Catalonia
                  CLIENT_CITY: Barcelona
                  CLIENT_ADDRESS: 'Passeig de Gracia 100'
                  CLIENT_CP: '08008'
                  CLIENT_COORDINATES: '41.396041,2.161047'
                  CID_OLD: null
                  company: null
                properties:
                  CLIENT_ID:
                    type: integer
                    example: 10
                  CLIENT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME:
                    type: string
                    example: 'Beta Solutions Ltd.'
                  CLIENT_COUNTRY:
                    type: string
                    example: ES
                  CLIENT_REGION:
                    type: string
                    example: Catalonia
                  CLIENT_CITY:
                    type: string
                    example: Barcelona
                  CLIENT_ADDRESS:
                    type: string
                    example: 'Passeig de Gracia 100'
                  CLIENT_CP:
                    type: string
                    example: '08008'
                  CLIENT_COORDINATES:
                    type: string
                    example: '41.396041,2.161047'
                  CID_OLD:
                    type: string
                    example: null
                    nullable: true
                  company:
                    type: string
                    example: null
                    nullable: true
      tags:
        - Clients
    put:
      summary: 'Update a client.'
      operationId: updateAClient
      description: 'All address fields are required. Returns the updated client on success.'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  CLIENT_ID: 10
                  CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME: 'Beta Solutions Ltd. (Updated)'
                  CLIENT_COUNTRY: ES
                  CLIENT_REGION: Catalonia
                  CLIENT_CITY: Barcelona
                  CLIENT_ADDRESS: 'Passeig de Gracia 200'
                  CLIENT_CP: '08008'
                  CLIENT_COORDINATES: '41.396041,2.161047'
                  CID_OLD: null
                properties:
                  CLIENT_ID:
                    type: integer
                    example: 10
                  CLIENT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  CLIENT_NAME:
                    type: string
                    example: 'Beta Solutions Ltd. (Updated)'
                  CLIENT_COUNTRY:
                    type: string
                    example: ES
                  CLIENT_REGION:
                    type: string
                    example: Catalonia
                  CLIENT_CITY:
                    type: string
                    example: Barcelona
                  CLIENT_ADDRESS:
                    type: string
                    example: 'Passeig de Gracia 200'
                  CLIENT_CP:
                    type: string
                    example: '08008'
                  CLIENT_COORDINATES:
                    type: string
                    example: '41.396041,2.161047'
                  CID_OLD:
                    type: string
                    example: null
                    nullable: true
      tags:
        - Clients
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "The client's display name."
                  example: 'Beta Solutions Ltd. (Updated)'
                country:
                  type: string
                  description: 'ISO 3166-1 alpha-2 country code.'
                  example: ES
                region:
                  type: string
                  description: 'Region or province.'
                  example: Catalonia
                city:
                  type: string
                  description: 'City name.'
                  example: Barcelona
                address:
                  type: string
                  description: 'Street address.'
                  example: 'Passeig de Gracia 200'
                cp:
                  type: string
                  description: 'Postal/ZIP code.'
                  example: '08008'
                coordinates:
                  type: string
                  description: 'Latitude and longitude pair separated by a comma.'
                  example: '41.396041,2.161047'
              required:
                - name
                - country
                - region
                - city
                - address
                - cp
                - coordinates
    parameters:
      -
        in: path
        name: CLIENT_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: client
        description: "The client's ID."
        example: 10
        required: true
        schema:
          type: integer
  '/company-apps/api/v2/client/{client_CLIENT_ID}':
    delete:
      summary: 'Delete a client.'
      operationId: deleteAClient
      description: 'Soft-deletes the client record. Returns an empty 204 response on success.'
      parameters: []
      responses:
        204:
          description: 'Client deleted'
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Clients
    parameters:
      -
        in: path
        name: client_CLIENT_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: client
        description: "The client's ID."
        example: 10
        required: true
        schema:
          type: integer
  '/company-apps/api/v2/user/{employee_USER_ID}/clocking_requests':
    get:
      summary: 'List clocking requests for an employee.'
      operationId: listClockingRequestsForAnEmployee
      description: "Returns a `{\"clocking_requests\": [...]}` wrapper containing all time-correction\nrequests for the specified employee within the given year (defaults to the\ncurrent year when omitted).\n\nThe route-bound `{employee}` is company-fenced by model binding — a cross-tenant\nemployee resolves to 404 before this action runs."
      parameters:
        -
          in: query
          name: year
          description: 'optional 4-digit year filter for `CLOCKING_REQUESTS_DT_START`. Defaults to the current year.'
          example: 2024
          required: false
          schema:
            type: integer
            description: 'optional 4-digit year filter for `CLOCKING_REQUESTS_DT_START`. Defaults to the current year.'
            example: 2024
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  clocking_requests:
                    -
                      CLOCKING_REQUESTS_ID: 55
                      CLOCKING_REQUESTS_USER_ID: 101
                      CLOCKING_REQUESTS_TYPE: 1
                      CLOCKING_REQUESTS_STATUS: 0
                      CLOCKING_REQUESTS_DT_START: '2024-03-10 09:00:00'
                      CLOCKING_REQUESTS_DT_END: '2024-03-10 10:00:00'
                      CLOCKING_REQUESTS_COMMENTS: 'Forgot to clock in'
                      CLOCKING_REQUESTS_TARGET_CLOCKING_ID: null
                      CLOCKING_REQUESTS_AMEND_PROJECT_ID: null
                      CLOCKING_REQUESTS_COMPANY_ID: 42
                    -
                      CLOCKING_REQUESTS_ID: 56
                      CLOCKING_REQUESTS_USER_ID: 101
                      CLOCKING_REQUESTS_TYPE: 2
                      CLOCKING_REQUESTS_STATUS: 1
                      CLOCKING_REQUESTS_DT_START: '2024-03-12 14:00:00'
                      CLOCKING_REQUESTS_DT_END: '2024-03-12 14:30:00'
                      CLOCKING_REQUESTS_COMMENTS: 'Time correction'
                      CLOCKING_REQUESTS_TARGET_CLOCKING_ID: 8840
                      CLOCKING_REQUESTS_AMEND_PROJECT_ID: null
                      CLOCKING_REQUESTS_COMPANY_ID: 42
                properties:
                  clocking_requests:
                    type: array
                    example:
                      -
                        CLOCKING_REQUESTS_ID: 55
                        CLOCKING_REQUESTS_USER_ID: 101
                        CLOCKING_REQUESTS_TYPE: 1
                        CLOCKING_REQUESTS_STATUS: 0
                        CLOCKING_REQUESTS_DT_START: '2024-03-10 09:00:00'
                        CLOCKING_REQUESTS_DT_END: '2024-03-10 10:00:00'
                        CLOCKING_REQUESTS_COMMENTS: 'Forgot to clock in'
                        CLOCKING_REQUESTS_TARGET_CLOCKING_ID: null
                        CLOCKING_REQUESTS_AMEND_PROJECT_ID: null
                        CLOCKING_REQUESTS_COMPANY_ID: 42
                      -
                        CLOCKING_REQUESTS_ID: 56
                        CLOCKING_REQUESTS_USER_ID: 101
                        CLOCKING_REQUESTS_TYPE: 2
                        CLOCKING_REQUESTS_STATUS: 1
                        CLOCKING_REQUESTS_DT_START: '2024-03-12 14:00:00'
                        CLOCKING_REQUESTS_DT_END: '2024-03-12 14:30:00'
                        CLOCKING_REQUESTS_COMMENTS: 'Time correction'
                        CLOCKING_REQUESTS_TARGET_CLOCKING_ID: 8840
                        CLOCKING_REQUESTS_AMEND_PROJECT_ID: null
                        CLOCKING_REQUESTS_COMPANY_ID: 42
                    items:
                      type: object
                      properties:
                        CLOCKING_REQUESTS_ID:
                          type: integer
                          example: 55
                        CLOCKING_REQUESTS_USER_ID:
                          type: integer
                          example: 101
                        CLOCKING_REQUESTS_TYPE:
                          type: integer
                          example: 1
                        CLOCKING_REQUESTS_STATUS:
                          type: integer
                          example: 0
                        CLOCKING_REQUESTS_DT_START:
                          type: string
                          example: '2024-03-10 09:00:00'
                        CLOCKING_REQUESTS_DT_END:
                          type: string
                          example: '2024-03-10 10:00:00'
                        CLOCKING_REQUESTS_COMMENTS:
                          type: string
                          example: 'Forgot to clock in'
                        CLOCKING_REQUESTS_TARGET_CLOCKING_ID:
                          type: string
                          example: null
                          nullable: true
                        CLOCKING_REQUESTS_AMEND_PROJECT_ID:
                          type: string
                          example: null
                          nullable: true
                        CLOCKING_REQUESTS_COMPANY_ID:
                          type: integer
                          example: 42
      tags:
        - 'Clocking Requests'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                year:
                  type: string
                  description: 'value debe tener 4 dígitos.'
                  example: '9775'
                  nullable: true
    parameters:
      -
        in: path
        name: employee_USER_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: employee
        description: "The employee's ID."
        example: 101
        required: true
        schema:
          type: integer
  '/company-apps/api/v2/user/{employee_USER_ID}/clocking':
    post:
      summary: 'Record a new clocking.'
      operationId: recordANewClocking
      description: "Creates a clocking event for the specified employee. The response is a\n**flat** `INOUT_*` object — NOT the legacy `{\"success\":true,\"clocking\":{...}}` wrapper.\nIf the optional `user_file` image is included, send the request as\n`multipart/form-data`."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  INOUT_ID: 8841
                  INOUT_USER_ID: 101
                  INOUT_TYPE: 0
                  INOUT_DATE: '2024-03-15 09:02:47'
                  INOUT_END_DATE: null
                  INOUT_PROJECT_ID: 7
                  INOUT_COMMENTS: null
                  INOUT_COORDINATES: '40.416775,-3.703790'
                  INOUT_SOURCE: 2
                  INOUT_DEVICE_UID: device-uuid-abc123
                  INOUT_DEVICE_DATE: '2024-03-15 09:02:45'
                  INOUT_USE_SERVER_TIME: false
                  INOUT_TELECOMMUTING: false
                properties:
                  INOUT_ID:
                    type: integer
                    example: 8841
                  INOUT_USER_ID:
                    type: integer
                    example: 101
                  INOUT_TYPE:
                    type: integer
                    example: 0
                  INOUT_DATE:
                    type: string
                    example: '2024-03-15 09:02:47'
                  INOUT_END_DATE:
                    type: string
                    example: null
                    nullable: true
                  INOUT_PROJECT_ID:
                    type: integer
                    example: 7
                  INOUT_COMMENTS:
                    type: string
                    example: null
                    nullable: true
                  INOUT_COORDINATES:
                    type: string
                    example: '40.416775,-3.703790'
                  INOUT_SOURCE:
                    type: integer
                    example: 2
                  INOUT_DEVICE_UID:
                    type: string
                    example: device-uuid-abc123
                  INOUT_DEVICE_DATE:
                    type: string
                    example: '2024-03-15 09:02:45'
                  INOUT_USE_SERVER_TIME:
                    type: boolean
                    example: false
                  INOUT_TELECOMMUTING:
                    type: boolean
                    example: false
      tags:
        - Clockings
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                user_action:
                  type: integer
                  description: 'Clocking type: `0` = Check-in, `1` = Check-out, `2` = Break start, `3` = Break end.'
                  example: 0
                user_timestamp:
                  type: string
                  description: 'Clocking datetime in `Y-m-d H:i:s` format (device local time unless `user_use_server_time` is `true`).'
                  example: '2024-03-15 09:02:45'
                user_gps_coordinates:
                  type: string
                  description: 'optional Latitude and longitude pair separated by a comma.'
                  example: '40.416775,-3.703790'
                  nullable: true
                user_project:
                  type: integer
                  description: 'optional The project ID to associate with this clocking (must belong to the authenticated company).'
                  example: 7
                  nullable: true
                user_file:
                  type: string
                  format: binary
                  description: 'optional Clocking image (JPEG, PNG or JPG). Multipart form upload only. Max size controlled by MAX_FILE_SIZE_CLOCKINGS env var (default 2 MB).'
                  nullable: true
                user_expense:
                  type: integer
                  description: 'optional The expense-type ID to associate with this clocking (must belong to the authenticated company).'
                  example: 2
                  nullable: true
                inout_device_uid:
                  type: string
                  description: 'optional Unique identifier of the originating device.'
                  example: device-uuid-abc123
                  nullable: true
                user_use_server_time:
                  type: boolean
                  description: "optional When `true`, the server's current time is used instead of `user_timestamp`."
                  example: false
                  nullable: true
                expense_amount:
                  type: number
                  description: 'optional Monetary amount for the associated expense type.'
                  example: 15.5
                  nullable: true
              required:
                - user_action
                - user_timestamp
    parameters:
      -
        in: path
        name: employee_USER_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: employee
        description: "The employee's ID."
        example: 101
        required: true
        schema:
          type: integer
  '/company-apps/api/v2/user/{employee_USER_ID}/clockings':
    get:
      summary: 'List clockings for an employee.'
      operationId: listClockingsForAnEmployee
      description: "Returns a flat JSON array of clocking records for the specified employee.\nA hard server-side cap (`LoginLogout::COMPANY_APPS_MAX_RESULTS`) is always\napplied — `maxResult` may further restrict but cannot exceed the cap.\n\nClocking types map to: `0` = Check-in, `1` = Check-out, `2` = Break start, `3` = Break end."
      parameters:
        -
          in: query
          name: last
          description: 'optional When `true`, results are ordered most-recent first; default is oldest first.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'optional When `true`, results are ordered most-recent first; default is oldest first.'
            example: true
        -
          in: query
          name: maxResult
          description: 'optional Maximum number of records to return (server cap always applies).'
          example: 50
          required: false
          schema:
            type: integer
            description: 'optional Maximum number of records to return (server cap always applies).'
            example: 50
        -
          in: query
          name: from
          description: 'optional Filter by start datetime (`Y-m-d H:i:s`).'
          example: '2024-03-01 00:00:00'
          required: false
          schema:
            type: string
            description: 'optional Filter by start datetime (`Y-m-d H:i:s`).'
            example: '2024-03-01 00:00:00'
        -
          in: query
          name: to
          description: 'optional Filter by end datetime (`Y-m-d H:i:s`); must be ≥ `from`.'
          example: '2024-03-31 23:59:59'
          required: false
          schema:
            type: string
            description: 'optional Filter by end datetime (`Y-m-d H:i:s`); must be ≥ `from`.'
            example: '2024-03-31 23:59:59'
        -
          in: query
          name: type
          description: 'optional Comma-separated clocking type filter. Allowed values: `0`, `1`, `2`, `3`.'
          example: '0,1'
          required: false
          schema:
            type: string
            description: 'optional Comma-separated clocking type filter. Allowed values: `0`, `1`, `2`, `3`.'
            example: '0,1'
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    INOUT_ID:
                      type: integer
                      example: 8840
                    INOUT_USER_ID:
                      type: integer
                      example: 101
                    INOUT_TYPE:
                      type: integer
                      example: 0
                    INOUT_DATE:
                      type: string
                      example: '2024-03-14 08:58:10'
                    INOUT_END_DATE:
                      type: string
                      example: null
                      nullable: true
                    INOUT_PROJECT_ID:
                      type: string
                      example: null
                      nullable: true
                    INOUT_COMMENTS:
                      type: string
                      example: null
                      nullable: true
                    INOUT_COORDINATES:
                      type: string
                      example: null
                      nullable: true
                    INOUT_SOURCE:
                      type: integer
                      example: 2
                    INOUT_DEVICE_UID:
                      type: string
                      example: null
                      nullable: true
                    INOUT_DEVICE_DATE:
                      type: string
                      example: '2024-03-14 08:58:10'
                    INOUT_USE_SERVER_TIME:
                      type: boolean
                      example: true
                    INOUT_TELECOMMUTING:
                      type: boolean
                      example: false
                example:
                  -
                    INOUT_ID: 8840
                    INOUT_USER_ID: 101
                    INOUT_TYPE: 0
                    INOUT_DATE: '2024-03-14 08:58:10'
                    INOUT_END_DATE: null
                    INOUT_PROJECT_ID: null
                    INOUT_COMMENTS: null
                    INOUT_COORDINATES: null
                    INOUT_SOURCE: 2
                    INOUT_DEVICE_UID: null
                    INOUT_DEVICE_DATE: '2024-03-14 08:58:10'
                    INOUT_USE_SERVER_TIME: true
                    INOUT_TELECOMMUTING: false
                  -
                    INOUT_ID: 8841
                    INOUT_USER_ID: 101
                    INOUT_TYPE: 1
                    INOUT_DATE: '2024-03-14 17:03:22'
                    INOUT_END_DATE: null
                    INOUT_PROJECT_ID: null
                    INOUT_COMMENTS: null
                    INOUT_COORDINATES: null
                    INOUT_SOURCE: 2
                    INOUT_DEVICE_UID: null
                    INOUT_DEVICE_DATE: '2024-03-14 17:03:22'
                    INOUT_USE_SERVER_TIME: true
                    INOUT_TELECOMMUTING: false
      tags:
        - Clockings
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                last:
                  type: string
                  description: ''
                  example: '1'
                  enum:
                    - '0'
                    - '1'
                    - 'true'
                    - 'false'
                  nullable: true
                maxResult:
                  type: integer
                  description: 'El value debe ser minimo 1.'
                  example: 16
                  nullable: true
                from:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                  example: '2026-07-16 16:42:12'
                  nullable: true
                to:
                  type: string
                  description: 'Must be a valid date in the format <code>Y-m-d H:i:s</code>. Fecha inválida.'
                  example: '2052-08-08'
                  nullable: true
                type:
                  type: string
                  description: "[0-3] mirrors Activity::CLOCKINGS [0,1,2,3] (the native clocking types).\nInput pre-validation only — the real type guard is $employee->clockings()'s\nwhereIn('INOUT_TYPE', Activity::CLOCKINGS). Keep them in sync if CLOCKINGS changes. Must match the regex /^[0-3](,[0-3])*$/."
                  example: '1,3,1,2,2,3,2'
                  nullable: true
    parameters:
      -
        in: path
        name: employee_USER_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: employee
        description: "The employee's ID."
        example: 101
        required: true
        schema:
          type: integer
  /company-apps/api/v2/companies/current:
    get:
      summary: "Get the authenticated company's profile."
      operationId: getTheAuthenticatedCompanysProfile
      description: "Returns the full company object including all employees with their\nassociated projects, clients, and work centres."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  COMPANY_ID: 42
                  COMPANY_UNIQUE_ID: abc12345-1234-1234-1234-abc123456789
                  COMPANY_NAME: 'Acme Corp S.L.'
                  COMPANY_CIF: B12345678
                  COMPANY_CCC: '1234567890'
                  COMPANY_ADDRESS: 'Calle Gran Via 1'
                  COMPANY_COUNTRY: ES
                  COMPANY_LOCATION: Madrid
                  COMPANY_CP: '28013'
                  COMPANY_COORDINATES: '40.416775,-3.703790'
                  COMPANY_MAIL: admin@acme.example
                  COMPANY_PASSWORD: ''
                  COMPANY_PRO: 1
                  COMPANY_RATE: 2
                  COMPANY_DELETION_DATE: null
                  COMPANY_HAS_ADS: 0
                  COMPANIES_TOKEN: ''
                  COMPANY_LOGO: 'https://cdn.example.com/logos/acme.png'
                  COMPANY_SIGNATURE: null
                  COMPANY_CONTINUOUS_WORKDAYS: 0
                  COMPANY_USE_SERVER_TIME: 1
                  COMPANY_FORCE_LOCATION: 0
                  COMPANY_CALENDAR_DAYS: 0
                  COMPANY_SHOW_CLIENT: 1
                  COMPANY_SHOW_CLIENT_SELECT: 0
                  COMPANY_EMAIL_UPDATES: 1
                  COMPANY_API_COMMENTS: 0
                  COMPANY_TIMEZONE: Europe/Madrid
                  users:
                    -
                      USER_ID: 101
                      USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                      USER_NAME: 'Jane Smith'
                      USER_EMAIL: jane.smith@acme.example
                      USER_TOKEN: ''
                      USER_IMAGE: null
                      USER_NIF: null
                      USER_AFFILIATION: null
                      USER_WORKING_TIME: null
                      USER_USERNAME: jane.smith@acme.example
                      USER_PASWORD: ''
                      projects: []
                      workcenters: []
                properties:
                  COMPANY_ID:
                    type: integer
                    example: 42
                  COMPANY_UNIQUE_ID:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  COMPANY_NAME:
                    type: string
                    example: 'Acme Corp S.L.'
                  COMPANY_CIF:
                    type: string
                    example: B12345678
                  COMPANY_CCC:
                    type: string
                    example: '1234567890'
                  COMPANY_ADDRESS:
                    type: string
                    example: 'Calle Gran Via 1'
                  COMPANY_COUNTRY:
                    type: string
                    example: ES
                  COMPANY_LOCATION:
                    type: string
                    example: Madrid
                  COMPANY_CP:
                    type: string
                    example: '28013'
                  COMPANY_COORDINATES:
                    type: string
                    example: '40.416775,-3.703790'
                  COMPANY_MAIL:
                    type: string
                    example: admin@acme.example
                  COMPANY_PASSWORD:
                    type: string
                    example: ''
                  COMPANY_PRO:
                    type: integer
                    example: 1
                  COMPANY_RATE:
                    type: integer
                    example: 2
                  COMPANY_DELETION_DATE:
                    type: string
                    example: null
                    nullable: true
                  COMPANY_HAS_ADS:
                    type: integer
                    example: 0
                  COMPANIES_TOKEN:
                    type: string
                    example: ''
                  COMPANY_LOGO:
                    type: string
                    example: 'https://cdn.example.com/logos/acme.png'
                  COMPANY_SIGNATURE:
                    type: string
                    example: null
                    nullable: true
                  COMPANY_CONTINUOUS_WORKDAYS:
                    type: integer
                    example: 0
                  COMPANY_USE_SERVER_TIME:
                    type: integer
                    example: 1
                  COMPANY_FORCE_LOCATION:
                    type: integer
                    example: 0
                  COMPANY_CALENDAR_DAYS:
                    type: integer
                    example: 0
                  COMPANY_SHOW_CLIENT:
                    type: integer
                    example: 1
                  COMPANY_SHOW_CLIENT_SELECT:
                    type: integer
                    example: 0
                  COMPANY_EMAIL_UPDATES:
                    type: integer
                    example: 1
                  COMPANY_API_COMMENTS:
                    type: integer
                    example: 0
                  COMPANY_TIMEZONE:
                    type: string
                    example: Europe/Madrid
                  users:
                    type: array
                    example:
                      -
                        USER_ID: 101
                        USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                        USER_NAME: 'Jane Smith'
                        USER_EMAIL: jane.smith@acme.example
                        USER_TOKEN: ''
                        USER_IMAGE: null
                        USER_NIF: null
                        USER_AFFILIATION: null
                        USER_WORKING_TIME: null
                        USER_USERNAME: jane.smith@acme.example
                        USER_PASWORD: ''
                        projects: []
                        workcenters: []
                    items:
                      type: object
                      properties:
                        USER_ID:
                          type: integer
                          example: 101
                        USER_COMPANY:
                          type: string
                          example: abc12345-1234-1234-1234-abc123456789
                        USER_NAME:
                          type: string
                          example: 'Jane Smith'
                        USER_EMAIL:
                          type: string
                          example: jane.smith@acme.example
                        USER_TOKEN:
                          type: string
                          example: ''
                        USER_IMAGE:
                          type: string
                          example: null
                          nullable: true
                        USER_NIF:
                          type: string
                          example: null
                          nullable: true
                        USER_AFFILIATION:
                          type: string
                          example: null
                          nullable: true
                        USER_WORKING_TIME:
                          type: string
                          example: null
                          nullable: true
                        USER_USERNAME:
                          type: string
                          example: jane.smith@acme.example
                        USER_PASWORD:
                          type: string
                          example: ''
                        projects:
                          type: array
                          example: []
                        workcenters:
                          type: array
                          example: []
      tags:
        - Companies
  /company-apps/api/v2/companies/login:
    post:
      summary: 'Company login (deprecated — 410 Gone).'
      operationId: companyLogindeprecated410Gone
      description: "This endpoint has been retired. API access must now be granted formally\nby Intratime. Contact support to request a Bearer token."
      parameters: []
      responses:
        410:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error:
                    code: ENDPOINT_GONE
                    message: 'This login endpoint is no longer available. Access must now be requested formally.'
                    contact: support@intratime.es
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: ENDPOINT_GONE
                      message:
                        type: string
                        example: 'This login endpoint is no longer available. Access must now be requested formally.'
                      contact:
                        type: string
                        example: support@intratime.es
      tags:
        - Companies
  /company-apps/api/v2/user:
    get:
      summary: 'List all employees.'
      operationId: listAllEmployees
      description: "Returns all active employees of the authenticated company, each with\ntheir associated projects, clients, and work centres."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    USER_ID:
                      type: integer
                      example: 101
                    USER_COMPANY:
                      type: string
                      example: abc12345-1234-1234-1234-abc123456789
                    USER_NAME:
                      type: string
                      example: 'Jane Smith'
                    USER_EMAIL:
                      type: string
                      example: jane.smith@acme.example
                    USER_TOKEN:
                      type: string
                      example: ''
                    USER_IMAGE:
                      type: string
                      example: null
                      nullable: true
                    USER_NIF:
                      type: string
                      example: null
                      nullable: true
                    USER_AFFILIATION:
                      type: string
                      example: null
                      nullable: true
                    USER_WORKING_TIME:
                      type: string
                      example: null
                      nullable: true
                    USER_USERNAME:
                      type: string
                      example: jane.smith@acme.example
                    USER_PASWORD:
                      type: string
                      example: ''
                    projects:
                      type: array
                      example:
                        -
                          PROJECT_ID: 7
                          PROJECT_NAME: 'Alpha Project'
                          PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                          PID_OLD: null
                          client: null
                          users: []
                      items:
                        type: object
                        properties:
                          PROJECT_ID:
                            type: integer
                            example: 7
                          PROJECT_NAME:
                            type: string
                            example: 'Alpha Project'
                          PROJECT_COMPANY:
                            type: string
                            example: abc12345-1234-1234-1234-abc123456789
                          PID_OLD:
                            type: string
                            example: null
                            nullable: true
                          client:
                            type: string
                            example: null
                            nullable: true
                          users:
                            type: array
                            example: []
                    workcenters:
                      type: array
                      example:
                        -
                          WORKCENTER_ID: 3
                          WORKCENTER_COMPANY: abc12345-1234-1234-1234-abc123456789
                          WORKCENTER_NAME: 'Main Office'
                          WORKCENTER_COUNTRY: ES
                          WORKCENTER_REGION: Madrid
                          WORKCENTER_CITY: Madrid
                          WORKCENTER_ADDRESS: 'Calle Gran Via 1'
                          WORKCENTER_CP: '28013'
                          WORKCENTER_COORDINATES: '40.416775,-3.703790'
                          WORKCENTER_CREATION_DATE: '2023-01-15 09:00:00'
                          WCID_OLD: null
                      items:
                        type: object
                        properties:
                          WORKCENTER_ID:
                            type: integer
                            example: 3
                          WORKCENTER_COMPANY:
                            type: string
                            example: abc12345-1234-1234-1234-abc123456789
                          WORKCENTER_NAME:
                            type: string
                            example: 'Main Office'
                          WORKCENTER_COUNTRY:
                            type: string
                            example: ES
                          WORKCENTER_REGION:
                            type: string
                            example: Madrid
                          WORKCENTER_CITY:
                            type: string
                            example: Madrid
                          WORKCENTER_ADDRESS:
                            type: string
                            example: 'Calle Gran Via 1'
                          WORKCENTER_CP:
                            type: string
                            example: '28013'
                          WORKCENTER_COORDINATES:
                            type: string
                            example: '40.416775,-3.703790'
                          WORKCENTER_CREATION_DATE:
                            type: string
                            example: '2023-01-15 09:00:00'
                          WCID_OLD:
                            type: string
                            example: null
                            nullable: true
                example:
                  -
                    USER_ID: 101
                    USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                    USER_NAME: 'Jane Smith'
                    USER_EMAIL: jane.smith@acme.example
                    USER_TOKEN: ''
                    USER_IMAGE: null
                    USER_NIF: null
                    USER_AFFILIATION: null
                    USER_WORKING_TIME: null
                    USER_USERNAME: jane.smith@acme.example
                    USER_PASWORD: ''
                    projects:
                      -
                        PROJECT_ID: 7
                        PROJECT_NAME: 'Alpha Project'
                        PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                        PID_OLD: null
                        client: null
                        users: []
                    workcenters:
                      -
                        WORKCENTER_ID: 3
                        WORKCENTER_COMPANY: abc12345-1234-1234-1234-abc123456789
                        WORKCENTER_NAME: 'Main Office'
                        WORKCENTER_COUNTRY: ES
                        WORKCENTER_REGION: Madrid
                        WORKCENTER_CITY: Madrid
                        WORKCENTER_ADDRESS: 'Calle Gran Via 1'
                        WORKCENTER_CP: '28013'
                        WORKCENTER_COORDINATES: '40.416775,-3.703790'
                        WORKCENTER_CREATION_DATE: '2023-01-15 09:00:00'
                        WCID_OLD: null
                  -
                    USER_ID: 102
                    USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                    USER_NAME: 'John Doe'
                    USER_EMAIL: john.doe@acme.example
                    USER_TOKEN: ''
                    USER_IMAGE: null
                    USER_NIF: null
                    USER_AFFILIATION: null
                    USER_WORKING_TIME: null
                    USER_USERNAME: john.doe@acme.example
                    USER_PASWORD: ''
                    projects: []
                    workcenters: []
      tags:
        - Employees
    post:
      summary: 'Create a new employee.'
      operationId: createANewEmployee
      description: "Creates an employee record under the authenticated company. Optionally\naccepts a profile picture via multipart form upload."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  USER_ID: 103
                  USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                  USER_NAME: 'Alice Doe'
                  USER_EMAIL: alice.doe@acme.example
                  USER_TOKEN: ''
                  USER_IMAGE: null
                  USER_NIF: null
                  USER_AFFILIATION: null
                  USER_WORKING_TIME: null
                  USER_USERNAME: alice.doe@acme.example
                  USER_PASWORD: ''
                  projects: []
                  workcenters: []
                properties:
                  USER_ID:
                    type: integer
                    example: 103
                  USER_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  USER_NAME:
                    type: string
                    example: 'Alice Doe'
                  USER_EMAIL:
                    type: string
                    example: alice.doe@acme.example
                  USER_TOKEN:
                    type: string
                    example: ''
                  USER_IMAGE:
                    type: string
                    example: null
                    nullable: true
                  USER_NIF:
                    type: string
                    example: null
                    nullable: true
                  USER_AFFILIATION:
                    type: string
                    example: null
                    nullable: true
                  USER_WORKING_TIME:
                    type: string
                    example: null
                    nullable: true
                  USER_USERNAME:
                    type: string
                    example: alice.doe@acme.example
                  USER_PASWORD:
                    type: string
                    example: ''
                  projects:
                    type: array
                    example: []
                  workcenters:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Validation failed'
                  errors:
                    user_email:
                      - 'The user email field is required.'
                      - 'The user email has already been taken.'
                    user_pin:
                      - 'The user pin field is required.'
                    user_name:
                      - 'The user name field is required.'
                properties:
                  message:
                    type: string
                    example: 'Validation failed'
                  errors:
                    type: object
                    properties:
                      user_email:
                        type: array
                        example:
                          - 'The user email field is required.'
                          - 'The user email has already been taken.'
                        items:
                          type: string
                      user_pin:
                        type: array
                        example:
                          - 'The user pin field is required.'
                        items:
                          type: string
                      user_name:
                        type: array
                        example:
                          - 'The user name field is required.'
                        items:
                          type: string
      tags:
        - Employees
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                user_email:
                  type: string
                  description: "The employee's unique email address."
                  example: alice@acme.example
                user_pin:
                  type: string
                  description: "The employee's PIN code."
                  example: '1234'
                user_name:
                  type: string
                  description: "The employee's full name."
                  example: 'Alice Doe'
                user_file:
                  type: string
                  format: binary
                  description: 'optional Profile picture (JPEG, PNG or JPG). Max size controlled by MAX_FILE_SIZE_AVATAR env var (default 2 MB). Multipart form upload only.'
                  nullable: true
              required:
                - user_email
                - user_pin
                - user_name
  /company-apps/api/v2/user/login:
    post:
      summary: 'Employee login (deprecated — 410 Gone).'
      operationId: employeeLogindeprecated410Gone
      description: "This endpoint has been retired. Use Bearer token authentication instead.\nContact Intratime to obtain an API token."
      parameters: []
      responses:
        410:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error:
                    code: ENDPOINT_GONE
                    message: 'This login endpoint is no longer available. Access must now be requested formally.'
                    contact: support@intratime.es
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: ENDPOINT_GONE
                      message:
                        type: string
                        example: 'This login endpoint is no longer available. Access must now be requested formally.'
                      contact:
                        type: string
                        example: support@intratime.es
      tags:
        - Employees
  /company-apps/api/v2/user/my-profile:
    get:
      summary: 'Get my profile (deprecated — 410 Gone).'
      operationId: getMyProfiledeprecated410Gone
      description: 'This endpoint has been retired. Use `GET /company-apps/api/v2/user/{employee}` instead.'
      parameters: []
      responses:
        410:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error:
                    code: ENDPOINT_GONE
                    message: "The 'my-profile' endpoint has been retired. Please refer to the new alternative."
                    alternative_01: 'https://example.com/company-apps/api/v2/user/{employee_id}'
                    alternative_02: 'https://old.example.com/api/user/{employee_id}'
                    documentation: 'https://docs.example.com'
                    contact: support@intratime.es
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: ENDPOINT_GONE
                      message:
                        type: string
                        example: "The 'my-profile' endpoint has been retired. Please refer to the new alternative."
                      alternative_01:
                        type: string
                        example: 'https://example.com/company-apps/api/v2/user/{employee_id}'
                      alternative_02:
                        type: string
                        example: 'https://old.example.com/api/user/{employee_id}'
                      documentation:
                        type: string
                        example: 'https://docs.example.com'
                      contact:
                        type: string
                        example: support@intratime.es
      tags:
        - Employees
  /company-apps/api/v2/user/my-project:
    get:
      summary: 'Get my projects (deprecated — 410 Gone).'
      operationId: getMyProjectsdeprecated410Gone
      description: "This endpoint has been retired. Use `GET /company-apps/api/v2/user/{employee}` instead\n(the employee object includes their assigned projects)."
      parameters: []
      responses:
        410:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error:
                    code: ENDPOINT_GONE
                    message: "The 'my-project' endpoint has been retired. Please refer to the new alternative."
                    alternative_01: 'https://example.com/company-apps/api/v2/user/{employee_id}'
                    alternative_02: 'https://old.example.com/api/user/{employee_id}'
                    documentation: 'https://docs.example.com'
                    contact: support@intratime.es
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: ENDPOINT_GONE
                      message:
                        type: string
                        example: "The 'my-project' endpoint has been retired. Please refer to the new alternative."
                      alternative_01:
                        type: string
                        example: 'https://example.com/company-apps/api/v2/user/{employee_id}'
                      alternative_02:
                        type: string
                        example: 'https://old.example.com/api/user/{employee_id}'
                      documentation:
                        type: string
                        example: 'https://docs.example.com'
                      contact:
                        type: string
                        example: support@intratime.es
      tags:
        - Employees
  '/company-apps/api/v2/user/{employee_USER_ID}':
    get:
      summary: 'Get a single employee.'
      operationId: getASingleEmployee
      description: ''
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  USER_ID: 101
                  USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                  USER_NAME: 'Jane Smith'
                  USER_EMAIL: jane.smith@acme.example
                  USER_TOKEN: ''
                  USER_IMAGE: null
                  USER_NIF: null
                  USER_AFFILIATION: null
                  USER_WORKING_TIME: null
                  USER_USERNAME: jane.smith@acme.example
                  USER_PASWORD: ''
                  projects:
                    -
                      PROJECT_ID: 7
                      PROJECT_NAME: 'Alpha Project'
                      PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                      PID_OLD: null
                      client: null
                      users: []
                  workcenters:
                    -
                      WORKCENTER_ID: 3
                      WORKCENTER_COMPANY: abc12345-1234-1234-1234-abc123456789
                      WORKCENTER_NAME: 'Main Office'
                      WORKCENTER_COUNTRY: ES
                      WORKCENTER_REGION: Madrid
                      WORKCENTER_CITY: Madrid
                      WORKCENTER_ADDRESS: 'Calle Gran Via 1'
                      WORKCENTER_CP: '28013'
                      WORKCENTER_COORDINATES: '40.416775,-3.703790'
                      WORKCENTER_CREATION_DATE: '2023-01-15 09:00:00'
                      WCID_OLD: null
                properties:
                  USER_ID:
                    type: integer
                    example: 101
                  USER_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  USER_NAME:
                    type: string
                    example: 'Jane Smith'
                  USER_EMAIL:
                    type: string
                    example: jane.smith@acme.example
                  USER_TOKEN:
                    type: string
                    example: ''
                  USER_IMAGE:
                    type: string
                    example: null
                    nullable: true
                  USER_NIF:
                    type: string
                    example: null
                    nullable: true
                  USER_AFFILIATION:
                    type: string
                    example: null
                    nullable: true
                  USER_WORKING_TIME:
                    type: string
                    example: null
                    nullable: true
                  USER_USERNAME:
                    type: string
                    example: jane.smith@acme.example
                  USER_PASWORD:
                    type: string
                    example: ''
                  projects:
                    type: array
                    example:
                      -
                        PROJECT_ID: 7
                        PROJECT_NAME: 'Alpha Project'
                        PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                        PID_OLD: null
                        client: null
                        users: []
                    items:
                      type: object
                      properties:
                        PROJECT_ID:
                          type: integer
                          example: 7
                        PROJECT_NAME:
                          type: string
                          example: 'Alpha Project'
                        PROJECT_COMPANY:
                          type: string
                          example: abc12345-1234-1234-1234-abc123456789
                        PID_OLD:
                          type: string
                          example: null
                          nullable: true
                        client:
                          type: string
                          example: null
                          nullable: true
                        users:
                          type: array
                          example: []
                  workcenters:
                    type: array
                    example:
                      -
                        WORKCENTER_ID: 3
                        WORKCENTER_COMPANY: abc12345-1234-1234-1234-abc123456789
                        WORKCENTER_NAME: 'Main Office'
                        WORKCENTER_COUNTRY: ES
                        WORKCENTER_REGION: Madrid
                        WORKCENTER_CITY: Madrid
                        WORKCENTER_ADDRESS: 'Calle Gran Via 1'
                        WORKCENTER_CP: '28013'
                        WORKCENTER_COORDINATES: '40.416775,-3.703790'
                        WORKCENTER_CREATION_DATE: '2023-01-15 09:00:00'
                        WCID_OLD: null
                    items:
                      type: object
                      properties:
                        WORKCENTER_ID:
                          type: integer
                          example: 3
                        WORKCENTER_COMPANY:
                          type: string
                          example: abc12345-1234-1234-1234-abc123456789
                        WORKCENTER_NAME:
                          type: string
                          example: 'Main Office'
                        WORKCENTER_COUNTRY:
                          type: string
                          example: ES
                        WORKCENTER_REGION:
                          type: string
                          example: Madrid
                        WORKCENTER_CITY:
                          type: string
                          example: Madrid
                        WORKCENTER_ADDRESS:
                          type: string
                          example: 'Calle Gran Via 1'
                        WORKCENTER_CP:
                          type: string
                          example: '28013'
                        WORKCENTER_COORDINATES:
                          type: string
                          example: '40.416775,-3.703790'
                        WORKCENTER_CREATION_DATE:
                          type: string
                          example: '2023-01-15 09:00:00'
                        WCID_OLD:
                          type: string
                          example: null
                          nullable: true
      tags:
        - Employees
    put:
      summary: 'Update an employee.'
      operationId: updateAnEmployee
      description: "Updates an employee's profile. All fields are required except `user_pin`\nand `user_file`. Providing `user_file` replaces any existing profile picture."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  USER_ID: 101
                  USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                  USER_NAME: 'Jane Smith Updated'
                  USER_EMAIL: jane.updated@acme.example
                  USER_TOKEN: ''
                  USER_IMAGE: null
                  USER_NIF: null
                  USER_AFFILIATION: null
                  USER_WORKING_TIME: null
                  USER_USERNAME: jane.updated@acme.example
                  USER_PASWORD: ''
                  projects: []
                  workcenters: []
                properties:
                  USER_ID:
                    type: integer
                    example: 101
                  USER_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  USER_NAME:
                    type: string
                    example: 'Jane Smith Updated'
                  USER_EMAIL:
                    type: string
                    example: jane.updated@acme.example
                  USER_TOKEN:
                    type: string
                    example: ''
                  USER_IMAGE:
                    type: string
                    example: null
                    nullable: true
                  USER_NIF:
                    type: string
                    example: null
                    nullable: true
                  USER_AFFILIATION:
                    type: string
                    example: null
                    nullable: true
                  USER_WORKING_TIME:
                    type: string
                    example: null
                    nullable: true
                  USER_USERNAME:
                    type: string
                    example: jane.updated@acme.example
                  USER_PASWORD:
                    type: string
                    example: ''
                  projects:
                    type: array
                    example: []
                  workcenters:
                    type: array
                    example: []
        422:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Validation failed'
                  errors:
                    user_email:
                      - 'The user email field is required.'
                      - 'The user email has already been taken.'
                    user_pin:
                      - 'The user pin field is required.'
                    user_name:
                      - 'The user name field is required.'
                properties:
                  message:
                    type: string
                    example: 'Validation failed'
                  errors:
                    type: object
                    properties:
                      user_email:
                        type: array
                        example:
                          - 'The user email field is required.'
                          - 'The user email has already been taken.'
                        items:
                          type: string
                      user_pin:
                        type: array
                        example:
                          - 'The user pin field is required.'
                        items:
                          type: string
                      user_name:
                        type: array
                        example:
                          - 'The user name field is required.'
                        items:
                          type: string
      tags:
        - Employees
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                user_email:
                  type: string
                  description: "The employee's email address (must be unique, may be unchanged)."
                  example: alice@acme.example
                user_pin:
                  type: string
                  description: 'optional New PIN code. Omit to keep the existing PIN.'
                  example: '5678'
                  nullable: true
                user_name:
                  type: string
                  description: "The employee's full name."
                  example: 'Alice Smith'
                user_file:
                  type: string
                  format: binary
                  description: 'optional New profile picture (JPEG, PNG or JPG). Max size controlled by MAX_FILE_SIZE_AVATAR env var (default 2 MB). Replaces the current picture. Multipart form upload only.'
                  nullable: true
              required:
                - user_email
                - user_name
    delete:
      summary: 'Delete an employee.'
      operationId: deleteAnEmployee
      description: 'Soft-deletes the employee record. Returns an empty 204 response on success.'
      parameters: []
      responses:
        204:
          description: 'Employee deleted'
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Employees
    parameters:
      -
        in: path
        name: employee_USER_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: employee
        description: "The employee's ID."
        example: 101
        required: true
        schema:
          type: integer
  /company-apps/api/v2/expenses:
    get:
      summary: 'List expense types.'
      operationId: listExpenseTypes
      description: "Returns the expense-type catalogue for the authenticated company as a flat\nJSON array. There are no filters — all active expense types are returned.\n\nEach entry includes an `EXPENSE_ICON` URL (may be an empty string when no\nicon has been configured)."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    EXPENSE_ID:
                      type: integer
                      example: 1
                    EXPENSE_NAME:
                      type: string
                      example: Travel
                    EXPENSE_ICON:
                      type: string
                      example: 'https://cdn.example.com/expenses/travel.png'
                    EXPENSE_CC:
                      type: string
                      example: TRV
                example:
                  -
                    EXPENSE_ID: 1
                    EXPENSE_NAME: Travel
                    EXPENSE_ICON: 'https://cdn.example.com/expenses/travel.png'
                    EXPENSE_CC: TRV
                  -
                    EXPENSE_ID: 2
                    EXPENSE_NAME: Meal
                    EXPENSE_ICON: 'https://cdn.example.com/expenses/meal.png'
                    EXPENSE_CC: MLT
                  -
                    EXPENSE_ID: 3
                    EXPENSE_NAME: Accommodation
                    EXPENSE_ICON: ''
                    EXPENSE_CC: ACC
      tags:
        - Expenses
  /company-apps/api/v2/project:
    get:
      summary: 'List all projects.'
      operationId: listAllProjects
      description: "Returns all projects belonging to the authenticated company, each with\ntheir associated client and assigned employees."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    PROJECT_ID:
                      type: integer
                      example: 7
                    PROJECT_NAME:
                      type: string
                      example: 'Alpha Project'
                    PROJECT_COMPANY:
                      type: string
                      example: abc12345-1234-1234-1234-abc123456789
                    PID_OLD:
                      type: string
                      example: null
                      nullable: true
                    client:
                      type: object
                      properties:
                        CLIENT_ID:
                          type: integer
                          example: 10
                        CLIENT_COMPANY:
                          type: string
                          example: abc12345-1234-1234-1234-abc123456789
                        CLIENT_NAME:
                          type: string
                          example: 'Beta Solutions Ltd.'
                        CLIENT_COUNTRY:
                          type: string
                          example: ES
                        CLIENT_REGION:
                          type: string
                          example: Catalonia
                        CLIENT_CITY:
                          type: string
                          example: Barcelona
                        CLIENT_ADDRESS:
                          type: string
                          example: 'Passeig de Gracia 100'
                        CLIENT_CP:
                          type: string
                          example: '08008'
                        CLIENT_COORDINATES:
                          type: string
                          example: '41.396041,2.161047'
                        CID_OLD:
                          type: string
                          example: null
                          nullable: true
                    users:
                      type: array
                      example:
                        -
                          USER_ID: 101
                          USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                          USER_NAME: 'Jane Smith'
                          USER_EMAIL: jane.smith@acme.example
                          USER_TOKEN: ''
                          USER_IMAGE: null
                          USER_NIF: null
                          USER_AFFILIATION: null
                          USER_WORKING_TIME: null
                          USER_USERNAME: jane.smith@acme.example
                          USER_PASWORD: ''
                          projects: []
                          workcenters: []
                      items:
                        type: object
                        properties:
                          USER_ID:
                            type: integer
                            example: 101
                          USER_COMPANY:
                            type: string
                            example: abc12345-1234-1234-1234-abc123456789
                          USER_NAME:
                            type: string
                            example: 'Jane Smith'
                          USER_EMAIL:
                            type: string
                            example: jane.smith@acme.example
                          USER_TOKEN:
                            type: string
                            example: ''
                          USER_IMAGE:
                            type: string
                            example: null
                            nullable: true
                          USER_NIF:
                            type: string
                            example: null
                            nullable: true
                          USER_AFFILIATION:
                            type: string
                            example: null
                            nullable: true
                          USER_WORKING_TIME:
                            type: string
                            example: null
                            nullable: true
                          USER_USERNAME:
                            type: string
                            example: jane.smith@acme.example
                          USER_PASWORD:
                            type: string
                            example: ''
                          projects:
                            type: array
                            example: []
                          workcenters:
                            type: array
                            example: []
                example:
                  -
                    PROJECT_ID: 7
                    PROJECT_NAME: 'Alpha Project'
                    PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    PID_OLD: null
                    client:
                      CLIENT_ID: 10
                      CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                      CLIENT_NAME: 'Beta Solutions Ltd.'
                      CLIENT_COUNTRY: ES
                      CLIENT_REGION: Catalonia
                      CLIENT_CITY: Barcelona
                      CLIENT_ADDRESS: 'Passeig de Gracia 100'
                      CLIENT_CP: '08008'
                      CLIENT_COORDINATES: '41.396041,2.161047'
                      CID_OLD: null
                    users:
                      -
                        USER_ID: 101
                        USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                        USER_NAME: 'Jane Smith'
                        USER_EMAIL: jane.smith@acme.example
                        USER_TOKEN: ''
                        USER_IMAGE: null
                        USER_NIF: null
                        USER_AFFILIATION: null
                        USER_WORKING_TIME: null
                        USER_USERNAME: jane.smith@acme.example
                        USER_PASWORD: ''
                        projects: []
                        workcenters: []
      tags:
        - Projects
    post:
      summary: 'Create a new project.'
      operationId: createANewProject
      description: "Creates a project under the authenticated company and optionally assigns\nemployees. Returns the created project with its client and assigned users."
      parameters: []
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  PROJECT_ID: 8
                  PROJECT_NAME: 'Beta Project'
                  PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  PID_OLD: null
                  client:
                    CLIENT_ID: 11
                    CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME: 'Gamma Industries S.A.'
                    CLIENT_COUNTRY: ES
                    CLIENT_REGION: Valencia
                    CLIENT_CITY: Valencia
                    CLIENT_ADDRESS: 'Avinguda del Regne de Valencia 25'
                    CLIENT_CP: '46005'
                    CLIENT_COORDINATES: '39.469903,-0.376288'
                    CID_OLD: null
                  users: []
                properties:
                  PROJECT_ID:
                    type: integer
                    example: 8
                  PROJECT_NAME:
                    type: string
                    example: 'Beta Project'
                  PROJECT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  PID_OLD:
                    type: string
                    example: null
                    nullable: true
                  client:
                    type: object
                    properties:
                      CLIENT_ID:
                        type: integer
                        example: 11
                      CLIENT_COMPANY:
                        type: string
                        example: abc12345-1234-1234-1234-abc123456789
                      CLIENT_NAME:
                        type: string
                        example: 'Gamma Industries S.A.'
                      CLIENT_COUNTRY:
                        type: string
                        example: ES
                      CLIENT_REGION:
                        type: string
                        example: Valencia
                      CLIENT_CITY:
                        type: string
                        example: Valencia
                      CLIENT_ADDRESS:
                        type: string
                        example: 'Avinguda del Regne de Valencia 25'
                      CLIENT_CP:
                        type: string
                        example: '46005'
                      CLIENT_COORDINATES:
                        type: string
                        example: '39.469903,-0.376288'
                      CID_OLD:
                        type: string
                        example: null
                        nullable: true
                  users:
                    type: array
                    example: []
      tags:
        - Projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "The project's name."
                  example: 'Beta Project'
                client:
                  type: integer
                  description: 'The client ID to associate with the project (must belong to the authenticated company).'
                  example: 11
                user_ids:
                  type: string
                  description: 'optional Comma-separated list of employee IDs to assign to the project (each must belong to the authenticated company).'
                  example: '101,102'
                  nullable: true
              required:
                - name
                - client
  '/company-apps/api/v2/project/{PROJECT_ID}':
    get:
      summary: 'Get a single project.'
      operationId: getASingleProject
      description: ''
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  PROJECT_ID: 7
                  PROJECT_NAME: 'Alpha Project'
                  PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  PID_OLD: null
                  client:
                    CLIENT_ID: 10
                    CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME: 'Beta Solutions Ltd.'
                    CLIENT_COUNTRY: ES
                    CLIENT_REGION: Catalonia
                    CLIENT_CITY: Barcelona
                    CLIENT_ADDRESS: 'Passeig de Gracia 100'
                    CLIENT_CP: '08008'
                    CLIENT_COORDINATES: '41.396041,2.161047'
                    CID_OLD: null
                  users:
                    -
                      USER_ID: 101
                      USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                      USER_NAME: 'Jane Smith'
                      USER_EMAIL: jane.smith@acme.example
                      USER_TOKEN: ''
                      USER_IMAGE: null
                      USER_NIF: null
                      USER_AFFILIATION: null
                      USER_WORKING_TIME: null
                      USER_USERNAME: jane.smith@acme.example
                      USER_PASWORD: ''
                      projects: []
                      workcenters: []
                properties:
                  PROJECT_ID:
                    type: integer
                    example: 7
                  PROJECT_NAME:
                    type: string
                    example: 'Alpha Project'
                  PROJECT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  PID_OLD:
                    type: string
                    example: null
                    nullable: true
                  client:
                    type: object
                    properties:
                      CLIENT_ID:
                        type: integer
                        example: 10
                      CLIENT_COMPANY:
                        type: string
                        example: abc12345-1234-1234-1234-abc123456789
                      CLIENT_NAME:
                        type: string
                        example: 'Beta Solutions Ltd.'
                      CLIENT_COUNTRY:
                        type: string
                        example: ES
                      CLIENT_REGION:
                        type: string
                        example: Catalonia
                      CLIENT_CITY:
                        type: string
                        example: Barcelona
                      CLIENT_ADDRESS:
                        type: string
                        example: 'Passeig de Gracia 100'
                      CLIENT_CP:
                        type: string
                        example: '08008'
                      CLIENT_COORDINATES:
                        type: string
                        example: '41.396041,2.161047'
                      CID_OLD:
                        type: string
                        example: null
                        nullable: true
                  users:
                    type: array
                    example:
                      -
                        USER_ID: 101
                        USER_COMPANY: abc12345-1234-1234-1234-abc123456789
                        USER_NAME: 'Jane Smith'
                        USER_EMAIL: jane.smith@acme.example
                        USER_TOKEN: ''
                        USER_IMAGE: null
                        USER_NIF: null
                        USER_AFFILIATION: null
                        USER_WORKING_TIME: null
                        USER_USERNAME: jane.smith@acme.example
                        USER_PASWORD: ''
                        projects: []
                        workcenters: []
                    items:
                      type: object
                      properties:
                        USER_ID:
                          type: integer
                          example: 101
                        USER_COMPANY:
                          type: string
                          example: abc12345-1234-1234-1234-abc123456789
                        USER_NAME:
                          type: string
                          example: 'Jane Smith'
                        USER_EMAIL:
                          type: string
                          example: jane.smith@acme.example
                        USER_TOKEN:
                          type: string
                          example: ''
                        USER_IMAGE:
                          type: string
                          example: null
                          nullable: true
                        USER_NIF:
                          type: string
                          example: null
                          nullable: true
                        USER_AFFILIATION:
                          type: string
                          example: null
                          nullable: true
                        USER_WORKING_TIME:
                          type: string
                          example: null
                          nullable: true
                        USER_USERNAME:
                          type: string
                          example: jane.smith@acme.example
                        USER_PASWORD:
                          type: string
                          example: ''
                        projects:
                          type: array
                          example: []
                        workcenters:
                          type: array
                          example: []
      tags:
        - Projects
    put:
      summary: 'Update a project.'
      operationId: updateAProject
      description: "Updates the project name, client association, and employee assignments.\nProviding `user_ids` **replaces** the existing employee list entirely."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  PROJECT_ID: 7
                  PROJECT_NAME: 'Alpha Project Updated'
                  PROJECT_COMPANY: abc12345-1234-1234-1234-abc123456789
                  PID_OLD: null
                  client:
                    CLIENT_ID: 10
                    CLIENT_COMPANY: abc12345-1234-1234-1234-abc123456789
                    CLIENT_NAME: 'Beta Solutions Ltd.'
                    CLIENT_COUNTRY: ES
                    CLIENT_REGION: Catalonia
                    CLIENT_CITY: Barcelona
                    CLIENT_ADDRESS: 'Passeig de Gracia 100'
                    CLIENT_CP: '08008'
                    CLIENT_COORDINATES: '41.396041,2.161047'
                    CID_OLD: null
                  users: []
                properties:
                  PROJECT_ID:
                    type: integer
                    example: 7
                  PROJECT_NAME:
                    type: string
                    example: 'Alpha Project Updated'
                  PROJECT_COMPANY:
                    type: string
                    example: abc12345-1234-1234-1234-abc123456789
                  PID_OLD:
                    type: string
                    example: null
                    nullable: true
                  client:
                    type: object
                    properties:
                      CLIENT_ID:
                        type: integer
                        example: 10
                      CLIENT_COMPANY:
                        type: string
                        example: abc12345-1234-1234-1234-abc123456789
                      CLIENT_NAME:
                        type: string
                        example: 'Beta Solutions Ltd.'
                      CLIENT_COUNTRY:
                        type: string
                        example: ES
                      CLIENT_REGION:
                        type: string
                        example: Catalonia
                      CLIENT_CITY:
                        type: string
                        example: Barcelona
                      CLIENT_ADDRESS:
                        type: string
                        example: 'Passeig de Gracia 100'
                      CLIENT_CP:
                        type: string
                        example: '08008'
                      CLIENT_COORDINATES:
                        type: string
                        example: '41.396041,2.161047'
                      CID_OLD:
                        type: string
                        example: null
                        nullable: true
                  users:
                    type: array
                    example: []
      tags:
        - Projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "The project's name."
                  example: 'Alpha Project Updated'
                client:
                  type: integer
                  description: 'The client ID to associate with the project (must belong to the authenticated company).'
                  example: 10
                user_ids:
                  type: string
                  description: 'optional Comma-separated list of employee IDs. Replaces all existing assignments.'
                  example: '101'
                  nullable: true
              required:
                - name
                - client
    parameters:
      -
        in: path
        name: PROJECT_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: project
        description: "The project's ID."
        example: 7
        required: true
        schema:
          type: integer
  '/company-apps/api/v2/project/{project_PROJECT_ID}':
    delete:
      summary: 'Delete a project.'
      operationId: deleteAProject
      description: 'Soft-deletes the project record. Returns an empty 204 response on success.'
      parameters: []
      responses:
        204:
          description: 'Project deleted'
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Projects
    parameters:
      -
        in: path
        name: project_PROJECT_ID
        description: ''
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: project
        description: "The project's ID."
        example: 7
        required: true
        schema:
          type: integer
