> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiIxZGQzYmI1NC1hMDc1LTQxNDctYTdiZS0xNWQxNzI2ODFkNGMiLCJleHAiOjE3NzgyODEzMzIsImlhdCI6MTc3ODI4MTAzMn0.KVu1XnhABnH2FtQayGD9v9OYvcc-TN2V9jHzS7gDK0E
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Get Code Record By Id

GET https://fai.buildwithfern.com/code/{domain}/{code_id}

Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/code/get-code-record-by-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: fai
  version: 1.0.0
paths:
  /code/{domain}/{code_id}:
    get:
      operationId: get-code-record-by-id
      summary: Get Code Record By Id
      tags:
        - subpackage_code
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
        - name: code_id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCodeRecordResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://fai.buildwithfern.com
  - url: https://fai-dev.buildwithfern.com
  - url: http://localhost:8080
components:
  schemas:
    Code:
      type: object
      properties:
        code_id:
          type: string
        domain:
          type: string
        chunk:
          type: string
        document:
          type: string
        title:
          type:
            - string
            - 'null'
        url:
          type:
            - string
            - 'null'
        version:
          type:
            - string
            - 'null'
        product:
          type:
            - string
            - 'null'
        keywords:
          type:
            - array
            - 'null'
          items:
            type: string
        authed:
          type:
            - boolean
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - code_id
        - domain
        - chunk
        - document
        - created_at
        - updated_at
      title: Code
    GetCodeRecordResponse:
      type: object
      properties:
        document:
          $ref: '#/components/schemas/Code'
          description: The requested code
      required:
        - document
      title: GetCodeRecordResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```