Register the signed-in user's mobile device for push notifications
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": {}
}Push
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.
POST
/
v1
/
push
/
devices
Register the signed-in user's mobile device for push notifications
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
application/json
Response
Device registered.
Was this page helpful?