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

# List accounts available for sharing

> Lists all accounts belonging to the customer that are available for sharing. If account selection is supported for your Data Provider, this API will be used to present the user with a list of accounts to authorize



## OpenAPI

````yaml openapi/auth.yml GET /auth/v1/customer/{customerId}/accounts
openapi: 3.0.3
info:
  description: Fiskil Data Holder as a Service (DHaaS) endpoints for the Energy sector
  title: Authentication & Authorization
  version: 1.5.0
servers:
  - url: https://api.provider.fiskil.com
security:
  - bearerAuth: []
paths:
  /auth/v1/customer/{customerId}/accounts:
    get:
      summary: List accounts available for sharing
      description: >-
        Lists all accounts belonging to the customer that are available for
        sharing. If account selection is supported for your Data Provider, this
        API will be used to present the user with a list of accounts to
        authorize
      operationId: listAccountsAuth
      parameters:
        - $ref: '#/components/parameters/customerId'
      responses:
        '200':
          description: List of accounts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customerAccountListResponse'
        '401':
          $ref: '#/components/responses/unauthenticatedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/customerNotFoundError'
components:
  parameters:
    customerId:
      description: ID of a customer
      explode: false
      in: path
      name: customerId
      required: true
      schema:
        type: string
      style: simple
  schemas:
    customerAccountListResponse:
      title: Consent Accounts
      type: object
      description: List of account available for consent
      properties:
        accounts:
          type: array
          description: An array of accounts available for consent
          items:
            title: Consent Account
            description: Details of an account that is available for consent
            type: object
            properties:
              accountId:
                description: Unique identifier for the account
                type: string
                example: 7fa27638-cc84-4b53-bed2-c6edec5473a9
              displayName:
                description: >-
                  Human friendly name of the account suitable for display. This
                  will be the title of the account during account selection.
                type: string
                example: Transaction account
              subtitle:
                description: >-
                  Human friendly subtitle for the account. This will be
                  displayed under the account title during account selection.
                  You may want to use another identifier that is easily
                  recognisable by the user such as an account number or meter
                  number
                type: string
                example: '11223344'
              openStatus:
                description: Open status of the account
                enum:
                  - CLOSED
                  - OPEN
              extensions:
                description: >-
                  Extended data about the account for industry-specific
                  scenarios
                type: object
                properties:
                  cdr:
                    description: >-
                      CDR specific properties of the account. Required if your
                      data provider operates under the CDR jurisdiction
                    type: object
                    properties:
                      complexAccountType:
                        description: >-
                          Type of account ownership defining complex account
                          behaviour
                        enum:
                          - INDIVIDUAL
                          - JOINT
                          - ORGANISATION
                      users:
                        type: array
                        description: >-
                          List of users authorised for sharing data from the
                          account (including the customer whose ID is in the
                          request URL)
                        items:
                          description: >-
                            A user authorised to share data or manage sharing
                            from the account
                          type: object
                          properties:
                            id:
                              type: string
                              description: Unique identifier for the user of the account.
                              example: dff4fce4-0aca-4916-ab4d-676776233089
                            email:
                              type: string
                              description: >-
                                contact email for the user, used for
                                notifications
                              example: hello@example.com
                            isAccountHolder:
                              type: boolean
                              description: >-
                                Flag denoting whether the user is an account
                                holder. Account holders have full privileges
                                over data sharing for the account.
                          required:
                            - id
                            - email
                            - isAccountHolder
                    required:
                      - complexAccountType
                      - users
            required:
              - accountId
              - displayName
      required:
        - accounts
      example:
        accounts:
          - accountId: aae2c55a-d8df-4c56-bc1a-3f36af2a24dc
            displayName: Savings Account
            subtitle: '102312'
            openStatus: OPEN
            extensions:
              cdr:
                complexAccountType: JOINT
                users:
                  - id: 3671870b-2ece-4767-9425-f506e22075a6
                    email: hello@example.com
                    isAccountHolder: true
                  - id: 86251be4-0e3d-488a-aeea-ae28ae8386bb
                    email: hello@example.org
                    isAccountHolder: false
  responses:
    unauthenticatedError:
      description: |-
        ## Unauthenticated
        The authentication JWT is missing or invalid
    forbiddenError:
      description: >-
        ## Forbidden

        This data is unavailable for sharing. You may withhold data if it could
        cause physical or monetary harm to an entity. If data is being withheld
        for this reason, set the `X-Sharing-Refused` header
    customerNotFoundError:
      description: >-
        ## Customer Not Found

        The customer in the URL parameter does not exist. Also a valid response
        when data is being withheld to protect an entity from physical or
        monetary harm. If data is being withheld for this reason, set the
        `X-Sharing-Refused` header
  securitySchemes:
    bearerAuth:
      description: >
        The Fiskil Data Provider will include a self-signed JWT as a Bearer
        token in the `Authorization` header.

        You should verify this JWT using the JWKS URL you can find for your Data
        Provider instance in the Fiskil

        Console. To verify the JWT you **must**:
          * Verify the signature
          * Ensure the token has not expired by checking the `exp` claim
          * The `sub` and `iss` claims are your data provider subdomain
          * The `aud` claim is the URI of the resource being requested (excluding any query parameters)
          * The `jti` value is unique
        For further detail on security and authentication refer to our
        [Authentication](/TODO) documentation
      type: http
      scheme: bearer
      bearerFormat: JWT

````