Skip to main content
POST
/
v1
/
custom-kpi-datasets
/
{dataset_id}
/
download_excel
Download Excel
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    selected_kpi_ids: ['<string>'],
    selected_campaign_ids: ['<string>'],
    language: '<string>'
  })
};

fetch('https://api.dcycle.io/v1/custom-kpi-datasets/{dataset_id}/download_excel', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "message": "<string>",
  "queued": true,
  "processing_job_id": "<string>"
}

Download Excel

Queue an asynchronous Excel export of custom KPI values for a dataset. The export is processed in the background and you receive an email with the download link when ready.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

dataset_id
string
required
UUID of the dataset to export

Body Parameters

selected_kpi_ids
string[]
default:"[]"
KPI UUIDs to include in the export (max 100). Empty array exports all KPIs.
selected_campaign_ids
string[]
default:"[]"
Campaign UUIDs to include (max 100). Empty array exports all campaigns.
language
string
default:"es"
Export language: es (Spanish) or en (English)

Response (202 Accepted)

message
string
Confirmation message
queued
boolean
Always true — the export is processing asynchronously
processing_job_id
string
UUID of the processing job for tracking progress

Example

curl -X POST "https://api.dcycle.io/v1/custom-kpi-datasets/${DATASET_ID}/download_excel" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "selected_kpi_ids": [],
    "selected_campaign_ids": [],
    "language": "en"
  }'

Successful Response

{
  "message": "Custom KPI download queued. You will receive an email when ready.",
  "queued": true,
  "processing_job_id": "job-uuid"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

404 Not Found

Cause: The dataset does not exist or belongs to another organization
{"detail": "Not Found"}

List Dataset Values

View values in the browser

Get Dataset

View dataset details