> ## 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.

# Assign Tenant Permission

> Creates a permission that allows certain specified operations to be executed. 
  
  Response is either the permission object itself (success) or a reason why it was not possible to create the permission (failure).

#### Authentication

❌ Organization User (`CustomerEmployee`)\
❌ Delegated User (`EndUser`)\
❌ Service Account

#### Required Permissions

`Tenant:Permissions:Assign`: Always required.


## OpenAPI

````yaml /openapi.yaml post /tenant/permissions/{permissionId}/assign
openapi: 3.1.0
info:
  version: 2.0.249
  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:
  /tenant/permissions/{permissionId}/assign:
    post:
      tags:
        - Tenant
      summary: Assign Tenant Permission
      description: >-
        Creates a permission that allows certain specified operations to be
        executed. 
          
          Response is either the permission object itself (success) or a reason why it was not possible to create the permission (failure).
      operationId: assignTenantPermission
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                identityId:
                  type: string
                  minLength: 1
                  description: >-
                    ID of the identity to assign the permission to. Can be a
                    user ID, a service account ID, or a personal access token
                    (PAT) ID.
              required:
                - identityId
              additionalProperties: false
      responses:
        '200':
          description: Success
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  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)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.