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

# List Permission Assignments

> Lists all permission (role) assignments for a given permission.



## OpenAPI

````yaml /openapi.yaml get /permissions/{permissionId}/assignments
openapi: 3.1.0
info:
  version: 1.807.0
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /permissions/{permissionId}/assignments:
    get:
      tags:
        - Permissions
      summary: List Permission Assignments
      description: Lists all permission (role) assignments for a given permission.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            description: >-
              ID of the permission (also referred to as "role" in the
              dashboard).
          required: true
          description: ID of the permission (also referred to as "role" in the dashboard).
          name: permissionId
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 50
            description: Maximum number of items to return.
          required: false
          description: Maximum number of items to return.
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            description: >-
              Opaque token used to retrieve the next page. Returned as
              `nextPageToken` from the previous request.
          required: false
          description: >-
            Opaque token used to retrieve the next page. Returned as
            `nextPageToken` from the previous request.
          name: paginationToken
          in: query
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              minLength: 1
                              maxLength: 64
                              pattern: ^as-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                              description: ID of the permission assignment.
                              example: as-1vcmc-qrek0-6b4vii9pln60907e
                            permissionId:
                              type: string
                              minLength: 1
                              maxLength: 64
                              pattern: ^pm-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                              description: >-
                                ID of the permission (also referred to as "role"
                                in the dashboard).
                              example: pm-37vj4-jkr4l-lc9945spfftkne57
                            identityId:
                              type: string
                              description: >-
                                ID of the identity the permission is assigned
                                to. Can be a user ID, a service account ID, or a
                                personal access token (PAT) ID.
                            isImmutable:
                              type: boolean
                              description: >-
                                Whether this assignment is system-managed and
                                cannot be modified.
                            dateCreated:
                              type: string
                              format: date-time
                              description: >-
                                [ISO
                                8601](https://en.wikipedia.org/wiki/ISO_8601)
                                date (must be UTC). Date the assignment was
                                created.
                              example: '2023-04-14T20:41:28.715Z'
                            dateUpdated:
                              type: string
                              format: date-time
                              description: >-
                                [ISO
                                8601](https://en.wikipedia.org/wiki/ISO_8601)
                                date (must be UTC). Date the assignment was last
                                updated.
                              example: '2023-04-14T20:41:28.715Z'
                          required:
                            - id
                            - permissionId
                            - identityId
                            - isImmutable
                            - dateCreated
                            - dateUpdated
                          additionalProperties: false
                        - type: object
                          properties:
                            pendingChangeRequest:
                              type: object
                              properties:
                                id:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                  pattern: ^cr-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                                  description: ID of the change request.
                                  example: cr-6uunn-bm6ja-f6rmod5kqrk5rbel
                                requester:
                                  $ref: '#/components/schemas/ChangeRequestRequester'
                                status:
                                  type: string
                                  enum:
                                    - Applied
                                    - Failed
                                    - Pending
                                    - Rejected
                                  description: Current status of the change request.
                                entityId:
                                  type: string
                                  description: ID of the entity being changed.
                                dateCreated:
                                  type: string
                                  format: date-time
                                  description: >-
                                    [ISO
                                    8601](https://en.wikipedia.org/wiki/ISO_8601)
                                    date (must be UTC). Date the change request
                                    was created.
                                  example: '2023-04-14T20:41:28.715Z'
                                dateResolved:
                                  type: string
                                  format: date-time
                                  description: >-
                                    [ISO
                                    8601](https://en.wikipedia.org/wiki/ISO_8601)
                                    date (must be UTC). Date the change request
                                    was resolved.
                                  example: '2023-04-14T20:41:28.715Z'
                                approvalId:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                  pattern: ^ap-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                                  example: ap-2a9in-tt2a1-983lho480p35ejd0
                                kind:
                                  type: string
                                  enum:
                                    - Assignment
                                operationKind:
                                  type: string
                                  enum:
                                    - Create
                                    - Delete
                                body:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                      pattern: >-
                                        ^as-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                                      description: ID of the permission assignment.
                                      example: as-1vcmc-qrek0-6b4vii9pln60907e
                                    permissionId:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                      pattern: >-
                                        ^pm-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                                      description: >-
                                        ID of the permission (also referred to
                                        as "role" in the dashboard).
                                      example: pm-37vj4-jkr4l-lc9945spfftkne57
                                    identityId:
                                      type: string
                                      description: >-
                                        ID of the identity the permission is
                                        assigned to. Can be a user ID, a service
                                        account ID, or a personal access token
                                        (PAT) ID.
                                    isImmutable:
                                      type: boolean
                                      description: >-
                                        Whether this assignment is
                                        system-managed and cannot be modified.
                                  required:
                                    - id
                                    - permissionId
                                    - identityId
                                    - isImmutable
                                  additionalProperties: false
                              required:
                                - id
                                - requester
                                - status
                                - entityId
                                - dateCreated
                                - kind
                                - operationKind
                                - body
                              additionalProperties: false
                    description: Current page items.
                  nextPageToken:
                    type: string
                    description: >-
                      token to use as `paginationToken` to request the next
                      page.
                required:
                  - items
      security:
        - authenticationToken: []
components:
  schemas:
    ChangeRequestRequester:
      type: object
      properties:
        userId:
          type: string
        tokenId:
          type: string
        appId:
          type: string
      required:
        - userId
      description: The user who initiated the change request.
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)

````