API Documentation

Full RapidPro documentation for comprehensive support

  1. Home
  2. API Documentation

Archives Endpoint

This endpoint allows you to list the data archives associated with your account.

Listing Archives

A GET returns the archives for your organization with the following fields.

  • archive_type - the type of the archive, one of message or run (filterable as archive_type).
  • start_date - the UTC date of the archive (string) (filterable as before and after).
  • period - daily for daily archives, monthly for monthly archives (filterable as period).
  • record_count - number of records in the archive (int).
  • size - size of the gzipped archive content (int).
  • hash - MD5 hash of the gzipped archive (string).
  • download_url - temporary download URL of the archive (string).

Example:

GET /api/v2/archives.json?archive_type=message&before=2017-05-15&period=daily

Response is a list of the archives on your account:

{
  "next": null,
  "previous": null,
  "count": 248,
  "results": [
    {
      "archive_type": "message",
      "start_date": "2017-02-20",
      "period": "daily",
      "record_count": 1432,
      "size": 2304,
      "hash": "feca9988b7772c003204a28bd741d0d0",
      "download_url": "https://..."
    },
    ...
  ]
}

Boundaries Endpoint

This endpoint allows you to list the administrative boundaries for the country associated with your account, along with the simplified GPS geometry for those boundaries in GEOJSON format.

Listing Boundaries

A GET returns the boundaries for your organization with the following fields. To include geometry, specify geometry=true.

  • osm_id - the OSM ID for this boundary prefixed with the element type (string).
  • name - the name of the administrative boundary (string).
  • parent - the id of the containing parent of this boundary or null if this boundary is a country (string).
  • level - the level: 0 for country, 1 for state, 2 for district (int).
  • geometry - the geometry for this boundary, which will usually be a MultiPolygon (GEOJSON).

Note that including geometry may produce a very large result so it is recommended to cache the results on the client side.

Example:

GET /api/v2/boundaries.json?geometry=true

Response is a list of the boundaries on your account:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "osm_id": "1708283",
      "name": "Kigali City",
      "parent": {"osm_id": "171496", "name": "Rwanda"},
      "level": 1,
      "aliases": ["Kigari"],
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [7.5251021, 5.0504713],
              [7.5330272, 5.0423498]
            ]
          ]
        ]
      }
    },
    ...
  ]
}

Broadcasts Endpoint

This endpoint allows you to send new message broadcasts and list existing broadcasts in your account.

Listing Broadcasts

A GET returns the outgoing message activity for your organization, listing the most recent messages first.

  • id - the id of the broadcast (int), filterable as id.
  • urns - the URNs that received the broadcast (array of strings).
  • contacts - the contacts that received the broadcast (array of objects).
  • groups - the groups that received the broadcast (array of objects).
  • text - the message text translations (dict of strings).
  • attachments - the attachment translations (dict of lists of strings).
  • base_language - the default translation language (string).
  • status - the status, one of pending, queued, started, completed, failed, interrupted.
  • created_on - when this broadcast was created (datetime) (filterable as before and after).

Example:

GET /api/v2/broadcasts.json

Response is a list of recent broadcasts:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 123456,
      "urns": ["tel:+250788123123", "tel:+250788123124"],
      "contacts": [{"uuid": "09d23a05-47fe-11e4-bfe9-b8f6b119e9ab", "name": "Joe"}],
      "groups": [],
      "text": {"eng": "hello world"},
      "attachments": {"eng": []},
      "base_language": "eng",
      "created_on": "2013-03-02T17:28:12.123456Z"
    },
    ...
  ]
}

Sending Broadcasts

A POST allows you to create and send new broadcasts. Attachments are media object UUIDs returned from POSTing to the media endpoint.

  • urns - the URNs of contacts to send to (array of up to 100 strings, optional).
  • contacts - the UUIDs of contacts to send to (array of up to 100 strings, optional).
  • groups - the UUIDs of contact groups to send to (array of up to 100 strings, optional).
  • text - the message text translations (dict of strings).
  • attachments - the attachment translations (dict of lists of strings).
  • base_language - the default translation language (string, optional).

