# Create a new code

Endpoint: POST /code
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `title` (string, required)
    The title of the code
    Example: Medical Code Title

  - `code` (string, required)
    The unique code associated with the title
    Example: M1234

  - `category` (string, required)
    The category of the code
    Example: Dental

  - `categoryCode` (string, required)
    The unique code for the category
    Example: D4567

  - `isEnabled` (boolean)
    Indicates whether the code is enabled
    Example: true

## Response 201:

  - `201` (unknown)
    Code created successfully.

## Response 201 fields (application/json):

  - `title` (string, required)
    The title of the code
    Example: Medical Code Title

  - `code` (string, required)
    The unique code associated with the title
    Example: M1234

  - `category` (string, required)
    The category of the code
    Example: Dental

  - `categoryCode` (string, required)
    The unique code for the category
    Example: D4567

  - `isEnabled` (boolean)
    Indicates whether the code is enabled
    Example: true

  - `id` (number, required)
    The ID of the code to be updated
    Example: 123

  - `createdAt` (string, required)
    The date and time the code was created
    Example: 2021-05-01T12:00:00Z

  - `updatedAt` (string, required)
    The date and time the code was last updated
    Example: 2021-05-01T12:00:00Z

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 401:

  - `401` (unknown)
    Unauthorized: Invalid or missing token.

## Response 401 fields (application/json):

  - `message` (string, required)
    Error message indicating unauthorized access.
    Example: Unauthorized

  - `statusCode` (number, required)
    HTTP status code for unauthorized access.
    Example: 401

## Response 403:

  - `403` (unknown)
    Forbidden: Access denied due to unaccepted Terms or insufficient permissions.

## Response 403 fields (application/json):

  - `statusCode` (number, required)
    HTTP status code indicating forbidden access due to unaccepted Terms of Service.
    Example: 403

  - `message` (string, required)
    Human-readable explanation of the error.
    Example: User must accept Terms of Service before continuing

  - `reason` (string, required)
    Machine-readable reason code for the error.
    Example: tos_required

  - `termsOfServicesLink` (string, required)
    URL to the Terms of Service the user must accept.
    Example: https://heydonto.com/terms-of-use/

  - `timestamp` (string, required)
    Timestamp when the error occurred (ISO 8601).
    Example: 2025-01-01T00:00:00.000Z

  - `statusCode` (number, required)
    HTTP status code indicating forbidden access.
    Example: 403

