Organizations (v1)

This document uses the v1 API, which will eventually be deprecated, as further Snyk developments are now focused on the REST API. For more details, see the v1 API.

List all the organizations a user belongs to

get

Each request to Snyk has to be done in the context of a Snyk organization. If no organization is specified, the user's default organization (user is identified according to the API_KEY) will be used. The organization determines the access rights, licenses policy and is the unit of billing for private projects. An organization should be given as a query parameter named org, with the public identifier given to this org. The list of organizations and their corresponding public ids can be found with the organization resource

Required permissions

  • View Organization
Responses
get
GET /v1/orgs HTTP/1.1
Host: api.snyk.io
Accept: */*
200Success
{
  "orgs": [
    {
      "name": "text",
      "id": "text",
      "slug": "text",
      "url": "text",
      "group": {}
    }
  ]
}

Create a new organization

post

An organization can be created as part of a group, or independently. If the groupId is not provided, a Personal Org will be created independent of a group.

Body
all ofOptional
and
anyOptionalExample: {"name":"new-org","groupId":"4a18d42f-0706-4ad0-b127-24078731fbed","sourceOrgId":"6b4a3261-b68f-43a0-9218-1f082e77f879"}
Responses
Responseall of
and
anyOptionalExample: {"id":"0356f641-c55c-488f-af05-c2122590f369","name":"new-org","slug":"new-org","url":"https://api.snyk.io/v1/org/new-org","created":"2021-01-07T16:07:16.237Z","group":{"name":"test-group","id":"4a18d42f-0706-4ad0-b127-24078731fbed"}}
post
POST /v1/org HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 120

{
  "name": "new-org",
  "groupId": "4a18d42f-0706-4ad0-b127-24078731fbed",
  "sourceOrgId": "6b4a3261-b68f-43a0-9218-1f082e77f879"
}
{
  "id": "0356f641-c55c-488f-af05-c2122590f369",
  "name": "new-org",
  "slug": "new-org",
  "url": "https://api.snyk.io/v1/org/new-org",
  "created": "2021-01-07T16:07:16.237Z",
  "group": {
    "name": "test-group",
    "id": "4a18d42f-0706-4ad0-b127-24078731fbed"
  }
}

Remove organization

delete

Required permissions

  • View Organization

  • Remove Organization

Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have permission to delete the provided organization. Currently this operation is only supported for organizations without any projects.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Responses
delete
DELETE /v1/org/{orgId} HTTP/1.1
Host: api.snyk.io
Accept: */*
204Success

No content

Update organization settings

put

Settings that are not provided will not be modified.

Required permissions

  • View Organization

  • Edit Organization

Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 25065eb1-109c-4c3e-9503-68fc56ef6f44
Body
stringOptionalExample: + Attributes (Org settings request)
Responses
Responseall of
and
anyOptionalExample: {"requestAccess":{"enabled":true}}
put
PUT /v1/org/{orgId}/settings HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 37

"+ Attributes (Org settings request)"
{
  "requestAccess": {
    "enabled": true
  }
}

View organization settings

get

Required permissions

  • View Organization
Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have access to this organization.

Example: 25065eb1-109c-4c3e-9503-68fc56ef6f44
Responses
Responseall of
and
anyOptionalExample: {"requestAccess":{"enabled":true},"ignores":{"reasonRequired":false,"autoApproveIgnores":false}}
get
GET /v1/org/{orgId}/settings HTTP/1.1
Host: api.snyk.io
Accept: */*
200Success
{
  "requestAccess": {
    "enabled": true
  },
  "ignores": {
    "reasonRequired": false,
    "autoApproveIgnores": false
  }
}

Provision a user to the organization

post

This endpoint allows Snyk Admins to provision user access to Snyk Orgs prior to the user login to the Snyk platform, and does not send out invitation emails to the Snyk platform. When the provisioned user logs into Snyk for the first time, the user will automatically be granted the appropriate Snyk org access and role permissions specified in the API call. This endpoint can be called multiple times to provision a user to multiple Snyk orgs. The API token used requires Org Admin permisisons, and must be part of a Snyk group with a valid SSO connection. Service accounts are restricted from invoking this API. As this endpoint can only be used to provision new users, if a user has already logged into Snyk, this endpoint will not work to provision user access

Required permissions

  • Provision User
Path parameters
orgIdstringRequired

The organization ID. The API_KEY must not exceed the permissions being granted to the provisioned user.

Example: 25065eb1-109c-4c3e-9503-68fc56ef6f44
Body
emailstringRequired

The email of the user.

Example: [email protected]
rolePublicIdstringOptional

ID of the role to grant this user.

rolestringOptional

Deprecated. Name of the role to grant this user. Must be one of ADMIN, COLLABORATOR, or RESTRICTED_COLLABORATOR. This field is invalid if rolePublicId is supplied with the request.

Responses
post
POST /v1/org/{orgId}/provision HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "email": "[email protected]",
  "rolePublicId": "",
  "role": ""
}
{
  "email": "",
  "role": "",
  "rolePublicId": "",
  "created": ""
}

List pending user provisions

get

This endpoint allows Snyk Admins to provision user access to Snyk Orgs prior to the user login to the Snyk platform, and does not send out invitation emails to the Snyk platform. When the provisioned user logs into Snyk for the first time, the user will automatically be granted the appropriate Snyk org access and role permissions specified in the API call. This endpoint can be called multiple times to provision a user to multiple Snyk orgs. The API token used requires Org Admin permisisons, and must be part of a Snyk group with a valid SSO connection. Service accounts are restricted from invoking this API. As this endpoint can only be used to provision new users, if a user has already logged into Snyk, this endpoint will not work to provision user access

Required permissions

  • Provision User
Path parameters
orgIdstringRequired

The organization ID.

Example: 25065eb1-109c-4c3e-9503-68fc56ef6f44
Responses
get
GET /v1/org/{orgId}/provision HTTP/1.1
Host: api.snyk.io
Accept: */*
[
  {
    "email": "text",
    "role": "text",
    "rolePublicId": "text",
    "created": "text"
  }
]

