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

# List of active roles for a given contract address and base asset ID

> Returns a list of currently active roles for the specified baseAssetId and contractAddress.



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml get /onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/roles
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/roles:
    get:
      tags:
        - Onchain Data
      summary: List of active roles for a given contract address and base asset ID
      description: >-
        Returns a list of currently active roles for the specified baseAssetId
        and contractAddress.
      operationId: getActiveRolesForContract
      parameters:
        - $ref: '#/components/parameters/BaseAssetId'
        - $ref: '#/components/parameters/ContractAddress'
      responses:
        '200':
          description: Successfully retrieved the list of active roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveRolesResponse'
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response: Promise<FireblocksResponse<ActiveRolesResponse>> =
            fireblocks.onchainData.getActiveRolesForContract(onchainDataApiGetActiveRolesForContractRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<ActiveRolesResponse>> response =
            fireblocks.onchainData().getActiveRolesForContract(baseAssetId,
            contractAddress);
        - lang: Python
          source: >-
            response =
            fireblocks.onchain_data.get_active_roles_for_contract(base_asset_id,
            contract_address);
components:
  parameters:
    BaseAssetId:
      name: baseAssetId
      in: path
      description: The blockchain base assetId
      example: ETH_TEST3
      schema:
        type: string
      required: true
    ContractAddress:
      name: contractAddress
      in: path
      description: The contract address
      example: '0xC2c4e1Db41F0bB97996D0eD0542D2170d146FB66'
      schema:
        type: string
      required: true
  schemas:
    ActiveRolesResponse:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/RoleDetails'
      description: A map of role names to their details
    RoleDetails:
      type: object
      properties:
        roleHash:
          type: string
          description: The role hash identifier
          example: '0x0000000000000000000000000000000000000000000000000000000000000000'
        description:
          type: string
          description: Human-readable description of the role
          example: DEFAULT_ADMIN_ROLE
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/RoleGrantee'
          description: List of accounts that have been granted this role
      required:
        - roleHash
        - description
        - accounts
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    RoleGrantee:
      type: object
      properties:
        accountAddress:
          type: string
          description: The address of the account that has been granted the role
          example: '0xC2c4e1Db41F0bB97996D0eD0542D2170d146FB66'
        dateOfGrant:
          type: string
          format: date-time
          description: The date when the role was granted to this account
          example: '2024-07-01T00:00:00.000Z'
      required:
        - accountAddress
        - dateOfGrant
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs

````