Push API Reference

The Userlist Push API is a write-only JSON API that allows you to send data to Userlist. You can use the Push API to create and update users, companies, relationships, events, and send transactional messages. The base URL for the Push API the following:

Base URL
https://push.userlist.com

Authentication

To start sending data into Userlist, you first have to get your Push API Key from the Push Settings.

It is used to authenticate your requests to the Push API and connect the data with your account. Keep this Push API Key secure, or an attacker will be able to mess with your data and automations.

All requests to our Push API need to have the Push API Key in the Authorization header.

Authorization
1
Authorization: Push your-push-key-here

Errors

When things go wrong, the Push API will respond with appropriate HTTP status codes. Status codes in the 4xx range indicate a problem with the initial request. Status codes in the 5xx range indicate errors on the server.

The Push API will also respond with a JSON body describing the error in more detail.

1
2
3
4
5
6
7
8
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

{
  "status": 422,
  "code": "unprocessable_content",
  "errors": ["User must exist"]
}

The following table lists the most common HTTP status codes you may encounter when using the Push API:

Status Name Description
401 Unauthorized Invalid Push key or authorization scheme
403 Forbidden You’re accessing a feature that isn’t included in your plan
404 Not Found The endpoint you specified was not found.
413 Content Too Large The payload you provided was too large. See Limits.
422 Unprocessable Entity The payload you provided was invalid. See response body for details.
429 Too Many Requests You exceeded the rate limit for your account. See Limits.

Limits

The Push API has a rate limit of 1000 requests per minute per account. Additionally, there is also a 100KB request size limit.

If you exceed the rate limit, you will receive a 429 Too Many Requests response, including headers that indicate the limit, remaining requests, and reset time.

1
2
3
4
5
6
7
8
9
10
11
12
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1741873313
Retry-After: 59

{
  "status": 429,
  "code": "too_many_requests",
  "errors": ["Rate limit of 1000 requests per 60 seconds exceeded. Please try again in 59 seconds."]
}

If you exceed the request size limit, you will receive a 413 Content Too Large response.

1
2
3
4
5
6
7
8
HTTP/1.1 413 Content Too Large
Content-Type: application/json

{
  "status": 413,
  "code": "content_too_large",
  "errors": ["Payload is too large. Request was 1 MB, but the limit is 100 KB."]
}

Payloads & Responses

The Push API expects payloads as JSON and responds with JSON. It’s recommended to set the Accept and Content-Type headers accordingly.

1
2
3
POST /users HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8

Object keys, as well as event names, will be normalized to snake_case. You’re free to use any format you like for these, just be aware that we’ll store it in snake_case way.

Timestamps are expected to be strings formatted according to RFC3339: YYYY-MM-DDTHH:MM:SS+HH:MM. If no time zone is given, we’ll assume UTC.

Custom properties

Custom properties are key-value pairs that you can use to store additional information about users, companies, and relationships, and events. You can use any string as a key, and the value can be a string, number, boolean, array, object, or null.

We will normalize all keys to snake_case internally. Strings formatted according to RFC3339 will automatically be recognized as timestamps.

Nested properties will help structure your data, especially if you’re managing multiple products in one Userlist account.

E.g. a billing plan property for Product A will look like this: user.product_a.billing_plan.

1
2
3
4
5
6
7
8
9
10
11
{
  "identifier": "3d70d1d4-484a-4e72-8857-916ee525214e",
  "properties": {
    "product_a": {
      "billing_plan": "pro"
    },
    "product_b": {
      "billing_plan": "free"
    }
  }
}

Referencing and embedding resources

In all payload that allow referencing another resources by their identifier (like an event that references the user that performed the event) it’s also possible to embed the resource in place.

The following example shows a payload that references a user by their identifier.

1
2
3
{
  "user": "3d70d1d4-484a-4e72-8857-916ee525214e"
}

This is equivalent to the following expanded payload.

1
2
3
4
5
{
  "user": {
    "identifier": "3d70d1d4-484a-4e72-8857-916ee525214e"
  }
}

This allows complex updates of multiple related resources in the same transaction. The following example shows how to update a nested user resource within the parent payload.

1
2
3
4
5
6
7
8
9
{
  "user": {
    "identifier": "3d70d1d4-484a-4e72-8857-916ee525214e",
    "properties": {
      "first_name": "Delaney",
      "last_name": "Jones"
    }
  }
}

Users

Users are people who interact with your product, or sign up for your marketing emails.

Create or Update a User

Creates a new user or updates an existing one. If the user already exists, the user will be updated partially with only the specified data. Omitted/unspecified data will remain unchanged. Remove a value by setting it to null.

Request

POST /users

Properties

  • identifier Required unless email is provided string number

    The unique identifier of the user.

  • email Required unless identifier is provided string

    The email address of the user.

  • signed_up_at Optional string

    The timestamp when the user signed up formatted as YYYY-MM-DDTHH:MM:SS+HH:MM (RFC3339).

  • properties Optional object

    Custom properties for the user. See Custom properties for more details.

  • relationships Optional array

    Array of relationships to companies. See Relationships for more details.

  • company Optional string number object

    A single company that the user is related to. This is a shortcut to creating just a single relationship. See Companies for more details.

  • companies Optional array

    An array of companies that the user is related to. This is a shortcut to creating multiple relationships without any properties. See Companies for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

POST /users
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
POST /users HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "identifier": "user-123",
  "email": "user-123@example.com",
  "properties": {
    "first_name": "Delaney",
    "last_name": "Jones"
  },
  "relationships": [
    {
      "company": "company-567",
      "properties": { "role": "owner" }
    }
  ]
}