Example:

POST /api/v2/broadcasts.json
{
  "urns": ["tel:+250788123123", "tel:+250788123124"],
  "contacts": ["09d23a05-47fe-11e4-bfe9-b8f6b119e9ab"],
  "text": {"eng": "Hello @contact.name!", "spa": "Hola @contact.name!"},
  "base_language": "eng"
}

You will receive a response containing the message broadcast created:

{
  "id": 1234,
  "urns": ["tel:+250788123123", "tel:+250788123124"],
  "contacts": [{"uuid": "09d23a05-47fe-11e4-bfe9-b8f6b119e9ab", "name": "Joe"}],
  "groups": [],
  "text": {"eng": "Hello @contact.name!", "spa": "Hola @contact.name!"},
  "attachments": {"eng": [], "spa": []},
  "base_language": "eng",
  "created_on": "2013-03-02T17:28:12.123456Z"
}

Campaigns Endpoint

This endpoint allows you to list campaigns in your account.

Listing Campaigns

A GET returns the campaigns, listing the most recently created campaigns first.

  • uuid - the UUID of the campaign (string), filterable as uuid.
  • name - the name of the campaign (string).
  • archived - whether this campaign is archived (boolean).
  • group - the group this campaign operates on (object).
  • created_on - when the campaign was created (datetime), filterable as before and after.

Example:

GET /api/v2/campaigns.json

Response is a list of the campaigns on your account:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "f14e4ff0-724d-43fe-a953-1d16aefd1c00",
      "name": "Reminders",
      "archived": false,
      "group": {"uuid": "7ae473e8-f1b5-4998-bd9c-eb8e28c92fa9", "name": "Reporters"},
      "created_on": "2013-08-19T19:11:21.088Z"
    },
    ...
  ]
}

Adding Campaigns

A POST can be used to create a new campaign, by sending the following data. Don't specify a UUID as this will be generated for you.

  • name - the name of the campaign (string, required).
  • group - the UUID of the contact group this campaign will be run against (string, required).

Example:

POST /api/v2/campaigns.json
{
  "name": "Reminders",
  "group": "7ae473e8-f1b5-4998-bd9c-eb8e28c92fa9"
}

You will receive a campaign object as a response if successful:

{
  "uuid": "f14e4ff0-724d-43fe-a953-1d16aefd1c00",
  "name": "Reminders",
  "archived": false,
  "group": {"uuid": "7ae473e8-f1b5-4998-bd9c-eb8e28c92fa9", "name": "Reporters"},
  "created_on": "2013-08-19T19:11:21.088Z"
}

Campaign Events Endpoint

This endpoint allows you to list campaign events in your account.

Listing Campaign Events

A GET returns the campaign events, listing the most recently created events first.

  • uuid - the UUID of the campaign (string), filterable as uuid.
  • campaign - the UUID and name of the campaign (object), filterable as campaign with UUID.
  • relative_to - the key and label of the date field this event is based on (object).
  • offset - the offset from our contact field (positive or negative integer).
  • unit - the unit for our offset, one of minutes, hours, days or weeks.
  • delivery_hour - the hour of the day to deliver the message (integer 0-24, -1 indicates send at the same hour as the contact field).
  • message - the message to send to the contact by language (object).
  • flow - the UUID and name of the flow if this is a flow event (object).
  • created_on - when the event was created (datetime).

Example:

GET /api/v2/campaign_events.json

Adding Campaign Events

A POST can be used to create a new campaign event, by sending the following data.

  • campaign - the UUID of the campaign this event should be part of (string)
  • relative_to - the field key that this event will be relative to (string)
  • offset - the offset from our contact field (positive or negative integer)
  • unit - the unit for our offset (minutes, hours, days or weeks)
  • delivery_hour - the hour of the day to deliver the message (integer 0-24, -1 indicates send at the same hour as the field)
  • message - the message to send to the contact (string, required if flow is not specified)
  • flow - the UUID of the flow to start the contact down (string, required if message is not specified)

