Groups
Get list of org memberships of a group user
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: Bearer YOUR_SECRET_TOKEN
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
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: Bearer YOUR_SECRET_TOKEN
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
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: Bearer YOUR_SECRET_TOKEN
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
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: Bearer YOUR_SECRET_TOKEN
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
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: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated
Was this helpful?