Delete pending user provision

delete

This endpoint allows Snyk Admins to provision user access to Snyk Orgs prior to the user login to the Snyk platform, and does not send out invitation emails to the Snyk platform. When the provisioned user logs into Snyk for the first time, the user will automatically be granted the appropriate Snyk org access and role permissions specified in the API call. This endpoint can be called multiple times to provision a user to multiple Snyk orgs. The API token used requires Org Admin permisisons, and must be part of a Snyk group with a valid SSO connection. Service accounts are restricted from invoking this API. As this endpoint can only be used to provision new users, if a user has already logged into Snyk, this endpoint will not work to provision user access

Required permissions

  • Provision User
Path parameters
orgIdstringRequired

The organization ID.

Example: 25065eb1-109c-4c3e-9503-68fc56ef6f44
Responses
delete
DELETE /v1/org/{orgId}/provision HTTP/1.1
Host: api.snyk.io
Accept: */*
{
  "ok": false
}

Set notification settings

put

Manage the default settings for organization notifications. These will be used as defaults, but can be re-defined by organization members

Required permissions

  • View Organization

  • Edit Organization

Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
all ofOptional
and
anyOptionalExample: {"new-issues-remediations":{"enabled":true,"issueSeverity":"high","issueType":"vuln"},"project-imported":{"enabled":true},"test-limit":{"enabled":true},"weekly-report":{"enabled":true}}
Responses
Responseall of
and
anyOptionalExample: {"new-issues-remediations":{"enabled":true,"issueSeverity":"high","issueType":"vuln","inherited":false},"project-imported":{"enabled":true,"inherited":false},"test-limit":{"enabled":true,"inherited":false},"weekly-report":{"enabled":true,"inherited":false}}
put
PUT /v1/org/{orgId}/notification-settings HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 185

{
  "new-issues-remediations": {
    "enabled": true,
    "issueSeverity": "high",
    "issueType": "vuln"
  },
  "project-imported": {
    "enabled": true
  },
  "test-limit": {
    "enabled": true
  },
  "weekly-report": {
    "enabled": true
  }
}
200Success
{
  "new-issues-remediations": {
    "enabled": true,
    "issueSeverity": "high",
    "issueType": "vuln",
    "inherited": false
  },
  "project-imported": {
    "enabled": true,
    "inherited": false
  },
  "test-limit": {
    "enabled": true,
    "inherited": false
  },
  "weekly-report": {
    "enabled": true,
    "inherited": false
  }
}

Get organization notification settings

get

Manage the default settings for organization notifications. These will be used as defaults, but can be re-defined by organization members

Required permissions

  • View Organization
Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Responses
Responseall of
and
anyOptionalExample: {"new-issues-remediations":{"enabled":true,"issueSeverity":"high","issueType":"vuln","inherited":false},"project-imported":{"enabled":true,"inherited":false},"test-limit":{"enabled":true,"inherited":false},"weekly-report":{"enabled":true,"inherited":false}}
get
GET /v1/org/{orgId}/notification-settings HTTP/1.1
Host: api.snyk.io
Accept: */*
200Success
{
  "new-issues-remediations": {
    "enabled": true,
    "issueSeverity": "high",
    "issueType": "vuln",
    "inherited": false
  },
  "project-imported": {
    "enabled": true,
    "inherited": false
  },
  "test-limit": {
    "enabled": true,
    "inherited": false
  },
  "weekly-report": {
    "enabled": true,
    "inherited": false
  }
}

List Members

get

Manage members in your organization

Required permissions

  • View Organization

  • View Users

Path parameters
orgIdstringRequired

The organization ID.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Query parameters
includeGroupAdminsbooleanOptional

Include group administrators who also have access to this organization.

Example: true
Responses
get
GET /v1/org/{orgId}/members HTTP/1.1
Host: api.snyk.io
Accept: */*
200Success
[
  {
    "id": "",
    "name": "",
    "username": "",
    "email": "",
    "role": ""
  }
]

Update a member in the organization

put

Manage member's roles in your organization

Required permissions

  • Manage Users
Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
userIdstringRequired

The user ID.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
all ofOptional
and
anyOptionalExample: {"role":""}
Responses
put
PUT /v1/org/{orgId}/members/{userId} HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 11

{
  "role": ""
}
200Success

No content

Remove a member from the organization

delete

Manage member's roles in your organization

Required permissions

  • View Organization

  • View Users

  • User Remove

Path parameters
orgIdstringRequired

The organization ID. The API_KEY must admin have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
userIdstringRequired

The user ID we want to remove.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Responses
delete
DELETE /v1/org/{orgId}/members/{userId} HTTP/1.1
Host: api.snyk.io
Accept: */*
200Success

No content

Update a member's role in the organization

put

Update member's role in your organization by role publicId

Required permissions

  • Manage Users
Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
userIdstringRequired

The user ID.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
all ofOptional
and
anyOptionalExample: {"rolePublicId":""}
Responses
put
PUT /v1/org/{orgId}/members/update/{userId} HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "rolePublicId": ""
}
200Success

No content

Invite users

post

Invite users to the organization by email

Required permissions

  • View Organization

  • View Users

  • Invite Users

Path parameters
orgIdstringRequired

The organization ID. The API_KEY must have admin access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Body
all ofOptional
and
anyOptionalExample: {"email":""}
Responses
post
POST /v1/org/{orgId}/invite HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 12

{
  "email": ""
}
200Success

No content

Last updated

Was this helpful?