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

# Create a timesheet

> Create a timesheet

```jsonc Body raw (json) wrap expandable theme={null}
{
  "user_id",// required | integer | existing user id
  "clock_in_title",// required | string | max:255
  "clock_out_title",// nullable | string | max:255
  "clock_in_method",// required | string | acceptable_values: automatic,manual
  "clock_out_method",// nullable | string | acceptable_values: automatic,manual
  "clock_in_time",// required | timestamp
  "clock_out_time",// nullable | timestamp
  "clock_in_notes",// nullable | string | max:255
  "clock_out_notes",// nullable | string | max:255
  "clock_in_location",// optional | string
  "clock_out_location",// optional | string
  "job_id",// nullable | integer | existing job id
  "subtask_id",// nullable | integer | existing subtask id
  "type",// nullable | string | acceptable_values: general,job
  "is_historical"// nullable | boolean
}
```


## OpenAPI

````yaml post /timesheets
openapi: 3.0.0
info:
  title: FieldPulse API
  description: >-
    REST API for the FieldPulse field service management platform.


    **Authentication:** All requests require an `x-api-key` header. Contact
    support@fieldpulse.com to obtain your API key.


    **Important:** The API Playground below makes live requests against your
    production data. Use caution when testing write operations (POST, PUT,
    DELETE).
  version: 1.0.0
servers:
  - url: https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Assets
    description: Endpoints related to assets
  - name: Assets Category
    description: Endpoints related to assets category
  - name: Comments
    description: Endpoints related to comments
  - name: Company Profile
    description: Endpoints related to contracts
  - name: Contracts
    description: Endpoints related to contracts
  - name: Customers
    description: Endpoints related to customers
  - name: Custom Fields
    description: Endpoints related to custom fields
  - name: Estimates
    description: Endpoints related to estimates
  - name: Invoices
  - name: Items
  - name: Jobs
  - name: Lead Source
  - name: Locations
  - name: Material Lists
  - name: Payments
  - name: Pipeline Status
  - name: Projects
  - name: Purchase Orders
  - name: Subtasks
  - name: Tags
  - name: Teams
  - name: Timesheets
  - name: Users
  - name: Vendors
  - name: Version
paths:
  /timesheets:
    post:
      tags:
        - Timesheets
      summary: Create a timesheet
      description: Create a timesheet
      operationId: postTimesheets
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
                  description: Existing user id.
                clock_in_title:
                  type: string
                  maxLength: 255
                clock_out_title:
                  type: string
                  nullable: true
                  maxLength: 255
                clock_in_method:
                  type: string
                  enum:
                    - automatic
                    - manual
                clock_out_method:
                  type: string
                  nullable: true
                  enum:
                    - automatic
                    - manual
                clock_in_time:
                  type: integer
                  description: Unix timestamp.
                clock_out_time:
                  type: integer
                  nullable: true
                  description: Unix timestamp.
                clock_in_notes:
                  type: string
                  nullable: true
                  maxLength: 255
                clock_out_notes:
                  type: string
                  nullable: true
                  maxLength: 255
                clock_in_location:
                  type: string
                clock_out_location:
                  type: string
                job_id:
                  type: integer
                  nullable: true
                  description: Existing job id.
                subtask_id:
                  type: integer
                  nullable: true
                  description: Existing subtask id.
                type:
                  type: string
                  nullable: true
                  enum:
                    - general
                    - job
                is_historical:
                  type: boolean
                  nullable: true
              required:
                - user_id
                - clock_in_title
                - clock_in_method
                - clock_in_time
            example:
              user_id: 1
              clock_in_title: some string
              clock_out_title: some string
              clock_in_method: automatic
              clock_out_method: automatic
              clock_in_time: 1234567890
              clock_out_time: 1234567890
              clock_in_notes: some string
              clock_out_notes: some string
              clock_in_location: some string
              clock_out_location: some string
              job_id: 1
              subtask_id: 1
              type: general
              is_historical: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                    description: false when the request succeeds.
                    example: false
                  response:
                    type: object
                    description: The created record.
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                error: true
                errors:
                  - error message
                  - error message
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                message: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              example:
                message: Request URL not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                message: Internal Server Error
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

## Related topics

- [How to Use Employee Timesheets](/jobs/timesheets/employee-timesheets.md)
- [How to Create Timesheet Reports](/reporting/raw-data/timesheet-reports.md)
- [How to Create Job Reports](/reporting/raw-data/job-reports.md)
- [How to Track Lunch Breaks](/scheduling-dispatch/working-hours/tracking-lunch-breaks.md)
- [How to Create Site Visit Reports](/reporting/raw-data/site-visit-reports.md)


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