# Userpilot

> Identify users and companies in Userpilot, track events, run bulk updates, manage email subscriptions, delete people's data, export raw analytics data, and follow new flows, segments, surveys and finished jobs.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/userpilot

## Actions

### Bulk update companies

Create or update many companies in one background job.

**Inputs**

- Companies (`companies`, list, required): The companies, each with a company_id and their properties.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "completed_rows": 1,
    "elapsed_time": 1,
    "end_time": "example",
    "file_size": 1,
    "filename": "example",
    "job_id": "example",
    "links": "example",
    "start_time": "example",
    "status": "example",
    "total_rows": 1,
    "type": "example"
  }
}
```

### Bulk update users

Create or update many users in one background job.

**Inputs**

- Users (`users`, list, required): The users, each with a user_id, an optional company_id and their properties.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "completed_rows": 1,
    "elapsed_time": 1,
    "end_time": "example",
    "file_size": 1,
    "filename": "example",
    "job_id": "example",
    "links": "example",
    "start_time": "example",
    "status": "example",
    "total_rows": 1,
    "type": "example"
  }
}
```

### Delete companies

Schedule companies and their data for permanent deletion. Their users are kept.

**Inputs**

- Company IDs (`ids`, list, required): The company IDs to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "scheduled": [
      "example"
    ]
  }
}
```

### Delete users

Schedule users and their data for permanent deletion. Userpilot deletes them daily at 2:00 AM UTC.

**Inputs**

- User IDs (`ids`, list, required): The user IDs to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "scheduled": [
      "example"
    ]
  }
}
```

### Get export

Get a data export's status and, once it completes, its download links (valid for 2 days).

**Inputs**

- Export job ID (`job_id`, text, required): The export's job ID, which Start export returns.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "all_chunks": [
      "example"
    ],
    "app_token": "example",
    "completed_chunks": [
      "example"
    ],
    "current_chunk": "example",
    "end_time": "example",
    "job_id": "example",
    "presigned_urls": [
      {
        "filename": "example",
        "url": "example"
      }
    ],
    "progress": "example",
    "start_time": "example",
    "status": "example",
    "type": "example"
  }
}
```

### Get job

Get a bulk update or import job's status and progress.

**Inputs**

- Job ID (`job_id`, text, required): The job's ID, which a bulk update returns.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "completed_rows": 1,
    "elapsed_time": 1,
    "end_time": "example",
    "file_size": 1,
    "filename": "example",
    "job_id": "example",
    "links": "example",
    "start_time": "example",
    "status": "example",
    "total_rows": 1,
    "type": "example"
  }
}
```

### Identify company

Create or update a company's profile.

**Inputs**

- Company ID (`company_id`, text, required): The company's ID in your product, the same one your app sends Userpilot.
- Name (`name`, text): The company's name.
- Other properties (`properties`, object): Other properties to set, by name, such as plan or role. Values are saved as text.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accepted": true,
    "company_id": "example"
  }
}
```

### Identify user

Create or update a user's profile, and the company they belong to.

**Inputs**

- User ID (`user`, text, required): The user's ID in your product, the same one your app sends Userpilot.
- Name (`name`, text): The user's full name.
- Email (`email`, text): The user's email address.
- Other properties (`properties`, object): Other properties to set, by name, such as plan or role. Values are saved as text.
- Company ID (`company_id`, text): The ID of the company the user belongs to, in your product.
- Company properties (`company_properties`, object): Properties of that company to set, by name, such as name or plan.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accepted": true,
    "user_id": "example"
  }
}
```

### List checklists

List onboarding checklists.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "data_type": "example",
      "display_name": "example",
      "key": "example"
    }
  ]
}
```

### List company properties

List the company properties Userpilot holds, with their types.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "data_type": "example",
      "display_name": "example",
      "id": 1,
      "is_auto_property": true,
      "key": "example",
      "type": "example"
    }
  ]
}
```

### List email subscription types

List the live email subscription types people can opt out of.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "topics": [
      {
        "id": 1,
        "title": "example"
      }
    ]
  }
}
```

### List embeds

List embeds (banners and cards).

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "title": "example",
      "type": "example"
    }
  ]
}
```

### List event properties

List the properties tracked events carry, with the event each belongs to.

**Inputs**

- Records to return (`limit`, number): How many records to return. Leave empty for 50. At least 1.
- Next page cursor (`after_cursor`, text): The cursor after which to read, from the last page's cursor. Leave empty for the first page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [
      {
        "category": "example",
        "data_type": "example",
        "description": "example",
        "display_name": "example",
        "event": {
          "display_name": "example",
          "id": 1
        },
        "id": 1,
        "inserted_at": "example",
        "is_archived": true,
        "is_auto_property": true,
        "key": "example",
        "last_seen": "example"
      }
    ],
    "metadata": {
      "cursor": {
        "after": "example",
        "before": "example"
      },
      "limit": 1,
      "total_count": 1
    }
  }
}
```

### List exports

List data export jobs started with this API key, with their progress.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "elapsed_time": "example",
      "end_time": "example",
      "job_id": "example",
      "progress": "example",
      "start_time": "example",
      "status": "example"
    }
  ]
}
```