Delete a User

Deletes the specified user from the system. If the user does not exist, the request will be ignored.

Request

DELETE /users

Properties

  • identifier Required unless email is provided string number

    The unique identifier of the user.

  • email Required unless identifier is provided string

    The email address of the user.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

DELETE /users
1
2
3
4
5
6
7
8
9
10
DELETE /users HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "identifier": "user-123",
  "email": "user-123@example.com"
}

Companies

Companies are organizations that your users belong to.

Create or Update a Company

Creates a new company or updates an existing one. If the company already exists, the company will be updated partially with only the specified data. Omitted/unspecified data will remain unchanged. Remove a value by setting it to null.

Request

POST /companies

Properties

  • identifier Required string number

    The unique identifier of the company.

  • name Optional string

    The name of the company.

  • signed_up_at Optional string

    The timestamp when the company signed up formatted as YYYY-MM-DDTHH:MM:SS+HH:MM (RFC3339).

  • properties Optional object

    Custom properties for the company. See Custom properties for more details.

  • relationships Optional array

    Array of relationships to users. See Relationships for more details.

  • user Optional string number object

    A single user that the company is related to. This is a shortcut to creating just a single relationship. See Users for more details.

  • users Optional array

    An array of user identifiers that the company is related to. This is a shortcut to creating multiple relationships without any properties. See Users for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

POST /companies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
POST /companies HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "identifier": "company-567",
  "name": "Example, Inc.",
  "properties": {
    "industry": "Software",
    "billing_plan": "enterprise"
  },
  "relationships": [
    {
      "user": {
        "identifier": "user-123",
        "email": "user-123@example.com",
        "properties": {
          "first_name": "Delaney",
          "last_name": "Jones"
        }
      },
      "properties": { "role": "owner" }
    }
  ]
}

Delete a Company

Deletes the specified company from the system. If the company does not exist, the request will be ignored.

Request

DELETE /companies

Properties

  • identifier Required string number

    The unique identifier of the company.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

DELETE /companies
1
2
3
4
5
6
7
DELETE /companies HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{ "identifier": "company-123" }

Relationships

Relationships are connections between users and companies. They can have custom properties that describe the relationship.

Create or Update a Relationship

Creates a new relationship or updates an existing one. If the relationship already exists, the relationship will be updated partially with only the specified data. Omitted/unspecified data will remain unchanged. Remove a value by setting it to null.

Request

POST /relationships

Properties

  • user Required string number object

    The identifier of the user or an embedded user object. See Users for more details.

  • company Required string number object

    The identifier of the company or an embedded company object. See Companies for more details.

  • properties Optional object

    Custom properties for the relationship. See Custom properties for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

POST /relationships
1
2
3
4
5
6
7
8
9
10
11
POST /relationships HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "user": "user-123",
  "company": "company-567",
  "properties": { "role": "admin" }
}

Delete a Relationship

Deletes the specified relationship from the system. If the relationship does not exist, the request will be ignored.

Request

DELETE /relationships

Properties

  • user Required string number object

    The identifier of the user or an embedded user object. See Users for more details.

  • company Required string number object

    The identifier of the company or an embedded company object. See Companies for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

DELETE /relationships
1
2
3
4
5
6
7
DELETE /relationships HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{ "user": "user-123", "company": "company-567" }

Events

Events are actions that users or companies take in your product. Events can also be associated with both a user and a company for cases where a user performs an action within the context of a company.

Create an Event

Creates a new event in the system.

Request

POST /events

Properties

  • name Required string

    The name of the event.

  • user Required unless a company is provided string number object

    The identifier of the user or an embedded user object that the event is associated with. See Users for more details.

  • company Required unless a user is provided string number object

    The identifier of the company or an embedded company object that the event is associated with. See Companies for more details.

  • occurred_at Optional string

    The timestamp when the event occurred formatted as YYYY-MM-DDTHH:MM:SS+HH:MM (RFC3339).

  • properties Optional object

    Custom properties for the event. See Custom properties for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

POST /events
1
2
3
4
5
6
7
8
9
10
11
12
POST /events HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "name": "project_created",
  "user": "user-123",
  "company": "company-567",
  "properties": { "project_name": "New Project" }
}

Transactional Messages

Transactional messages allow you to send one-off messages to users

Send a Message

Sends a message to a user

Request

POST /messages

Properties

  • template Required string

    The transactional message template to use.

  • user Required string number object

    The identifier of the user or an embedded user object that should receive this message. See Users for more details.

  • company Optional string number object

    The identifier of the company or an embedded company object that this message is associated with. See Companies for more details.

  • properties Optional object

    Custom properties for the message. See Custom properties for more details.

Response

Status Description
202 The request was accepted and will be processed soon. There is no response body.
422 There was a validation error with your payload. See Errors for details about the response body.

Examples

POST /messages
1
2
3
4
5
6
7
8
9
10
11
POST /messages HTTP/1.1
Host: push.userlist.com
Authorization: Push your-push-key-here
Accept: application/json
Content-Type: application/json; charset=UTF8

{
  "template": "8e433865-bcd3-45ee-b775-983df0e4dc0f",
  "user": "user-123",
  "properties": { "project_name": "New Project" }
}

Book your discovery demo

Let’s see how Userlist fits into the bigger picture of your SaaS business. You’ll learn about our automation features, integrations, proven lifecycle frameworks, and how we can help you hit your SaaS growth targets.