API ReferenceapicommsPOST /v1/messages/schedule

POST /v1/messages/schedule

Service: comms · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms",
        "push",
        "in_app"
      ]
    },
    "template_key": {
      "type": "string",
      "minLength": 1
    },
    "recipient": {
      "type": "string",
      "minLength": 1
    },
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "person_id": {
      "type": "string",
      "minLength": 1
    },
    "variables": {
      "type": "object",
      "additionalProperties": {},
      "default": {}
    },
    "dedup_key": {
      "type": "string",
      "minLength": 1
    },
    "hipaa": {
      "type": "boolean",
      "default": false
    },
    "scheduled_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "channel",
    "template_key",
    "recipient",
    "brand_id",
    "person_id",
    "dedup_key",
    "scheduled_at"
  ]
}

Responses

201 Message scheduled

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "person_id": {
      "type": "string"
    },
    "channel": {
      "type": "string"
    },
    "template_key": {
      "type": "string"
    },
    "recipient": {
      "type": "string"
    },
    "dedup_key": {
      "type": "string"
    },
    "scheduled_at": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "sent_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancelled_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "failure_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "brand_id",
    "person_id",
    "channel",
    "template_key",
    "recipient",
    "dedup_key",
    "scheduled_at",
    "status",
    "sent_at",
    "cancelled_at",
    "failure_reason",
    "created_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/messages/schedule \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'