### List features and events

List the tracked features and events.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "data_type": "example",
      "display_name": "example",
      "key": "example"
    }
  ]
}
```

### List flows

List flows (in-app experiences).

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "title": "example"
    }
  ]
}
```

### List jobs

List bulk update and import jobs with their status.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "completed_rows": 1,
      "elapsed_time": 1,
      "end_time": "example",
      "file_size": 1,
      "filename": "example",
      "job_id": "example",
      "links": "example",
      "start_time": "example",
      "status": "example",
      "total_rows": 1,
      "type": "example"
    }
  ]
}
```

### List resource center modules

List the modules of the resource center.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "data_type": "example",
      "display_name": "example",
      "key": "example"
    }
  ]
}
```

### List segments

List user and company segments.

**Inputs**

- Records to return (`limit`, number): How many records to return. Leave empty for 50. At least 1.
- Next page cursor (`after_cursor`, text): The cursor after which to read, from the last page's cursor. Leave empty for the first page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": [
      {
        "category": "example",
        "id": 1,
        "is_hidden": true,
        "is_protected": true,
        "status": "example",
        "title": "example",
        "usage": "example"
      }
    ],
    "metadata": {
      "cursor": {
        "after": "example",
        "before": "example"
      },
      "limit": 1,
      "total_count": 1
    }
  }
}
```

### List spotlights

List spotlights (tooltips, hotspots and buttons).

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "title": "example"
    }
  ]
}
```

### List surveys

List surveys with their questions.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "modules": [
        {
          "id": 1,
          "order": 1,
          "question": "example",
          "type": "example"
        }
      ],
      "platform": "example",
      "title": "example"
    }
  ]
}
```

### List user properties

List the user properties Userpilot holds, with their types.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Userpilot.

**Example output**

```json
{
  "data": [
    {
      "data_type": "example",
      "display_name": "example",
      "id": 1,
      "is_auto_property": true,
      "key": "example",
      "type": "example"
    }
  ]
}
```

### Start export

Start exporting raw events, users and companies for a date range. Needs Userpilot's data export add-on.

**Inputs**

- From (`from_date`, date, required): The first day to export.
- To (`to_date`, date, required): The last day to export.
- Event types (`event_types`, list): Only these kinds of events. Leave empty for all of them. One or more of: `identify_user` (User identified), `identify_company` (Company identified), `page_view` (Page view), `track` (Tracked event), `track_feature` (Feature used), `interaction` (Content interaction), `session_start` (Session start).
- User IDs (`user_ids`, list): Only these users' data.
- Company IDs (`company_ids`, list): Only these companies' data.
- Segment (`segment_id`, text): Only users in this segment.
- Format (`format`, text): The files' format. Leave empty for JSON. One of: `json`, `csv`.
- Leave out excluded users (`exclusions`, true/false): Leave out the users and companies excluded in Userpilot's settings.
- Email links to (`emails`, list): Email addresses to send the download links to when the export is ready.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "environment_app_token": "example",
    "environment_name": "example",
    "job_id": "example",
    "links": "example",
    "start_time": "example"
  }
}
```

### Track event

Record an event a user did, such as a purchase, for analytics and targeting.

**Inputs**

- User ID (`user`, text, required): The user's ID in your product, the same one your app sends Userpilot.
- Event name (`event_name`, text, required): The event's name, such as purchase_completed.
- Event properties (`properties`, object): Details of the event, by name, such as plan or amount.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accepted": true,
    "event_name": "example",
    "user_id": "example"
  }
}
```

### Update email subscriptions

Unsubscribe or re-subscribe email addresses from some subscription types, or from every email.

**Inputs**

- Email addresses (`emails`, list, required): Email addresses, up to 1,000.
- Change (`status`, text): Unsubscribe or re-subscribe. Leave empty to unsubscribe. One of: `unsubscribed` (Unsubscribe), `subscribed` (Re-subscribe). Default: `unsubscribed`.
- Subscription types (`topic_ids`, list): The subscription types this applies to.
- All emails (`all_emails`, true/false): Apply it to every email, including ones with no subscription type.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "received": 1,
    "rejected": [
      {
        "email": "example",
        "reason": "example"
      }
    ],
    "resubscribed": 1,
    "unsubscribed": 1
  }
}
```
