API ReferenceapicommsPOST /v1/push/send

POST /v1/push/send

Service: comms · operationId: (none)

Fan out a web push notification to all subscribed devices for a patient.

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "patientId": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "body": {
      "type": "string",
      "minLength": 1
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "patientId",
    "title",
    "body"
  ]
}

Responses

200 Push send fanout result

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string"
    },
    "person_id": {
      "type": "string"
    },
    "sent": {
      "type": "integer"
    },
    "rejected": {
      "type": "integer"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "subscription_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "rejected"
            ]
          },
          "vendor_message_id": {
            "type": "string"
          }
        },
        "required": [
          "subscription_id",
          "status",
          "vendor_message_id"
        ]
      }
    }
  },
  "required": [
    "patient_id",
    "person_id",
    "sent",
    "rejected",
    "results"
  ]
}

403 Only M2M callers may send push

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

404 Patient or identity mapping not found

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

Example

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