Updating Campaign Events

A POST can also be used to update an existing campaign event if you specify its UUID in the URL.

Deleting Campaign Events

A DELETE can be used to delete a campaign event if you specify its UUID in the URL.

Channels Endpoint

This endpoint allows you to list channels in your account.

Listing Channels

A GET returns the list of channels for your organization, in the order of last created.

  • uuid - the UUID of the channel (string), filterable as uuid.
  • name - the name of the channel (string).
  • address - the address (e.g. phone number, Twitter handle) of the channel (string), filterable as address.
  • country - which country the sim card for this channel is registered for (string, two letter country code).
  • device - information about the device if this is an Android channel.
  • last_seen - the datetime when this channel was last seen (datetime).
  • created_on - the datetime when this channel was created (datetime).

Example:

GET /api/v2/channels.json

Classifiers Endpoint

This endpoint allows you to list the active natural language understanding classifiers on your account.

Listing Classifiers

A GET returns the classifiers for your organization, most recent first.

  • uuid - the UUID of the classifier, filterable as uuid.
  • name - the name of the classifier.
  • intents - the list of intents this classifier exposes (list of strings).
  • type - the type of the classifier, one of wit, luis or bothub.
  • created_on - when this classifier was created.

Example:

GET /api/v2/classifiers.json

Contacts Endpoint

This endpoint allows you to list, create, update and delete contacts in your account.

Listing Contacts

A GET returns the list of contacts for your organization, in the order of last modified.

  • uuid - the UUID of the contact (string), filterable as uuid.
  • name - the name of the contact (string).
  • status - the status of the contact, one of active, blocked, stopped or archived.
  • language - the preferred language of the contact (string).
  • urns - the URNs associated with the contact (string array), filterable as urn.
  • groups - the UUIDs of any groups the contact is part of (array of objects), filterable as group with group name or UUID.
  • fields - any contact fields on this contact (object).
  • flow - the flow that the contact is currently in, if any (object).
  • created_on - when this contact was created (datetime).
  • modified_on - when this contact was last modified (datetime), filterable as before and after.
  • last_seen_on - when this contact last communicated with us (datetime).

Example:

GET /api/v2/contacts.json

Adding Contacts

You can add a new contact to your account by sending a POST request with the following JSON data:

  • name - the full name of the contact (string, optional).
  • language - the preferred language for the contact (3 letter iso code, optional).
  • urns - a list of URNs you want associated with the contact (array of up to 100 strings, optional).
  • groups - a list of the UUIDs of any groups this contact is part of (array of up to 100 strings, optional).
  • fields - the contact fields you want to set or update on this contact (dictionary of up to 100 items, optional).

Updating Contacts

A POST can also be used to update an existing contact if you specify either its UUID or one of its URNs in the URL.

Deleting Contacts

A DELETE can also be used to delete an existing contact if you specify either its UUID or one of its URNs in the URL.

Contact Actions Endpoint

Bulk Contact Updating

A POST can be used to perform an action on a set of contacts in bulk.

  • contacts - the contact UUIDs or URNs (array of up to 100 strings).
  • action - the action to perform, a string one of:
    • add - add the contacts to the given group.
    • remove - remove the contacts from the given group.
    • block - block the contacts.
    • unblock - unblock the contacts.
    • interrupt - interrupt and end any of the contacts' active flow runs.
    • delete - permanently delete the contacts.
  • group - the UUID or name of a contact group (string, optional).

Example:

POST /api/v2/contact_actions.json

Fields Endpoint

This endpoint allows you to list custom contact fields in your account.

Listing Fields

A GET returns the list of custom contact fields for your organization, in the order of last created.

  • key - the unique key of this field (string), filterable as key.
  • name - the display name of this field (string).
  • type - the data type of this field, one of text, number, datetime, state, district or ward.

Example:

GET /api/v2/fields.json

Adding Fields

A POST can be used to create a new contact field. Don't specify a key as this will be generated for you.

  • name - the display name (string)
  • type - one of the data type codes (string)

