Skip to content

Create or update a user with the given ID. Updates lastSeenTime automatically.

POST
/users/{userId}
curl --request POST \
--url https://api.pingram.io/users/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "email": "example", "number": "example", "pushTokens": [ { "type": "FCM", "token": "example", "device": { "app_id": "example", "ad_id": "example", "device_id": "example", "platform": "example", "manufacturer": "example", "model": "example" }, "environment": "undefined" } ], "webPushTokens": [ { "sub": { "endpoint": "example", "keys": { "p256dh": "example", "auth": "example" } } } ], "timezone": "example", "slackChannel": "example", "slackToken": { "access_token": "example", "app_id": "example", "authed_user": { "access_token": "example", "expires_in": 1, "id": "example", "refresh_token": "example", "scope": "example", "token_type": "example" }, "bot_user_id": "example", "enterprise": { "id": "example", "name": "example" }, "error": "example", "expires_in": 1, "incoming_webhook": { "channel": "example", "channel_id": "example", "configuration_url": "example", "url": "example" }, "is_enterprise_install": true, "needed": "example", "ok": true, "provided": "example", "refresh_token": "example", "scope": "example", "team": { "id": "example", "name": "example" }, "token_type": "example", "warning": "example", "response_metadata": { "warnings": [ "example" ], "next_cursor": "example", "scopes": [ "example" ], "acceptedScopes": [ "example" ], "retryAfter": 1, "messages": [ "example" ] } } }'
userId
required
string

User ID

Media type application/json
object
id

Unique user identifier. Required.

string
email

User’s email address for email notifications.

string
number

User’s phone number for SMS/call notifications.

string
pushTokens

Mobile push tokens (FCM, APN) for push notifications.

Array<object>
object
type
required
string
Allowed values: FCM APN
token
required
string
device
required
object
app_id
string
ad_id
string
device_id
required
string
platform
string
manufacturer
string
model
string
environment

Used by APN to differentiate between sandbox and production builds (sandbox/undefined or production)

string
default: undefined
webPushTokens

Web push subscription config from the browser.

Array<object>
object
sub
required

Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser.

object
endpoint
required
string
keys
required
object
p256dh
required
string
auth
required
string
timezone

User’s timezone (e.g. “America/New_York”) for scheduling.

string
slackChannel

The destination channel of slack notifications sent to this user. Can be either of the following:

  • Channel name, e.g. “test”
  • Channel name with # prefix, e.g. “#test”
  • Channel ID, e.g. “C1234567890”
  • User ID for DM, e.g. “U1234567890”
  • Username with @ prefix, e.g. “@test”
string
slackToken
object
access_token
string
app_id
string
authed_user
object
access_token
string
expires_in
number
id
string
refresh_token
string
scope
string
token_type
string
bot_user_id
string
enterprise
object
id
string
name
string
error
string
expires_in
number
incoming_webhook
object
channel
string
channel_id
string
configuration_url
string
url
string
is_enterprise_install
boolean
needed
string
ok
required
boolean
provided
string
refresh_token
string
scope
string
team
object
id
string
name
string
token_type
string
warning
string
response_metadata
object
warnings
Array<string>
next_cursor
string
scopes
Array<string>
acceptedScopes
Array<string>
retryAfter
number
messages
Array<string>

Successful response

Media type application/json
object
id
required

Unique user identifier. Required.

string
email

User’s email address for email notifications.

string
number

User’s phone number for SMS/call notifications.

string
pushTokens

Mobile push tokens (FCM, APN) for push notifications.

Array<object>
object
type
required
string
Allowed values: FCM APN
token
required
string
device
required
object
app_id
string
ad_id
string
device_id
required
string
platform
string
manufacturer
string
model
string
environment

Used by APN to differentiate between sandbox and production builds (sandbox/undefined or production)

string
default: undefined
webPushTokens

Web push subscription config from the browser.

Array<object>
object
sub
required

Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser.

object
endpoint
required
string
keys
required
object
p256dh
required
string
auth
required
string
timezone

User’s timezone (e.g. “America/New_York”) for scheduling.

string
slackChannel

The destination channel of slack notifications sent to this user. Can be either of the following:

  • Channel name, e.g. “test”
  • Channel name with # prefix, e.g. “#test”
  • Channel ID, e.g. “C1234567890”
  • User ID for DM, e.g. “U1234567890”
  • Username with @ prefix, e.g. “@test”
string
slackToken
object
access_token
string
app_id
string
authed_user
object
access_token
string
expires_in
number
id
string
refresh_token
string
scope
string
token_type
string
bot_user_id
string
enterprise
object
id
string
name
string
error
string
expires_in
number
incoming_webhook
object
channel
string
channel_id
string
configuration_url
string
url
string
is_enterprise_install
boolean
needed
string
ok
required
boolean
provided
string
refresh_token
string
scope
string
team
object
id
string
name
string
token_type
string
warning
string
response_metadata
object
warnings
Array<string>
next_cursor
string
scopes
Array<string>
acceptedScopes
Array<string>
retryAfter
number
messages
Array<string>
lastSeenTime

Last activity timestamp. Updated automatically. Read-only.

string
updatedAt

Last update timestamp. Read-only.

string
createdAt

Creation timestamp. Read-only.

string
emailSuppressionStatus

Bounce or complaint status if email was suppressed. Read-only.

object
reason
required
string
Allowed values: Bounce Complaint
details
required
object
Example
{
"pushTokens": [
{
"type": "FCM",
"environment": "undefined"
}
],
"emailSuppressionStatus": {
"reason": "Bounce"
}
}

Bad Request - validation errors, invalid input

Media type application/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Example generated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

Unauthorized

Payment Required - usage limits exceeded

Media type application/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Example generated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

Internal Server Error

Bad Gateway - provider error

Media type application/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Example generated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}