> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/amplitude.md).

# Amplitude

Amplitude is a product analytics platform. Track events, update user properties, download cohort members, and run segmentation and funnel queries from your AI workflows.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector           | Authentication   |
| ------------------- | ---------------- |
| Amplitude (API Key) | API key or token |

#### Amplitude (API Key)

Connect to Amplitude to track events and query product analytics.

**Set up in Amplitude**

1. Prepare the Amplitude account or service that the workflow will access. Grant access to the required resources and operations.
2. **API Key:** Your Amplitude project API key (Settings -> Projects -> your project -> General). Authenticates event and user-property ingestion.
3. **Secret Key:** Your Amplitude project secret key (shown next to the API key). Required for analytics queries, cohorts, and user profiles. Amplitude shows it only in project settings.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Amplitude (API Key)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required                 | What to enter                                                                                                                                                                                                                                 |
| ------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Key       | Yes                      | Your Amplitude project API key (Settings -> Projects -> your project -> General). Authenticates event and user-property ingestion. [Provider instructions](https://app.amplitude.com/settings/projects).                                      |
| Secret Key    | Yes                      | Your Amplitude project secret key (shown next to the API key). Required for analytics queries, cohorts, and user profiles. Amplitude shows it only in project settings. [Provider instructions](https://app.amplitude.com/settings/projects). |
| Data Region   | Optional / as applicable | Amplitude data residency: 'us' (default) or 'eu'. Must match your project.                                                                                                                                                                    |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Amplitude** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Track Event

Record one analytics event for a user or device.

**Inputs**

| Field            | Type     | Required | Description                                                       |
| ---------------- | -------- | -------- | ----------------------------------------------------------------- |
| Event Type       | string   | Yes      | Name of the event to record.                                      |
| User ID          | string   | No       | Your identifier for the user. Required unless a device ID is set. |
| Device ID        | string   | No       | Device identifier. Required unless a user ID is set.              |
| Event Properties | object   | No       | Properties attached to this event (JSON object).                  |
| User Properties  | object   | No       | User properties to set with this event (JSON object).             |
| Event Time       | datetime | No       | When the event happened. Defaults to Amplitude's upload time.     |
| Session ID       | integer  | No       | Session start time in epoch milliseconds.                         |
| Insert ID        | string   | No       | Deduplication key; Amplitude drops repeats within 7 days.         |

**Outputs**

| Field                | Type    | Description                                                   |
| -------------------- | ------- | ------------------------------------------------------------- |
| Events Ingested      | integer | Number of events Amplitude accepted.                          |
| Payload Size (bytes) | integer | Size of the uploaded payload.                                 |
| Server Upload Time   | string  | When Amplitude's servers accepted the upload (ISO 8601, UTC). |

#### Batch Upload Events

Upload up to 2000 analytics events in one request.

**Inputs**

| Field  | Type  | Required | Description                                     |
| ------ | ----- | -------- | ----------------------------------------------- |
| Events | array | Yes      | Event objects to upload (max 2000 per request). |

**Outputs**

| Field                | Type    | Description                                                   |
| -------------------- | ------- | ------------------------------------------------------------- |
| Events Ingested      | integer | Number of events Amplitude accepted.                          |
| Payload Size (bytes) | integer | Size of the uploaded payload.                                 |
| Server Upload Time   | string  | When Amplitude's servers accepted the upload (ISO 8601, UTC). |

#### Update User Properties

Set, increment, or remove a user's properties.

**Inputs**

| Field                   | Type   | Required | Description                                                       |
| ----------------------- | ------ | -------- | ----------------------------------------------------------------- |
| User ID                 | string | No       | Your identifier for the user. Required unless a device ID is set. |
| Device ID               | string | No       | Device identifier. Required unless a user ID is set.              |
| Properties to Set       | object | No       | Property values to set or overwrite (JSON object).                |
| Properties to Set Once  | object | No       | Property values applied only if not already set (JSON object).    |
| Properties to Increment | object | No       | Numeric amounts to add to numeric properties (JSON object).       |
| Properties to Remove    | array  | No       | Names of properties to remove from the user.                      |

**Outputs**

| Field   | Type    | Description                                |
| ------- | ------- | ------------------------------------------ |
| Success | boolean | Whether Amplitude acknowledged the update. |

#### Get Cohort Members

Download the members of a behavioral cohort.

**Inputs**

| Field                   | Type            | Required | Description                                                                      |
| ----------------------- | --------------- | -------- | -------------------------------------------------------------------------------- |
| Offset                  | integer         | No       | Use next\_offset from the previous page to continue. Default: 0.                 |
| Export Request ID       | string          | No       | Reuse the previous page's export instead of creating another.                    |
| Cohort                  | select (string) | Yes      | The cohort whose members to download. Options load from the selected connection. |
| Include User Properties | boolean         | No       | Also include each member's user properties (slower).                             |
| Max Members             | integer         | No       | Maximum members to return (default 1000).                                        |

**Outputs**

| Field             | Type        | Description                                                  |
| ----------------- | ----------- | ------------------------------------------------------------ |
| Next Offset       | integer     | Offset for the next page, or null when complete.             |
| Export Request ID | string      | Export identifier to reuse for subsequent pages.             |
| Members           | dict\_array | The cohort's members.                                        |
| Member Count      | integer     | Number of members returned (may be capped; see has\_more).   |
| Has More          | boolean     | True if the cohort has more members beyond the returned set. |
| Cohort ID         | string      | The downloaded cohort's ID.                                  |

#### Query Event Segmentation

Get an event's metric time series, optionally segmented.

**Inputs**

| Field      | Type            | Required | Description                                                                                      |
| ---------- | --------------- | -------- | ------------------------------------------------------------------------------------------------ |
| Event      | select (string) | Yes      | The event to measure. Options load from the selected connection.                                 |
| Start Date | date            | Yes      | First date included in the series.                                                               |
| End Date   | date            | Yes      | Last date included in the series.                                                                |
| Metric     | select (string) | No       | What to measure. Defaults to unique users. Available values: uniques, totals, pct\_dau, average. |
| Interval   | select (string) | No       | Bucket size of the series. Defaults to daily. Available values: Daily, Weekly, Monthly.          |
| Group By   | string          | No       | User property to segment by (e.g. 'country').                                                    |

**Outputs**

| Field         | Type        | Description                           |
| ------------- | ----------- | ------------------------------------- |
| Points        | dict\_array | One row per series and date.          |
| Series Labels | array       | Label of each series (segment/group). |
| Total Value   | number      | Sum of all returned values.           |

#### Run Funnel Analysis

Measure conversion through a sequence of events.

**Inputs**

| Field                       | Type            | Required | Description                                                                                            |
| --------------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Funnel Steps                | array           | Yes      | Event types forming the funnel, in order (at least 2).                                                 |
| Start Date                  | date            | Yes      | First date included in the query.                                                                      |
| End Date                    | date            | Yes      | Last date included in the query.                                                                       |
| Mode                        | select (string) | No       | How strictly step order counts. Defaults to ordered. Available values: ordered, unordered, sequential. |
| User Segment                | select (string) | No       | Which users to consider. Defaults to active users. Available values: active, new.                      |
| Conversion Window (seconds) | integer         | No       | Time users have to convert. Defaults to 30 days.                                                       |

**Outputs**

| Field                   | Type        | Description                                               |
| ----------------------- | ----------- | --------------------------------------------------------- |
| Steps                   | dict\_array | One row per funnel step with counts and conversion rates. |
| Overall Conversion Rate | number      | Fraction of users who completed the whole funnel.         |

#### List Cohorts

List all discoverable behavioral cohorts.

**Inputs**

| Field  | Type    | Required | Description                                                          |
| ------ | ------- | -------- | -------------------------------------------------------------------- |
| Offset | integer | No       | Number of results to skip; use next\_offset to continue. Default: 0. |
| Limit  | integer | No       | Maximum cohorts to return (default 100).                             |

**Outputs**

| Field       | Type        | Description                                                |
| ----------- | ----------- | ---------------------------------------------------------- |
| Cohorts     | dict\_array | The discoverable cohorts.                                  |
| Count       | integer     | Number of cohorts returned (may be capped; see has\_more). |
| Next Offset | integer     | Offset for the next page, or null when complete.           |
| Has More    | boolean     | True if more cohorts exist beyond the returned set.        |

#### List Event Types

List the event types visible in this project.

**Inputs**

| Field  | Type    | Required | Description                                                          |
| ------ | ------- | -------- | -------------------------------------------------------------------- |
| Offset | integer | No       | Number of results to skip; use next\_offset to continue. Default: 0. |
| Limit  | integer | No       | Maximum event types to return (default 200).                         |

**Outputs**

| Field       | Type        | Description                                                    |
| ----------- | ----------- | -------------------------------------------------------------- |
| Event Types | dict\_array | The project's visible event types.                             |
| Count       | integer     | Number of event types returned (may be capped; see has\_more). |
| Next Offset | integer     | Offset for the next page, or null when complete.               |
| Has More    | boolean     | True if more event types exist beyond the returned set.        |

#### Get User Profile

Look up one user's properties and cohort memberships.

**Inputs**

| Field                   | Type    | Required | Description                                                       |
| ----------------------- | ------- | -------- | ----------------------------------------------------------------- |
| User ID                 | string  | No       | Your identifier for the user. Required unless a device ID is set. |
| Device ID               | string  | No       | Device (anonymous) identifier. Required unless a user ID is set.  |
| Include User Properties | boolean | No       | Return the user's full property set.                              |
| Include Cohort IDs      | boolean | No       | Return cohorts the user belongs to (Profile-API-synced only).     |

**Outputs**

| Field           | Type   | Description                                           |
| --------------- | ------ | ----------------------------------------------------- |
| User ID         | string | The user's ID.                                        |
| Device ID       | string | The user's device ID.                                 |
| User Properties | dict   | The user's properties (empty unless requested).       |
| Cohort IDs      | array  | Cohorts the user belongs to (empty unless requested). |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/amplitude.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
