> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifique.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Register push device

> Register a phone or browser to receive notifications.



## OpenAPI

````yaml /en/push-api/api-reference/openapi-push.json post /v1/push/devices
openapi: 3.0.3
info:
  title: Notifique API Push
  description: >-
    Send push notifications and manage apps and devices. Authenticate with
    `Authorization: Bearer sk_live_...` or `x-api-key`.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Production
security:
  - ntfPushBearerAuth: []
  - ntfPushApiKeyHeader: []
tags:
  - name: Push Apps
    description: >-
      CRUD de aplicações de push (um app por produto; credenciais
      Web/Android/iOS por app)
  - name: Push Devices
    description: Registro e listagem de dispositivos/subscriptions
  - name: Push Messages
    description: Envio, consulta e cancelamento de notificações push
paths:
  /v1/push/devices:
    post:
      tags:
        - Push Devices
      summary: Register push device
      description: Register a phone or browser to receive notifications.
      operationId: ntfPush_postV1PushDevices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfPush_PushDeviceRegisterRequest'
            example:
              appId: clxx...
              platform: web
              subscription:
                endpoint: https://...
                keys:
                  p256dh: ...
                  auth: ...
              externalUserId: user_123
      responses:
        '200':
          description: Dispositivo criado ou atualizado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_PushDeviceSingleResponse'
        '400':
          description: >-
            Validação: app_id/platform/subscription ou token ausente;
            subscription.endpoint inválido; plataforma não configurada no app.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
        '401':
          description: API Key ausente ou inválida (quando obrigatória).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
        '402':
          description: Plano expirado/suspenso (WORKSPACE_BLOCKED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
        '403':
          description: >-
            Escopo push:devices:register ausente ou origem não permitida
            (ORIGIN_NOT_ALLOWED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
        '404':
          description: Push app não encontrado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
        '429':
          description: Rate limit excedido (registro público).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfPush_ErrorResponse'
components:
  schemas:
    NtfPush_PushDeviceRegisterRequest:
      type: object
      required:
        - appId
        - platform
      properties:
        appId:
          type: string
        platform:
          type: string
          enum:
            - web
            - android
            - ios
        subscription:
          type: object
          properties:
            endpoint:
              type: string
            keys:
              type: object
              properties:
                p256dh:
                  type: string
                auth:
                  type: string
        token:
          type: string
          description: FCM token (android) or APNs device token hex (ios)
        packageName:
          type: string
          description: >-
            Required for public android registration; must match
            PushApp.androidPackageName
        bundleId:
          type: string
          description: >-
            Required for public ios registration; must match
            PushApp.apnsBundleId
        externalUserId:
          type: string
        contactId:
          type: string
          description: >-
            CRM contact link, requires authenticated API Key (rejected on public
            registration)
    NtfPush_PushDeviceSingleResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/NtfPush_PushDeviceItem'
    NtfPush_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: 'Rótulo HTTP do erro (ex.: Unauthorized, Bad Request, Not Found).'
        message:
          type: string
          description: >-
            Mensagem legível para exibir ao usuário (localizada via
            Accept-Language / x-locale quando aplicável).
        code:
          type: string
          description: >-
            Código estável da API v1 (enum). Sempre presente em erros. Use com o
            status HTTP para decidir retry ou correção. Ver [Respostas de
            erro](/guides/conceitos/resposta-de-erros).
        details:
          type: object
      required:
        - success
        - error
        - message
        - code
    NtfPush_PushDeviceItem:
      type: object
      properties:
        id:
          type: string
        appId:
          type: string
        platform:
          type: string
        externalUserId:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    ntfPushBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer sk_live_xxxxx'
    ntfPushApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'x-api-key: sk_live_xxxxx'

````