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

# getCompressedTokenAccountsByDelegate

> Returns the compressed token accounts that are partially or fully delegated to the given delegate.

## Request Parameters

<ParamField body="cursor" type="string" default="3J98t1WpEZ73CNm">
  A base 58 encoded string.
</ParamField>

<ParamField body="delegate" type="string" required default="11111116EPqoQskEM2Pddp8KTL9JdYEBZMGF3aq7V">
  A Solana public key represented as a base58 string.
</ParamField>

<ParamField body="limit" type="number" />

<ParamField body="mint" type="string" default="11111116EPqoQskEM2Pddp8KTL9JdYEBZMGF3aq7V">
  A Solana public key represented as a base58 string.
</ParamField>


## OpenAPI

````yaml openapi/zk-compression/getCompressedTokenAccountsByDelegate.yaml POST /
openapi: 3.0.3
info:
  title: photon-indexer
  description: Solana indexer for general compression
  license:
    name: Apache-2.0
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Mainnet RPC endpoint
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC endpoint
security: []
paths:
  /:
    summary: getCompressedTokenAccountsByDelegate
    post:
      description: Retrieves getCompressedTokenAccountsByDelegate information
      operationId: getCompressedTokenAccountsByDelegate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: The version of the JSON-RPC protocol.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: An ID to identify the request.
                  default: '1'
                method:
                  type: string
                  description: The name of the method to invoke.
                  enum:
                    - getCompressedTokenAccountsByDelegate
                  default: getCompressedTokenAccountsByDelegate
                params:
                  type: object
                  required:
                    - delegate
                  properties:
                    cursor:
                      allOf:
                        - $ref: '#/components/schemas/Base58String'
                      nullable: true
                    delegate:
                      $ref: '#/components/schemas/SerializablePubkey'
                    limit:
                      allOf:
                        - $ref: '#/components/schemas/Limit'
                      nullable: true
                    mint:
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      nullable: true
                  additionalProperties: false
        required: true
      responses:
        '200':
          description: >-
            Successfully retrieved compressed token accounts by delegate from
            the Solana blockchain
          content:
            application/json:
              schema:
                type: object
                required:
                  - context
                  - value
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/TokenAccountList'
                additionalProperties: false
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    Base58String:
      type: string
      description: A base 58 encoded string.
      default: 3J98t1WpEZ73CNm
      example: 3J98t1WpEZ73CNm
    SerializablePubkey:
      type: string
      description: A Solana public key represented as a base58 string.
      default: 11111116EPqoQskEM2Pddp8KTL9JdYEBZMGF3aq7V
      example: 11111116EPqoQskEM2Pddp8KTL9JdYEBZMGF3aq7V
    Limit:
      type: integer
      format: int64
      minimum: 0
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
    TokenAccountList:
      type: object
      required:
        - items
      properties:
        cursor:
          $ref: '#/components/schemas/Base58String'
        items:
          type: array
          items:
            $ref: '#/components/schemas/TokenAcccount'
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: The JSON-RPC protocol version.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: The error code.
              example: -32602
            message:
              type: string
              description: The error message.
            data:
              type: object
              description: Additional data about the error.
        id:
          type: string
          description: Identifier matching the request.
          example: '1'
    TokenAcccount:
      type: object
      required:
        - account
        - tokenData
      properties:
        account:
          $ref: '#/components/schemas/Account'
        tokenData:
          $ref: '#/components/schemas/TokenData'
      additionalProperties: false
    Account:
      type: object
      required:
        - hash
        - owner
        - lamports
        - tree
        - leafIndex
        - seq
        - slotCreated
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
        data:
          $ref: '#/components/schemas/AccountData'
        hash:
          $ref: '#/components/schemas/Hash'
        lamports:
          $ref: '#/components/schemas/UnsignedInteger'
        leafIndex:
          $ref: '#/components/schemas/UnsignedInteger'
        owner:
          $ref: '#/components/schemas/SerializablePubkey'
        seq:
          $ref: '#/components/schemas/UnsignedInteger'
        slotCreated:
          $ref: '#/components/schemas/UnsignedInteger'
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
      additionalProperties: false
    TokenData:
      type: object
      required:
        - mint
        - owner
        - amount
        - state
      properties:
        amount:
          $ref: '#/components/schemas/UnsignedInteger'
        delegate:
          $ref: '#/components/schemas/SerializablePubkey'
        mint:
          $ref: '#/components/schemas/SerializablePubkey'
        owner:
          $ref: '#/components/schemas/SerializablePubkey'
        state:
          $ref: '#/components/schemas/AccountState'
        tlv:
          $ref: '#/components/schemas/Base64String'
    AccountData:
      type: object
      required:
        - discriminator
        - data
        - dataHash
      properties:
        data:
          $ref: '#/components/schemas/Base64String'
        dataHash:
          $ref: '#/components/schemas/Hash'
        discriminator:
          $ref: '#/components/schemas/UnsignedInteger'
      additionalProperties: false
    Hash:
      type: string
      description: A 32-byte hash represented as a base58 string.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    UnsignedInteger:
      type: integer
      default: 100
      example: 100
    AccountState:
      type: string
      enum:
        - initialized
        - frozen
    Base64String:
      type: string
      description: A base 64 encoded string.
      default: SGVsbG8sIFdvcmxkIQ==
      example: SGVsbG8sIFdvcmxkIQ==
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Your Helius API key. You can get one for free in the
        [dashboard](https://dashboard.helius.dev/api-keys).

````