Dfns API Documentation
Ask or search…
K

Create Assignment

POST /permissions/{permissionId}/assignments
Creates a permission assignment, effectively granting a permission to a specific Identity. Response confirms the assignment (success) or gives the reason why it's not possible (failure).

Required Permissions

Name
Conditions
PermissionAssignments:Create
Always Required

Triggers

PermissionManagement

Request body

In the request body specify the identity ID.
Request body fields
Required/Optional
Description
Type
identityId
Required
The ID of the identity the permission is being assigned to.
String

Request example

{
"identityId": "some-identity-id",
}

Response

Response example 200 - no approval required

If successful, the response will contain an assignment object similar to the one below:
{
"id": "as-stream-pizza-08edcfff93",
"permissionId": "pm-orange-apple-2b17a80613",
"identityId": "oe-louisiana-one-6cf5e80c205c",
"isImmutable": false,
"dateCreated": "2022-10-26T09:48:31.247Z",
"dateUpdated": "2022-10-26T09:48:31.247Z"
}

Response example 202 - approval required

{
"id":"cr-...",
"orgId":"or-...",
"requester":{
"appId":"ap-...",
"userId":"us-...",
"tokenId":"to-..."
},
"kind":"Assignment",
"operationKind":"Create",
"status":"Pending",
"entityId":"as-...",
"body":{
"id":"as-stream-pizza-08edcfff93",
"permissionId":"pm-orange-apple-2b17a80613",
"identityId":"oe-louisiana-one-6cf5e80c205c",
"isImmutable":false,
"dateCreated":"2022-10-26T09:48:31.247Z",
"dateUpdated":"2022-10-26T09:48:31.247Z"
},
"dateCreated":"2023-12-22T20:57:55.814Z",
"dateResolved":"2023-12-22T20:57:55.814Z"
}

Notes

Assignment IDs look like this: as-stream-pizza-08edcfff93. They follow this format: as-<random-words>-<random-alphanumeric-string>
Last modified 24d ago