Orgs

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

List accessible organizations

get

Get a paginated list of organizations you have access to.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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: 100Optional

Number of results to return per page

Default: 10Example: 10
group_idstring · uuidOptional

If set, only return organizations within the specified group

is_personalbooleanOptional

If true, only return organizations that are not part of a group.

slugstring · max: 100Optional

Only return orgs whose slug exactly matches this value.

Pattern: ^[\w.-]+$
namestring · max: 100Optional

Only return orgs whose name contains this value.

Responses
200

A list of organizations you have access to.

application/vnd.api+json
get
/orgs
GET /rest/orgs?version=text 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 organization

patch

Update the details of an organization

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
org_idstring · uuidRequired

Unique identifier for org

Example: b667f176-df52-4b0a-9954-117af6b05ab7
Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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
Responses
200

Instance of org is updated

application/vnd.api+json
patch
/orgs/{org_id}
PATCH /rest/orgs/{org_id}?version=text 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

post

Create a org membership for a user with role

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
org_idstring · uuidRequired

The ID of the org

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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
Responses
post
/orgs/{org_id}/memberships
POST /rest/orgs/{org_id}/memberships?version=text 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"
  }
}

Get all memberships of the org

get

Returns all memberships of the org

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
org_idstring · uuidRequired

The ID of the org

Query parameters
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: 100Optional

Number of results to return per page

Default: 10Example: 10
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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))?))$
sort_bystring · enumOptional

Which column to sort by.

Possible values:
sort_orderstring · enumOptional

Order in which results are returned.

Default: ASCExample: ASCPossible values:
emailstringOptional

Filter the response by Users that match the provided email

user_idstringOptional

Filter the response by Users that match the provided user ID

usernamestringOptional

Filter the response by Users that match the provided username

role_namestringOptional

Filter the response for results only with the specified role.

Responses
200

List of org memberships is returned

application/vnd.api+json
get
/orgs/{org_id}/memberships
GET /rest/orgs/{org_id}/memberships?version=text 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

patch

Update a org membership for a user with role

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
org_idstring · uuidRequired

The id of the org

membership_idstring · uuidRequired

The id of the org membership

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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
Responses
patch
/orgs/{org_id}/memberships/{membership_id}
PATCH /rest/orgs/{org_id}/memberships/{membership_id}?version=text 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 user's org membership

delete

Remove a user's membership of the group.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
org_idstring · uuidRequired

The id of the org

membership_idstring · uuidRequired

The id of the org membership

Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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
delete
/orgs/{org_id}/memberships/{membership_id}
DELETE /rest/orgs/{org_id}/memberships/{membership_id}?version=text HTTP/1.1
Host: api.snyk.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

List all organizations in group

get

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
group_idstring · uuidRequired

Unique identifier for group

Example: b667f176-df52-4b0a-9954-117af6b05ab7
Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(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: 100Optional

Number of results to return per page

Default: 10Example: 10
namestringOptional

Only return organizations whose name contains this value. Case insensitive.

slugstringOptional

Only return organizations whose slug exactly matches this value. Case sensitive.

Responses
200

A list of organizations in the group.

application/vnd.api+json
get
/groups/{group_id}/orgs
GET /rest/groups/{group_id}/orgs?version=text 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?