For the complete documentation index, see llms.txt. This page is also available as Markdown.

User Properties

The HTTP API can only be used in a server environment.

Using the User Property API, you can update a user's properties without sending an event.

Updated properties are not applied retroactively and are only applied to events that occur after the update.

Authentication is performed using the SDK Key.

  • Add the SDK Key to the HTTP header as shown below.

  • You can find the SDK Key in the Hackle Dashboard under SDK Integration Info.

X-HACKLE-API-KEY: {YOUR_SERVER_SDK_KEY}

User General Properties

Request

POST https://api.hackle.io/v1/properties

Request Body

Field
Type
Required
Description

userId

string

X

User ID (required if deviceId is not provided)

deviceId

string

X

Device ID (required if userId is not provided)

operations

Operations Object

O

An object containing information for updating user properties.

Operations Object

Field
Type
Required
Description

$set

object

X

Sets the property value. An object of key-value pairs for the properties to set.

$setOnce

object

X

Sets the value only if it has not been set yet. An object of key-value pairs to set.

$unset

object

X

Removes the property. An object of key-value pairs for the properties to remove.

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.


Update User Phone Number Property

Request

Request Body

Field
Type
Required
Description

userId

string

O

User ID

phoneNumber

string

O

User phone number (E.164 format) e.g., +821012345678 (recommended)

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.


Delete User Phone Number Property

Request

Request Parameter

Field
Type
Required
Description

userId

string

O

User ID

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.


Request

Request Body

Field
Type
Required
Description

userId

string

X

User ID (required if deviceId is not provided)

deviceId

string

X

Device ID (required if userId is not provided)

marketingSubscriptionStatus

String

X

Marketing message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

informationSubscriptionStatus

String

X

Informational message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.


Request

Request Body

Field
Type
Required
Description

userId

string

O

User ID

marketingSubscriptionStatus

String

X

Marketing message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

informationSubscriptionStatus

String

X

Informational message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.


Request

Request Body

Field
Type
Required
Description

userId

string

O

User ID

marketingSubscriptionStatus

String

X

Marketing message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

informationSubscriptionStatus

String

X

Informational message subscription status * SUBSCRIBED: Subscribed * UNSUBSCRIBED: Not subscribed

Request Body Example

Response

200 OK

Returns a 200 response status for a successful request.

400 Bad Request

Returns a 400 status for invalid request information.

401 Unauthorized

Returns a 401 status when the X-HACKLE-API-KEY header value is missing or the SDK Key is invalid.

Last updated