Orgs
Get a paginated list of organizations you have access to.
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))?))$
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
If set, only return organizations within the specified group
If true, only return organizations that are not part of a group.
Only return orgs whose slug exactly matches this value.
^[\w.-]+$
Only return orgs whose name contains this value.
A list of organizations you have access to.
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/orgs HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"attributes": {
"access_requests_enabled": false,
"created_at": "2022-03-16T00:00:00Z",
"group_id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"is_personal": true,
"name": "My Org",
"slug": "my-org",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"relationships": {
"member_role": {
"data": {
"attributes": {
"name": "Collaborator"
},
"id": "f60ff965-6889-4db2-8c86-0285d62f35ab",
"type": "resource"
}
}
},
"type": "resource"
}
],
"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 the details of an organization
Unique identifier for org
b667f176-df52-4b0a-9954-117af6b05ab7
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))?))$
Instance of org is updated
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.
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/orgs/{org_id} HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 98
{
"data": {
"attributes": {
"name": "My Org"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "org"
}
}
{
"data": {
"attributes": {
"access_requests_enabled": false,
"created_at": "2022-03-16T00:00:00Z",
"group_id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"is_personal": true,
"name": "My Org",
"slug": "my-org",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"relationships": {
"member_role": {
"data": {
"attributes": {
"name": "Collaborator"
},
"id": "f60ff965-6889-4db2-8c86-0285d62f35ab",
"type": "resource"
}
}
},
"type": "org"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
Create a org membership for a user with role
The ID of the org
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 user is created on the org
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/orgs/{org_id}/memberships HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 282
{
"data": {
"relationships": {
"org": {
"data": {
"id": "8aab168e-fb3b-47c0-9d87-442715788b31",
"type": "org"
}
},
"role": {
"data": {
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "org_role"
}
},
"user": {
"data": {
"id": "677d5f47-a8bf-4090-ba52-680903e7c8b5",
"type": "user"
}
}
},
"type": "org_membership"
}
}
{
"data": {
"attributes": {
"created_at": "2021-05-29T09:50:54.014Z"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"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]",
"login_method": "text",
"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"
}
}
Returns all memberships of the org
The ID of the org
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.
ASC
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.
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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/orgs/{org_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",
"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]",
"login_method": "text",
"name": "User2",
"username": "User name 2"
},
"id": "331ede0a-de94-456f-b788-166caeca58bf",
"type": "user"
}
}
},
"type": "org_memberships"
}
],
"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 org membership for a user with role
The id of the org
The id of the org 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 Membership is updated
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/orgs/{org_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: 192
{
"data": {
"attributes": {},
"id": "f60ff965-6889-4db2-8c86-0285d62f35ab",
"relationships": {
"role": {
"data": {
"id": "f60ff965-6889-4db2-8c86-0285d62f35ab",
"type": "org_role"
}
}
},
"type": "org_membership"
}
}
No content
Remove a user's membership of the group.
The id of the org
The id of the org 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))?))$
Org membership for the user was 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.
Internal Server Error: An error was encountered while attempting to process the request.
DELETE /rest/orgs/{org_id}/memberships/{membership_id} HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Get a paginated list of all the organizations belonging to the group. By default, this endpoint returns the organizations in alphabetical order of their name.
Unique identifier for group
b667f176-df52-4b0a-9954-117af6b05ab7
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))?))$
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
Only return organizations whose name contains this value. Case insensitive.
Only return organizations whose slug exactly matches this value. Case sensitive.
A list of organizations in the 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.
Internal Server Error: An error was encountered while attempting to process the request.
GET /rest/groups/{group_id}/orgs HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"attributes": {
"access_requests_enabled": false,
"created_at": "2022-03-16T00:00:00Z",
"group_id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"is_personal": true,
"name": "My Org",
"slug": "my-org",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"type": "resource"
}
],
"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"
}
}
Last updated
Was this helpful?