API · Dispositivos
Registrar, actualizar, identificar y dar de baja los dispositivos de tu app.
Base: https://api.pushhub.daertec.com. Todas las respuestas usan { errCode, errMsg, data, meta }. Autenticación y llaves · Catálogo de errores
- GET
/v1/devices - POST
/v1/devices - GET
/v1/devices/by-user/{externalUserId} - GET
/v1/devices/{token} - PATCH
/v1/devices/{token} - DELETE
/v1/devices/{token} - POST
/v1/devices/{token}/identify - POST
/v1/devices/{token}/logout - PUT
/v1/devices/{token}/tags - POST
/v1/devices/{token}/topics/{topic} - DELETE
/v1/devices/{token}/topics/{topic} - POST
/v1/devices/{token}/pair
GET/v1/devices
Listar/buscar dispositivos (sk_ con devices:read). Filtros q, status, platform, externalUserId; paginado.
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
appId | query | string | |
q | query | string | |
status | query | "active" | "pending_credential" | "invalid" | "unsubscribed" | |
platform | query | "android" | "ios" | |
externalUserId | query | string | |
page | query | integer | |
perPage | query | integer |
Respuestas: 200403
curl -X GET "https://api.pushhub.daertec.com/v1/devices" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"POST/v1/devices
Registrar o actualizar un dispositivo (upsert por token). pk_ o sk_ con devices:write.
Llave: pk_ / sk_
El proveedor se detecta por el formato del token (FCM o APNs). Errores: 2004 plataforma no habilitada en la app,
2005 token incoherente con platform/provider, 2006 token de Expo, 2012 zona horaria. Si la app no tiene la credencial
del proveedor el dispositivo queda pending_credential (meta.warnings lo explica) y se activa al cargarla.
Cuerpo
| Campo | Tipo | Descripción |
|---|---|---|
appId | string | |
token | string | Token FCM de registro, Firebase Installation ID (22 caracteres) o token APNs (hexadecimal) · máx. 512 caracteres |
platform | "android" | "ios" | |
provider | "fcm" | "apns" | Opcional: se detecta por el formato |
environment | "sandbox" | "production" | "auto" | |
framework | string | |
sdkName | string | |
sdkVersion | string | |
capabilities | "images" | "actions" | "open_tracking" | "foreground_display" | "deep_links"[] | |
externalUserId | string | |
language | string | |
timezone | string | |
country | string | |
appVersion | string | |
osVersion | string | |
deviceModel | string | |
notificationsEnabled | boolean | |
tags | object |
Respuestas: 200201422
curl -X POST "https://api.pushhub.daertec.com/v1/devices" \
-H "Authorization: Bearer pk_test_TU_LLAVE_PUBLICA" \
-H "Content-Type: application/json" \
-d '{
"token": "TOKEN_FCM_O_APNS_DEL_DISPOSITIVO",
"platform": "android",
"environment": "auto",
"externalUserId": "cliente-123",
"language": "es",
"timezone": "America/Santo_Domingo",
"appVersion": "2.4.0",
"notificationsEnabled": true,
"tags": {
"plan": "gold",
"ciudad": "santiago"
}
}'GET/v1/devices/by-user/{externalUserId}
Dispositivos de un usuario externo (sk_)
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
externalUserId* | path | string |
Respuestas: 200
curl -X GET "https://api.pushhub.daertec.com/v1/devices/by-user/cliente-123" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"GET/v1/devices/{token}
Detalle (con tags y topics). sk_.
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Respuestas: 200404
curl -X GET "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"PATCH/v1/devices/{token}
Actualizar atributos (idioma, zona horaria, versiones, notificationsEnabled…)
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Cuerpo
| Campo | Tipo | Descripción |
|---|---|---|
appId | string | |
token | string | Token FCM de registro, Firebase Installation ID (22 caracteres) o token APNs (hexadecimal) · máx. 512 caracteres |
platform | "android" | "ios" | |
provider | "fcm" | "apns" | Opcional: se detecta por el formato |
environment | "sandbox" | "production" | "auto" | |
framework | string | |
sdkName | string | |
sdkVersion | string | |
capabilities | "images" | "actions" | "open_tracking" | "foreground_display" | "deep_links"[] | |
externalUserId | string | |
language | string | |
timezone | string | |
country | string | |
appVersion | string | |
osVersion | string | |
deviceModel | string | |
notificationsEnabled | boolean | |
tags | object |
Respuestas: 200
curl -X PATCH "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA" \
-H "Content-Type: application/json" \
-d '{
"language": "en",
"notificationsEnabled": false,
"tags": {
"plan": "platinum"
}
}'DELETE/v1/devices/{token}
Dar de baja (status unsubscribed; registrarse de nuevo lo reactiva)
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Respuestas: 200
curl -X DELETE "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"POST/v1/devices/{token}/identify
Vincular externalUserId
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Cuerpo
| Campo | Tipo | Descripción |
|---|---|---|
externalUserId* | string | máx. 191 caracteres |
Respuestas: 200
curl -X POST "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/identify" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA" \
-H "Content-Type: application/json" \
-d '{
"externalUserId": "cliente-123"
}'POST/v1/devices/{token}/logout
Desvincular externalUserId
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Respuestas: 200
curl -X POST "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/logout" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"PUT/v1/devices/{token}/tags
Fusionar tags (null borra una clave) o reemplazar todos con replace=true. Maximo 50.
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Cuerpo
| Campo | Tipo | Descripción |
|---|---|---|
tags | object | |
replace | boolean |
Respuestas: 200
curl -X PUT "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/tags" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA" \
-H "Content-Type: application/json" \
-d '{
"tags": {
"plan": "gold",
"ultima_compra": "2026-10-01"
}
}'POST/v1/devices/{token}/topics/{topic}
Suscribir a un topic (se crea si no existe)
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string | |
topic* | path | string |
Respuestas: 200
curl -X POST "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/topics/ofertas" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"DELETE/v1/devices/{token}/topics/{topic}
Desuscribir
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string | |
topic* | path | string |
Respuestas: 200
curl -X DELETE "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/topics/ofertas" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA"POST/v1/devices/{token}/pair
Marcar como dispositivo de prueba con el codigo de 6 digitos del panel (2008 si es invalido o vencio)
Llave: sk_
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
token* | path | string |
Cuerpo
| Campo | Tipo | Descripción |
|---|---|---|
code* | string |
Respuestas: 200422
curl -X POST "https://api.pushhub.daertec.com/v1/devices/TOKEN_DEL_DISPOSITIVO/pair" \
-H "Authorization: Bearer sk_test_TU_LLAVE_SECRETA" \
-H "Content-Type: application/json" \
-d '{
"code": "482913"
}'