TenantRole
Create a custom tenant role for a given tenant.
Required permissions
-
tenant.roles.read -
tenant.roles.create
API key value must be prefixed with "Token ".
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000Requested API version
2021-06-04Pattern: ^(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?version=text 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
API key value must be prefixed with "Token ".
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000Requested API version
2021-06-04Pattern: ^(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.
examplenameWhether role is custom or not.
falseWhen true, only return roles that the current user can assign to others in the tenant.
falseoption to show all permission types
falseReturn 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
10Example: 10Returns 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?version=text 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"
},
"meta": {
"permissions": [
{
"description": "Edit details of the Group",
"name": "Edit Group Details",
"parent": "group.read",
"value": "text"
}
]
}
}Update attributes of a custom tenant role in a given tenant
Required permissions
-
tenant.roles.read -
tenant.roles.edit
API key value must be prefixed with "Token ".
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000Unique identifier of the role.
00000000-0000-0000-0000-000000000000Requested API version
2021-06-04Pattern: ^(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
falseReturns 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}?version=text 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
API key value must be prefixed with "Token ".
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000Unique identifier of the role.
00000000-0000-0000-0000-000000000000Requested API version
2021-06-04Pattern: ^(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
falseReturns 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}?version=text 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
API key value must be prefixed with "Token ".
Unique identifier of the tenant.
00000000-0000-0000-0000-000000000000Unique identifier of the role.
00000000-0000-0000-0000-000000000000Requested API version
2021-06-04Pattern: ^(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}?version=text HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?

