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

# Lists credentials for a database

> Lists all credentials that exist for a database. The id of the credential is
included in the response, but not the password. Passwords are provided only once,
at the time the credential is created, and are encrypted for storage.




## OpenAPI

````yaml https://global.thenile.dev/openapi.yaml get /workspaces/{workspaceSlug}/databases/{databaseName}/credentials
openapi: 3.0.1
info:
  title: Nile ReST API
  description: Making SaaS chill.
  contact:
    email: support@thenile.dev
  version: 0.1.0-1133318
servers:
  - url: https://global.thenile.dev
security: []
paths:
  /workspaces/{workspaceSlug}/databases/{databaseName}/credentials:
    get:
      tags:
        - databases
        - authentication
        - credentials
      summary: Lists credentials for a database
      description: >
        Lists all credentials that exist for a database. The id of the
        credential is

        included in the response, but not the password. Passwords are provided
        only once,

        at the time the credential is created, and are encrypted for storage.
      operationId: listCredentials
      parameters:
        - name: workspaceSlug
          in: path
          required: true
          schema:
            type: string
        - name: databaseName
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          in: query
          schema:
            type: string
        - name: internal
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A list of Credential objects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Credential'
        '401':
          description: Unauthorized. Credentials were missing or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '403':
          description: >-
            Forbidden. The credentials provided do not grant access to the
            requested resource(s).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      security:
        - jwtBearerAuth: []
components:
  schemas:
    Credential:
      required:
        - database
        - id
      type: object
      properties:
        id:
          minLength: 1
          type: string
        database:
          $ref: '#/components/schemas/Database'
    APIError:
      required:
        - errorCode
        - message
        - statusCode
      type: object
      properties:
        errorCode:
          type: string
          enum:
            - internal_error
            - bad_request
            - unsupported_operation
            - forbidden_operation
            - entity_not_found
            - duplicate_entity
            - invalid_credentials
            - unknown_oidc_provider
            - unknown_oidc_party
            - provider_already_exists
            - provider_config_error
            - provider_mismatch
            - provider_update_error
            - provider_disabled
            - session_state_missing
            - session_state_mismatch
            - oidc_code_missing
            - tenant_not_found
            - constraint_violation
            - sql_exception
            - db_creation_failure
            - db_status_failure
            - db_initialization_failure
            - db_deletion_failure
            - db_config_missing
            - unauthorized_workspace_access
            - email_send_failure
            - jdbc_exception
            - oidc_exception
            - region_mismatch
            - credential_creation_failure
            - credential_propagation_failure
            - unauthorized_client
            - unsupported_response_type
            - invalid_request
            - server_error
            - access_denied
            - feature_ineligible
            - customer_lookup_failure
            - threshold_exceeded
            - create_rejected
        message:
          minLength: 1
          type: string
        statusCode:
          type: integer
          format: int32
    Database:
      required:
        - id
        - name
        - regionId
        - status
        - workspace
      type: object
      properties:
        id:
          type: string
        name:
          minLength: 1
          type: string
        workspace:
          $ref: '#/components/schemas/Workspace'
        status:
          type: string
          enum:
            - PENDING
            - REQUESTED
            - BUILT
            - READY
        regionId:
          type: integer
          format: int32
        created:
          type: string
          format: date-time
    Workspace:
      required:
        - name
        - slug
      type: object
      properties:
        id:
          type: string
        name:
          minLength: 1
          type: string
        slug:
          minLength: 1
          type: string
        stripe_customer_id:
          type: string
        created:
          type: string
          format: date-time
  securitySchemes:
    jwtBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````