Updating Fields

A POST can also be used to update an existing field if you include it's key in the URL.

Flow Starts Endpoint

This endpoint allows you to list manual flow starts in your account, and add or start contacts in a flow.

Listing Flow Starts

By making a GET request you can list all the manual flow starts on your organization, in the order of last modified.

  • uuid - the UUID of this flow start (string), filterable as uuid.
  • flow - the flow which was started (object).
  • contacts - the list of contacts that were started in the flow (objects).
  • groups - the list of groups that were started in the flow (objects).
  • status - the status, one of pending, queued, started, completed, failed, interrupted.
  • params - the dictionary of extra parameters passed to the flow start (object).
  • created_on - the datetime when this flow start was created (datetime).
  • modified_on - the datetime when this flow start was modified (datetime).

Starting contacts down a flow

By making a POST request with the contacts, groups and URNs you want to start down a flow you can trigger a flow start.

  • flow - the UUID of the flow to start contacts in (required)
  • groups - the UUIDs of the groups you want to start in this flow (array of up to 100 strings, optional)
  • contacts - the UUIDs of the contacts you want to start in this flow (array of up to 100 strings, optional)
  • urns - the URNs you want to start in this flow (array of up to 100 strings, optional)
  • restart_participants - whether to restart participants already in this flow (optional, defaults to true)
  • exclude_active - whether to exclude contacts currently in other flow (optional, defaults to false)
  • params - extra parameters to pass to the flow start (object, accessible via @trigger.params in the flow)

Flows Endpoint

This endpoint allows you to list flows in your account.

Listing Flows

A GET returns the list of flows for your organization, in the order of last created.

  • uuid - the UUID of the flow (string), filterable as uuid.
  • name - the name of the flow (string).
  • type - the type of the flow (one of "message", "voice", "survey"), filterable as type.
  • archived - whether this flow is archived (boolean), filterable as archived.
  • labels - the labels for this flow (array of objects).
  • expires - the time (in minutes) when this flow's inactive contacts will expire (integer).
  • runs - the counts of active, completed, interrupted and expired runs (object).
  • results - the results that this flow may create (array).
  • parent_refs - the keys of the parent flow results referenced in this flow (array).
  • created_on - when this flow was created (datetime).
  • modified_on - when this flow was last modified (datetime), filterable as before and after.

Globals Endpoint

This endpoint allows you to list, create, and update active globals on your account.

Listing Globals

A GET returns the globals for your organization, most recently modified first.

  • key - the key of the global.
  • name - the name of the global.
  • value - the value of the global.
  • modified_on - when this global was modified.

Adding a Global

A POST can be used to create a new Global. Don't specify a key as this will be generated for you.

  • name - the name of the global
  • value - the value of the global

Updating a Global

A POST can also be used to update an existing global if you specify its key in the URL.

Groups Endpoint

This endpoint allows you to list, create, update and delete contact groups in your account.

Listing Groups

A GET returns the list of contact groups for your organization, in the order of last created.

  • uuid - the UUID of the group (string), filterable as uuid.
  • name - the name of the group (string), filterable as name.
  • query - the query if a smart group (string).
  • status - the status, one of initializing, evaluating or ready.
  • system - whether this is a system group that can't be edited (bool).
  • count - the number of contacts in the group (int).

Adding a Group

A POST can be used to create a new contact group. Don't specify a UUID as this will be generated for you.

  • name - the group name (string)

Updating a Group

A POST can also be used to update an existing contact group if you specify its UUID in the URL.

Deleting a Group

A DELETE can be used to delete a contact group if you specify its UUID in the URL.

Labels Endpoint

This endpoint allows you to list, create, update and delete message labels in your account.

Listing Labels

A GET returns the list of message labels for your organization, in the order of last created.

  • uuid - the UUID of the label (string), filterable as uuid.
  • name - the name of the label (string), filterable as name.
  • count - the number of messages with this label (int).

Adding a Label

A POST can be used to create a new message label. Don't specify a UUID as this will be generated for you.

  • name - the label name (string)

