auto-message-campaigns

Create an Auto Messages campaign

Changed on

Rate limit: 5 requests per second

The campaign starts running as soon as it is created: it begins matching fans the moment this request is answered. There is no way to stage one — use the status endpoint to pause it.

An empty audience_filters targets every fan that fires the trigger. Campaigns here are trigger-driven and send one message per fan event, so this is the ordinary shape of a welcome campaign rather than a broadcast.

audience_filters[].options.lists[].name is accepted and never published back: a name is required for each fan list, while the read endpoints carry identifiers alone.

This endpoint is not idempotent. A request that times out may still have created a running campaign. Before retrying, list the account campaigns and look for one already there; a duplicate can be stopped with the status endpoint. Listing the campaigns needs auto_messages.view in addition to auto_messages.edit.

Required permission: auto_messages.edit

post/api/v0/accounts/{account_id}/auto-message-campaigns

Request

  • Base URL
    https://omapi.onlymonster.ai
  • Auth
    API key in header x-om-auth-token

Path parameters

account_idstring required

OnlyMonster account whose campaigns are read.

Request body

trigger'welcome_message' | 'online_message' | 'has_expired_message' | 'will_expire_in_message' required
action'send_message' | 'start_mimic' required
namestring

Campaign name. Required for a sequence and for a message that carries media but no text.

Example request

{
  "messages": [
    {
      "tagged_platform_account_ids": [
        "1"
      ]
    }
  ]
}

Response

One Auto Messages campaign of the account.

idstring required

Campaign identifier.

account_idstring required

OnlyMonster account the campaign belongs to.

namestring required

Campaign name as the account owner set it. Null when the campaign has none.

trigger'welcome_message' | 'online_message' | 'has_expired_message' | 'will_expire_in_message' required
action'send_message' | 'start_mimic' required

What the campaign does when the trigger fires. send_message — sends the messages listed in messages. start_mimic — opens a Mimic chat instead of sending; such a campaign has no messages. Null when this version of the API does not name the action. Such a campaign reports no messages either, since what its content means depends on what it does with it.

status'active' | 'paused' | 'archived' | 'unsending' | 'unsent' required
created_atstring date-time required

When the campaign was created (ISO 8601 Zulu).

targeted_sends_countinteger required

Dispatches the campaign has made since it was created. Cumulative: a fan targeted twice counts twice, and the figure never decreases.

Example response

{
  "id": "4312",
  "account_id": "12345",
  "action": "send_message",
  "created_by": {
    "id": "42"
  },
  "messages": [
    {
      "price_gross": 9.99,
      "attachments": [
        {
          "id": "1289402"
        }
      ],
      "tagged_platform_account_ids": [
        "67890"
      ]
    }
  ]
}

Changes

    • warning

      added the new MIMIC_CAMPAIGN_FILTER_NOT_ALLOWED enum value to the response property for the response status

    • warning

      added the new verified_account enum value to the // response property for the response status

    • info

      added subschema #5 to the / request property anyOf list

    • info

      endpoint added