Skip to content

Consumers


Consumer Object

Consumers represent the users of your app. Each consumer is authenticated using a unique token, which is generated when the consumer is created or when requested with a valid consumer id.

This token is essential for making API requests on behalf of the consumer.

Consumer Object Structure

Field Type Description
id integer Unique identifier for the consumer
user_id string Unique identifier for the user
user_email string Email address of the user
device_id string Unique identifier for the device
device_model string Model of the device
os string Operating system of the device
country string Country code (ISO 3166-1 alpha-2)
language string Language code (ISO 639-1)

Create Consumer

Creates a new consumer. If one already exists with the same data, a new token will be returned.

POST /api/consumer

Headers

Name Value
Content-Type application/json
Accept application/json

Body Parameters

Required Parameters

Field Type Example Description
app_key string {YOUR_APP_KEY App Key to attach this consumer to. This value can be found under the App page
device_id string 1234512345 Unique identifier for the device.
device_model string iPhone 16 Pro Max Device model.
user_id string 12345123451234 Unique identifier for your user.
os string iOS 18.0.1 Device operating system.
country string US Country code (ISO 3166-1 alpha-2).
language string en Language code (ISO 639-1).

Optional Parameters

Field Type Example Description
user_email string email@example.com Email address of the user.

Example Request

JSON
{
    "app_key": "{YOUR_APP_KEY}",
    "device_id": "00008101-000E17360C84001E",
    "device_model": "iPhone 16",
    "user_id": "00008101-000E17360C84001E",
    "user_email": "example@mail.com",
    "os": "iOS 18.1",
    "country": "US",
    "language": "en"
}

Example Response

JSON
{

    "id": 1,
    "app_key": "{YOUR_APP_KEY}",
    "device_id": "00008101-000E17360C84001E",
    "device_model": "iPhone 16",
    "user_id": "00008101-000E17360C84001E",
    "user_email": "example@mail.com",
    "os": "iOS 18.1",
    "country": "US",
    "language": "en",
    "token": "{Bearer Token}"

}

Update Consumer (Partial)

This endpoint allows you to update the details of an existing consumer. You can update one or several fields at once.

PUT/PATCH /api/consumer/{id}

Headers

Header Value
Authorization Bearer {YOUR_AUTH_KEY}
Content-Type application/json
Accept application/json

URL Parameters

Field Type Example Description
id integer 1 Unique identifier of the consumer to be updated.

Body Parameters

Optional Parameters

Field Type Example Description
user_id string 12345123451234 Unique identifier for your user.
user_email string email@example.com Email address of the user.
country string US Country code (ISO 3166-1 alpha-2).
language string en Language code (ISO 639-1).

Example Request

JSON
{
    "user_email": "new_example@mail.com"
}

Example Response

JSON
{
    "id": 1,
    "app_key": "{YOUR_APP_KEY}",
    "device_id": "00008101-000E17360C84001E",
    "device_model": "iPhone 16",
    "user_id": "1",
    "user_email": "new_example@mail.com",
    "os": "iOS 18.1",
    "country": "US",
    "language": "en",
    "updated_at": "2025-05-14T21:18:20.000000Z"
}

Get Token

Generates a new token for an existing consumer using their consumer_id.

GET  /api/consumer/token

Headers

Name Value
Content-Type application/json
Accept application/json

Body Parameters

Required Parameters

Field Type Example Description
app_key string {YOUR_APP_KEY} App Key to attach this consumer to. This value can be found under the App page
consumer_id string 1 Unique identifier for the consumer.

Example Request

JSON
  {
     "app_key":"{YOUR_APP_KEY}",
     "consumer_id": "1"
  }

Example Response

JSON
{
    "token": "{Bearer Token}"
}