Updating a Label

A POST can also be used to update an existing message label if you specify its UUID in the URL.

Deleting a Label

A DELETE can be used to delete a message label if you specify its UUID in the URL.

Media Endpoint

This endpoint allows you to upload new media objects for use as attachments on messages.

Uploading Media

A POST can be used to upload a new media object.

  • file - the file data (bytes)

You will receive a media object as a response if successful with fields: uuid, content_type, url, filename, and size.

Messages Endpoint

This endpoint allows you to list messages in your account.

Listing Messages

A GET returns the messages for your organization, filtering them as needed.

  • id - the ID of the message (int), filterable as id.
  • broadcast - the id of the broadcast (int), filterable as broadcast.
  • contact - the UUID and name of the contact (object), filterable as contact with UUID.
  • urn - the URN of the sender or receiver, depending on direction (string).
  • channel - the UUID and name of the channel that handled this message (object).
  • direction - the direction of the message (one of incoming or outgoing).
  • type - the type of the message (one of text, optin or voice).
  • status - the status of the message (queued, handled, wired, sent, delivered, read, errored, failed).
  • visibility - the visibility of the message (one of visible, archived or deleted)
  • text - the text of the message received (string).
  • attachments - the attachments on the message (array of objects).
  • labels - any labels set on this message (array of objects), filterable as label with label name or UUID.
  • flow - the UUID and name of the flow if message was part of a flow (object, optional).
  • created_on - when this message was either received by the channel or created (datetime).
  • sent_on - for outgoing messages, when the channel sent the message (datetime).
  • modified_on - when the message was last modified (datetime).

Sending a Message

A POST can be used to create and send a new message.

  • contact - the UUID of the contact (string)
  • text - the text of the message (string)
  • attachments - the attachments of the message (list of strings, maximum 10)

Message Actions Endpoint

Bulk Message Updating

A POST can be used to perform an action on a set of messages in bulk.

  • messages - the message ids (array of up to 100 integers).
  • action - the action to perform, a string one of:
    • label - apply the given label to the messages.
    • unlabel - remove the given label from the messages.
    • archive - archive the messages.
    • restore - restore the messages if they are archived.
    • delete - permanently delete the messages.
  • label - the UUID or name of an existing label (string, optional).
  • label_name - the name of a label which can be created if it doesn't exist (string, optional).

Runs Endpoint

This endpoint allows you to fetch flow runs. A run represents a single contact's path through a flow.

Listing Flow Runs

A GET request returns the flow runs for your organization, filtering them as needed.

  • uuid - the ID of the run (string), filterable as uuid.
  • flow - the UUID and name of the flow (object), filterable as flow with UUID.
  • contact - the UUID and name of the contact (object), filterable as contact with UUID.
  • start - the UUID of the flow start (object).
  • responded - whether the contact responded (boolean).
  • values - values generated by rulesets in the flow (array of objects).
  • created_on - when this run was started (datetime).
  • modified_on - when this run was last modified (datetime).
  • exited_on - when this run exited or null if still active (datetime).
  • exit_type - how the run ended, one of interrupted, completed, expired.

Note: You cannot filter by flow and contact at the same time.

Resthooks Endpoint

This endpoint allows you to list configured resthooks in your account.

Listing Resthooks

A GET returns the resthooks on your organization.

  • resthook - the slug for the resthook (string).
  • created_on - when this resthook was created (datetime).
  • modified_on - when this resthook was last modified (datetime).

Resthook Events Endpoint

This endpoint lists recent events for the passed in Resthook.

Listing Resthook Events

A GET returns the recent resthook events on your organization.

  • resthook - the slug for the resthook (filterable).
  • data - the data for the resthook.
  • created_on - when this resthook event was created (datetime).

Resthook Subscribers Endpoint

This endpoint allows you to list, add or remove subscribers to resthooks.

Listing Resthook Subscribers

  • id - the id of the subscriber (integer, filterable).
  • resthook - the resthook they are subscribed to (string, filterable).
  • target_url - the URL that will be notified when this event occurs.
  • created_on - when this subscriber was added (datetime).

