Create a Permission
Create a new permission.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Create Object endpoint instead.
Endpoint
POST /v1/permissions
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
permissionId | A string identifier for the permission. A permissionId must be composed of alphanumeric chars and/or _ , - , . , @ , | , and : . | JSON body | yes |
name | An optional, display-friendly name for the permission. | JSON body | no |
description | An optional description of the permission. A useful description might include a summary of the functionality the permission grants. | JSON body | no |
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
- CLI
curl "https://api.warrant.dev/v1/permissions" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"permissionId": "edit-dashboards",
"name": "Edit Dashboards",
"description": "Grants the user the ability to create and update custom analytics dashboards"
}'
createdPermission, err := permission.Create(&warrant.PermissionParams{
PermissionId: "edit-dashboards",
Name: "Edit Dashboards",
Description: "Grants the user the ability to create and update custom analytics dashboards",
})
if err != nil {
// handle error
}
try {
Permission newPermission = client.createPermission(new Permission(
"edit-dashboards",
"Edit Dashboards",
"Grants the user the ability to create and update custom analytics dashboards"
));
} catch (WarrantException e) {
// Handle error
}
const newPermission = await warrantClient.Permission.create({
permissionId: "edit-dashboards",
name: "Edit Dashboards",
description:
"Grants the user the ability to create and update custom analytics dashboards",
});
permission = warrant.Permission.create("edit-dashboards", "Edit Dashboards", "Grants the user the ability to create and update custom analytics dashboards")
permission = Warrant::Permission.create(
permission_id: "edit-dashboards",
name: "Edit Dashboards",
description: "Grants the user the ability to create and update custom analytics dashboards"
)
$permission = $warrant->createPermission(new \Warrant\Permission(
"edit-dashboards",
"Edit Dashboards",
"Grants the user the ability to create and update custom analytics dashboards"
));
warrant create permission edit-dashboards
Response
{
"permissionId": "edit-dashboards",
"name": "Edit Dashboards",
"description": "Grants the user the ability to create and update custom analytics dashboards"
}