https://api.env0.com. The API reference lists every endpoint. This page covers what applies to all of them: authentication, rate limits, pagination, and errors.
To work from a terminal or CI without writing HTTP calls, use the env zero CLI.
Authentication
The API uses HTTP Basic authentication. Send the API key ID as the username and the API key secret as the password on every request.
Admin and user API keys can also be read-only. To create and delete keys, see API keys. The CLI manages them with
env0 api-key and env0 personal-api-key.
env zero caches a successful authentication for up to 1 hour. Deleting a key, or changing its permissions, can take up to 1 hour to apply.
If your organization has an IP allowlist, API key requests from addresses outside it fail with 401.
Make your first request
1
Create an API key
Create a key as described in API keys. The secret is shown once, so copy the key ID and secret before you close the dialog.
2
Export the key
3
List your organizations
id as the organizationId query parameter to endpoints such as List Projects and List Environments.Rate limits
Requests are counted per source IP address, HTTP method, and URL path, over the last 60 seconds:
The URL path is counted without the query string.
POST /environments/<ENVIRONMENT_A>/deployments and POST /environments/<ENVIRONMENT_B>/deployments have separate limits. GET /environments?projectId=<PROJECT_A> and GET /environments?projectId=<PROJECT_B> share one.
A request over the limit gets 429 Too Many Requests with a plain-text body. There is no Retry-After header. Back off and retry. Requests succeed again once the count for the last 60 seconds drops below the limit.
Pagination
List endpoints page in one of three ways. Each endpoint’s API reference page lists the parameters it accepts. Endpoints without paging parameters, such as List Organizations, return every row in one response.Offset and limit
List Environments and List Deployments takelimit (rows per page) and offset (rows to skip, default 0). List Environments returns at most 100 rows per page.
offset by the number of rows each page returned, and stop when a page is empty. List Deployments can return fewer rows than limit while more remain, to keep the response under its size limit, so a short page is not always the last one.
Page key
Fetch Audit Logs returnsevents and a nextPageKey. Pass nextPageKey as offset to get the next page. The last page has no nextPageKey. With filters, a page can have no events and still return a nextPageKey, so keep going until it is absent. limit defaults to 50, with a maximum of 1,000.
Page number
Cloud Compass resource lists, such as List Cloud Compass Managed Resources Of An Environment, takepage (starting at 1) and pageSize, and return the total row count.
Errors
Errors use standard HTTP status codes. Errors from env zero services have a plain-text body, so read it as text. A401, and a 403 for a path that doesn’t exist, come from the API gateway instead and have a JSON body with a message field. A 400 body looks like this:
Every response has an
x-amzn-requestid header. Include it, or the request ID from a 500 message, when you contact support.