Proactive

API / V1

Focus

2 endpoints in this section.

GET/api/v1/focus/sessions

Requires read scope with session_or_bearer authentication.

Parameters

ParamTypeRequiredDescriptionOptions
fromstring (date)No

Input value for this endpoint.

-
tostring (date)No

Input value for this endpoint.

-
timeFieldstringNo

Timestamp used for from/to range filtering. Default: createdAt.

createdAt, startedAt, completedAt
typestringNo

Domain category/type of the item.

FOCUS, SHORT_BREAK, LONG_BREAK, LUNCH_BREAK (repeatable or comma-separated)
interruptedstringNo

Input value for this endpoint.

true, false
completedstringNo

Filter by completedAt presence (true = completed, false = not completed).

true, false
pagenumberNo

Page number for paginated results.

-
pageSizenumberNo

Number of items returned per page.

-
sortFieldstringNo

Field used to sort results.

createdAt, startedAt, completedAt, type, duration, interrupted
sortDirectionstringNo

Sort order direction.

asc, desc

Request Example

Use the snippet below to call this endpoint from your app or CLI.

Response Example

Toggle between a success and failure payload returned by this endpoint.

GET/api/v1/focus/analytics

Requires read scope with session_or_bearer authentication.

Parameters

ParamTypeRequiredDescriptionOptions
fromstring (date)Yes

Input value for this endpoint.

-
tostring (date)Yes

Input value for this endpoint.

-
timeFieldstringNo

Timestamp used for range and bucketing. Default: createdAt.

createdAt, startedAt, completedAt
granularitystringNo

Timeseries bucket size. Default: day.

day, week, month
includestringNo

Select payload blocks. Default when omitted: summary, timeseries, distribution. Add streak to include streak.

-
timezonestringNo

Used for bucket boundaries. Default: UTC.

-
typestringNo

Domain category/type of the item.

FOCUS, SHORT_BREAK, LONG_BREAK, LUNCH_BREAK (repeatable or comma-separated)
interruptedstringNo

Input value for this endpoint.

true, false
completedstringNo

Input value for this endpoint.

true, false

Request Example

Use the snippet below to call this endpoint from your app or CLI.

Response Example

Toggle between a success and failure payload returned by this endpoint.