---
schema_version: "1"
id: 99185385db729dfc3287eb54d0ec88217b5f66cb87af060070ef4529016844f1
title: Get Started with Salesforce Spiff System Activity Log Export API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/sales-cloud/spiff/guides/system-activity-log-export-api-get-started.md
canonical_url: https://developer.salesforce.com/docs/sales/spiff/guide/system-activity-log-export-api-get-started.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1e7c45438f1e78842c0e909369d2f6f5ca178bac4cbb480dca67ea850a32bb3d
products:
  - Salesforce Spiff
  - Sales Cloud
---
# Get Started with Salesforce Spiff System Activity Log Export API

Create, query, download, and delete exports of your Salesforce Spiff System Activity Log (SAL) data for audit, monitoring, and compliance workflows.

## 1. Generate a Client ID and Client Secret

To create an OAuth application, the user must have the **System Activity Log: View** permission.

1. On the Admin tab in Spiff, select **Settings**, and then select **API Access Management**.
2. Enter an application name, select the **System Activity Log Export** application scope, and click **Create**.
3. From the window that appears, copy the Client ID and Client Secret. The Client ID appears in the Connected APIs list, but you can't view the Client Secret again.

## 2. Generate a Bearer Token

Authenticate with OAuth 2.0 and retrieve an access token before calling SAL export endpoints.

```curl
curl -X POST "https://SUBDOMAIN.spiff.com/api/v1/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=CLIENT_ID" \
  -d "client_secret=CLIENT_SECRET" \
  -d "audience=https://SUBDOMAIN.spiff.com/api/v1" \
  -d "scope=salApi.SystemActivityLogExport"
```

Replace these values:

- `CLIENT_SECRET`: The OAuth 2.0 client secret generated in Spiff Settings.
- `CLIENT_ID`: The OAuth 2.0 client ID generated in Spiff Settings.
- `SUBDOMAIN`: The subdomain for your Spiff environment.
  - If you're in the US, use `us1`.
  - If you're in the EU, use `eu1`.

Use the `access_token` from the response as a bearer token in all API requests:

`Authorization: Bearer YOUR_BEARER_TOKEN`

## API Error Responses

These are possible error responses that the user can encounter from any of the API endpoints.

- `401`: The authorization header is missing or the scope is incorrect.  
  `{"message":"Authorization header is missing or does not contain the required scope."}`
- `401`: The OAuth application user doesn’t have permission to access SAL data.  
  `{"message":"User not authorized to manage system activity log data."}`
- `403`: The OAuth application company doesn’t have the SAL export API feature enabled.
- `500`: The request was interrupted by an internal server error.  
  `{"message":"Something went wrong. Please try again."}`

**See Also**

- - _Salesforce Help_: [System Activity Log in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_log.htm&language=en_US&type=5)
