API ReferenceapicommsPOST /v1/push/subscriptions

POST /v1/push/subscriptions

Service: comms · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "person_id": {
      "type": "string",
      "minLength": 1
    },
    "endpoint": {
      "type": "string",
      "format": "uri"
    },
    "p256dh": {
      "type": "string",
      "minLength": 1
    },
    "auth": {
      "type": "string",
      "minLength": 1
    },
    "user_agent": {
      "type": "string"
    }
  },
  "required": [
    "brand_id",
    "person_id",
    "endpoint",
    "p256dh",
    "auth"
  ]
}

Responses

201 Push subscription registered

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "person_id": {
      "type": "string"
    },
    "endpoint": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "brand_id",
    "person_id",
    "endpoint",
    "created_at",
    "expires_at"
  ]
}

422 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://comms.platform.loop.health/v1/push/subscriptions \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'