TenantRole
Create a custom tenant role for a given tenant.
Required permissions
-
tenant.roles.read
-
tenant.roles.create
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000
Requested API version
2021-06-04
Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Tenant role successfully created.
Bad Request: A parameter provided as a part of the request was invalid.
Unauthorized: the request requires an authentication token.
Forbidden: the request requires an authentication token with more or different permissions.
Not Found: The resource being operated on could not be found.
Conflict: The requested operation conflicts with the current state of the resource in some way.
Internal Server Error: An error was encountered while attempting to process the request.
POST /rest/tenants/{tenant_id}/roles HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 104
{
"data": {
"attributes": {
"description": "text",
"name": "text",
"permissions": [
"text"
]
},
"type": "tenant_role"
}
}
{
"data": {
"attributes": {
"custom": false,
"description": "text",
"name": "text",
"normalized_name": "text",
"permissions": [
"text"
]
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"meta": {
"app_count": 1,
"service_account_count": 1,
"user_count": 1
},
"relationships": {
"tenant": {
"data": {
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"type": "tenant"
}
}
},
"type": "tenant_role"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
List all available roles for a given tenant.
Required permissions
tenant.roles.read
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000
Requested API version
2021-06-04
Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Role name filter.
examplename
Whether role is custom or not.
false
When true, only return roles that the current user can assign to others in the tenant.
false
Return the page of results immediately after this cursor
v1.eyJpZCI6IjEwMDAifQo=
Return the page of results immediately before this cursor
v1.eyJpZCI6IjExMDAifQo=
Number of results to return per page
10
Example: 10
Returns an array of roles that are the roles on a Tenant.
Bad Request: A parameter provided as a part of the request was invalid.
Unauthorized: the request requires an authentication token.
Forbidden: the request requires an authentication token with more or different permissions.
Not Found: The resource being operated on could not be found.
Conflict: The requested operation conflicts with the current state of the resource in some way.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/tenants/{tenant_id}/roles HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"custom": false,
"description": "text",
"name": "text",
"normalized_name": "text",
"permissions": [
"text"
]
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"meta": {
"app_count": 1,
"service_account_count": 1,
"user_count": 1
},
"relationships": {
"tenant": {
"data": {
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"type": "tenant"
}
}
},
"type": "tenant_role"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource?ending_before=v1.eyJpZCI6IjExIn0K",
"last": "https://example.com/api/resource?starting_after=v1.eyJpZCI6IjMwIn0K",
"next": "https://example.com/api/resource?starting_after=v1.eyJpZCI6IjEwIn0K"
}
}
Update attributes of a custom tenant role in a given tenant
Required permissions
-
tenant.roles.read
-
tenant.roles.edit
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000
Unique identifier of the role.
00000000-0000-0000-0000-000000000000
Requested API version
2021-06-04
Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
flag to force the update of a role, required if users are assigned to the role
false
Returns the updated role.
Bad Request: A parameter provided as a part of the request was invalid.
Unauthorized: the request requires an authentication token.
Forbidden: the request requires an authentication token with more or different permissions.
Not Found: The resource being operated on could not be found.
Conflict: The requested operation conflicts with the current state of the resource in some way.
Internal Server Error: An error was encountered while attempting to process the request.
PATCH /rest/tenants/{tenant_id}/roles/{role_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 148
{
"data": {
"attributes": {
"description": "text",
"name": "text",
"permissions": [
"text"
]
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "tenant_role"
}
}
{
"data": {
"attributes": {
"custom": false,
"description": "text",
"name": "text",
"normalized_name": "text",
"permissions": [
"text"
]
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"meta": {
"app_count": 1,
"service_account_count": 1,
"user_count": 1
},
"relationships": {
"tenant": {
"data": {
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"type": "tenant"
}
}
},
"type": "tenant_role"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
Return a role from a tenant by the tenant and role id with its details and permissions.
Required permissions
tenant.roles.read
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000
Unique identifier of the role.
00000000-0000-0000-0000-000000000000
Requested API version
2021-06-04
Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
returns current memberships of the role in the meta relationships section
false
Returns the requested role.
Bad Request: A parameter provided as a part of the request was invalid.
Unauthorized: the request requires an authentication token.
Forbidden: the request requires an authentication token with more or different permissions.
Not Found: The resource being operated on could not be found.
Conflict: The requested operation conflicts with the current state of the resource in some way.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/tenants/{tenant_id}/roles/{role_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": {
"attributes": {
"custom": false,
"description": "text",
"name": "text",
"normalized_name": "text",
"permissions": [
"text"
]
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"meta": {
"app_count": 1,
"service_account_count": 1,
"user_count": 1
},
"relationships": {
"tenant": {
"data": {
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"type": "tenant"
}
}
},
"type": "tenant_role"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
Delete a custom tenant role in a given tenant
Required permissions
-
tenant.roles.read
-
tenant.roles.delete
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000
Unique identifier of the role.
00000000-0000-0000-0000-000000000000
Requested API version
2021-06-04
Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Tenant role successfully deleted.
Bad Request: A parameter provided as a part of the request was invalid.
Unauthorized: the request requires an authentication token.
Forbidden: the request requires an authentication token with more or different permissions.
Not Found: The resource being operated on could not be found.
Conflict: The requested operation conflicts with the current state of the resource in some way.
Internal Server Error: An error was encountered while attempting to process the request.
DELETE /rest/tenants/{tenant_id}/roles/{role_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?