Referencia de la API

Reportes

Reportes de campañas y exportaciones en CSV.

GET /v1/reports/calls/export

Export the call log as CSV

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

The calls that match the filters of `listCalls` (without `limit` and `cursor`), newest first, one row per call: id, start, duration, assistant, campaign, direction, outcome, end reason, `phone_last4` and `simulated`. The result of the call adds `result_outcome`, `structured_output` as JSON text, and one `result.<key>` column for each top-level key of the structured outputs (a list or an object as JSON text). The `include_costs` and `include_internal` options require `costs:read` and add the cost estimate and captured values respectively. Streamed, never held in memory. Needs an `editor` or above. Never has a full phone number. A text that starts with `=`, `+`, `-` or `@` is prefixed with `'` so a spreadsheet does not run it. At most 100,000 rows: a larger result is refused with 422, narrow the filters. Every export is audited as `report.export` (filter names only, never values). An organization may start a limited number of exports per minute. 401, 422 and 503 as in `listCalls`; 403 for a `viewer`; 429 when the organization exports too often (see `Retry-After`).

Parámetros

NombreEnTipoRequeridoDescripción
formatquerystring
sincequerystring (date-time) | null
untilquerystring (date-time) | null
assistant_idquerystring (uuid) | null
campaign_idquerystring (uuid) | null
outcomequerystring | null
end_reasonquerystring | null
directionquerystring | null
qquerystring | null
sentimentquery"positive" | "neutral" | "negative" | nullThe sentiment of the post-call analysis.
criterionquerystring | nullId of a success criterion of the assistant; the call was analyzed.
criterion_resultquery"success" | "failure" | "unknown" | nullHow `criterion` was judged. Needs `criterion`.
include_costsqueryboolean
include_internalqueryboolean

Respuestas

  • 200 A CSV file.
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 The caller lacks the required role or permission. · ErrorResponse
  • 422 A filter is invalid or the result too big. · ErrorResponse
  • 429 Too many exports; retry later. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/reports/campaigns/{campaign_id}

How a campaign went

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member. `summary` (status, dates, contacts, attempts, minutes), `contactability` (contacts reached, those with an answered attempt, over contacts), `attempts_per_contact` (how many contacts took 0, 1, 2... attempts), `outcomes` of the closed attempts (`answered_responded` when an answered call has a transcribed caller turn; older calls without this signal remain `answered`), `best_hours` (attempts and answered by local hour of the campaign's time zone, only the hours with attempts), `dnc_skipped` (contacts closed by the do-not-call list) and `completion`. Reports include real and simulated campaign calls. 401 when the token is missing, expired or invalid; 404 when the campaign is not in the caller's organization; 503 when reports are not available.

Parámetros

NombreEnTipoRequeridoDescripción
campaign_idpathstring (uuid)sí

Respuestas

  • 200 Successful Response · CampaignReportResponse
    NombreTipoRequeridoDescripción
    attempts_per_contactAttemptsBucketResponse[]sí
    attempts_per_contact[].attemptsintegersí
    attempts_per_contact[].contactsintegersí
    best_hoursHourOutcomeResponse[]sí
    best_hours[].answeredintegersí
    best_hours[].attemptsintegersí
    best_hours[].hourintegersíLocal hour in the campaign's zone.
    completionCompletionResponsesí
    completion.contacts_doneintegersí
    completion.contacts_totalintegersí
    completion.progressnumbersí
    contactabilityContactabilityResponsesí
    contactability.contactsintegersí
    contactability.ratenumber | nullsí`reached` over `contacts`.
    contactability.reachedintegersíContacts with at least one answered attempt.
    dnc_skippedintegersíContacts closed by the do-not-call list.
    outcomesOutcomeCountResponse[]sí
    outcomes[].attemptsintegersí
    outcomes[].contactsintegersíDistinct contacts with such an attempt.
    outcomes[].outcomestringsí
    summaryReportSummaryResponsesí
    summary.assistant_idstring (uuid)sí
    summary.attemptsintegersí
    summary.campaign_idstring (uuid)sí
    summary.completed_atstring (date-time) | nullsí
    summary.contacts_totalintegersí
    summary.namestringsí
    summary.started_atstring (date-time) | nullsí
    summary.statusstringsí (draft, running, paused, completed, cancelled)
    summary.timezonestringsí
    summary.total_minutesnumbersí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none). · ErrorResponse
  • 404 No such campaign in the caller's tenant. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/reports/campaigns/{campaign_id}/export

