Export Quick Reports

Export Quick Reports

POST https://api.ocamba.com/v1/hood/quick-reports/{id}/export
Create an Export request for Quick Reports.

Note

The request body can be passed either as application/json or url encoded form data. In the request body, the standard parameters are described, but you can add any other add any other parameter for filtering, as long as it’s supported by Ocamba and the specific report you’re trying to export.

An export request will result in a web socket notification to the creator of the export whether it is successful or failed. The response body of the successful request will be a long running operation metadata. You can check out the progress of export by listing lro tasks with the ID provided in the response body.

If you want to see the export instance, list download center records.

Warning
If you want to define specific time range for which the report should be exported. Please use the pattern ‘field’: ‘daterange’

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v1/hood/quick-reports/{id}/export" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Email Campaign Performance Report - Q1 2025",
  "out": "csv",
  "source": "hood.campaign-reports",
  "fields": "channel_type,sent,delivered,total_click,click_rate,unsubscribed,open_rate",
  "sort": "-click_rate",
  "resolution": "day",
  "precision": 4,
  "filters": {
    "event_time": "rf:2025-07-01 00:00:00,2025-07-03 23:59:59",
    "channel_type": "in:push,sms"
  }
}'
const url = 'https://api.ocamba.com/v1/hood/quick-reports/{id}/export';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "Email Campaign Performance Report - Q1 2025",
      "out": "csv",
      "source": "hood.campaign-reports",
      "fields": "channel_type,sent,delivered,total_click,click_rate,unsubscribed,open_rate",
      "sort": "-click_rate",
      "resolution": "day",
      "precision": 4,
      "filters": {
        "event_time": "rf:2025-07-01 00:00:00,2025-07-03 23:59:59",
        "channel_type": "in:push,sms"
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/quick-reports/{id}/export");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "Email Campaign Performance Report - Q1 2025",
    "out" => "csv",
    "source" => "hood.campaign-reports",
    "fields" => "channel_type,sent,delivered,total_click,click_rate,unsubscribed,open_rate",
    "sort" => "-click_rate",
    "resolution" => "day",
    "precision" => 4,
    "filters" => [
      "event_time" => "rf:2025-07-01 00:00:00,2025-07-03 23:59:59",
      "channel_type" => "in:push,sms"
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

202 Accepted

{
  "id": "0f0ad209-af98-4b29-b710-39d2353b66c6",
  "company_id": "6197120",
  "creator_id": "1000223",
  "name": "quick-report-export",
  "status": "running",
  "start_time": "2025-07-28 08:00:35"
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses