Invites
Invite a user to an organization with a role.
Required permissions
Invite users (org.user.invite)
The id of the org the user is being invited 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))?))$
A new organization invitation has been 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.
Internal Server Error: An error was encountered while attempting to process the request.
POST /rest/orgs/{org_id}/invites HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 123
{
"data": {
"attributes": {
"email": "[email protected]",
"role": "f1968726-1dca-42d4-a4dc-80cab99e2b6c"
},
"type": "org_invitation"
}
}
{
"data": {
"attributes": {
"email": "[email protected]",
"is_active": true,
"role": "f1968726-1dca-42d4-a4dc-80cab99e2b6c"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"relationships": {
"org": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
}
},
"type": "org_invitation"
},
"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"
}
}
List pending user invitations to an organization.
Required permissions
-
View Organization (org.read)
-
View users (org.user.read)
The id of the org the user is being invited 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
List of pending invitations to an organization.
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}/invites HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"email": "[email protected]",
"is_active": true,
"role": "Developer"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"relationships": {
"org": {
"data": {
"id": "4a72d1db-b465-4764-99e1-ecedad03b06a",
"type": "resource"
},
"links": {
"related": {
"href": "https://example.com/api/resource/4a72d1db-b465-4764-99e1-ecedad03b06a"
}
}
}
},
"type": "text"
}
],
"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"
}
}
Cancel a pending user invitations to an organization.
Required permissions
Invite users (org.user.invite)
The id of the org the user is being invited to
The id of the pending invite to cancel
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.
DELETE /rest/orgs/{org_id}/invites/{invite_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?