> ## 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 an allowance type

> Creates an allowance type. It starts without a rule, so nothing accrues on it until you create one via POST /allowance-types/{allowance_type_id}/rules. How many types a workspace may have depends on its plan.



## OpenAPI

````yaml https://api.absentify.com/api/v1/openapi.json post /allowance-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:
  /allowance-types:
    post:
      tags:
        - Allowance Management
      summary: Create an allowance type
      description: >-
        Creates an allowance type. It starts without a rule, so nothing accrues
        on it until you create one via POST
        /allowance-types/{allowance_type_id}/rules. How many types a workspace
        may have depends on its plan.
      operationId: allowanceType-createAllowanceType
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                allowance_unit:
                  type: string
                  enum:
                    - days
                    - hours
                  description: >-
                    Whether this type is counted in days or in minutes. Cannot
                    be changed afterwards.
                ignore_allowance_limit:
                  default: false
                  description: >-
                    When true, members may book more than their balance and go
                    negative.
                  type: boolean
                translations:
                  description: >-
                    Optional per-language names, shown to members using that
                    language.
                  type: array
                  items:
                    type: object
                    properties:
                      language:
                        type: string
                        description: Language code the name below is written in, e.g. `de`.
                      name:
                        type: string
                    required:
                      - language
                      - name
              required:
                - name
                - allowance_unit
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                    description: >-
                      Translated into the API key owner's language when a
                      translation exists, otherwise the stored name.
                  default_name:
                    type: string
                    description: The stored name, without any translation applied.
                  allowance_unit:
                    type: string
                    enum:
                      - days
                      - hours
                    description: Whether this type is counted in days or in minutes.
                  ignore_allowance_limit:
                    type: boolean
                    description: >-
                      When true, members may book more than their balance and go
                      negative.
                  default_rule_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      The rule a new member of this workspace is put on. A
                      department default rule takes precedence over it.
                  workspace_id:
                    type: string
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                  translations:
                    type: array
                    items:
                      type: object
                      properties:
                        language:
                          type: string
                          description: >-
                            Language code the name below is written in, e.g.
                            `de`.
                        name:
                          type: string
                      required:
                        - language
                        - name
                      additionalProperties: false
                  leave_types:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        color:
                          type: string
                        icon:
                          type: string
                        deleted:
                          type: boolean
                      required:
                        - id
                        - name
                        - color
                        - icon
                        - deleted
                      additionalProperties: false
                    description: The leave types that draw from this allowance type.
                required:
                  - id
                  - name
                  - default_name
                  - allowance_unit
                  - ignore_allowance_limit
                  - default_rule_id
                  - workspace_id
                  - createdAt
                  - updatedAt
                  - translations
                  - leave_types
                additionalProperties: false
        '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

````