push

Embed
Preview of the card
<a href="https://hermetica.15.204.158.166.sslip.io/docs/ref-push"><img src="https://hermetica.15.204.158.166.sslip.io/docs/_api/public/orgs/5fcd8b3c-a27c-4688-972f-de710125592f/spaces/caf5dc05-15f7-4e0c-bdb8-ab29ede6211e/pages/01d5381a-8fd9-4459-a219-291e9fa5495a/social-card.svg?v=3e7ae33eec8b" alt="push" width="600" height="315"></a>
POSThttps://hermetica.15.204.158.166.sslip.io/client/push-tokens

Register a device push token for a profile (iOS, Android, or a web push subscription)

Request body

application/json
dataobjectrequired
Show child parameters
typestring
push-token
attributesobjectrequired
Show child parameters
tokenstringrequired
platformstringrequired
ios | android | web
vendorstringrequired
apns | fcm | expo | web_push
enablement_statusstring
AUTHORIZED | DENIED | UNAUTHORIZED | PROVISIONAL | NOT_DETERMINED
backgroundstring
AVAILABLE | DENIED | RESTRICTED
device_metadataobject
profileobjectrequired
{
  "data": {
    "type": "push-token",
    "attributes": {
      "token": "string",
      "platform": "ios",
      "vendor": "apns",
      "enablement_status": "AUTHORIZED",
      "background": "AVAILABLE",
      "device_metadata": {
        "device_id": "string",
        "klaviyo_sdk": "string",
        "sdk_version": "string",
        "device_model": "string",
        "os_name": "string",
        "os_version": "string",
        "app_name": "string",
        "app_version": "string",
        "app_build": "string",
        "app_id": "string",
        "environment": "sandbox"
      },
      "profile": {
        "data": {
          "type": "profile",
          "attributes": {
            "email": "string",
            "phone_number": "string",
            "external_id": "string",
            "anonymous_id": "string"
          }
        }
      }
    }
  }
}

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/client/push-tokens" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data":{"type":"push-token","attributes":{"token":"string","platform":"ios","vendor":"apns","enablement_status":"AUTHORIZED","background":"AVAILABLE","device_metadata":{"device_id":"string","klaviyo_sdk":"string","sdk_version":"string","device_model":"string","os_name":"string","os_version":"string","app_name":"string","app_version":"string","app_build":"string","app_id":"string","environment":"sandbox"},"profile":{"data":{"type":"profile","attributes":{"email":"string","phone_number":"string","external_id":"string","anonymous_id":"string"}}}}}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

202 Default Response
Example
{
  "ok": true
}
Schema
okbooleanrequired
true
4XX Default Response
Example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
Schema
errorobjectrequired
Show child parameters
codestringrequired
messagestringrequired
detailsobject
5XX Default Response

Same as 4XX · POST /client/push-tokens

POSThttps://hermetica.15.204.158.166.sslip.io/client/push-token-unregister

Remove a device push token (logout)

Request body

application/json
dataobjectrequired
Show child parameters
typestring
push-token-unregister | push-token
attributesobjectrequired
Show child parameters
tokenstringrequired
platformstring
ios | android | web
vendorstringrequired
apns | fcm | expo | web_push
profileobject
{
  "data": {
    "type": "push-token-unregister",
    "attributes": {
      "token": "string",
      "platform": "ios",
      "vendor": "apns",
      "profile": {
        "data": {
          "type": "profile",
          "attributes": {
            "email": "string",
            "phone_number": "string",
            "external_id": "string",
            "anonymous_id": "string"
          }
        }
      }
    }
  }
}

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/client/push-token-unregister" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data":{"type":"push-token-unregister","attributes":{"token":"string","platform":"ios","vendor":"apns","profile":{"data":{"type":"profile","attributes":{"email":"string","phone_number":"string","external_id":"string","anonymous_id":"string"}}}}}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

202 Default Response

Same as 202 · POST /client/push-tokens

4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

GEThttps://hermetica.15.204.158.166.sslip.io/client/push-config

The workspace's VAPID public key, for browsers subscribing to web push

Parameters

company_idstringquery
kstringquery

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/client/push-config" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "vapidPublicKey": "string"
}
Schema
vapidPublicKeystringrequired
4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

GEThttps://hermetica.15.204.158.166.sslip.io/v1/push-tokens

Registered devices, newest first; filter by profile, vendor or validity

Parameters

