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

# Automatic clock-in or clock-out based on current status

> Performs an automatic clock-in if no open work entry exists, or clock-out if there's an open work entry. When closing with `withIncidence: true`, creates an incidence alert for the employee (useful for entries open from previous days).



## OpenAPI

````yaml POST /schedule/v1/work-entries/clock
openapi: 3.0.0
info:
  description: ''
  version: 3.0.0
  title: Sesame Public API
servers:
  - url: https://api-{region}.sesametime.com
    variables:
      region:
        default: eu1
security: []
tags: []
paths:
  /schedule/v1/work-entries/clock:
    post:
      tags:
        - Work Entries
      summary: Automatic clock-in or clock-out based on current status
      description: >-
        Performs an automatic clock-in if no open work entry exists, or
        clock-out if there's an open work entry. When closing with
        `withIncidence: true`, creates an incidence alert for the employee
        (useful for entries open from previous days).
      operationId: Clock
      requestBody:
        description: Clock request data
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                employeeId:
                  type: string
                  format: uuid
                  description: The employee's unique identifier
                workEntryIn:
                  type: object
                  description: Entry data (coordinates)
                  properties:
                    coordinates:
                      type: object
                      description: GPS coordinates of the clock action
                      properties:
                        latitude:
                          type: number
                          format: float
                          minimum: -90
                          maximum: 90
                          description: Latitude coordinate
                        longitude:
                          type: number
                          format: float
                          minimum: -180
                          maximum: 180
                          description: Longitude coordinate
                workCheckTypeId:
                  type: string
                  format: uuid
                  nullable: true
                  description: >-
                    Work check type ID (only applies to clock-in). Must be
                    assigned to the employee.
                workBreakId:
                  type: string
                  format: uuid
                  nullable: true
                  description: Work break ID for pause entries (only applies to clock-in)
                withIncidence:
                  type: boolean
                  default: false
                  description: >-
                    If true and a clock-out is performed, creates an incidence
                    of type 'closed_api'. The employee will be notified about
                    this incidence. Useful for closing entries that were open
                    from previous days.
              required:
                - employeeId
            examples:
              basic_clock:
                summary: Basic clock without coordinates
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
              clock_with_coordinates:
                summary: Clock with GPS coordinates
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  workEntryIn:
                    coordinates:
                      latitude: 40.7128
                      longitude: -74.006
              clock_with_incidence:
                summary: Clock-out with incidence (for open entries from previous days)
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  withIncidence: true
              clock_with_work_type:
                summary: Clock-in with specific work check type
                value:
                  employeeId: 550e8400-e29b-41d4-a716-446655440000
                  workCheckTypeId: 660e8400-e29b-41d4-a716-446655440001
      responses:
        '200':
          description: Clock action performed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    description: Work entry data
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier of the work entry
                      workCheckTypeId:
                        type: string
                        format: uuid
                        nullable: true
                        description: Work check type ID if specified
                      employee:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          firstName:
                            type: string
                            example: Lucas
                          lastName:
                            type: string
                            example: García
                          secondLastName:
                            type: string
                            description: >-
                              The employee's second last name field is only
                              available in Mexico and Colombia
                            nullable: true
                          email:
                            type: string
                            format: email
                          workStatus:
                            type: string
                            enum:
                              - online
                              - offline
                              - paused
                              - remote
                          imageProfileURL:
                            type: string
                            example: >-
                              https://sesame-v2-prod-companies.s3.eu-west-3.amazonaws.com/48351485-1659-413d-bf7f-3ca34fadb521/public-read/g892f1fb-55a3-4e32-9cc9-7c19faa70gaa.png
                          code:
                            type: integer
                            example: 1
                          pin:
                            type: integer
                            example: 1000
                          phone:
                            type: string
                            example: +34 111 11 11 11
                          company:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                              name:
                                type: string
                              notificationEmail:
                                type: string
                                format: email
                              language:
                                type: string
                              createdAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                              updatedAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                          gender:
                            type: string
                            description: >-
                              Allowed values depend on the employee's company:


                              | Scenario | Allowed values |

                              |----------|----------------|

                              | MX with ADP or Nomitek integration | female,
                              male |

                              | All other companies | female, male, no_response,
                              non_binary_gender |
                            enum:
                              - female
                              - male
                              - no_response
                              - non_binary_gender
                          contractId:
                            type: string
                            description: The identifier of your internal employee contract
                          nid:
                            type: string
                            description: The National Identity Document of the employee
                          identityNumberType:
                            type: string
                            description: Primary identity number type
                            enum:
                              - dni
                              - nie
                              - rut
                              - other
                          secondaryIdentityNumberType:
                            type: string
                            description: Secondary identity number type
                            enum:
                              - dni
                              - nie
                              - rut
                              - other
                          secondaryNid:
                            type: string
                            description: >-
                              The Secondary National Identity Document of the
                              employee
                          ssn:
                            type: string
                            description: The Social Security Number of the employee
                          pricePerHour:
                            type: number
                            format: float
                            description: The Price per hour of the employee
                          accountNumber:
                            type: string
                            description: The Account Number of the employee
                          dateOfBirth:
                            type: string
                            format: date
                            description: ''
                          customFields:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                companyId:
                                  type: string
                                  format: uuid
                                name:
                                  type: string
                                slug:
                                  type: string
                                type:
                                  type: string
                                value:
                                  anyOf:
                                    - type: string
                                createdAt:
                                  type: string
                                  format: Y-m-dTH:i:sP
                                  example: '2020-01-01T10:00:00+01:00'
                                updatedAt:
                                  type: string
                                  format: Y-m-dTH:i:sP
                                  example: '2020-01-01T10:00:00+01:00'
                          createdAt:
                            type: string
                            format: Y-m-dTH:i:sP
                            example: '2020-01-01T10:00:00+01:00'
                          updatedAt:
                            type: string
                            format: Y-m-dTH:i:sP
                            example: '2020-01-01T10:00:00+01:00'
                          status:
                            type: string
                            enum:
                              - active
                              - inactive
                          children:
                            type: integer
                            example: 2
                          disability:
                            type: integer
                            example: 25
                          address:
                            type: string
                            description: The Address of the employee
                          postalCode:
                            type: string
                            description: The postal code of the employee
                          city:
                            type: string
                            description: The city of the employee
                          province:
                            type: string
                            description: The province of the employee
                          country:
                            type: string
                            description: >-
                              Two-letter country code (ISO alpha-2), e.g. 'ES'
                              for Spain, 'MX' for Mexico.
                            nullable: true
                            example: ES
                            minLength: 2
                            maxLength: 2
                          nationality:
                            type: string
                            description: >-
                              The nationality of the employee (deprecated: use
                              nationalities instead)
                            example: ES
                          nationalities:
                            type: array
                            items:
                              type: string
                            description: The nationalities of the employee
                            example:
                              - ES
                              - FR
                          personalMail:
                            type: string
                            format: email
                            nullable: true
                          maritalStatus:
                            type: string
                          emergencyPhone:
                            type: string
                            description: The emergency phone of the employee
                          description:
                            type: string
                            description: The description of the employee
                          salaryRange:
                            type: string
                            description: The salary range of the employee
                          studyLevel:
                            type: string
                            description: The study level of the employee
                          professionalCategoryCode:
                            type: string
                            description: >-
                              The professional category code of the employee.
                              Use contributionGroupId instead.
                            deprecated: true
                          professionalCategoryDescription:
                            type: string
                            description: >-
                              The professional category description of the
                              employee
                          bic:
                            type: string
                          jobChargeId:
                            type: string
                            description: The identifier of the job charge
                          jobChargeName:
                            type: string
                            description: The name of the job charge
                          jobChargeDescription:
                            type: string
                            description: >-
                              The description of the job position duties and
                              responsibilities
                            nullable: true
                          jobChargeCompetencies:
                            type: string
                            description: >-
                              The competencies and skills required for the job
                              position
                            nullable: true
                          language:
                            type: string
                            description: ISO language code
                            example: es-ES
                          workPhone:
                            type: string
                            description: work phone
                            example: +34 111 11 11 11
                          mainRecruiter:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                              firstName:
                                type: string
                                example: Lucas
                              lastName:
                                type: string
                                example: García
                              secondLastName:
                                type: string
                                description: >-
                                  The employee's second last name field is only
                                  available in Mexico and Colombia
                                nullable: true
                              imageProfileURL:
                                type: string
                                example: >-
                                  https://sesame-v2-prod-companies.s3.eu-west-3.amazonaws.com/48351485-1659-413d-bf7f-3ca34fadb521/public-read/g892f1fb-55a3-4e32-9cc9-7c19faa70gaa.png
                              email:
                                type: string
                                format: email
                              workStatus:
                                type: string
                                enum:
                                  - online
                                  - offline
                                  - paused
                                  - remote
                              workCheckTypeColor:
                                type: string
                                example: '#FF0000'
                              workCheckTypeName:
                                type: string
                                example: Remote
                          nfc:
                            type: string
                          contributionGroupId:
                            type: string
                            format: uuid
                      workEntryType:
                        type: string
                        enum:
                          - work
                          - pause
                        description: Type of work entry
                      workEntryIn:
                        type: object
                        description: Clock-in data
                        properties:
                          origin:
                            type: string
                            description: >-
                              Origin of the clock action (e.g., 'api', 'mobile',
                              'web')
                          date:
                            type: string
                            format: Y-m-dTH:i:sP
                            example: '2020-01-01T10:00:00+01:00'
                          coordinates:
                            type: object
                            nullable: true
                            description: GPS coordinates at clock-in
                            properties:
                              latitude:
                                type: number
                                format: float
                              longitude:
                                type: number
                                format: float
                          officeId:
                            type: string
                            format: uuid
                            nullable: true
                            description: Office ID if within office geofence
                      workEntryOut:
                        type: object
                        nullable: true
                        description: Clock-out data (null if entry is still open)
                        properties:
                          origin:
                            type: string
                          date:
                            type: string
                            format: Y-m-dTH:i:sP
                            example: '2020-01-01T10:00:00+01:00'
                          coordinates:
                            type: object
                            nullable: true
                            properties:
                              latitude:
                                type: number
                                format: float
                              longitude:
                                type: number
                                format: float
                          officeId:
                            type: string
                            format: uuid
                            nullable: true
                      hasIncidence:
                        type: boolean
                        description: Whether this work entry has an associated incidence
                      workedSeconds:
                        type: number
                        format: float
                        description: Total worked seconds (0 if entry is still open)
                      createdAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                      updatedAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                      deletedAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                    required:
                      - id
                      - employee
                      - workEntryType
                      - workEntryIn
                      - hasIncidence
                      - workedSeconds
                      - createdAt
                      - updatedAt
                  meta:
                    type: object
                    properties:
                      currentPage:
                        type: integer
                        example: 1
                      lastPage:
                        type: integer
                        example: 1
                      total:
                        type: integer
                        example: 1
                      perPage:
                        type: integer
                        example: 1
              examples:
                check_in_performed:
                  summary: Clock-in was performed (no open entry existed)
                  value:
                    data:
                      id: 770e8400-e29b-41d4-a716-446655440000
                      workCheckTypeId: null
                      employee:
                        id: 550e8400-e29b-41d4-a716-446655440000
                        firstName: John
                        lastName: Doe
                      workEntryType: work
                      workEntryIn:
                        origin: api
                        date: '2025-01-26T09:00:00+01:00'
                        coordinates:
                          latitude: 40.7128
                          longitude: -74.006
                        officeId: null
                      workEntryOut: null
                      hasIncidence: false
                      workedSeconds: 0
                      createdAt: '2025-01-26T09:00:00+01:00'
                      updatedAt: '2025-01-26T09:00:00+01:00'
                      deletedAt: null
                    meta: {}
                check_out_performed:
                  summary: Clock-out was performed (open entry was closed)
                  value:
                    data:
                      id: 770e8400-e29b-41d4-a716-446655440000
                      workCheckTypeId: null
                      employee:
                        id: 550e8400-e29b-41d4-a716-446655440000
                        firstName: John
                        lastName: Doe
                      workEntryType: work
                      workEntryIn:
                        origin: api
                        date: '2025-01-26T09:00:00+01:00'
                        coordinates: null
                        officeId: null
                      workEntryOut:
                        origin: api
                        date: '2025-01-26T18:00:00+01:00'
                        coordinates:
                          latitude: 40.7128
                          longitude: -74.006
                        officeId: null
                      hasIncidence: false
                      workedSeconds: 32400
                      createdAt: '2025-01-26T09:00:00+01:00'
                      updatedAt: '2025-01-26T18:00:00+01:00'
                      deletedAt: null
                    meta: {}
                check_out_with_incidence:
                  summary: Clock-out with incidence (entry was open from previous day)
                  value:
                    data:
                      id: 770e8400-e29b-41d4-a716-446655440000
                      workCheckTypeId: null
                      employee:
                        id: 550e8400-e29b-41d4-a716-446655440000
                        firstName: John
                        lastName: Doe
                      workEntryType: work
                      workEntryIn:
                        origin: api
                        date: '2025-01-25T09:00:00+01:00'
                        coordinates: null
                        officeId: null
                      workEntryOut:
                        origin: api
                        date: '2025-01-26T09:00:00+01:00'
                        coordinates: null
                        officeId: null
                      hasIncidence: true
                      workedSeconds: 86400
                      createdAt: '2025-01-25T09:00:00+01:00'
                      updatedAt: '2025-01-26T09:00:00+01:00'
                      deletedAt: null
                    meta: {}
        '404':
          description: Employee not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: employee_not_found
        '422':
          description: Unprocessable Entity - Validation failed for the provided data
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: invalid_coordinates
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````