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

# List categories

> Returns the system categories and the space's custom categories, named and nested the way the space shows them. Requires the `pfm:read` scope. Match a system category by its `key`: its `name` follows the space and can change.



## OpenAPI

````yaml /openapi.json get /v1/spaces/{space_id}/categories
openapi: 3.0.3
info:
  description: >-
    Personal REST API for Visor Pro and Premium users. Authenticate with a
    personal API token created in Visor Settings, sent as `Authorization: Bearer
    visor_pat_...`, or with an OAuth access token from the Visor CLI browser
    login.
  title: Visor Personal API
  version: 1.0.0
servers:
  - url: https://api.visorfinance.app
    variables: {}
security:
  - personal_api_token: []
  - visor_cli_oauth:
      - pfm:read
tags: []
paths:
  /v1/spaces/{space_id}/categories:
    get:
      tags:
        - Categories
      summary: List categories
      description: >-
        Returns the system categories and the space's custom categories, named
        and nested the way the space shows them. Requires the `pfm:read` scope.
        Match a system category by its `key`: its `name` follows the space and
        can change.
      operationId: VisorWeb.Api.V1.CategoryController.index
      parameters:
        - description: A space `id` from `GET /v1/spaces`
          in: path
          name: space_id
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            Set to `true` to include categories the user hid in Visor. Defaults
            to `false`.
          in: query
          name: include_hidden
          required: false
          schema:
            default: false
            type: boolean
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  - hidden: false
                    id: 3e9a1b7c-4d2f-4a8e-9b6c-0d1e2f3a4b5c
                    key: category.food_and_drinks
                    kind: system
                    name: Food and drinks
                    parent_id: null
                    type: expense
                  - hidden: false
                    id: 7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d
                    key: null
                    kind: custom
                    name: Padaria
                    parent_id: 3e9a1b7c-4d2f-4a8e-9b6c-0d1e2f3a4b5c
                    type: expense
              schema:
                $ref: '#/components/schemas/CategoryListResponse'
          description: Categories available in the space
          headers:
            x-ratelimit-limit:
              description: Requests allowed for this token per minute
              schema:
                example: 60
                type: integer
              style: simple
            x-ratelimit-remaining:
              description: Requests left for this token in the current minute
              schema:
                example: 59
                type: integer
              style: simple
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '400':
          content:
            application/json:
              example:
                errors:
                  - code: BAD_REQUEST
                    details:
                      parameter: include_hidden
                    message: The request is malformed.
                    request_id: F8x2kQ9vXc1AAAAB
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: A query parameter has an invalid value
          headers:
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '401':
          content:
            application/json:
              example:
                errors:
                  - code: INVALID_TOKEN
                    details: {}
                    message: The personal API token is not valid.
                    request_id: F8x2kQ9vXc1AAAAB
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing, invalid, expired, or revoked token
          headers:
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '403':
          content:
            application/json:
              example:
                errors:
                  - code: INSUFFICIENT_SCOPE
                    details:
                      required_scope: pfm:read
                    message: The personal API token does not grant this operation.
                    request_id: F8x2kQ9vXc1AAAAB
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Pro or Premium plan required, or insufficient scope
          headers:
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '404':
          content:
            application/json:
              example:
                errors:
                  - code: NOT_FOUND
                    details: {}
                    message: The resource does not exist.
                    request_id: F8x2kQ9vXc1AAAAB
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The space does not exist or the token's user cannot access it
          headers:
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '406':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The client does not accept JSON
          headers:
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
        '429':
          content:
            application/json:
              example:
                errors:
                  - code: RATE_LIMITED
                    details:
                      retry_after_seconds: 42
                    message: >-
                      Too many requests. Retry after the number of seconds in
                      Retry-After.
                    request_id: F8x2kQ9vXc1AAAAB
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Rate limit exceeded
          headers:
            retry-after:
              description: Seconds until the current window ends
              schema:
                example: 42
                type: integer
              style: simple
            x-ratelimit-limit:
              description: Requests allowed for this token per minute
              schema:
                example: 60
                type: integer
              style: simple
            x-ratelimit-remaining:
              description: Requests left for this token in the current minute
              schema:
                example: 59
                type: integer
              style: simple
            x-request-id:
              description: Request identifier, also returned as `request_id` in errors
              schema:
                type: string
              style: simple
      callbacks: {}
components:
  schemas:
    CategoryListResponse:
      additionalProperties: false
      properties:
        data:
          items:
            $ref: '#/components/schemas/Category'
          type: array
      required:
        - data
      title: CategoryListResponse
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        errors:
          items:
            $ref: '#/components/schemas/Error'
          minItems: 1
          type: array
      required:
        - errors
      title: ErrorResponse
      type: object
    Category:
      additionalProperties: false
      properties:
        hidden:
          description: True when the user hid the category in this space
          type: boolean
        id:
          format: uuid
          type: string
        key:
          description: >-
            Stable identifier of a system category, such as
            `category.food_and_drinks`; null for a custom category
          example: category.food_and_drinks
          nullable: true
          type: string
        kind:
          description: >-
            `system` for a category Visor provides; `custom` for one the user
            created
          enum:
            - system
            - custom
          type: string
        name:
          description: >-
            The name this space shows: the space name when the space renamed a
            system category, otherwise its English name; the name the user gave
            a custom category
          type: string
        names:
          additionalProperties: false
          description: >-
            Canonical English and Brazilian Portuguese labels using Visor's
            translations and fallbacks, whatever name the space gave a system
            category; both contain the user's name for a custom category
          example:
            en: Groceries
            pt-BR: Supermercado
          properties:
            en:
              type: string
            pt-BR:
              type: string
          required:
            - en
            - pt-BR
          type: object
        parent_id:
          description: >-
            The parent this space shows the category under, which can differ
            from the canonical parent of a system category; null for a top-level
            category
          format: uuid
          nullable: true
          type: string
        type:
          description: >-
            Null for a system category that Visor created from a bank category
            and has not classified yet
          enum:
            - expense
            - income
            - null
          nullable: true
          type: string
      required:
        - id
        - key
        - name
        - names
        - parent_id
        - type
        - kind
        - hidden
      title: Category
      type: object
    Error:
      additionalProperties: false
      properties:
        code:
          description: Stable machine-readable code
          example: INVALID_TOKEN
          type: string
        details:
          additionalProperties: true
          description: Code-specific context
          type: object
        message:
          description: English text for developers
          type: string
        request_id:
          description: The x-request-id response header of the request
          nullable: true
          type: string
      required:
        - code
        - message
        - details
        - request_id
      title: Error
      type: object
  securitySchemes:
    personal_api_token:
      bearerFormat: visor_pat_<public_id>_<secret>
      description: Personal API token created in Visor Settings
      scheme: bearer
      type: http
    visor_cli_oauth:
      description: >-
        OAuth 2.0 access token of the Visor CLI browser login (authorization
        code with PKCE). Only the first-party Visor CLI client can use it on
        this API.
      flows:
        authorizationCode:
          authorizationUrl: https://dashboard.visorfinance.app/oauth/authorize
          refreshUrl: https://dashboard.visorfinance.app/oauth/token
          scopes:
            pfm:read: Read financial data
            pfm:transactions:write: Create, edit, and delete transactions
            pix:payments:write: Start Pix payments that you confirm with biometrics at your bank
          tokenUrl: https://dashboard.visorfinance.app/oauth/token
      type: oauth2

````

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