API ReferenceapicommsPOST /v1/admin/campaigns/{id}/send

POST /v1/admin/campaigns/\{id\}/send

Service: comms · operationId: (none)

Required scopes

(no scope declared — review service config)

Path parameters

  • id (string) required

Request body

{
  "type": "object",
  "properties": {
    "recipients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "person_id": {
            "type": "string",
            "minLength": 1
          },
          "recipient": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "person_id",
          "recipient"
        ]
      }
    }
  },
  "required": [
    "recipients"
  ]
}

Responses

200 Campaign send initiated

{
  "type": "object",
  "properties": {
    "send": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "campaign_id": {
          "type": "string"
        },
        "brand_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "total_recipients": {
          "type": "number"
        },
        "sent": {
          "type": "number"
        },
        "failed": {
          "type": "number"
        },
        "started_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_by": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "campaign_id",
        "brand_id",
        "status",
        "total_recipients",
        "sent",
        "failed",
        "started_at",
        "completed_at",
        "created_by",
        "created_at"
      ]
    }
  },
  "required": [
    "send"
  ]
}

404 Campaign not found

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

409 Campaign already sent

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

500 Send failed

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

Example

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