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

# Subscribe device

> This endpoint associates the specified customer device, identified by customerId, 
to push notifications.



## OpenAPI

````yaml openapi/push-v1.json POST /v1/customers/{customerId}/subscription
openapi: 3.0.1
info:
  title: Push.Api
  version: v1
servers:
  - url: https://{host}/push
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v1/customers/{customerId}/subscription:
    post:
      tags:
        - S2S
      summary: Subscribe device
      description: "This endpoint associates the specified customer device, identified by customerId, \r\nto push notifications."
      parameters:
        - name: customerId
          in: path
          description: The unique identifier of the customer/device being subscribed.
          required: true
          schema:
            type: string
      requestBody:
        description: The subscription request
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/Push.Api.DTO.SubscribeRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/Push.Api.DTO.SubscribeRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/Push.Api.DTO.SubscribeRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Push.Api.DTO.SubscribeRequest'
      responses:
        '200':
          description: Success
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
components:
  schemas:
    Push.Api.DTO.SubscribeRequest:
      required:
        - installationId
        - platform
        - tokenHandle
      type: object
      properties:
        tokenHandle:
          maxLength: 255
          minLength: 1
          type: string
          description: >-
            The device token that is used by Azure Notification Hub to send push
            notifications to the device
        platform:
          maxLength: 10
          minLength: 1
          type: string
          description: "Identifier of the platform.\r\nPossible values: \"Apns\" (iOs), \"Fcm\" (deprecated Android), FcmV1 (new Android), \"Hms\" (Huawei)"
        installationId:
          maxLength: 50
          minLength: 1
          type: string
          description: The unique identifier of the device installation.
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        Opaque Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````