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

# Register employee

## Overview

This endpoint allows you to register a new employee in the Cobee system.

When an employee is successfully registered through this endpoint, the system automatically sends an invitation to the employee's email address. The employee must complete the corresponding onboarding process by activating the link sent to their email. Therefore, it is crucial to provide a correct email address if you want the employee to be able to access their Cobee account.

> **Important**: Always ensure the email address is valid and belongs to the employee. An incorrect email address will prevent the employee from completing the onboarding process and accessing their benefits.

> **Note:** For part-time employees, if you provide a working time percentage lower than 100%, please note that their benefit limits will be adjusted proportionally. It is important to ensure that the salary you provide is already adjusted to reflect the employee's part-time status (i.e., the actual salary they will receive, not the full-time equivalent).

> **Note:** The employee will automatically receive an invitation email to activate their account. If the invitation expires or there is an error, use the [Invite employee](/en/api-reference/employees/endpoint/post_employee_invite) endpoint to resend the invitation.

> **Defaults:** If omitted in the request body, the following default values are applied under `workdayConfiguration`:
>
> * `daysPerMonth`: 20
> * `numberOfPaychecks`: 14


## OpenAPI

````yaml POST /companies/{companyId}/employees
openapi: 3.0.1
info:
  title: Partners API
  description: >-
    Partners API definition where you can check the documentation for the
    different available operations to integrate with the platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://pre-partners-api.cobee.io/api/v3
  - url: https://partners-api.cobee.io/api/v3
security:
  - bearerAuth: []
paths:
  /companies/{companyId}/employees:
    post:
      summary: Register employee
      parameters:
        - name: companyId
          in: path
          required: true
          description: The unique identifier of the company
          schema:
            type: string
            format: uuid
          example: a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
      requestBody:
        description: Employee data to be registered
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterEmployeeRequest'
            example:
              email: john.smith@example.com
              legalId: 12345678Z
              name: John
              surname: Smith
              birthDate: '1985-07-15'
              grossSalary:
                amountInCents: 4500000
                currency: EUR
              hiringDate: '2023-01-10'
              taxRegime: general
              workdayConfiguration:
                daysPerMonth: 22
                workTimePercentage: 100
                numberOfPaychecks: 14
                collectiveAgreementSalary:
                  amountInCents: 3800000
                  currency: EUR
              internalId: EMP-1234
              costCenter: Finance
              payrollCompany: Main Branch
              modelId: 7a6c9ab8-8c2d-5c82-9c8c-f5e7e7e7e7e7
              metadata:
                department: Finance
                manager: Jane Doe
                office: Madrid
      responses:
        '201':
          description: Employee successfully registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterEmployeeResponse'
              example:
                id: 7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8
        '400':
          description: Bad Request - The request body is invalid or missing required fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'Invalid request: ''email'' field is required'
        '401':
          description: Unauthorised - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Invalid API key
        '403':
          description: Forbidden - You don't have permission to register employees
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Your API key does not have permission to register employees
        '404':
          description: Not Found - The company ID was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: >-
                  Company with ID 'a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890' not
                  found
        '409':
          description: >-
            Conflict - An employee with the same email or legal ID already
            exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: There is already an existing employee with the same data
        '500':
          description: Internal Server Error - Something went wrong on our end
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'Internal server error: Unable to process request'
components:
  schemas:
    RegisterEmployeeRequest:
      type: object
      required:
        - email
        - legalId
        - name
        - surname
        - birthDate
        - grossSalary
        - hiringDate
        - taxRegime
        - workdayConfiguration
      properties:
        email:
          type: string
          format: email
          description: The employee's email address
        legalId:
          type: string
          description: The employee's legal identifier
        name:
          type: string
          description: The employee's first name
        surname:
          type: string
          description: The employee's surname
        birthDate:
          type: string
          format: date
          description: The employee's date of birth in ISO 8601 format (YYYY-MM-DD)
        grossSalary:
          $ref: '#/components/schemas/MonetaryAmount'
          description: The employee's gross salary details
        hiringDate:
          type: string
          format: date
          description: The date when the employee was hired in ISO 8601 format (YYYY-MM-DD)
        taxRegime:
          type: string
          enum:
            - general
            - basque
            - navarrese
            - biscayan
          description: The employee's tax regime
        workdayConfiguration:
          $ref: '#/components/schemas/WorkdayConfiguration'
          description: Configuration of the employee's workday
        internalId:
          type: string
          description: Your internal identifier for the employee
        costCenter:
          type: string
          description: The cost centre associated with this employee
        payrollCompany:
          type: string
          description: >-
            The company handling the employee's payroll, if different from the
            main company
        modelId:
          type: string
          format: uuid
          description: The ID of the benefit model to assign to this employee
        metadata:
          type: object
          description: Additional metadata for the employee (key-value pairs)
          additionalProperties: true
      example:
        email: john.smith@example.com
        legalId: 12345678Z
        name: John
        surname: Smith
        birthDate: '1985-07-15'
        grossSalary:
          amountInCents: 4500000
          currency: EUR
        hiringDate: '2023-01-10'
        taxRegime: general
        workdayConfiguration:
          daysPerMonth: 22
          workTimePercentage: 100
          numberOfPaychecks: 14
          collectiveAgreementSalary:
            amountInCents: 3800000
            currency: EUR
        internalId: EMP-1234
        costCenter: Finance
        payrollCompany: Main Branch
        modelId: 7a6c9ab8-8c2d-5c82-9c8c-f5e7e7e7e7e7
        metadata:
          department: Finance
          manager: Jane Doe
          office: Madrid
    RegisterEmployeeResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the registered employee
      example:
        id: 7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
      example:
        message: 'Bad request: Invalid field value'
    MonetaryAmount:
      type: object
      required:
        - amountInCents
        - currency
      properties:
        amountInCents:
          type: integer
          description: The monetary amount in cents (e.g., 4500000 for 45,000)
          minimum: 1
        currency:
          type: string
          description: The currency code (e.g., EUR)
          example: EUR
      example:
        amountInCents: 4500000
        currency: EUR
    WorkdayConfiguration:
      type: object
      required:
        - workTimePercentage
      properties:
        daysPerMonth:
          type: integer
          description: The number of working days per month for this employee
          example: 22
        workTimePercentage:
          type: number
          description: The percentage of a full-time schedule this employee works
          minimum: 0.01
          maximum: 100
          example: 100
        numberOfPaychecks:
          type: integer
          description: The number of salary payments the employee receives per year
          example: 14
        collectiveAgreementSalary:
          $ref: '#/components/schemas/MonetaryAmount'
          description: The salary established by the collective agreement, if applicable
      example:
        daysPerMonth: 22
        workTimePercentage: 100
        numberOfPaychecks: 14
        collectiveAgreementSalary:
          amountInCents: 3800000
          currency: EUR
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````