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

# List grants on a database

> Retrieve grants on a database. Grants are the privileges granted to users
on this database.



## OpenAPI

````yaml /openapi/cluster-api-v2.json get /databases/{database}/grants/
openapi: 3.0.0
info:
  description: >-
    REST API for querying information about CockroachDB cluster health, nodes,
    ranges,

    sessions, and other meta information. For additional details, see
    cockroachlabs.com/docs/stable/cluster-api.
  title: CockroachDB v2 API
  license:
    name: Business Source License
  version: '2.0'
  x-logo:
    url: https://www.cockroachlabs.com/docs/images/cockroachlabs-logo-170.png
    backgroundColor: '#FFFFFF'
    altText: Cockroach Labs logo
servers:
  - url: https://localhost/api/v2
  - url: http://localhost/api/v2
security: []
paths:
  /databases/{database}/grants/:
    get:
      summary: List grants on a database
      description: >-
        Retrieve grants on a database. Grants are the privileges granted to
        users

        on this database.
      operationId: databaseGrants
      parameters:
        - description: Name of the database being looked up.
          name: database
          in: path
          required: true
          schema:
            type: string
        - description: Maximum number of grants to return in this call.
          name: limit
          in: query
          schema:
            type: integer
        - description: Continuation token for results after a past limited run.
          name: offset
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Database grants response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/databaseGrantsResponse'
        '404':
          description: Database not found
      x-codeSamples:
        - lang: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://localhost/api/v2/databases/%7Bdatabase%7D/grants/?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE'
components:
  schemas:
    databaseGrantsResponse:
      type: object
      title: Response for databaseGrants.
      properties:
        grants:
          description: Grants are the privileges granted to users on this database.
          type: array
          items:
            $ref: '#/components/schemas/DatabaseDetailsResponse_Grant'
          x-go-name: Grants
        next:
          description: >-
            The continuation token, for use in the next paginated call in the
            `offset`

            parameter.
          type: integer
          format: int64
          x-go-name: Next
      x-go-package: github.com/cockroachdb/cockroach/pkg/server
    DatabaseDetailsResponse_Grant:
      type: object
      properties:
        privileges:
          description: Privileges granted to the user.
          type: array
          items:
            type: string
          x-go-name: Privileges
        user:
          description: User that this grant applies to.
          type: string
          x-go-name: User
      x-go-package: github.com/cockroachdb/cockroach/pkg/server/serverpb

````