# Heap

> Send Heap server-side events, identify users, set user and account properties, one at a time or in bulk, and delete users for privacy requests.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/heap

## Actions

### Add account properties

Set properties on an account (a company your users belong to), such as industry or plan.

**Inputs**

- Account ID (`account_id`, text, required): The account's ID, the one your users' Account ID property holds.
- Properties (`properties`, object, required): Properties by name, each a number or text under 1024 characters. Send email in lower case to fill Heap's built-in Email property.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "updated": 1
  }
}
```

### Add account properties in bulk

Set properties on up to 1,000 accounts at once.

**Inputs**

- Accounts (`accounts`, list, required): The accounts, each with account_id and properties.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "updated": 1
  }
}
```

### Add user properties

Set properties on an identified user, such as plan or sign-up date. If the identity is new, Heap creates the user.

**Inputs**

- Identity (`identity`, text, required): The user's identity, such as their email address or your own user ID, the one your app passes to Heap's identify. Up to 255 characters; case matters.
- Properties (`properties`, object, required): Properties by name, each a number or text under 1024 characters. Send email in lower case to fill Heap's built-in Email property.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "updated": 1
  }
}
```

### Add user properties in bulk

Set properties on up to 1,000 users at once.

**Inputs**

- Users (`users`, list, required): The users, each with identity and properties.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "updated": 1
  }
}
```

### Delete users

Delete users and all their data from every environment in the Heap account, such as for a privacy request. Needs the API key.

**Inputs**

- Identities (`identities`, list): Identities of the users to delete.
- Heap user IDs (`heap_user_ids`, list): Heap user IDs of anonymous users to delete.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "deletion_request_id": "example",
    "deletion_request_location": "example",
    "status": "example"
  }
}
```

### Get deletion status

Check whether a user deletion request is pending or complete. Needs the API key.

**Inputs**

- Deletion request ID (`deletion_request_id`, text, required): The request's ID, which Delete users returns.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "deletion_request_id": "example",
    "status": "example"
  }
}
```

### Identify user

Link an anonymous Heap user to a known identity, moving their past events to that user.

**Inputs**

- Heap user ID (`heap_user_id`, text, required): Heap's own user ID for the anonymous user, from Heap's SDK.
- Identity (`identity`, text, required): The user's identity, such as their email address or your own user ID, the one your app passes to Heap's identify. Up to 255 characters; case matters.
- Time (`timestamp`, date and time): When they were identified. Leave empty for now.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "heap_user_id": "example",
    "identified": true,
    "identity": "example"
  }
}
```

### Track event

Send Heap an event that happened on your servers, such as an order completed, for an identified user.

**Inputs**

- Event name (`event`, text, required): The event's name, up to 1024 characters, such as Order completed.
- Identity (`identity`, text): The user's identity, such as their email address or your own user ID, the one your app passes to Heap's identify. Up to 255 characters; case matters.
- Heap user ID (`heap_user_id`, text): Heap's own user ID for an anonymous user, from Heap's SDK, instead of an identity.
- Properties (`properties`, object): Details about the event by name, each a number or text under 1024 characters. Don't use user_id, session_id or screen_name.
- Time (`timestamp`, date and time): When it happened. Leave empty for now.
- Session ID (`session_id`, text): The Heap session the event belongs to.
- Idempotency key (`idempotency_key`, text): A unique ID for this event, so sending it twice records it once.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "event": "example",
    "tracked": 1
  }
}
```

### Track events in bulk

Send Heap up to 1,000 server-side events at once.

**Inputs**

- Events (`events`, list, required): The events, each with event, identity (or user_id), and optionally timestamp, properties and idempotency_key.

**Outputs**

- `data` (object): The response from Heap.

**Example output**

```json
{
  "data": {
    "tracked": 1
  }
}
```
