Skip to main content
GET
Fetch Audit Logs

Authorizations

Authorization
string
header
required

env zero API authentication is done via API keys. An API Key can either be created by an organization administrator, in which case it will not be connected to any specific user, or via Personal API Keys to authenticate as a user.

Creating an API Key with a Specific Role

  • Once you've created your organization, you can set up and manage API Keys.
  • Navigate to the Organization Settings page and click the API Keys tab.
  • Click Add API Key and enter a name for your key in the Name field. This name is for reference purposes only and isn't used directly in authentication.

❗️Save Your API Key ID and secret The secret will not be available after you close this window.

Creating a Personal API Key

  • Click on your avatar (located on the top right of the screen)
  • Click on Personal Settings
  • Select the API Keys tab
  • Click Add API Key, and enter a name for your key in the Name field. This name is for reference purposes and isn't used directly in authentication.

❗️Save your API Key ID & secret The secret will not be available after you close this window.

Using an API Key to Authenticate

Authentication of the env zero API is done using the Basic Authentication method. Each request made should include the API Key ID as the username, and the API Key secret as the password. For example, when using curl, we can include these parameters via flag --user {API Key ID}:{API Key Secret}.

API Key Permissions

When creating an API key through the organization settings, you will need to choose if you’d like to grant it Organization Admin or User permissions. In case of the latter, you can assign fine-grained permissions per project. Personal API Keys can be created through the user’s profile page and will have the same permissions as the user has.

Rate Limits

env zero API allows up to 1K requests per 60 seconds, requests are aggregated by IP, HTTP Method and URI. If you exceed this limit, you will receive a 429 status code.

Query Parameters

limit
string

Number of audit logs per page. The maximum is 1000, the default is 50

offset
string

An audit log's id from which the page will start

from
string

Return only audit logs at or after this ISO-8601 date

to
string

Return only audit logs at or before this ISO-8601 date

userId
string

Return only audit logs attributed to this user or API key

userIds
string

Return only audit logs attributed to one of these users or API keys, separated by commas

excludeUserIds
string

Return only audit logs not attributed to any of these users or API keys, separated by commas

projectId
string

Return only audit logs of this project

projectIds
string

Return only audit logs of one of these projects, separated by commas

excludeProjectIds
string

Return only audit logs not of any of these projects, separated by commas

entityId
string

Return only audit logs of this environment, project, template or deployment

entityTypes
string

Return only audit logs of these entity types, separated by commas: environment, deployment, project, template

sources
string

Return only audit logs from these sources, separated by commas: ui, cli, api, system, not-recorded

actionNames
string

Return only audit logs with one of these action names, separated by commas

excludeActionNames
string

Return only audit logs with none of these action names, separated by commas

order
string

Sort by time. 'desc' (newest first) is the default; 'asc' gives oldest first

organizationId
string
required

Response

200 - application/json
events
object[]
required
nextPageKey
string
required
searchedUntil
string