GET/v1/devices

Listar/buscar dispositivos (sk_ con devices:read). Filtros q, status, platform, externalUserId; paginado.

Llave: sk_

Parámetros

NombreEnTipoDescripción
appIdquerystring
qquerystring
statusquery"active" | "pending_credential" | "invalid" | "unsubscribed"
platformquery"android" | "ios"
externalUserIdquerystring
pagequeryinteger
perPagequeryinteger

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

CampoTipoDescripción
appIdstring
tokenstringToken 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"
frameworkstring
sdkNamestring
sdkVersionstring
capabilities"images" | "actions" | "open_tracking" | "foreground_display" | "deep_links"[]
externalUserIdstring
languagestring
timezonestring
countrystring
appVersionstring
osVersionstring
deviceModelstring
notificationsEnabledboolean
tagsobject

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

NombreEnTipoDescripción
externalUserId*pathstring

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

NombreEnTipoDescripción
token*pathstring

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

NombreEnTipoDescripción
token*pathstring

Cuerpo

CampoTipoDescripción
appIdstring
tokenstringToken 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"
frameworkstring
sdkNamestring
sdkVersionstring
capabilities"images" | "actions" | "open_tracking" | "foreground_display" | "deep_links"[]
externalUserIdstring
languagestring
timezonestring
countrystring
appVersionstring
osVersionstring
deviceModelstring
notificationsEnabledboolean
tagsobject

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

NombreEnTipoDescripción
token*pathstring

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

NombreEnTipoDescripción
token*pathstring

Cuerpo

CampoTipoDescripción
externalUserId*stringmá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

NombreEnTipoDescripción
token*pathstring

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

NombreEnTipoDescripción
token*pathstring

Cuerpo

CampoTipoDescripción
tagsobject
replaceboolean

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

NombreEnTipoDescripción
token*pathstring
topic*pathstring

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

NombreEnTipoDescripción
token*pathstring
topic*pathstring

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

NombreEnTipoDescripción
token*pathstring

Cuerpo

CampoTipoDescripció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"
}'