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

# Validate a code in a code system

> FHIR `CodeSystem/$validate-code`. Asks whether a code exists in a code system — distinct from the ValueSet operation of the same name, which asks about membership of a particular set. On POST, a `coding` or `codeableConcept` parameter may stand in for `url` + `code`; a codeableConcept validates if any of its codings does.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/fhir/r4/CodeSystem/$validate-code
openapi: 3.1.0
info:
  title: haau3 Platform API
  version: 1.0.0
  description: >-
    The haau3 platform API (non-PHI). Endpoints require a free API key — send it
    as `Authorization: Bearer <key>`. Requests without a valid key return 401.
    Create a key in the dashboard at https://platform.haau3.com.
servers:
  - url: https://api.haau3.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scheduling
    description: Provider availability (SMART Scheduling Links) — slots and publishers.
  - name: Terminology
    description: FHIR terminology operations — CodeSystem lookups against LOINC.
  - name: Provider directory
    description: >-
      FHIR Practitioner and PractitionerRole, resolved from the national
      provider directory. Resolution, not discovery: bring an NPI and get what
      the directory publishes for it.
paths:
  /v1/fhir/r4/CodeSystem/$validate-code:
    post:
      tags:
        - Terminology
      summary: Validate a code in a code system
      description: >-
        FHIR `CodeSystem/$validate-code`. Asks whether a code exists in a code
        system — distinct from the ValueSet operation of the same name, which
        asks about membership of a particular set. On POST, a `coding` or
        `codeableConcept` parameter may stand in for `url` + `code`; a
        codeableConcept validates if any of its codings does.
      operationId: codeSystemValidateCodePost
      requestBody:
        required: true
        content:
          application/fhir+json:
            schema:
              $ref: '#/components/schemas/FhirParameters'
      responses:
        '200':
          description: A FHIR `Parameters` resource carrying `result`.
          content:
            application/fhir+json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid request. Returns a FHIR `OperationOutcome`.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '404':
          description: >-
            The code system is not served here, or the code was not found. The
            `OperationOutcome` says which, and why — an unrecognised system, a
            system we are not licensed to serve, and a genuinely missing code
            are different answers.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '406':
          description: >-
            A FHIR release this endpoint does not serve was requested via the
            `fhirVersion` media-type parameter.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '502':
          description: The upstream terminology server could not be reached.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '503':
          description: >-
            No source is configured for this code system on this deployment. The
            service returns no answer rather than guessing one.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
        '504':
          description: The upstream terminology server did not respond in time.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
components:
  schemas:
    FhirParameters:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Parameters
        parameter:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
        - resourceType
    OperationOutcome:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - OperationOutcome
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              details:
                type: object
                properties:
                  text:
                    type: string
                additionalProperties: true
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
            additionalProperties: true
      required:
        - resourceType
        - issue
    AuthError:
      type: object
      properties:
        error:
          type: string
          examples:
            - API key required
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your platform API key (`haau3_sk_…`), sent as `Authorization: Bearer
        <key>`.

````