Permissions API
8 endpoints. Request and response schemas are described on the schemas page; the other tags are listed in the API index.
Endpoints
GET /api/v1/permission-targets
List permission targets
List all permission targets
Responses
| Status | Description | Body |
|---|---|---|
200 | List of permission targets | application/json: object |
403 | Forbidden | application/json: Error |
Fields of the 200 response (application/json):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of PermissionTarget | yes | - |
POST /api/v1/permission-targets
Create permission target
Create a new permission target
Request body (required)
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
actions | array of string | no | Items: one of: read, write, delete, manage, annotate. |
name | string | yes | - |
path_pattern | string | no | - |
repository_filter | string | no | - |
Responses
| Status | Description | Body |
|---|---|---|
201 | Permission target created | application/json: PermissionTarget |
400 | Invalid request | application/json: Error |
403 | Forbidden | application/json: Error |
409 | Conflict with the current state | application/json: Error |
GET /api/v1/permission-targets/{id}
Get permission target
Get details of a specific permission target
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Responses
| Status | Description | Body |
|---|---|---|
200 | Permission target details | application/json: PermissionTarget |
400 | Invalid request, including a NUL byte in the URL or the body | application/json: Error |
403 | Forbidden | application/json: Error |
404 | Permission target not found | - |
PATCH /api/v1/permission-targets/{id}
Update permission target
Update a permission target
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Request body (required)
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
actions | array of string | no | Items: one of: read, write, delete, manage, annotate. |
name | string | no | - |
path_pattern | string | no | - |
repository_filter | string | no | - |
Responses
| Status | Description | Body |
|---|---|---|
200 | Permission target updated | application/json: PermissionTarget |
400 | Invalid request | application/json: Error |
403 | Forbidden | application/json: Error |
404 | Permission target not found | - |
409 | Conflict with the current state | application/json: Error |
DELETE /api/v1/permission-targets/{id}
Delete permission target
Delete a permission target
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Responses
| Status | Description | Body |
|---|---|---|
204 | Permission target deleted | - |
400 | Invalid request, including a NUL byte in the URL or the body | application/json: Error |
403 | Forbidden | application/json: Error |
404 | Permission target not found | - |
GET /api/v1/permission-targets/{id}/assignments
List permission assignments
List the users and groups a permission target is assigned to (admin only)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Responses
| Status | Description | Body |
|---|---|---|
200 | Assignments sorted by principal type then name | application/json: object |
400 | Invalid request, including a NUL byte in the URL or the body | application/json: Error |
403 | Admin access required | - |
404 | Permission target not found | - |
Fields of the 200 response (application/json):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of PermissionAssignment | yes | - |
POST /api/v1/permission-targets/{id}/assignments
Assign permission
Assign a permission target to a user or group
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Request body (required)
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
group_id | string (uuid) | no | - |
user_id | string (uuid) | no | - |
Responses
| Status | Description | Body |
|---|---|---|
200 | Permission assigned | - |
400 | Invalid request | application/json: Error |
403 | Forbidden | application/json: Error |
404 | The addressed resource was not found | application/json: Error |
DELETE /api/v1/permission-targets/{id}/assignments
Unassign permission
Remove a permission assignment
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | - |
Request body (required)
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
group_id | string (uuid) | no | - |
user_id | string (uuid) | no | - |
Responses
| Status | Description | Body |
|---|---|---|
204 | Permission unassigned | - |
400 | Invalid request | application/json: Error |
403 | Forbidden | application/json: Error |
404 | The addressed resource was not found | application/json: Error |