Export a campaign as CSV

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

One row per contact: id, `phone_last4`, state, attempts, the last outcome (`answered_responded` when caller speech was transcribed), `last_call_at` (start of the last completed attempt, in the campaign's time zone) and the seconds of the contact's completed attempts: `seconds_total`, `seconds_effective` (answered attempts) and `seconds_not_effective` (the rest). Then one `file.<header>` column for each other column of the contact file (in file order, at most 100), as the client uploaded it, followed by exportable result columns. The legacy layout uses the last completed attempt. Select `view=contact` or `view=attempt` for the configured dashboard layout and filters. An explicit request for costs or internal fields requires `costs:read`. Never the full phone number. Streamed, never held in memory. Needs an `editor` or above. At most 100,000 contacts: a larger campaign is refused with 422. Every export is audited as `report.export`. An organization may start a limited number of exports per minute. 401, 403, 429 and 503 as in `exportCalls`; 404 when the campaign is not in the caller's organization.

Parámetros

NombreEnTipoRequeridoDescripción
campaign_idpathstring (uuid)sí
formatquerystring
include_costsqueryboolean
include_internalqueryboolean
outcomequerystring | "answered_responded" | "no_initial_response" | "silence_abandonment" | null
sincequerystring (date-time) | null
untilquerystring (date-time) | null
viewquerystring | null

Respuestas

  • 200 A CSV file.
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 The caller lacks the required role or permission. · ErrorResponse
  • 404 No such campaign in the caller's tenant. · ErrorResponse
  • 422 The format is invalid or the campaign too big. · ErrorResponse
  • 429 Too many exports; retry later. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/reports/campaigns/{campaign_id}/rows

Page through the contacts or call attempts of a campaign

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

Contacts show all completed outcomes and the best and latest dispatch. Attempt mode expands individual dispatches. Outcome and UTC date filters select matching rows without altering a contact's totals. Standard reports omit cost and captured variables. The include_costs and include_internal options require costs:read.

Parámetros

NombreEnTipoRequeridoDescripción
campaign_idpathstring (uuid)sí
include_costsqueryboolean
include_internalqueryboolean
outcomequerystring | "answered_responded" | "no_initial_response" | "silence_abandonment" | null
sincequerystring (date-time) | null
untilquerystring (date-time) | null
viewquerystring
limitqueryinteger
cursorquerystring (uuid) | null

Respuestas

  • 200 Successful Response · ReportRowsResponse
    NombreTipoRequeridoDescripción
    available_columnsReportColumn[]sí
    available_columns[].keystringsí
    available_columns[].labelstring | null
    available_columns[].sourcestringsí (file, result, captured)
    columnsReportColumn[]sí
    columns[].keystringsí
    columns[].labelstring | null
    columns[].sourcestringsí (file, result, captured)
    itemsReportRowResponse[]sí
    items[].attemptReportAttemptResponse | nullsí
    items[].attempt.attempt_numberintegersí
    items[].attempt.cost_usdnumber | null
    items[].attempt.dispatch_sequenceintegersí
    items[].attempt.duration_secondsinteger | nullsí
    items[].attempt.idstring (uuid)sí
    items[].attempt.outcomestring | "answered_responded" | "no_initial_response" | "silence_abandonment" | nullsí (answered, busy, no_answer, voicemail, failed, dnc)
    items[].attempt.silence_phasestring | nullsí (initial, in_conversation)
    items[].attempt.started_atstring (date-time)sí
    items[].attempt.statusstringsí (in_progress, completed, released)
    items[].attempt_countintegersí
    items[].attempt_outcomesstring | "answered_responded" | "no_initial_response" | "silence_abandonment"[]síOutcome of each completed attempt, ascending by dispatch sequence.
    items[].best_attemptReportAttemptResponse | nullsí
    items[].best_attempt.attempt_numberintegersí
    items[].best_attempt.cost_usdnumber | null
    items[].best_attempt.dispatch_sequenceintegersí
    items[].best_attempt.duration_secondsinteger | nullsí
    items[].best_attempt.idstring (uuid)sí
    items[].best_attempt.outcomestring | "answered_responded" | "no_initial_response" | "silence_abandonment" | nullsí (answered, busy, no_answer, voicemail, failed, dnc)
    items[].best_attempt.silence_phasestring | nullsí (initial, in_conversation)
    items[].best_attempt.started_atstring (date-time)sí
    items[].best_attempt.statusstringsí (in_progress, completed, released)
    items[].cellsany[]sí
    items[].contact_idstring (uuid)sí
    items[].latest_attemptReportAttemptResponse | nullsí
    items[].latest_attempt.attempt_numberintegersí
    items[].latest_attempt.cost_usdnumber | null
    items[].latest_attempt.dispatch_sequenceintegersí
    items[].latest_attempt.duration_secondsinteger | nullsí
    items[].latest_attempt.idstring (uuid)sí
    items[].latest_attempt.outcomestring | "answered_responded" | "no_initial_response" | "silence_abandonment" | nullsí (answered, busy, no_answer, voicemail, failed, dnc)
    items[].latest_attempt.silence_phasestring | nullsí (initial, in_conversation)
    items[].latest_attempt.started_atstring (date-time)sí
    items[].latest_attempt.statusstringsí (in_progress, completed, released)
    items[].outcomesReportOutcomeResponse[]sí
    items[].outcomes[].countintegersí
    items[].outcomes[].outcomestring | "answered_responded" | "no_initial_response" | "silence_abandonment"sí (answered, busy, no_answer, voicemail, failed, dnc)
    next_cursorstring (uuid) | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Insufficient role or full report permission. · ErrorResponse
  • 404 No such campaign in the organization. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/reports/config

Read the organization's campaign report settings

Solo para usuarios con sesión iniciada (sin API key) · Rol: editor o superior

Parámetros

NombreEnTipoRequeridoDescripción
include_internalqueryboolean
campaign_idquerystring (uuid) | null

Respuestas

  • 200 Successful Response · ReportConfig
    NombreTipoRequeridoDescripción
    columnsReportColumn[] | null
    columns[].keystringsí
    columns[].labelstring | null
    columns[].sourcestringsí (file, result, captured)
    objective_fieldstring | null
    rankingstring[]
    stage_orderstring[]
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Insufficient role or full report permission. · ErrorResponse
  • 404 No such campaign in the organization. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

PUT /v1/reports/config

Replace the organization's campaign report settings

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

Parámetros

NombreEnTipoRequeridoDescripción
campaign_idquerystring (uuid) | null
include_internalqueryboolean

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
columnsReportColumn[] | null
columns[].keystringsí
columns[].labelstring | null
columns[].sourcestringsí (file, result, captured)
objective_fieldstring | null
rankingstring[]
stage_orderstring[]

Respuestas

  • 200 Successful Response · ReportConfig
    NombreTipoRequeridoDescripción
    columnsReportColumn[] | null
    columns[].keystringsí
    columns[].labelstring | null
    columns[].sourcestringsí (file, result, captured)
    objective_fieldstring | null
    rankingstring[]
    stage_orderstring[]
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Insufficient role or full report permission. · ErrorResponse
  • 404 No such campaign in the organization. · ErrorResponse
  • 409 Protected settings require costs:read. · ErrorResponse
  • 503 Reports are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse