Groups
Returns a list of groups which a user is a member of
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
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))?))$
A list of groups is returned
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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/groups HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"name": "My Group",
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group",
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
}
}
Returns a list of SSO connections for a group
Required permissions
View SSO settings (group.sso.read)
The ID of the group
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
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))?))$
List of SSO connections is returned
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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/groups/{group_id}/sso_connections HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"name": "My SSO"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "sso_connection"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
}
}
Returns a list of users for a SSO connection
Required permissions
-
View SSO settings (group.sso.read)
-
View users (group.user.read)
The ID of the group
The ID of the SSO
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
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))?))$
List of users is returned
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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/groups/{group_id}/sso_connections/{sso_id}/users HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"active": true,
"email": "[email protected]",
"membership": {
"created_at": "2022-09-14T09:19:29.206Z",
"strategy": "direct"
},
"name": "user",
"username": "username"
},
"id": "55a348e2-c3ad-4bbc-b40e-9b232d1f4121",
"type": "user"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
}
}
Deletes a user from a Group SSO connection
Required permissions
-
View SSO settings (group.sso.read)
-
Delete users (group.user.delete)
The ID of the group
The ID of the SSO
The ID of the User
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))?))$
User is deleted from Group SSO connection
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.
Internal Server Error: An error was encountered while attempting to process the request.
DELETE /rest/groups/{group_id}/sso_connections/{sso_id}/users/{user_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Get list of org memberships of a group user
Required permissions
-
View Group Memberships (group.membership.read)
-
View Organizations (group.org.list)
The ID of the group
The ID of the User
Organization name
Org name
Filter the response for results only with the specified role.
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
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))?))$
A list of org memberships is returned
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/groups/{group_id}/org_memberships HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"created_at": "2021-05-29T09:50:54.014Z"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"org_membership_count": 1,
"relationships": {
"org": {
"data": {
"attributes": {
"name": "Example org"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "org"
}
},
"role": {
"data": {
"attributes": {
"name": "Admin role"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "org_role"
}
},
"user": {
"data": {
"attributes": {
"email": "[email protected]",
"name": "User2",
"username": "User name 2"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "user"
}
}
},
"type": "org_membership"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
},
"meta": {
"org_membership_count": 1
}
}
Create a group membership for a user with role
Required permissions
Add Group Memberships (group.membership.add)
The ID of the group
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))?))$
Membership for the group was 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/groups/{group_id}/memberships HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 290
{
"data": {
"relationships": {
"group": {
"data": {
"id": "8aab168e-fb3b-47c0-9d87-442715788b31",
"type": "group"
}
},
"role": {
"data": {
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group_role"
}
},
"user": {
"data": {
"id": "677d5f47-a8bf-4090-ba52-680903e7c8b5",
"type": "user"
}
}
},
"type": "group_membership"
}
}
{
"data": {
"attributes": {
"created_at": "2021-05-29T09:50:54.014Z"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"relationships": {
"group": {
"data": {
"attributes": {
"name": "Example group"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group"
}
},
"role": {
"data": {
"attributes": {
"name": "Admin role"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group_role"
}
},
"user": {
"data": {
"attributes": {
"email": "[email protected]",
"login_method": "text",
"name": "User2",
"username": "User name 2"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "user"
}
}
},
"type": "group_membership"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
}
}
Returns all memberships of the group
Required permissions
View Group Memberships (group.membership.read)
The ID of the group
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
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))?))$
Which column to sort by.
Order in which results are returned.
DESC
Example: ASC
Possible values: Filter the response by Users that match the provided email
Filter the response by Users that match the provided user ID
Filter the response by Users that match the provided username
Filter the response for results only with the specified role.
indicates whether the count of group memberships is included
List of group memberships is returned
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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/groups/{group_id}/memberships HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"created_at": "2022-03-16T00:00:00Z"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"meta": {
"group_membership_count": 1
},
"relationships": {
"group": {
"data": {
"attributes": {
"name": "Example group"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group"
}
},
"role": {
"data": {
"attributes": {
"name": "Admin role"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "group_role"
}
},
"user": {
"data": {
"attributes": {
"email": "[email protected]",
"login_method": "text",
"name": "User2",
"username": "User name 2"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "user"
}
}
},
"type": "group_membership"
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https://example.com/api/resource",
"last": "https://example.com/api/resource",
"next": "https://example.com/api/resource",
"prev": "https://example.com/api/resource",
"related": "https://example.com/api/resource",
"self": "https://example.com/api/resource"
}
}
Update a role from a group membership
Required permissions
Edit Group Memberships (group.membership.edit)
The ID of the group
The ID of the Group Membership
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))?))$
The operation completed successfully with no content
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.
Internal Server Error: An error was encountered while attempting to process the request.
PATCH /rest/groups/{group_id}/memberships/{membership_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 207
{
"data": {
"attributes": {},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"relationships": {
"role": {
"data": {
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "Always \"group_role\""
}
}
},
"type": "group_membership"
}
}
No content
Deletes a membership from a group
Required permissions
Delete Group Memberships (group.membership.delete)
The ID of the group
The ID of the Group Membership
indicates whether to delete the child org memberships of the group membership.
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))?))$
group membership is deleted from Group
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/groups/{group_id}/memberships/{membership_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?