Audit Logs
The audit log records changes made in your account, such as team updates, invites, and API key changes. These endpoints are read-only, so keys with the Read Only or Admin role can call them.
The list is paginated, see Pagination.
The Audit Entry Object
Section titled “The Audit Entry Object”| Name | Type | Description |
|---|---|---|
accountId | number | The account ID. |
id | number | The entry ID. |
actor | object | Who made the change. |
type | string | What happened. See Audit Types. |
target | object | What the change was applied to. |
metadata | object | Extra details about the change. |
ttl | number | When the entry expires, in epoch seconds. |
If actor, target, or metadata has no data, it is returned as an empty object.
actor:
| Name | Type | Description |
|---|---|---|
id | string | The actor’s ID. |
name | string | The actor’s name. Optional. |
email | string | The actor’s email address. Optional. |
type | string | user, apikey, or support. Optional. |
target:
| Name | Type | Description |
|---|---|---|
id | string | The target’s ID. |
name | string | The target’s name. Optional. |
email | string | The target’s email address. Optional. |
metadata:
| Name | Type | Description |
|---|---|---|
id | string | A related ID. Optional. |
name | string | A related name. Optional. |
email | string | A related email address. Optional. |
value | string | A related value. Optional. |
values | array of strings | Related values. Optional. |
Audit Types
Section titled “Audit Types”| Group | Types |
|---|---|
| Account | account-create, account-update |
| API keys | apikey-create, apikey-update, apikey-delete |
| Billing | billing-create, billing-update, billing-delete |
| Invites | invite-create, invite-delete |
| Support | support-create, support-close, support-reopen, support-user-add, support-user-remove |
| Teams | team-create, team-update, team-delete, team-member-add, team-member-remove, team-mute-add, team-mute-remove |
| Users | user-create, user-update, user-delete |
List Audit Entries
Section titled “List Audit Entries”GET /account/{accountId}/audit
| Required role |
|---|
| Admin or Read Only |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
accountId | number | Yes | Your account ID. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | No | Page size. Defaults to 20. Any whole number from 1 to 100. Any other value is treated as 20. |
id | number | No | Pagination cursor. Pass the pk.id value from the previous response. |
start | number | No | Earliest time to include, in epoch milliseconds. Inclusive. |
end | number | No | Latest time to include, in epoch milliseconds. Inclusive. |
order | string | No | asc returns the oldest entries first. Any other value, or omitting it, returns the newest first. |
Response
Status 200.
| Name | Type | Description |
|---|---|---|
items | array | Audit entries, as described in The Audit Entry Object. |
pk | object | Present only when more results exist. Contains id, the cursor for the next page. |
Errors
| Status | When |
|---|---|
400 | id, start, or end is not numeric. |
Notes
- You can use
startandendon their own or together. - A page can contain fewer than
limititems whilepkis still present. Keep requesting pages untilpkis absent.
Get Audit Entry
Section titled “Get Audit Entry”GET /account/{accountId}/audit/{auditId}
| Required role |
|---|
| Admin or Read Only |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
accountId | number | Yes | Your account ID. |
auditId | number | Yes | The entry ID. |
Response
Status 200. Returns one entry, as described in The Audit Entry Object.