> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-docs-cloudflare-tunnel-self-hosting.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a category



## OpenAPI

````yaml /openapi.yaml get /api/v1/categories/{id}
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation for the Sure API.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/categories/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Category ID
        schema:
          type: string
    get:
      tags:
        - Categories
      summary: Retrieve a category
      responses:
        '200':
          description: subcategory retrieved with parent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryDetail'
        '404':
          description: category not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    CategoryDetail:
      type: object
      required:
        - id
        - name
        - classification
        - color
        - icon
        - subcategories_count
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        classification:
          type: string
          enum:
            - income
            - expense
        color:
          type: string
        icon:
          type: string
        parent:
          $ref: '#/components/schemas/CategoryParent'
          nullable: true
        subcategories_count:
          type: integer
          minimum: 0
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
    CategoryParent:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````