Invites

This document uses the REST API. For more details, see the Authentication for API page.

Invite a user to an organization

post

Invite a user to an organization with a role.

Authorizations
Path parameters
org_idstring · uuidrequired

The id of the org the user is being invited to

Query parameters
versionstringrequired

Requested API version

Example: 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))?))$
Body
dataobjectrequired

Responses
curl -L \
  --request POST \
  --url 'https://api.snyk.io/rest/orgs/{org_id}/invites?version=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
    "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.

get

List pending user invitations to an organization.

Authorizations
Path parameters
org_idstring · uuidrequired

The id of the org the user is being invited to

Query parameters
versionstringrequired

Requested API version

Example: 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))?))$
starting_afterstringoptional

Return the page of results immediately after this cursor

Example: v1.eyJpZCI6IjEwMDAifQo=
ending_beforestringoptional

Return the page of results immediately before this cursor

Example: v1.eyJpZCI6IjExMDAifQo=
limitinteger · int32 · min: 10 · max: 100 · default: 10optional

Number of results to return per page

Example: 10
Responses
curl -L \
  --url 'https://api.snyk.io/rest/orgs/{org_id}/invites?version=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "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.

delete

Cancel a pending user invitations to an organization.

Authorizations
Path parameters
org_idstring · uuidrequired

The id of the org the user is being invited to

invite_idstring · uuidrequired

The id of the pending invite to cancel

Query parameters
versionstringrequired

Requested API version

Example: 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))?))$
Responses
curl -L \
  --request DELETE \
  --url 'https://api.snyk.io/rest/orgs/{org_id}/invites/{invite_id}?version=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

No body

Last updated

Was this helpful?

Revision created

Add comment to emphasize required filters hidden in GitBook collapsed field