Using the API to export campaign data

Overview

Ortto supports exporting campaign data via API. This can be useful for exporting campaigns and their statuses, allowing you to audit your Ortto campaigns externally.

You can use this endpoint to export the following campaign types:

  • Email
  • Playbook
  • SMS
  • Journey
  • Push notification
  • WhatsApp

HTTP method and request resource

Requests to export campaign data in Ortto via API are submitted as a single POST method to the following URL:

https://api.ap3api.com/v1/campaign/get-all

NOTE: Ortto customers who have their instance region set to Australia or Europe will need to use specific service endpoints relative to the region:

  • Australia: https://api.au.ap3api.com/
  • Europe: https://api.eu.ap3api.com/

For example: https://api.eu.ap3api.com/v1/<entity/endpoint>

All other Ortto users will use the default service endpoint (https://api.ap3api.com/).


Headers

This endpoint requires a custom API key and content type (application/json for the request body) in the header of the request:

  • X-Api-Key: CUSTOM-PRIVATE-API-KEY
  • Content-Type: application/json

Request body

The request body consists of a JSON object whose are listed in this table.

Example get campaign data request body from Ortto's CDP

json

{ "type": "journey", "state": "on", "folder_id": "6842c82de2f490232b196392", "q": "welcome", "sort_order": "desc", "sort": "name", "limit": 5 }

Valid request body elements

The following table lists all request body elements that are available at this endpoint.

Element

Type

Description

type

string

Campaign type to return. Available options:

  • all
  • email
  • playbook
  • sms
  • journey
  • push
  • whatsapp

types

array

Array of campaign types to return. Supports the same options as above. Example: "types": ["email", "playbook", "journey"]

state

string

Status of the campaigns to return. Available options:

  • draft
  • scheduled
  • sending
  • sent
  • cancelled
  • on
  • off

folder_id

string

Return campaigns from a certain folder. Example: "folder_id": "6842c82de2f490232b196392"

Learn more about finding the folder ID.

campaign_ids

array

Array of specific campaigns to return based on IDs. Example: "campaign_ids": ["6842c850c999be9c835e731a", "67853315c44081ee21b6fc1c"]

Learn more about finding the campaign ID.

limit

integer

The limit value determines the number of activities to be returned by Ortto from the request.

This value also represents the "page" length of campaigns (for pagination purposes). This element can be used in conjunction with offset to retrieve subsequent pages of campaign records.

The default value is 50 but also accepts between 1 and 50.

offset

integer

The offset parameter specifies how far through the list of campaigns to get this batch from, enabling pagination through the results. For example, assuming the default limit of 50, get the first 50 matching campaigns by using an offset of 0, and then get the next 50 campaigns by using an offset of 50. Keep adding 50 to the offset each time to iterate through the list.

q

string

The search tem or query to run against the campaign names to be returned. Example: "q": "newsletter"

sort_order

string

Ascending or descending order. Examples:

  • "sort_order": "asc"
  • "sort_order": "desc"

sort

string

The element by which to sort the results. Supported options:

  • name
  • state
  • edited_at
  • edited_by_name
  • created_at
  • created_by_name
  • delivered
  • opens
  • open_rate
  • email_clicks
  • email_click_rate
  • sms_clicks
  • sms_click_rate
  • push_clicks
  • push_click_rate
  • widget_clicks
  • widget_click_rate
  • widget_engagement
  • widget_engagement_rate
  • conversions
  • conversion_rate
  • revenue
  • replied
  • reply_rate
  • entered
  • exited

Response payload

The following JSON object is an example of a campaigns call that Ortto retrieves from your Ortto account’s CDP after a request to this endpoint.

json

{ "campaigns": [ { "id": "6842c850c999be9c835e731a", "asset_id": "000000000000000000000000", "name": "New user welcome journey inc. widgets", "type": "journey", "instance_id": "example", "folder_id": "6842c82de2f490232b196392", "created_by_id": "62d8d333c98b835bgb5a0357", "created_by_name": "Admin", "created_by_email": "example@example.com", "created_at": "2025-06-06T10:52:00.688Z", "edited_at": "2025-06-23T10:19:38.354Z", "edited_by_id": "62d8d333c98b835bab5a0357", "edited_by_name": "Admin", "cancelled_by_id": "000000000000000000000000", "has_a_b_testing": false, "goal_activity_id": "act:cm:account-canceled", "goal_activity_title": "Account canceled", "attribution_disabled": false, "report_type": "revenue", "state": "on", "imported_from_template": true, "template_id": "6667ae339a63f63c09cf003e", "scheduled_location": "", "scheduled_use_local_time": false, "scheduled_local_time": "", "enable_schedule": null, "clicks": 0, "click_rate": 0, "variant_a_clicks": 0, "variant_b_clicks": 0, "variant_a_delivered": 0, "variant_b_delivered": 0, "widget_flags": "101", "email_clicks": 0, "email_click_rate": 0, "sms_clicks": 0, "sms_click_rate": 0, "push_clicks": 0, "push_click_rate": 0, "widget_clicks": 0, "widget_click_rate": 0, "widget_engagement": 0, "widget_engagement_rate": 0, "opens": 0, "open_rate": 0, "replied": 0, "reply_rate": 0, "variant_a_opens": 0, "variant_a_email_clicks": 0, "variant_a_email_delivered": 0, "variant_a_sms_clicks": 0, "variant_a_sms_delivered": 0, "variant_a_push_clicks": 0, "variant_a_push_delivered": 0, "variant_a_revenue": 0, "variant_a_conversions": 0, "variant_a_whatsapp_delivered": 0, "variant_b_opens": 0, "variant_b_email_clicks": 0, "variant_b_email_delivered": 0, "variant_b_sms_clicks": 0, "variant_b_sms_delivered": 0, "variant_b_push_clicks": 0, "variant_b_push_delivered": 0, "variant_b_revenue": 0, "variant_b_conversions": 0, "variant_b_whatsapp_delivered": 0, "entered": 1, "exited": 0, "delivered": 0, "revenue": 0, "conversions": 0, "conversion_rate": 0, "last_updated": "2025-06-23T10:25:04.211Z" } ], "next_offset": 1, "has_more": false, "folder_id": "6842c82de2f490232b196392" }

Finding the campaign IDs

To find the campaign IDs to include in your payload, open the relevant campaigns in your Ortto account and copy the ID from the URL in your browser's address bar.

Alternatively, you can call this endpoint without specifying the campaign IDs (you can still include campaign-related details like the search term), and we'll return the campaign ID for any matching campaigns.

Example of where to find a journey’s Campaign ID in the URL.

Finding the folder ID

To find the folder ID to include in your payload, open the relevant folder in your Ortto account and copy the ID from the URL in your browser's address bar.

Example of where to find a folder ID in the URL.