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

# Start the offboarding of an employee

> Start the offboarding of an employee who is leaving: writes their last day, creates the offboarding and its ticket, and opens its first steps as typed tasks according to the offboarding settings (the confirmation of the leaver information, then the access removal, the device handling and the return shipment). The steps run through their intent tools: read the tasks with `getTicket`, then `updateOffboardingConfirmationIntent` / `executeOffboardingConfirmationIntent` and the others. Refused with `OFFBOARDING_TICKETS_NOT_ENABLED` (403) when offboarding tickets are not enabled for the company, `EMPLOYEE_NOT_FOUND`, `EMPLOYEE_HIDDEN`, `CANNOT_OFFBOARD_YOURSELF`, `OFFBOARDING_ALREADY_EXISTS` (the employee already has an open offboarding: use `getOffboardings`), `OFFBOARDING_IS_LEGACY` (one on the steppers from before offboarding tickets), `TERMINATION_DATE_REQUIRED` (send `terminationDate` or set it on the employee), `FAIL_TO_OPEN_OFFBOARDING_TICKET` (502, nothing was created). To drop an offboarding that has not started, use `ignoreOffboarding`.

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /offboardings
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /offboardings:
    post:
      tags:
        - Offboardings
      summary: Start the offboarding of an employee
      description: >-
        Start the offboarding of an employee who is leaving: writes their last
        day, creates the offboarding and its ticket, and opens its first steps
        as typed tasks according to the offboarding settings (the confirmation
        of the leaver information, then the access removal, the device handling
        and the return shipment). The steps run through their intent tools: read
        the tasks with `getTicket`, then `updateOffboardingConfirmationIntent` /
        `executeOffboardingConfirmationIntent` and the others. Refused with
        `OFFBOARDING_TICKETS_NOT_ENABLED` (403) when offboarding tickets are not
        enabled for the company, `EMPLOYEE_NOT_FOUND`, `EMPLOYEE_HIDDEN`,
        `CANNOT_OFFBOARD_YOURSELF`, `OFFBOARDING_ALREADY_EXISTS` (the employee
        already has an open offboarding: use `getOffboardings`),
        `OFFBOARDING_IS_LEGACY` (one on the steppers from before offboarding
        tickets), `TERMINATION_DATE_REQUIRED` (send `terminationDate` or set it
        on the employee), `FAIL_TO_OPEN_OFFBOARDING_TICKET` (502, nothing was
        created). To drop an offboarding that has not started, use
        `ignoreOffboarding`.
      operationId: createOffboarding
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOffboardingBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOffboarding_Output'
components:
  schemas:
    CreateOffboardingBody:
      type: object
      properties:
        employeeId:
          description: The leaver, from `getEmployees`
          type: string
          pattern: ^[a-f\d]{24}$
        terminationDate:
          description: >-
            The leaver's last day. Defaults to the termination date already on
            the employee.
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
      required:
        - employeeId
    GetOffboarding_Output:
      type: object
      properties:
        id:
          type: string
        employeeId:
          type: string
        ticketId:
          description: The offboarding ticket, whose tasks are its steps (`getTicket`)
          anyOf:
            - type: string
            - type: 'null'
        ticketReference:
          description: The reference the cockpit shows for that ticket
          anyOf:
            - type: string
            - type: 'null'
        isLegacy:
          description: >-
            Whether the offboarding runs on the steppers from before offboarding
            tickets
          type: boolean
        stepModel:
          description: >-
            How the offboarding holds its steps: ACTIONS (the steppers from
            before offboarding tickets) or INTENTS (typed tasks under its
            ticket, run through the intent tools such as
            `executeOffboardingConfirmationIntent`). Null while it has neither a
            ticket nor a step.
          anyOf:
            - type: string
              enum:
                - ACTIONS
                - INTENTS
            - type: 'null'
        status:
          type: string
          enum:
            - PENDING
            - SCHEDULED
            - IN_PROGRESS
            - CLOSED
            - CANCELED
        source:
          type: string
          enum:
            - COCKPIT
            - MERGE
            - KOMBO
            - API
        terminationDate:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - employeeId
        - isLegacy
        - status
        - source
        - terminationDate
        - createdAt
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

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