API RU
Early access. API keys are issued on request. How to get a key

A campaign is a message sequence that Telegram accounts send to contacts on a schedule.

#The Campaign object

Campaign: a sequence of messages that Telegram accounts send to contacts.

Attributes

  • objectstring
    Object type, always campaign.
  • idstring (uuid)
    Campaign ID.
  • workspace_idstring (uuid)
    Workspace the campaign belongs to.
  • namestring
    Campaign name.
  • statusstring
    Campaign status. An unknown value is returned as unknown. Values: draft scheduled active paused stopped completed archived launching failed paused_no_credits unknown
  • Where the first message comes from. Always template in v1: from the campaign template.
  • Whether the campaign accepts contacts through the API. Always false in v1.
  • reasonobject
    Why the campaign is not sending messages right now, if known.
    Child attributes
    • Reason code. Values: none schedule_window daily_limit queue_pending telegram_wait account_unavailable account_restricted campaign_paused subscription_inactive manual_hold automation_stopped service_unavailable unknown
    • reason_observed_atstring (date-time) or null
      When the reason was recorded. null if unknown.
    • next_attempt_atstring (date-time) or null
      When the next attempt is expected. null if the time is unknown.
    • Whether someone needs to act in Meliora for sending to resume. null if unknown.
  • created_atstring (date-time)
    When the campaign was created.
  • observed_atstring (date-time)
    Time the server read the data.
Campaign
{
  "object": "campaign",
  "id": "4d8b2f73-6e1a-4c95-b7d0-8a3f5e2c9b14",
  "workspace_id": "3f6a9d21-8b4c-4e7f-a102-5c9e8d7b6a43",
  "name": "Example campaign",
  "status": "active",
  "first_message_mode": "template",
  "accepts_api_leads": false,
  "reason": {
    "reason_code": "none",
    "reason_observed_at": null,
    "next_attempt_at": null,
    "requires_customer_action": null
  },
  "created_at": "2026-10-20T08:00:00.000Z",
  "observed_at": "2026-10-27T09:15:42.000Z"
}

#List campaigns

GET/v1/campaigns

Campaigns in the key's scope, oldest first by created_at.

Permission
campaigns:read
Request weight
2

Parameters

  • limitinteger, queryoptional
    Number of objects to return per page. From 1 to 100. Defaults to 50.
  • cursorstring, queryoptional
    The next_cursor value from the previous response. Other filters must match the first request.
  • workspace_idstring (uuid), queryoptional
    Only objects in this workspace.
  • statusstring, queryoptional
    Only campaigns with this status. Values: draft scheduled active paused stopped completed archived launching failed paused_no_credits unknown

Response

A list: object, data (an array of Campaign objects), has_more, next_cursor. See Pagination.

Endpoint-specific errors

  • cursor_mismatch: The cursor is corrupted, was issued for a different route or filters, or the key's permissions and scope have changed.
  • scope_required: The key does not have permission for this read. Texts also require "Message text" to be enabled.
  • not_found: The object was not found or is outside the key's scope. An unknown path also returns 404.
  • cursor_expired: The cursor expired: 15 minutes for lists, 30 days for the event feed.

Common errors are described in Errors.

Request
curl -G https://api.melioralab.io/v1/campaigns \
  -H "Authorization: Bearer $MELIORA_API_KEY" \
  -d workspace_id=3f6a9d21-8b4c-4e7f-a102-5c9e8d7b6a43 \
  -d status=active
Response
{
  "object": "list",
  "data": [
    {
      "object": "campaign",
      "id": "4d8b2f73-6e1a-4c95-b7d0-8a3f5e2c9b14",
      "workspace_id": "3f6a9d21-8b4c-4e7f-a102-5c9e8d7b6a43",
      "name": "Example campaign",
      "status": "active",
      "first_message_mode": "template",
      "accepts_api_leads": false,
      "reason": {
        "reason_code": "none",
        "reason_observed_at": null,
        "next_attempt_at": null,
        "requires_customer_action": null
      },
      "created_at": "2026-10-20T08:00:00.000Z",
      "observed_at": "2026-10-27T09:15:42.000Z"
    },
    {
      "object": "campaign",
      "id": "6e3a9c15-2b7d-4f80-9a64-3c1d8e5f7b29",
      "workspace_id": "3f6a9d21-8b4c-4e7f-a102-5c9e8d7b6a43",
      "name": "Follow-up",
      "status": "paused",
      "first_message_mode": "template",
      "accepts_api_leads": false,
      "reason": {
        "reason_code": "campaign_paused",
        "reason_observed_at": "2026-10-25T16:40:00.000Z",
        "next_attempt_at": null,
        "requires_customer_action": true
      },
      "created_at": "2026-10-22T11:15:00.000Z",
      "observed_at": "2026-10-27T09:15:42.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "v1.k1.Qm9hcmRfMWZ4.c3RyaWN0bHlfb3BhcXVl.dGFnX2V4YW1wbGU.bWFjX2V4YW1wbGVfdmFsdWU"
}

#Retrieve a campaign

GET/v1/campaigns/{id}

A single campaign by ID. A campaign outside the key's scope returns 404, as if it did not exist.

Permission
campaigns:read
Request weight
1

Parameters

  • idstring (uuid), pathrequired
    Campaign ID.

Response

Returns a Campaign object.

Endpoint-specific errors

  • scope_required: The key does not have permission for this read. Texts also require "Message text" to be enabled.
  • not_found: The object was not found or is outside the key's scope. An unknown path also returns 404.

Common errors are described in Errors.

Request
curl https://api.melioralab.io/v1/campaigns/4d8b2f73-6e1a-4c95-b7d0-8a3f5e2c9b14 \
  -H "Authorization: Bearer $MELIORA_API_KEY"
Response
{
  "object": "campaign",
  "id": "4d8b2f73-6e1a-4c95-b7d0-8a3f5e2c9b14",
  "workspace_id": "3f6a9d21-8b4c-4e7f-a102-5c9e8d7b6a43",
  "name": "Example campaign",
  "status": "active",
  "first_message_mode": "template",
  "accepts_api_leads": false,
  "reason": {
    "reason_code": "none",
    "reason_observed_at": null,
    "next_attempt_at": null,
    "requires_customer_action": null
  },
  "created_at": "2026-10-20T08:00:00.000Z",
  "observed_at": "2026-10-27T09:15:42.000Z"
}