# Permissions
# Paginate Permissions
GET
/permissions
# Example Request
curl --location --request GET 'https://yourwebsite.com/api/permissions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'
# Example Response
{
"data": [
{
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation.",
"id": 1,
"removable": true,
"created_at": "2017-04-20 16:47:59",
"updated_at": "2017-04-27 10:47:59"
},
// ...
]
}
# Sortable Fields
name
, created_at
(default)
# Partial filters
name
, display_name
# Exact Filters
role
# Create Permission
POST
/permissions
# Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | String | Yes | Permission name for using it within the code. |
display_name | String | Yes | Permission display name. |
description | String | No | A short permission description. |
# Example Request
curl --location --request POST 'https://yourwebsite.com/api/permissions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation."
}'
# Example Response
{
"data": {
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation.",
"id": 1,
"removable": true,
"created_at": "2017-04-20 16:47:59",
"updated_at": "2017-04-27 10:47:59"
}
}
# Get Permission
GET
/permissions/{id}
# Example Request
curl --location --request GET 'https://yourwebsite.com/api/permissions/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'
# Example Response
{
"data": {
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation.",
"id": 1,
"removable": true,
"created_at": "2017-04-20 16:47:59",
"updated_at": "2017-04-27 10:47:59"
}
}
# Update Permission
PATCH
/permissions/{id}
# Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | String | No | Permission name for using it within the code. |
display_name | String | No | Permission display name. |
description | String | No | A short permission description. |
# Example Request
curl --location --request PATCH 'https://yourwebsite.com/api/permissions/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation."
}'
# Example Response
{
"data": {
"name": "users.create",
"display_name": "Create Users",
"description": "Allows user creation.",
"id": 1,
"removable": true,
"created_at": "2017-04-20 16:47:59",
"updated_at": "2017-04-27 10:47:59"
}
}
# Delete Permission
DELETE
/permissions/{id}
# Example Request
curl --location --request DELETE 'https://yourwebsite.com/api/permissions/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'
# Example Response
Status: 200 OK
{
"success": true
}