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

# Create a leave type

> Create a leave type



## OpenAPI

````yaml https://api.absentify.com/api/v1/openapi.json post /leave_types
openapi: 3.1.0
info:
  title: absentify CRUD API
  description: OpenAPI compliant REST API
  version: 1.0.0
servers:
  - url: https://api.absentify.com/api/v1
security: []
tags:
  - name: Departments
  - name: Leave types
  - name: Members
  - name: Requests
  - name: Public holidays
  - name: Workspace
  - name: Absences
  - name: Allowance Management
externalDocs:
  url: https://absentify.com/docs/en/api-reference
paths:
  /leave_types:
    post:
      tags:
        - Leave types
      summary: Create a leave type
      description: Create a leave type
      operationId: leaveTypes-createLeaveType
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                color:
                  type: string
                needs_approval:
                  type: boolean
                maximum_absent:
                  type: boolean
                leave_unit:
                  type: string
                  enum:
                    - days
                    - half_days
                    - hours
                    - minutes_30
                    - minutes_15
                    - minutes_10
                    - minutes_5
                    - minutes_1
                position:
                  type: number
                take_from_allowance:
                  type: boolean
                privacy_hide_leavetype:
                  type: boolean
                outlook_synchronization_show_as:
                  type: string
                  enum:
                    - free
                    - tentative
                    - busy
                    - oof
                    - workingElsewhere
                    - unknown
                outlook_synchronization_subject:
                  anyOf:
                    - type: string
                    - type: 'null'
                icon:
                  type: string
                  enum:
                    - NoIcon
                    - Umbrella
                    - Anchor
                    - Archive
                    - Award
                    - Briefcase
                    - Calendar
                    - Cast
                    - Clock
                    - Coffee
                    - Compass
                    - Battery
                    - Emoji
                    - Gift
                    - Frown
                    - Image
                    - Sun
                    - Zap
                    - Home
                    - Users
                reason_mandatory:
                  type: boolean
                reason_hint_text:
                  anyOf:
                    - type: string
                    - type: 'null'
                allowance_type_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                ignore_schedule:
                  type: boolean
                sync_option:
                  type: string
                  enum:
                    - Disabled
                    - All
                    - OnlyApproved
                ignore_public_holidays:
                  type: boolean
                reason_visibility_public:
                  type: boolean
                counts_as_leave:
                  default: true
                  type: boolean
                allow_representative_overlap:
                  default: false
                  type: boolean
              required:
                - name
                - color
                - needs_approval
                - maximum_absent
                - leave_unit
                - position
                - take_from_allowance
                - privacy_hide_leavetype
                - outlook_synchronization_show_as
                - outlook_synchronization_subject
                - icon
                - reason_mandatory
                - reason_hint_text
                - allowance_type_id
                - ignore_schedule
                - sync_option
                - ignore_public_holidays
                - reason_visibility_public
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKey: []
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.FORBIDDEN:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Insufficient access
        code:
          type: string
          description: The error code
          example: FORBIDDEN
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiKey:
      type: apiKey
      name: X-API-KEY
      in: header

````