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

# Update an employee

> Updates the fields you send. Set `termination_date` to terminate an employee and send
`null` to reinstate them. Employees are never deleted.




## OpenAPI

````yaml /openapi.yaml post /employees/{id}
openapi: 3.1.0
info:
  title: Hammock Partner API
  version: '2026-12-01'
  summary: Offer Hammock benefits inside your payroll product.
  description: |
    Preview of the Hammock Partner API. Nothing in this document is live yet:
    object shapes and endpoints may change before release.
  contact:
    name: Hammock
    email: support@usehammock.co
servers:
  - url: https://api.usehammock.co
    description: Live
  - url: https://api.sandbox.usehammock.co
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Employers
    description: The companies you offer Hammock benefits to.
  - name: Pay schedules
    description: >-
      How often an employer pays its employees, and the lock date of each pay
      period.
  - name: Employees
    description: An employer's roster, kept in sync by you.
  - name: Benefits
    description: The benefits an employer offers for a plan year.
  - name: Elections
    description: What an employee chose in the hosted enrollment flow.
  - name: Deductions
    description: >-
      Standing instructions for what to withhold and contribute on each
      paycheck.
  - name: Reimbursements
    description: One-time amounts to pay an employee through payroll.
  - name: Employer contributions
    description: >-
      One-time employer contributions made outside payroll, for year-end
      reporting.
  - name: Payrolls
    description: Payrolls you report to Hammock, with what was withheld and paid.
  - name: Pulls
    description: ACH debits from an employer's bank account.
  - name: Events
    description: A record of everything that changed.
  - name: Webhook endpoints
    description: Where Hammock delivers events.
  - name: Test helpers
    description: Sandbox-only endpoints that skip hosted flows and waiting periods.
paths:
  /employees/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - Employees
      summary: Update an employee
      description: >
        Updates the fields you send. Set `termination_date` to terminate an
        employee and send

        `null` to reinstate them. Employees are never deleted.
      operationId: updateEmployee
      parameters:
        - $ref: '#/components/parameters/HammockVersion'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmployeeUpdateParams'
            example:
              termination_date: '2027-06-30'
      responses:
        '200':
          description: The updated employee.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Employee'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: string
    HammockVersion:
      name: Hammock-Version
      in: header
      description: >-
        The API version to use for this request. Defaults to the version pinned
        to your API key.
      schema:
        type: string
      example: '2026-12-01'
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >-
        A unique value, up to 255 characters, that makes the request safe to
        retry for 24 hours.
      schema:
        type: string
        maxLength: 255
      example: 4f1c6a52-9d0e-4b7a-8a51-2f6f1c1b9e77
  schemas:
    EmployeeUpdateParams:
      type: object
      properties:
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        pay_schedule:
          type: string
        date_of_birth:
          type: string
          format: date
        ssn:
          type: string
          writeOnly: true
          pattern: ^\d{9}$
          description: Nine digits. Write-only.
        phone:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        hire_date:
          type: string
          format: date
        termination_date:
          type:
            - string
            - 'null'
          format: date
          description: Set to terminate the employee. Send `null` to reinstate.
        send_invitation:
          type: boolean
          description: Send `true` to email the employee an invitation now.
        metadata:
          $ref: '#/components/schemas/Metadata'
    Employee:
      type: object
      required:
        - id
        - object
        - employer
        - external_id
        - email
        - pay_schedule
        - status
        - enrollment_status
        - metadata
        - livemode
        - created
      properties:
        id:
          type: string
          examples:
            - emp_5Tg7Rw2nBx8P
        object:
          type: string
          const: employee
        employer:
          type: string
          examples:
            - empr_1Qx8Zt2eZvKYlo2C
        external_id:
          type: string
          description: Your ID for this worker. Unique within the employer.
          examples:
            - wrk_4821
        email:
          type: string
          format: email
          examples:
            - jordan.lee@acmerobotics.example
        first_name:
          type:
            - string
            - 'null'
          examples:
            - Jordan
        last_name:
          type:
            - string
            - 'null'
          examples:
            - Lee
        date_of_birth:
          type:
            - string
            - 'null'
          format: date
          examples:
            - '1991-06-14'
        ssn_last4:
          type:
            - string
            - 'null'
          description: Last four digits of the SSN. The full SSN is never returned.
          examples:
            - '4321'
        phone:
          type:
            - string
            - 'null'
          examples:
            - '+14155550134'
        address:
          oneOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        pay_schedule:
          type: string
          examples:
            - ps_7Hn3Kd9sLq2W
        hire_date:
          type:
            - string
            - 'null'
          format: date
          examples:
            - '2027-02-08'
        termination_date:
          type:
            - string
            - 'null'
          format: date
        status:
          type: string
          enum:
            - active
            - terminated
        enrollment_status:
          $ref: '#/components/schemas/EnrollmentStatus'
        invited_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When Hammock last emailed the employee an invitation, if it did.
        metadata:
          $ref: '#/components/schemas/Metadata'
        livemode:
          type: boolean
        created:
          type: string
          format: date-time
    Address:
      type: object
      required:
        - line1
        - city
        - state
        - postal_code
        - country
      properties:
        line1:
          type: string
          examples:
            - 500 Howard St
        line2:
          type:
            - string
            - 'null'
        city:
          type: string
          examples:
            - San Francisco
        state:
          type: string
          description: Two-letter state code.
          examples:
            - CA
        postal_code:
          type: string
          examples:
            - '94105'
        country:
          type: string
          description: Two-letter country code. Only `US` is supported.
          examples:
            - US
    Metadata:
      type: object
      description: >-
        Up to 50 key-value pairs you can attach to an object. Keys are up to 40
        characters and values up to 500.
      additionalProperties:
        type: string
      examples:
        - plan: growth
    EnrollmentStatus:
      type: string
      enum:
        - not_started
        - in_progress
        - pending
        - enrolled
        - not_enrolled
        - closed
      description: >
        `not_started`: the employee hasn't opened enrollment. `in_progress`:
        they opened it and

        haven't elected anything. `pending`: they elected, and their accounts
        are being opened.

        `enrolled`: at least one benefit is active. `not_enrolled`: the
        enrollment window closed

        without an election. `closed`: every enrollment has ended.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - idempotency_error
                - api_error
              description: The category of error.
            code:
              type: string
              description: A short, stable string identifying the specific error.
              examples:
                - payroll_not_voidable
            message:
              type: string
              description: >-
                A human-readable explanation. Don't parse it, and don't show it
                to end users.
            param:
              type:
                - string
                - 'null'
              description: >-
                The parameter the error relates to, using dot and bracket
                notation for nested fields.
              examples:
                - deductions[0].employee_amount
            doc_url:
              type: string
              format: uri
            request_id:
              type: string
              examples:
                - req_9Kd2Lm5nPq8R
  responses:
    Error:
      description: An error. The HTTP status and `error.type` say what kind.
      headers:
        Request-Id:
          description: Identifies this request. Include it when you contact support.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: invalid_request_error
              code: parameter_missing
              message: 'Missing required parameter: employer.'
              param: employer
              doc_url: https://docs.usehammock.co/api/errors#parameter_missing
              request_id: req_9Kd2Lm5nPq8R
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your secret API key, sent as `Authorization: Bearer hmk_test_...`.'

````

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