Subscribing to a Resthook

POST request fields:

  • resthook - the slug of the resthook to subscribe to.
  • target_url - the URL to notify (POST).

Deleting a Subscription

A DELETE can be used with the subscriber id in the URL.

Tickets Endpoint

This endpoint allows you to list the tickets opened on your account.

Listing Tickets

  • uuid - the UUID of the ticket (string).
  • contact - the UUID and name of the contact (object).
  • status - the status of the ticket (open or closed).
  • topic - the topic of the ticket (object).
  • assignee - the user assigned to the ticket (object).
  • opened_on - when this ticket was opened (datetime).
  • opened_by - the user who opened the ticket (object).
  • opened_in - the flow which opened the ticket (object).
  • modified_on - when this ticket was last modified (datetime).
  • closed_on - when this ticket was closed (datetime).

Ticket Actions Endpoint

This endpoint allows you to perform bulk updates on tickets.

Bulk Ticket Updating

  • tickets - array of up to 100 ticket UUIDs (strings).
  • action - one of assign, note, close, reopen.
  • assignee - email of the user to assign (optional).
  • note - note to add to tickets (optional).

Topics Endpoint

This endpoint allows you to list the topics in your workspace and create new ones.

Listing Topics

  • uuid - the UUID of the topic (string).
  • name - the name of the topic (string).
  • counts - counts of open and closed tickets (object).
  • system - whether this is a system topic (boolean).
  • created_on - when this topic was created (datetime).

Adding a Topic

A POST can be used to create a new topic.

  • name - the name of the topic (string).

Users Endpoint

This endpoint allows you to list the user logins in your workspace.

Listing Users

  • email - the email address of the user (string).
  • first_name - the first name of the user (string).
  • last_name - the last name of the user (string).
  • role - the role of the user (string).
  • team - team user belongs to (object).
  • created_on - when this user was created (datetime).

Workspace Endpoint

This endpoint allows you to view details about your workspace.

Viewing Current Workspace

A GET returns the details of your workspace. No parameters required.

  • uuid - the UUID of the workspace.
  • name - the workspace name.
  • country - the country code of the workspace.
  • languages - the supported languages (array).
  • timezone - the workspace timezone.
  • date_style - the date style (day_first or month_first).
  • anon - whether the workspace is anonymous (boolean).

/api/v2/archives – to list archives of messages and runs

Archives Endpoint

This endpoint allows you to list the data archives associated with your account.

Listing Archives

A GET returns the archives for your organization with the following fields.

  • archive_type – the type of the archive, one of message or run (filterable as archive_type).
  • start_date – the UTC date of the archive (string) (filterable as before and after).
  • period – daily for daily archives, monthly for monthly archives (filterable as period).
  • record_count – number of records in the archive (int).
  • size – size of the gzipped archive content (int).
  • hash – MD5 hash of the gzipped archive (string).
  • download_url – temporary download URL of the archive (string).

Example:

GET /api/v2/archives.json?archive_type=message&before=2017-05-15&period=daily

Response is a list of the archives on your account

