curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "<string>",
"token": "<string>",
"p256dh": "<string>",
"auth": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_id: '<string>', token: '<string>', p256dh: '<string>', auth: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices"
payload = {
"device_id": "<string>",
"token": "<string>",
"p256dh": "<string>",
"auth": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Register the signed-in user's mobile device for push notifications
Stores the device’s APNs or FCM token and its notification key (RFC 8291),
sealed at rest. Registering again with the same device_id updates it. A
former registration of the same token, whichever the account, is replaced.
The app draws a device_id at sign-in and forgets it at sign-out; on 409
it draws a new one and retries. Org API keys are refused.
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "<string>",
"token": "<string>",
"p256dh": "<string>",
"auth": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_id: '<string>', token: '<string>', p256dh: '<string>', auth: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/push/devices"
payload = {
"device_id": "<string>",
"token": "<string>",
"p256dh": "<string>",
"auth": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Body
^[A-Za-z0-9_-]{16,64}$ios, android APNs or FCM token.
Uncompressed P-256 public key, base64url.
16-byte secret, base64url.
APNs environment. Required on iOS, refused on Android.
production, development APNs topic (the app bundle id). iOS only.
Response
Device registered.
Was this page helpful?