Audit Logs
Sync Type: Incremental
Overview
This source connector fetches audit logs events from the Zendesk API. The audit log shows various changes in a Zendesk account since the account was created.
Prerequisites
- Confirm that your Zendesk subscription supports viewing audit logs.
- A Zendesk account with an Administrator role.
- The unique Zendesk subdomain associated with the account.
Limitations
- Audit Logs are only available for Enterprise account
- This input is restricted by rate limits.
Authentication
The following authentication methods are supported by this input:
| Authentication Method | Documentation |
|---|---|
| API Token Authentication | API Token Authentication |
| OAuth access token authentication | OAuth access token authentication |
API Token Authentication
Generate API Token
- Login to Zendesk Admin Center.
- On the left navigation bar expand the option Apps and Integrations and below the APIs menu click on API tokens.
- Click on Add API Token button on top right.
- Fill out the description and click on Save to generate the API Token.
- Copy and store this token. It won't be shown in full again after you leave this page.
- On the left navigation bar under APIs select API Configuration and make sure the
Allow API token accesscheckbox is enabled.
Configuration
The following fields are specific for the API token authentication method.
| Field | Description |
|---|---|
| API token | Active API token |
| An administrator email address |
OAuth access token authentication
Create Client credentials
- Login to Zendesk Admin Center.
- On the left navigation bar expand the option Apps and Integrations and below the APIs menu click on OAuth clients.
- Click on Add OAuth client button on top right.
- Fill out the required fields and click on Save to generate the Secret value.
- Unique identifier is your Client ID.
- Choose the Client kind of type Confidential.
- Add
http://localhostin Redirect URLs field. - Save the secret value as it won't be shown in full again after you leave this page.
Create an Oauth authorization flow
- In a browser, navigate to
https://{subdomain}.zendesk.com/oauth/authorizations/new?response_type=code&client_id={Unique Identifier}&scope=auditlogs:readto authorize the application.- Replace
subdomainandUnique Identifierin the URL with their respective values. - Once the page has loaded, click "Allow".
- Replace
Locate the OAuth's client ID
- Zendesk does not provide a UI to get this information, but it is available using the browser's developer tools.
- Navigate away from the OAuth Clients tab, and then navigate back to the OAuth Clients tab. This will initiate the browser to make a new API request for the OAuth Clients list. This request will have a json response, and in there will be the id that is required. This will be used as the client_id in the next step.
Create the OAuth access token
-
Make an API request to Zendesk to generate an OAuth Access Token. This access token does not expire and can be used in the configuration of this input.
-
Using an adminitrator's email address and the API Token created above, update the
subdomain,client_id,email_addressandapi_tokenvalues below, then make the following request:curl https://{subdomain}.zendesk.com/api/v2/oauth/tokens.json \
-X POST \
-v -u {email_address}/token:{api_token} \
-H "Content-Type: application/json" \
-d '{
"token": {
"client_id": {client_id},
"scopes": [
"auditlogs:read"
]
}
}' -
In the JSON reponse, copy the
full_tokenvalue. This will be the value to use for Access Token field in the input configuration.
Configuration
Secrets
| Setting | Type | Required | Description |
|---|---|---|---|
| Token | string | true | Either the API token or the Access token generated using OAuth client credentials. |
Settings
| Setting | Type | Required | Description |
|---|---|---|---|
| Subdomain | string | true | This is the subdomain found in the Zendesk URL. |
| Email Address | string | true | This is the email address registered with your Zendesk account. |
| AuthType | string | true | This is the type of authentication used by the input. |
Sample Audit Log
{
"url": "https://demo.zendesk.com/api/v2/audit_logs/1234.json",
"id": 1234,
"action_label": "Updated",
"actor_id": -1,
"source_id": 56765,
"source_type": "account",
"source_label": "Contacts: Account owner",
"action": "update",
"change_description": "Changed from not set to demo_user",
"ip_address": null,
"created_at": "2023-07-01T14:00:00Z",
"actor_name": "Zendesk"
}