limitintegerquery
= 50
cursorstringquery
profileIdstringquery
vendorstringquery
apns | fcm | expo | web_push
validstringquery
true | false

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/push-tokens" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "items": [
    {
      "id": "string",
      "profileId": "string",
      "token": "string",
      "platform": "ios",
      "vendor": "apns",
      "appId": "string",
      "environment": "sandbox",
      "enablementStatus": "AUTHORIZED",
      "background": "AVAILABLE",
      "deviceMetadata": {},
      "lastSeenAt": "2024-01-01T00:00:00Z",
      "invalidatedAt": "2024-01-01T00:00:00Z",
      "invalidReason": "string",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "nextCursor": "string"
}
Schema
itemsobject[]required
Show child parameters
idstringrequired
profileIdstringrequired
tokenstringrequired
platformstringrequired
ios | android | web
vendorstringrequired
apns | fcm | expo | web_push
appIdstringrequired
environmentstringrequired
sandbox | production
enablementStatusstringrequired
AUTHORIZED | DENIED | UNAUTHORIZED | PROVISIONAL | NOT_DETERMINED
backgroundstringrequired
AVAILABLE | DENIED | RESTRICTED
deviceMetadataobjectrequired
lastSeenAtstringrequired
invalidatedAtstringrequired
invalidReasonstringrequired
createdAtstringrequired
nextCursorstringrequired
4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

POSThttps://hermetica.15.204.158.166.sslip.io/v1/push-tokens

Register a device for a profile (server side; the SDKs use /client/push-tokens)

Request body

application/json
profileIdstringrequired
tokenstringrequired
platformstringrequired
ios | android | web
vendorstringrequired
apns | fcm | expo | web_push
appIdstring
environmentstring
sandbox | production = production
enablementStatusstring
AUTHORIZED | DENIED | UNAUTHORIZED | PROVISIONAL | NOT_DETERMINED = AUTHORIZED
backgroundstring
AVAILABLE | DENIED | RESTRICTED = AVAILABLE
deviceMetadataobject
= {}
{
  "profileId": "string",
  "token": "string",
  "platform": "ios",
  "vendor": "apns",
  "appId": "string",
  "environment": "production",
  "enablementStatus": "AUTHORIZED",
  "background": "AVAILABLE",
  "deviceMetadata": {}
}

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/v1/push-tokens" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"profileId":"string","token":"string","platform":"ios","vendor":"apns","appId":"string","environment":"production","enablementStatus":"AUTHORIZED","background":"AVAILABLE","deviceMetadata":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Default Response
Example
{
  "id": "string",
  "profileId": "string",
  "token": "string",
  "platform": "ios",
  "vendor": "apns",
  "appId": "string",
  "environment": "sandbox",
  "enablementStatus": "AUTHORIZED",
  "background": "AVAILABLE",
  "deviceMetadata": {},
  "lastSeenAt": "2024-01-01T00:00:00Z",
  "invalidatedAt": "2024-01-01T00:00:00Z",
  "invalidReason": "string",
  "createdAt": "2024-01-01T00:00:00Z"
}
Schema
idstringrequired
profileIdstringrequired
tokenstringrequired
platformstringrequired
ios | android | web
vendorstringrequired
apns | fcm | expo | web_push
appIdstringrequired
environmentstringrequired
sandbox | production
enablementStatusstringrequired
AUTHORIZED | DENIED | UNAUTHORIZED | PROVISIONAL | NOT_DETERMINED
backgroundstringrequired
AVAILABLE | DENIED | RESTRICTED
deviceMetadataobjectrequired
lastSeenAtstringrequired
invalidatedAtstringrequired
invalidReasonstringrequired
createdAtstringrequired
4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

GEThttps://hermetica.15.204.158.166.sslip.io/v1/push-tokens/{id}

One registered device; `profileId` names the profile it belongs to

Parameters

idstringpathrequired

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/push-tokens/{id}" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 201 · POST /v1/push-tokens

4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

DELETEhttps://hermetica.15.204.158.166.sslip.io/v1/push-tokens/{id}

Delete a registered device

Parameters

idstringpathrequired

Code samples

cURL
curl -X DELETE "https://hermetica.15.204.158.166.sslip.io/v1/push-tokens/{id}" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 202 · POST /client/push-tokens

4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

GEThttps://hermetica.15.204.158.166.sslip.io/v1/profiles/{id}/push-tokens

The devices registered for one profile, including ones the provider rejected

Parameters

limitintegerquery
Page size; omitted returns the whole list
cursorstringquery
Opaque: the nextCursor of the previous page
idstringpathrequired

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/profiles/{id}/push-tokens" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · GET /v1/push-tokens

4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

POSThttps://hermetica.15.204.158.166.sslip.io/v1/push/vapid-keys

Generate a VAPID key pair for a web push connection. The private key is returned once and is not stored here: put it in the connection.

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/v1/push/vapid-keys" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "publicKey": "string",
  "privateKey": "string"
}
Schema
publicKeystringrequired
privateKeystringrequired
4XX Default Response

Same as 4XX · POST /client/push-tokens

5XX Default Response

Same as 4XX · POST /client/push-tokens

Updated