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

# Validate an extra field value

> Checks a value against an extra field's rules (non-empty, numeric for number fields, not already used for unique fields) without saving anything.



## OpenAPI

````yaml /openapi.yaml post /clients/{company_slug}/validate-extra-field/
openapi: 3.1.0
info:
  title: hackU Client API
  version: 1.2.0
  description: >
    Public API for hackU corporate clients. It lets a company manage its
    learners

    (create, update, deactivate), enroll them in courses (routes) and pensums,

    read their progress, and send WhatsApp / email communications.


    **Authentication.** Every request must send the header

    `Authorization: Api-Key <token>`. The key identifies the company; there is
    no

    company parameter in the URL except where noted.


    **Pagination.** List endpoints that are paginated use limit/offset

    (`limit` default 50, maximum 500) and return `{count, next, previous,
    results}`.


    **Errors.** A missing, invalid, revoked or expired key returns `403` with

    `{"detail": "..."}`. Validation errors return `400` with

    `{"<field>": ["<message>", ...]}` (or `non_field_errors`). Some messages are

    returned in Spanish.


    **Identifiers.** `user_id` in every path is the hackU user id, returned as

    `user_pk` by `POST /clients/users/` and as `id` by `GET /clients/users/`.
servers:
  - url: https://app.reinvented.education/api
    description: Production
  - url: https://qa-admin.hacku.co/api
    description: Test
security:
  - ApiKeyAuth: []
tags:
  - name: Users
    description: Create, read, update and deactivate the company's learners.
  - name: Enrollment
    description: Assign courses (routes), modules and pensums.
  - name: Progress
    description: >-
      Read learners' progress in courses, modules, pensums, evaluations, surveys
      and certificates.
  - name: Catalog
    description: The company's courses (routes) and their modules.
  - name: Extra fields
    description: Company-defined custom user fields.
  - name: Communications
    description: Send WhatsApp or email messages using approved templates.
paths:
  /clients/{company_slug}/validate-extra-field/:
    parameters:
      - $ref: '#/components/parameters/CompanySlug'
    post:
      tags:
        - Extra fields
      summary: Validate an extra field value
      description: >-
        Checks a value against an extra field's rules (non-empty, numeric for
        number fields, not already used for unique fields) without saving
        anything.
      operationId: validateExtraField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateExtraFieldRequest'
      responses:
        '200':
          description: Validation result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtraFieldValidation'
              examples:
                valid:
                  value:
                    is_valid: true
                    reason: El valor es válido.
                duplicated:
                  value:
                    is_valid: false
                    reason: Ya existe un usuario con este valor en la compañía.
        '400':
          description: Missing `extra_field` or empty `value`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtraFieldValidation'
              example:
                is_valid: false
                reason: El valor a validar no puede estar vacío.
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Company or extra field not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtraFieldValidation'
              example:
                is_valid: false
                reason: El extra field no existe para esta compañía.
components:
  parameters:
    CompanySlug:
      name: company_slug
      in: path
      required: true
      description: >-
        Your company's `slug_name`, provided by your account manager with the
        API key.
      schema:
        type: string
      example: acme
  schemas:
    ValidateExtraFieldRequest:
      type: object
      required:
        - extra_field
        - value
      properties:
        extra_field:
          oneOf:
            - type: integer
            - type: string
          description: Extra field id, or its `name` (case-insensitive).
        value:
          type: string
      example:
        extra_field: employee_code
        value: '45821'
    ExtraFieldValidation:
      type: object
      required:
        - is_valid
        - reason
      properties:
        is_valid:
          type: boolean
        reason:
          type: string
          description: Localized explanation (Spanish by default).
    Error:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
  responses:
    Forbidden:
      description: Missing, invalid, revoked or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Authentication credentials were not provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Company API key. The header value must be `Api-Key <token>`, e.g.
        `Authorization: Api-Key AbCd1234.xxxxxxxx`.

````

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