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

# Get Case Judgment

> Look up a case by canonical `case_id` (e.g. `HKCFA_2023_5`), neutral citation (e.g. `[2023] HKCFA 5`), or action number (e.g. `FACV 5/2022` or `FACV5/2022` — the space is optional). The API tries each format in order and returns the first match. The `matched_by` field in the response tells you which form was used. See the [identifiers guide](https://docs.casebyte.ai/guides/identifiers) for details on each format and URL-encoding.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/cases/{id}
openapi: 3.1.0
info:
  title: Casebyte API
  description: >-
    REST API for searching and retrieving Hong Kong case law. See the guides at
    https://docs.casebyte.ai for tutorials and conceptual overviews.
  version: 1.1.0
  contact:
    name: Casebyte support
    email: support@casebyte.ai
    url: https://casebyte.ai
  license:
    name: Proprietary
servers:
  - url: https://api.casebyte.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Cases
    description: Search and retrieve Hong Kong case law.
  - name: Health
    description: Service health checks.
  - name: Daily
    description: Completed case summaries within the active seven Hong Kong calendar days.
paths:
  /v1/cases/{id}:
    get:
      tags:
        - Cases
      summary: Get Case Judgment
      description: >-
        Look up a case by canonical `case_id` (e.g. `HKCFA_2023_5`), neutral
        citation (e.g. `[2023] HKCFA 5`), or action number (e.g. `FACV 5/2022`
        or `FACV5/2022` — the space is optional). The API tries each format in
        order and returns the first match. The `matched_by` field in the
        response tells you which form was used. See the [identifiers
        guide](https://docs.casebyte.ai/guides/identifiers) for details on each
        format and URL-encoding.
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Case identifier — case ID, neutral citation, or action number.
            URL-encode reserved characters (`[`, `]`, `/`, space).
          schema:
            type: string
          examples:
            caseId:
              value: HKCFA_2023_5
              summary: Canonical case ID
            neutralCitation:
              value: '%5B2023%5D%20HKCFA%205'
              summary: Neutral citation (URL-encoded)
            actionNumber:
              value: FACV%205%2F2022
              summary: Action number (URL-encoded)
      responses:
        '200':
          description: Case found.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Case'
              example:
                case_id: HKCFA_2021_12
                case_name: Kwok Cheuk Kin v Director of Lands
                court: HKCFA
                neutral_citation: '[2021] HKCFA 12'
                action_numbers:
                  - FACV 4/2020
                publish_date: '2021-04-21'
                case_url: https://www.hklii.hk/eng/hk/cases/hkcfa/2021/12.html
                doc_text: |-
                  JUDGMENT

                  1. This appeal raises...
                matched_by: case_id
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/CaseNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  headers:
    RateLimitLimit:
      description: Per-window quota for this API key.
      schema:
        type: integer
      example: 10
    RateLimitRemaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
      example: 9
  schemas:
    Case:
      type: object
      required:
        - case_id
        - matched_by
      properties:
        case_id:
          type: string
          example: HKCFA_2021_12
        case_name:
          type:
            - string
            - 'null'
        court:
          type:
            - string
            - 'null'
        neutral_citation:
          type:
            - string
            - 'null'
        action_numbers:
          type: array
          items:
            type: string
          description: >-
            All action numbers associated with this case (e.g. consolidated
            appeals).
        publish_date:
          type:
            - string
            - 'null'
          format: date
        case_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            URL of the original judgment on the source publisher (judiciary.hk
            or HKLII).
        doc_text:
          type:
            - string
            - 'null'
          description: Full plain-text judgment. May be very large (up to several MB).
        matched_by:
          type: string
          enum:
            - case_id
            - neutral_citation
            - action_number
          description: Which identifier form matched the supplied `id`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                Stable, machine-readable error code. Branch on this in your
                code.
            message:
              type: string
              description: >-
                Human-readable summary. May change between versions; do not
                branch on this.
            details:
              description: Optional, endpoint-specific extra context.
              nullable: true
  responses:
    Unauthorized:
      description: Missing, malformed, or revoked credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: No Authorization header
              value:
                error:
                  code: missing_credentials
                  message: Authorization header with a Bearer token is required.
            invalid:
              summary: Unrecognised key
              value:
                error:
                  code: invalid_credentials
                  message: API key not recognised.
            revoked:
              summary: Revoked key
              value:
                error:
                  code: revoked_credentials
                  message: API key has been revoked.
    CaseNotFound:
      description: No case matched the supplied identifier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: case_not_found
              message: No case matched that identifier.
              details:
                identifier: HKCFA_9999_0
    RateLimited:
      description: >-
        You exceeded your per-minute quota. Back off with exponential delay and
        jitter — `Retry-After` is intentionally not returned.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded.
    InternalError:
      description: Something went wrong on our side. Retry with exponential backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: Internal server error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cb_live_*
      description: >-
        Casebyte API key, prefixed with `cb_live_`. Generate one from your
        [casebyte.ai dashboard](https://casebyte.ai/dashboard).

````

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