{

    “next”: null,

    “previous”: null,

    “count”: 248,

    “results”: [

    {

        “archive_type”: “message”,

        “start_date”: “2017-02-20”,

        “period”: “daily”,

        “record_count”: 1432,

        “size”: 2304,

        “hash”: “feca9988b7772c003204a28bd741d0d0”,

        “download_url”: “https://…”

    },

    …

}

Boundaries Endpoint

 

This endpoint allows you to list the administrative boundaries for the country associated with your account, along with the simplified GPS geometry for those boundaries in GEOJSON format.

Listing Boundaries

A GET returns the boundaries for your organization with the following fields. To include geometry, specify geometry=true.

  • osm_id – the OSM ID for this boundary prefixed with the element type (string).
  • name – the name of the administrative boundary (string).
  • parent – the id of the containing parent of this boundary or null if this boundary is a country (string).
  • level – the level: 0 for country, 1 for state, 2 for district (int).
  • geometry – the geometry for this boundary, which will usually be a MultiPolygon (GEOJSON).

Note that including geometry may produce a very large result so it is recommended to cache the results on the client side.

Example:

GET /api/v2/boundaries.json?geometry=true

 

Response is a list of the boundaries on your account

{

    “next”: null,

    “previous”: null,

    “results”: [

    {

        “osm_id”: “1708283”,

        “name”: “Kigali City”,

        “parent”: {“osm_id”: “171496”, “name”: “Rwanda”},

        “level”: 1,

        “aliases”: [“Kigari”],

        “geometry”: {

            “type”: “MultiPolygon”,

            “coordinates”: [

                [

                    [

                        [7.5251021, 5.0504713],

                        [7.5330272, 5.0423498]

                    ]

                ]

            ]

        }

    },

    …

}

  /api/v2/broadcasts – to list and send broadcasts

 

Broadcasts Endpoint

 

This endpoint allows you to send new message broadcasts and list existing broadcasts in your account.

Listing Broadcasts

A GET returns the outgoing message activity for your organization, listing the most recent messages first.

  • id – the id of the broadcast (int), filterable as id.
  • urns – the URNs that received the broadcast (array of strings).
  • contacts – the contacts that received the broadcast (array of objects).
  • groups – the groups that received the broadcast (array of objects).
  • text – the message text translations (dict of strings).
  • attachments – the attachment translations (dict of lists of strings).
  • base_language – the default translation language (string).
  • status – the status, one of pending, queued, started, completed, failed, interrupted.
  • created_on – when this broadcast was either created (datetime) (filterable as before and after).

Example:

GET /api/v2/broadcasts.json

 

Response is a list of recent broadcasts:

{

    “next”: null,

    “previous”: null,

    “results”: [

        {

            “id”: 123456,

            “urns”: [“tel:+250788123123”, “tel:+250788123124”],

            “contacts”: [{“uuid”: “09d23a05-47fe-11e4-bfe9-b8f6b119e9ab”, “name”: “Joe”}]

            “groups”: [],

            “text”: {“eng”, “hello world”},

            “attachments”: {“eng”, []},

            “base_language”: “eng”,

            “created_on”: “2013-03-02T17:28:12.123456Z”

        },

        …

 

Sending Broadcasts

A POST allows you to create and send new broadcasts. Attachments are media object UUIDs returned from POSTing to the media endpoint.

  • urns – the URNs of contacts to send to (array of up to 100 strings, optional)
  • contacts – the UUIDs of contacts to send to (array of up to 100 strings, optional)
  • groups – the UUIDs of contact groups to send to (array of up to 100 strings, optional)
  • text – the message text translations (dict of strings)
  • attachments – the attachment translations (dict of lists of strings)
  • base_language – the default translation language (string, optional)

Example:

POST /api/v2/broadcasts.json

{

    “urns”: [“tel:+250788123123”, “tel:+250788123124”],

    “contacts”: [“09d23a05-47fe-11e4-bfe9-b8f6b119e9ab”],

    “text”: {“eng”: “Hello @contact.name!”, “spa”: “Hola @contact.name!”},

    “base_language”: “eng”

}

 

You will receive a response containing the message broadcast created:

{

    “id”: 1234,

    “urns”: [“tel:+250788123123”, “tel:+250788123124”],

    “contacts”: [{“uuid”: “09d23a05-47fe-11e4-bfe9-b8f6b119e9ab”, “name”: “Joe”}]

    “groups”: [],

    “text”: {“eng”: “Hello @contact.name!”, “spa”: “Hola @contact.name!”},

    “attachments”: {“eng”, [], “spa”: []},

    “base_language”: “eng”,

    “created_on”: “2013-03-02T17:28:12.123456Z”

}

Get started

Start Your RapidPro Project Today

Transform your communication strategy now. Choose the hosting solution that matches your specific needs and requirements.

RapidPro hosting platform dashboard showing a conversational flow for a "Healthy Life Journey" campaign.