Tenants
Get a list of all Tenants which the calling user is a member of
Authorizations
Query parameters
versionstringRequiredExample:
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))?))$
starting_afterstringOptionalExample:
Return the page of results immediately after this cursor
v1.eyJpZCI6IjEwMDAifQo=
ending_beforestringOptionalExample:
Return the page of results immediately before this cursor
v1.eyJpZCI6IjExMDAifQo=
limitinteger · int32 · min: 10 · max: 100OptionalDefault:
Number of results to return per page
10
Example: 10
Responses
200
Returns a list of tenants.
application/vnd.api+json
400
Bad Request: A parameter provided as a part of the request was invalid.
application/vnd.api+json
401
Unauthorized: the request requires an authentication token.
application/vnd.api+json
403
Forbidden: the request requires an authentication token with more or different permissions.
application/vnd.api+json
404
Not Found: The resource being operated on could not be found.
application/vnd.api+json
409
Conflict: The requested operation conflicts with the current state of the resource in some way.
application/vnd.api+json
500
Internal Server Error: An error was encountered while attempting to process the request.
application/vnd.api+json
get
GET /rest/tenants HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attributes": {
"created_at": "2022-03-16T00:00:00Z",
"name": "My Tenant",
"slug": "my-tenant",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"relationships": {
"owner": {
"data": {
"id": "b667f176-df52-4b0a-9954-117af6b05ab7",
"type": "user"
}
}
},
"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 a tenant
Required permissions
Edit Tenant Details (tenant.edit)
Authorizations
Path parameters
tenant_idstring · uuidRequiredExample:
Unique identifier for tenant
b667f176-df52-4b0a-9954-117af6b05ab7
Query parameters
versionstringRequiredExample:
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))?))$
Body
Responses
200
Instance of tenant is updated
application/vnd.api+json
204
The operation completed successfully with no content
400
Bad Request: A parameter provided as a part of the request was invalid.
application/vnd.api+json
401
Unauthorized: the request requires an authentication token.
application/vnd.api+json
403
Forbidden: the request requires an authentication token with more or different permissions.
application/vnd.api+json
404
Not Found: The resource being operated on could not be found.
application/vnd.api+json
409
Conflict: The requested operation conflicts with the current state of the resource in some way.
application/vnd.api+json
500
Internal Server Error: An error was encountered while attempting to process the request.
application/vnd.api+json
patch
PATCH /rest/tenants/{tenant_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 106
{
"data": {
"attributes": {
"name": "My Tenant"
},
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "resource"
}
}
{
"data": {
"attributes": {
"created_at": "2022-03-16T00:00:00Z",
"name": "My Tenant",
"slug": "my-tenant",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "d5b640e5-d88c-4c17-9bf0-93597b7a1ce2",
"type": "resource"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
Get the full details of a Tenant.
Required permissions
View Tenant Details (tenant.read)
Authorizations
Path parameters
tenant_idstring · uuidRequiredExample:
Unique identifier for tenant
b667f176-df52-4b0a-9954-117af6b05ab7
Query parameters
versionstringRequiredExample:
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))?))$
Responses
200
Returns an instance of a tenant.
application/vnd.api+json
400
Bad Request: A parameter provided as a part of the request was invalid.
application/vnd.api+json
401
Unauthorized: the request requires an authentication token.
application/vnd.api+json
403
Forbidden: the request requires an authentication token with more or different permissions.
application/vnd.api+json
404
Not Found: The resource being operated on could not be found.
application/vnd.api+json
409
Conflict: The requested operation conflicts with the current state of the resource in some way.
application/vnd.api+json
500
Internal Server Error: An error was encountered while attempting to process the request.
application/vnd.api+json
get
GET /rest/tenants/{tenant_id} HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Accept: */*
{
"data": {
"attributes": {
"created_at": "2022-03-16T00:00:00Z",
"name": "My Tenant",
"slug": "my-tenant",
"updated_at": "2022-03-16T00:00:00Z"
},
"id": "59d6d97e-3106-4ebb-b608-352fad9c5b34",
"relationships": {
"owner": {
"data": {
"id": "b667f176-df52-4b0a-9954-117af6b05ab7",
"type": "user"
}
}
},
"type": "resource"
},
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://example.com/api/this_resource"
}
}
Last updated
Was this helpful?