# Retrieve all codes

Endpoint: GET /code
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Query parameters:

  - `title` (string)
    The title of the code

  - `page` (number)
    Page number (0-based)

  - `pageSize` (number)
    Number of items per page

  - `sortBy[0][field]` (string)
    First sort field

  - `sortBy[0][dir]` (string)
    First sort direction

  - `sortBy[1][field]` (string)
    Second sort field

  - `sortBy[1][dir]` (string)
    Second sort direction

## Response 200:

  - `200` (unknown)
    List of codes retrieved successfully.

## Response 200 fields (application/json):

  - `data` (array, required)
    Array of codes

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

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

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

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

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

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

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

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

  - `meta` (object, required)
    Pagination metadata

  - `meta.page` (number, required)
    Current page number (0-based)
    Example: 0

  - `meta.pageSize` (number, required)
    Number of items per page
    Example: 10

  - `meta.total` (number, required)
    Total number of items
    Example: 150

  - `meta.totalPages` (number, required)
    Total number of pages
    Example: 15

  - `meta.hasNext` (boolean, required)
    Whether there is a next page
    Example: true

  - `meta.hasPrevious` (boolean, required)
    Whether there is a previous page
    Example: false

## 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

