API ReferenceapimessagingPOST /v1/messaging/campaigns/{id}/publish

POST /v1/messaging/campaigns/\{id\}/publish

Service: messaging · 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"
          },
          "recipient": {
            "type": "string"
          }
        },
        "required": [
          "person_id",
          "recipient"
        ]
      }
    }
  },
  "required": [
    "recipients"
  ]
}

Responses

202 Queued

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "campaign_id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "total_recipients": {
      "type": "number"
    },
    "sent_count": {
      "type": "number"
    },
    "failed_count": {
      "type": "number"
    },
    "skipped_count": {
      "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_count",
    "failed_count",
    "skipped_count",
    "started_at",
    "completed_at",
    "created_by",
    "created_at"
  ]
}

400 Validation

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

404 Not found

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

412 Bad state

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

500 Server error

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

Example

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