Usage

List phone sessions with cost

Changed on

Paginated, filterable list of the caller's phone sessions over a required time window (allocated_after/allocated_before), each row carrying billing detail: phone-time cost, inference cost, and combined total in microdollars, billing processing status, and allocation source. Filters: session status, billing processing status, agent, allocation source, free-text search. Order with order_by ('<field> <asc|desc>').

get/usage/sessions

Request

Query parameters

allocated_afterstring date-time required

Only sessions allocated at or after this time (RFC 3339).

allocated_beforestring date-time required

Only sessions allocated before this time (RFC 3339).

limitinteger

Number of sessions per page (1-100).

offsetinteger

Pagination offset.

session_statusstring[] nullable

Only sessions at one of these lifecycle statuses; repeatable.

processed_statusstring[] nullable

Only sessions at one of these billing processing statuses; repeatable.

agent_idstring

Restrict results to sessions of a single agent's runs.

allocated_bystring[] nullable

Restrict results to the given allocation sources; repeatable.

searchstring

Filter by session, agent, or phone id substring.

order_bystring

Sort expression '<field> [asc|desc]', direction defaulting to desc; field is allocated_at, deallocated_at, duration_seconds, cost_microdollars, session_status, processed_status, allocated_by, session_id or agent_id. Defaults to allocated_at desc.

Response

OK

limitinteger required

Page size used for this response.

offsetinteger required

Pagination offset used for this response.

totalinteger required

Total number of sessions matching the query.

Changes

    • breaking

      removed the enum value workflow_editor from the property items/ of the query request parameter allocated_by

    • breaking

      removed the required property // from the response with the status

    • warning

      changed the pattern of the query request parameter order_by from ^(allocated_at|deallocated_at|duration_seconds|cost_microdollars|session_status|processed_status|allocated_by|session_id|workflow_id)( (asc|desc))?$ to ^(allocated_at|deallocated_at|duration_seconds|cost_microdollars|session_status|processed_status|allocated_by|session_id|agent_id)( (asc|desc))?$

    • warning

      deleted the query request parameter workflow_id

    • info

      added the new optional query request parameter agent_id

    • info

      removed the workflow_editor enum value from the // response property for the response status

    • info

      added the required property // to the response with the status

    • breaking

      added the new required query request parameter allocated_after

    • breaking

      added the new required query request parameter allocated_before

    • breaking

      added the pattern ^(allocated_at|deallocated_at|duration_seconds|cost_microdollars|session_status|processed_status|allocated_by|session_id|workflow_id)( (asc|desc))?$ to the query request parameter order_by

    • warning

      deleted the query request parameter end_date

    • warning

      deleted the query request parameter processed_status_filter

    • warning

      deleted the query request parameter session_status_filter

    • warning

      deleted the query request parameter start_date

    • warning

      added the new active enum value to the // response property for the response status

    • warning

      added the new api_run enum value to the // response property for the response status

    • warning

      added the new billed enum value to the // response property for the response status

    • warning

      added the new cancelled enum value to the // response property for the response status

    • warning

      added the new completed enum value to the // response property for the response status

    • warning

      added the new dashboard_run enum value to the // response property for the response status

    • warning

      added the new expired enum value to the // response property for the response status

    • warning

      added the new failed enum value to the // response property for the response status

    • warning

      added the new interactive enum value to the // response property for the response status

    • warning

      added the new pending enum value to the // response property for the response status

    • warning

      added the new workflow_editor enum value to the // response property for the response status

    • info

      added the new optional query request parameter processed_status

    • info

      added the new optional query request parameter session_status

    • info

      added the enum value api_run to the property items/ of the query request parameter allocated_by

    • info

      added the enum value dashboard_run to the property items/ of the query request parameter allocated_by

    • info

      added the enum value interactive to the property items/ of the query request parameter allocated_by

    • info

      added the enum value workflow_editor to the property items/ of the query request parameter allocated_by

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status