@recovr/sdk 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +191 -23
- package/dist/cjs/generated/index.d.ts +1 -1
- package/dist/cjs/generated/sdk.gen.d.ts +394 -16
- package/dist/cjs/generated/sdk.gen.js +1523 -33
- package/dist/cjs/generated/types.gen.d.ts +5882 -679
- package/dist/esm/generated/index.d.ts +1 -1
- package/dist/esm/generated/sdk.gen.d.ts +394 -16
- package/dist/esm/generated/sdk.gen.js +1523 -33
- package/dist/esm/generated/types.gen.d.ts +5882 -679
- package/examples/add-lead.ts +45 -0
- package/examples/add-note.ts +34 -0
- package/examples/export-health-scores.ts +38 -0
- package/examples/set-suspension.ts +38 -0
- package/package.json +8 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
-
import type { AddClientLabelData, AddClientLabelErrors, AddClientLabelResponses, AssignClientData, AssignClientErrors, AssignClientResponses, CloseReminderData, CloseReminderErrors, CloseReminderResponses, CreateClientInteractionData, CreateClientInteractionErrors, CreateClientInteractionResponses, CreateClientNoteData, CreateClientNoteErrors, CreateClientNoteResponses, CreateClientReminderData, CreateClientReminderErrors, CreateClientReminderResponses, FlagClientData, FlagClientErrors, FlagClientResponses, GetClientData, GetClientErrors, GetClientResponses, GetClientSuspensionData, GetClientSuspensionErrors, GetClientSuspensionResponses, GetFormData, GetFormErrors, GetFormResponses, GetFormSubmissionData, GetFormSubmissionErrors, GetFormSubmissionResponses, GetLocationData, GetLocationErrors, GetLocationResponses, GetMeData, GetMeErrors, GetMeResponses, ListClientFormSubmissionsData, ListClientFormSubmissionsErrors, ListClientFormSubmissionsResponses, ListClientInteractionsData, ListClientInteractionsErrors, ListClientInteractionsResponses, ListClientLabelsData, ListClientLabelsErrors, ListClientLabelsResponses, ListClientNotesData, ListClientNotesErrors, ListClientNotesResponses, ListClientRemindersData, ListClientRemindersErrors, ListClientRemindersResponses, ListClientsData, ListClientsErrors, ListClientsResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListFormSubmissionsData, ListFormSubmissionsErrors, ListFormSubmissionsResponses, ListTeamMembersData, ListTeamMembersErrors, ListTeamMembersResponses, PinNoteData, PinNoteErrors, PinNoteResponses, RemoveClientLabelData, RemoveClientLabelErrors, RemoveClientLabelResponses, SetClientDoNotContactData, SetClientDoNotContactErrors, SetClientDoNotContactResponses, SnoozeClientData, SnoozeClientErrors, SnoozeClientResponses, UnflagClientData, UnflagClientErrors, UnflagClientResponses, UnpinNoteData, UnpinNoteErrors, UnpinNoteResponses, UnsnoozeClientData, UnsnoozeClientErrors, UnsnoozeClientResponses, UpdateClientSuspensionData, UpdateClientSuspensionErrors, UpdateClientSuspensionResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses } from './types.gen.js';
|
|
2
|
+
import type { AddClientLabelData, AddClientLabelErrors, AddClientLabelResponses, ApproveNextUpItemData, ApproveNextUpItemErrors, ApproveNextUpItemResponses, ArchiveClientLabelData, ArchiveClientLabelErrors, ArchiveClientLabelResponses, ArchiveClientLeadsData, ArchiveClientLeadsErrors, ArchiveClientLeadsResponses, ArchiveConversationData, ArchiveConversationErrors, ArchiveConversationResponses, ArchiveLeadData, ArchiveLeadErrors, ArchiveLeadResponses, AssignClientData, AssignClientErrors, AssignClientResponses, AssignReminderData, AssignReminderErrors, AssignReminderResponses, CancelTeamMemberInviteData, CancelTeamMemberInviteErrors, CancelTeamMemberInviteResponses, CloseReminderData, CloseReminderErrors, CloseReminderResponses, CreateClientInteractionData, CreateClientInteractionErrors, CreateClientInteractionResponses, CreateClientLabelData, CreateClientLabelErrors, CreateClientLabelResponses, CreateClientNoteData, CreateClientNoteErrors, CreateClientNoteResponses, CreateClientReminderData, CreateClientReminderErrors, CreateClientReminderResponses, CreateLeadData, CreateLeadErrors, CreateLeadResponses, FlagClientData, FlagClientErrors, FlagClientResponses, GetActionsReportData, GetActionsReportErrors, GetActionsReportResponses, GetChannelData, GetChannelErrors, GetChannelResponses, GetClassTimetableData, GetClassTimetableErrors, GetClassTimetableResponses, GetClientAttendanceData, GetClientAttendanceErrors, GetClientAttendanceResponses, GetClientCustomFieldsData, GetClientCustomFieldsErrors, GetClientCustomFieldsResponses, GetClientData, GetClientErrors, GetClientMilestonesData, GetClientMilestonesErrors, GetClientMilestonesResponses, GetClientNextUpData, GetClientNextUpErrors, GetClientNextUpResponses, GetClientResponses, GetClientSuspensionData, GetClientSuspensionErrors, GetClientSuspensionResponses, GetClientTimelineData, GetClientTimelineErrors, GetClientTimelineResponses, GetConversationData, GetConversationErrors, GetConversationResponses, GetFormData, GetFormErrors, GetFormResponses, GetFormSubmissionData, GetFormSubmissionErrors, GetFormSubmissionResponses, GetLeadData, GetLeadErrors, GetLeadResponses, GetLocationData, GetLocationErrors, GetLocationResponses, GetMeData, GetMeErrors, GetMeResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetSummaryData, GetSummaryErrors, GetSummaryResponses, InviteTeamMemberData, InviteTeamMemberErrors, InviteTeamMemberResponses, LinkConversationToClientData, LinkConversationToClientErrors, LinkConversationToClientResponses, ListActivityData, ListActivityErrors, ListActivityResponses, ListChannelsData, ListChannelsErrors, ListChannelsResponses, ListClientFormSubmissionsData, ListClientFormSubmissionsErrors, ListClientFormSubmissionsResponses, ListClientInteractionsData, ListClientInteractionsErrors, ListClientInteractionsResponses, ListClientLabelsData, ListClientLabelsErrors, ListClientLabelsResponses, ListClientNotesData, ListClientNotesErrors, ListClientNotesResponses, ListClientRemindersData, ListClientRemindersErrors, ListClientRemindersResponses, ListClientsData, ListClientsErrors, ListClientSessionsData, ListClientSessionsErrors, ListClientSessionsResponses, ListClientsResponses, ListConversationMessagesData, ListConversationMessagesErrors, ListConversationMessagesResponses, ListConversationsData, ListConversationsErrors, ListConversationsResponses, ListCustomFieldsData, ListCustomFieldsErrors, ListCustomFieldsResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListFormSubmissionsData, ListFormSubmissionsErrors, ListFormSubmissionsResponses, ListLeadsData, ListLeadsErrors, ListLeadSourcesData, ListLeadSourcesErrors, ListLeadSourcesResponses, ListLeadsResponses, ListNextUpData, ListNextUpErrors, ListNextUpResponses, ListPossibleDuplicatesData, ListPossibleDuplicatesErrors, ListPossibleDuplicatesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListSessionsData, ListSessionsErrors, ListSessionsResponses, ListTeamMembersData, ListTeamMembersErrors, ListTeamMembersResponses, MarkConversationNoReplyNeededData, MarkConversationNoReplyNeededErrors, MarkConversationNoReplyNeededResponses, MarkConversationReadData, MarkConversationReadErrors, MarkConversationReadResponses, MarkConversationUnreadData, MarkConversationUnreadErrors, MarkConversationUnreadResponses, MarkNextUpItemDoneData, MarkNextUpItemDoneErrors, MarkNextUpItemDoneResponses, MarkNotDuplicateData, MarkNotDuplicateErrors, MarkNotDuplicateResponses, OpenNextUpBatchData, OpenNextUpBatchErrors, OpenNextUpBatchResponses, PinNoteData, PinNoteErrors, PinNoteResponses, RecheckNextUpItemData, RecheckNextUpItemErrors, RecheckNextUpItemResponses, RejectNextUpItemData, RejectNextUpItemErrors, RejectNextUpItemResponses, RemoveClientLabelData, RemoveClientLabelErrors, RemoveClientLabelResponses, RemoveTeamMemberData, RemoveTeamMemberErrors, RemoveTeamMemberResponses, ReplyToConversationData, ReplyToConversationErrors, ReplyToConversationResponses, ResendTeamMemberInviteData, ResendTeamMemberInviteErrors, ResendTeamMemberInviteResponses, RestoreClientLabelData, RestoreClientLabelErrors, RestoreClientLabelResponses, SendClientMessageData, SendClientMessageErrors, SendClientMessageResponses, SetClientCustomFieldData, SetClientCustomFieldErrors, SetClientCustomFieldResponses, SetClientDoNotContactData, SetClientDoNotContactErrors, SetClientDoNotContactResponses, SettleNextUpItemData, SettleNextUpItemErrors, SettleNextUpItemResponses, SkipNextUpItemData, SkipNextUpItemErrors, SkipNextUpItemResponses, SnoozeClientData, SnoozeClientErrors, SnoozeClientResponses, SnoozeNextUpItemData, SnoozeNextUpItemErrors, SnoozeNextUpItemResponses, UnarchiveClientLeadsData, UnarchiveClientLeadsErrors, UnarchiveClientLeadsResponses, UnarchiveConversationData, UnarchiveConversationErrors, UnarchiveConversationResponses, UnarchiveLeadData, UnarchiveLeadErrors, UnarchiveLeadResponses, UndoConversationNoReplyNeededData, UndoConversationNoReplyNeededErrors, UndoConversationNoReplyNeededResponses, UnflagClientData, UnflagClientErrors, UnflagClientResponses, UnpinNoteData, UnpinNoteErrors, UnpinNoteResponses, UnsnoozeClientData, UnsnoozeClientErrors, UnsnoozeClientResponses, UpdateClientLabelData, UpdateClientLabelErrors, UpdateClientLabelResponses, UpdateClientSuspensionData, UpdateClientSuspensionErrors, UpdateClientSuspensionResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UpdateTeamMemberData, UpdateTeamMemberErrors, UpdateTeamMemberResponses } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -43,12 +43,6 @@ export declare class RecovrSdk extends HeyApiClient {
|
|
|
43
43
|
* The one location this key belongs to; every other endpoint reads and writes only there. Any valid key can call it.
|
|
44
44
|
*/
|
|
45
45
|
getLocation<ThrowOnError extends boolean = true>(options?: Options<GetLocationData, ThrowOnError>): RequestResult<GetLocationResponses, GetLocationErrors, ThrowOnError>;
|
|
46
|
-
/**
|
|
47
|
-
* List team members
|
|
48
|
-
*
|
|
49
|
-
* The team at the key's location, for assigning clients (POST /clients/{id}/assign) and filtering by `assigned_to`. Needs `clients:read`.
|
|
50
|
-
*/
|
|
51
|
-
listTeamMembers<ThrowOnError extends boolean = true>(options?: Options<ListTeamMembersData, ThrowOnError>): RequestResult<ListTeamMembersResponses, ListTeamMembersErrors, ThrowOnError>;
|
|
52
46
|
/**
|
|
53
47
|
* Get a client
|
|
54
48
|
*
|
|
@@ -131,6 +125,12 @@ export declare class RecovrSdk extends HeyApiClient {
|
|
|
131
125
|
* The location's labels, for `label_id` in GET /clients and POST /clients/{id}/labels. Archived labels only with `include_archived=true`. Needs `clients:read`.
|
|
132
126
|
*/
|
|
133
127
|
listClientLabels<ThrowOnError extends boolean = true>(options?: Options<ListClientLabelsData, ThrowOnError>): RequestResult<ListClientLabelsResponses, ListClientLabelsErrors, ThrowOnError>;
|
|
128
|
+
/**
|
|
129
|
+
* Create a label
|
|
130
|
+
*
|
|
131
|
+
* Adds a manual label to the location, as Settings → Labels does, ready for POST /clients/{id}/labels. If the location already has a label of that name (ignoring case), that label is returned instead with a 200, restored if it was archived, and its colour is left as it is. Needs `labels:manage`.
|
|
132
|
+
*/
|
|
133
|
+
createClientLabel<ThrowOnError extends boolean = true>(options: Options<CreateClientLabelData, ThrowOnError>): RequestResult<CreateClientLabelResponses, CreateClientLabelErrors, ThrowOnError>;
|
|
134
134
|
/**
|
|
135
135
|
* List a client's notes
|
|
136
136
|
*
|
|
@@ -170,56 +170,434 @@ export declare class RecovrSdk extends HeyApiClient {
|
|
|
170
170
|
/**
|
|
171
171
|
* List a client's open reminders
|
|
172
172
|
*
|
|
173
|
-
* Reminders the team still has to tick off for this client. Newest first; pages don't repeat or skip items when new ones are added meanwhile. Closed reminders aren't listed.
|
|
173
|
+
* Reminders the team still has to tick off for this client. Newest first; pages don't repeat or skip items when new ones are added meanwhile. Closed reminders aren't listed. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
|
|
174
174
|
*/
|
|
175
175
|
listClientReminders<ThrowOnError extends boolean = true>(options: Options<ListClientRemindersData, ThrowOnError>): RequestResult<ListClientRemindersResponses, ListClientRemindersErrors, ThrowOnError>;
|
|
176
176
|
/**
|
|
177
177
|
* Set a reminder
|
|
178
178
|
*
|
|
179
|
-
* A reminder for the team about this client, set as the key's owner: due at a time (`due_kind: "date"`, it comes up in Next Up)
|
|
179
|
+
* A reminder for the team about this client, set as the key's owner: due at a time (`due_kind: "date"`, it comes up in Next Up), at their next class (`due_kind: "next_class"`, it's shown on the class list), or now with no particular time (`due_kind: "now"`). Name a team member in `assigned_to` to give it to them, as the app's Assign picker does. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
|
|
180
180
|
*/
|
|
181
181
|
createClientReminder<ThrowOnError extends boolean = true>(options: Options<CreateClientReminderData, ThrowOnError>): RequestResult<CreateClientReminderResponses, CreateClientReminderErrors, ThrowOnError>;
|
|
182
|
+
/**
|
|
183
|
+
* Get a reminder
|
|
184
|
+
*
|
|
185
|
+
* One reminder, open or ticked off. Needs `notes:read`. Only for reminders at the key's location: any other id is a 404.
|
|
186
|
+
*/
|
|
187
|
+
getReminder<ThrowOnError extends boolean = true>(options: Options<GetReminderData, ThrowOnError>): RequestResult<GetReminderResponses, GetReminderErrors, ThrowOnError>;
|
|
182
188
|
/**
|
|
183
189
|
* Change a reminder
|
|
184
190
|
*
|
|
185
|
-
* Changes the due time, the note, or both, on an open dated reminder; what you leave out stays. Moving the time re-arms it. A next-class reminder has no time to change (400).
|
|
191
|
+
* Changes the due time, the note, or both, on an open dated reminder; what you leave out stays. Moving the time re-arms it. A next-class reminder has no time to change (400). Needs `notes:write`. Only for reminders at the key's location: any other id is a 404.
|
|
186
192
|
*/
|
|
187
193
|
updateReminder<ThrowOnError extends boolean = true>(options: Options<UpdateReminderData, ThrowOnError>): RequestResult<UpdateReminderResponses, UpdateReminderErrors, ThrowOnError>;
|
|
188
194
|
/**
|
|
189
195
|
* Close a reminder
|
|
190
196
|
*
|
|
191
|
-
* Ticks it off as the key's owner. It doesn't snooze the client. The body is optional.
|
|
197
|
+
* Ticks it off as the key's owner. It doesn't snooze the client. The body is optional. Needs `notes:write`. Only for reminders at the key's location: any other id is a 404.
|
|
192
198
|
*/
|
|
193
199
|
closeReminder<ThrowOnError extends boolean = true>(options: Options<CloseReminderData, ThrowOnError>): RequestResult<CloseReminderResponses, CloseReminderErrors, ThrowOnError>;
|
|
200
|
+
/**
|
|
201
|
+
* Reassign a reminder
|
|
202
|
+
*
|
|
203
|
+
* Gives an open reminder to another team member, or to the whole team with `assigned_to: null`, as the key's owner. The new person is told it was given to them, as when a reminder is set for them, unless they're the key's owner. Giving it to whoever has it already changes nothing. A ticked-off reminder can't be reassigned (409). Needs `notes:write`. Only for reminders at the key's location: any other id is a 404.
|
|
204
|
+
*/
|
|
205
|
+
assignReminder<ThrowOnError extends boolean = true>(options: Options<AssignReminderData, ThrowOnError>): RequestResult<AssignReminderResponses, AssignReminderErrors, ThrowOnError>;
|
|
206
|
+
/**
|
|
207
|
+
* List the location's reminders
|
|
208
|
+
*
|
|
209
|
+
* Every reminder at the key's location, for any client still on the books: the team's task list. Filter by who it's for, the client, how and when it's due, and whether it's done. Pages don't repeat or skip items when new ones are added meanwhile. Today's due reminders, ranked with the rest of the day's work, are in GET /next-up. Needs `notes:read`.
|
|
210
|
+
*/
|
|
211
|
+
listReminders<ThrowOnError extends boolean = true>(options?: Options<ListRemindersData, ThrowOnError>): RequestResult<ListRemindersResponses, ListRemindersErrors, ThrowOnError>;
|
|
194
212
|
/**
|
|
195
213
|
* List forms
|
|
196
214
|
*
|
|
197
|
-
* The location's published forms, newest first. Use a form's id to list its submissions.
|
|
215
|
+
* The location's published forms, newest first. Use a form's id to list its submissions. Needs `forms:read`.
|
|
198
216
|
*/
|
|
199
217
|
listForms<ThrowOnError extends boolean = true>(options?: Options<ListFormsData, ThrowOnError>): RequestResult<ListFormsResponses, ListFormsErrors, ThrowOnError>;
|
|
200
218
|
/**
|
|
201
219
|
* Get a form
|
|
202
220
|
*
|
|
203
|
-
* One form with the questions it asks. Works for forms that are no longer published, so older submissions can still be read.
|
|
221
|
+
* One form with the questions it asks. Works for forms that are no longer published, so older submissions can still be read. Needs `forms:read`.
|
|
204
222
|
*/
|
|
205
223
|
getForm<ThrowOnError extends boolean = true>(options: Options<GetFormData, ThrowOnError>): RequestResult<GetFormResponses, GetFormErrors, ThrowOnError>;
|
|
206
224
|
/**
|
|
207
225
|
* List a form's submissions
|
|
208
226
|
*
|
|
209
|
-
* Newest first, or with `after_id` oldest first from that id, which is how to fetch new submissions. Includes anonymous answers (for example to the Feedback form), which have a null `client_id`. Answers can contain contact and health details. Pages hold steady while new submissions arrive: none is repeated or skipped.
|
|
227
|
+
* Newest first, or with `after_id` oldest first from that id, which is how to fetch new submissions. Includes anonymous answers (for example to the Feedback form), which have a null `client_id`. Answers can contain contact and health details. Pages hold steady while new submissions arrive: none is repeated or skipped. Needs `forms:read`.
|
|
210
228
|
*/
|
|
211
229
|
listFormSubmissions<ThrowOnError extends boolean = true>(options: Options<ListFormSubmissionsData, ThrowOnError>): RequestResult<ListFormSubmissionsResponses, ListFormSubmissionsErrors, ThrowOnError>;
|
|
212
230
|
/**
|
|
213
231
|
* List a client's form submissions
|
|
214
232
|
*
|
|
215
|
-
* Every form this client has submitted, newest first (or with `after_id`, oldest first from that id), with their answers. Anonymous answers are never attached to a client. Answers can contain contact and health details.
|
|
233
|
+
* Every form this client has submitted, newest first (or with `after_id`, oldest first from that id), with their answers. Anonymous answers are never attached to a client. Answers can contain contact and health details. Needs `forms:read`.
|
|
216
234
|
*/
|
|
217
235
|
listClientFormSubmissions<ThrowOnError extends boolean = true>(options: Options<ListClientFormSubmissionsData, ThrowOnError>): RequestResult<ListClientFormSubmissionsResponses, ListClientFormSubmissionsErrors, ThrowOnError>;
|
|
218
236
|
/**
|
|
219
237
|
* Get a form submission
|
|
220
238
|
*
|
|
221
|
-
* One submission with its answers. Answers can contain contact and health details.
|
|
239
|
+
* One submission with its answers. Answers can contain contact and health details. Needs `forms:read`.
|
|
222
240
|
*/
|
|
223
241
|
getFormSubmission<ThrowOnError extends boolean = true>(options: Options<GetFormSubmissionData, ThrowOnError>): RequestResult<GetFormSubmissionResponses, GetFormSubmissionErrors, ThrowOnError>;
|
|
242
|
+
/**
|
|
243
|
+
* Member and risk counts
|
|
244
|
+
*
|
|
245
|
+
* The location's counts as of now: active members (the gym's member count), trials and holds beside it, and how many clients are in each risk band, non-attenders, conversions and renewals. These are the numbers Recovr's own reports, Recovr AI and its MCP retention summary give. Needs `clients:read`.
|
|
246
|
+
*
|
|
247
|
+
* The risk, non-attender, conversion and renewal counts hold only clients the gym shows in reports, as the Clients page's counts do, so they don't add up to `active_members`. GET /clients with the matching `risk_level` lists the same people: its `total` is the count.
|
|
248
|
+
*/
|
|
249
|
+
getSummary<ThrowOnError extends boolean = true>(options?: Options<GetSummaryData, ThrowOnError>): RequestResult<GetSummaryResponses, GetSummaryErrors, ThrowOnError>;
|
|
250
|
+
/**
|
|
251
|
+
* List the team's activity
|
|
252
|
+
*
|
|
253
|
+
* Everything the team did with clients at the key's location, newest first: messages sent through Recovr, calls, visits and messages logged, notes, snoozes, assignments, flags and Next Up cards ticked off, each with the team member who did it. For team dashboards and KPIs; GET /reports/actions has the Actions Report's totals. Needs `notes:read`.
|
|
254
|
+
*
|
|
255
|
+
* Messages sent through Recovr: every SMS, and emails, WhatsApp, Instagram and Messenger messages a team member or Recovr AI sent. A workflow's email and other non-SMS messages aren't listed. Messages a client sends aren't activity. Label changes aren't listed yet.
|
|
256
|
+
*
|
|
257
|
+
* Pages don't repeat or skip items when new ones are added meanwhile.
|
|
258
|
+
*/
|
|
259
|
+
listActivity<ThrowOnError extends boolean = true>(options?: Options<ListActivityData, ThrowOnError>): RequestResult<ListActivityResponses, ListActivityErrors, ThrowOnError>;
|
|
260
|
+
/**
|
|
261
|
+
* Actions Report
|
|
262
|
+
*
|
|
263
|
+
* The app's Actions Report for a date range: texts, calls and notes, per team member and per day, week or month, counted exactly as the report in Recovr counts them. Dates are the location's. For each action itself, use GET /activity. Needs `notes:read`.
|
|
264
|
+
*/
|
|
265
|
+
getActionsReport<ThrowOnError extends boolean = true>(options: Options<GetActionsReportData, ThrowOnError>): RequestResult<GetActionsReportResponses, GetActionsReportErrors, ThrowOnError>;
|
|
266
|
+
/**
|
|
267
|
+
* List leads
|
|
268
|
+
*
|
|
269
|
+
* Leads at the credential's location, newest enquiry first, filtered the way the Leads page filters them. Every filter you send must match (AND). Needs `leads:read`; `answers` and searching by email or phone also need `contact_details:read`.
|
|
270
|
+
*
|
|
271
|
+
* One lead is one enquiry, so a person who enquired twice appears twice; the Leads page groups them by person. Filter by `client_id` for one person's enquiries.
|
|
272
|
+
*/
|
|
273
|
+
listLeads<ThrowOnError extends boolean = true>(options?: Options<ListLeadsData, ThrowOnError>): RequestResult<ListLeadsResponses, ListLeadsErrors, ThrowOnError>;
|
|
274
|
+
/**
|
|
275
|
+
* Add a lead
|
|
276
|
+
*
|
|
277
|
+
* Adds a lead from another system, such as a quiz or a website form. Recovr matches it to an existing client at the location by email (or by phone, when the first name matches too); otherwise it makes a new client, who appears on the Leads board. A new lead starts the location's Lead received workflows once, with the source "Recovr API". Sending the same `external_id` again is safe: it adds nothing and starts nothing. Send an email or a phone number. Needs `clients:write` and `contact_details:read`. At most 60 leads a minute per location (`rate_limited`). Refusals: `invalid_phone` (a phone-only lead whose number can't be read).
|
|
278
|
+
*/
|
|
279
|
+
createLead<ThrowOnError extends boolean = true>(options: Options<CreateLeadData, ThrowOnError>): RequestResult<CreateLeadResponses, CreateLeadErrors, ThrowOnError>;
|
|
280
|
+
/**
|
|
281
|
+
* Get a lead
|
|
282
|
+
*
|
|
283
|
+
* One lead at the credential's location. Needs `leads:read`; `answers` is included only with `contact_details:read`. A lead at another location is a 404.
|
|
284
|
+
*/
|
|
285
|
+
getLead<ThrowOnError extends boolean = true>(options: Options<GetLeadData, ThrowOnError>): RequestResult<GetLeadResponses, GetLeadErrors, ThrowOnError>;
|
|
286
|
+
/**
|
|
287
|
+
* List lead sources
|
|
288
|
+
*
|
|
289
|
+
* Where this location's leads have come from: the sources, forms, campaigns, ad sets and ads the Leads page offers as filters, each usable as a GET /leads filter. Lead statuses aren't configured per location: they are `new`, `visited` and `member` everywhere (see `status` on a Lead). Needs `leads:read`.
|
|
290
|
+
*/
|
|
291
|
+
listLeadSources<ThrowOnError extends boolean = true>(options?: Options<ListLeadSourcesData, ThrowOnError>): RequestResult<ListLeadSourcesResponses, ListLeadSourcesErrors, ThrowOnError>;
|
|
292
|
+
/**
|
|
293
|
+
* Archive a lead
|
|
294
|
+
*
|
|
295
|
+
* Archives one enquiry, as the Leads page's archive does for a junk or dealt-with lead: it leaves the list (unless asked for) and is never deleted. Archiving an archived lead changes nothing. The client, their other enquiries and their workflows aren't touched. Needs `leads:write`. A lead at another location is a 404.
|
|
296
|
+
*/
|
|
297
|
+
archiveLead<ThrowOnError extends boolean = true>(options: Options<ArchiveLeadData, ThrowOnError>): RequestResult<ArchiveLeadResponses, ArchiveLeadErrors, ThrowOnError>;
|
|
298
|
+
/**
|
|
299
|
+
* Restore a lead
|
|
300
|
+
*
|
|
301
|
+
* Restores an archived enquiry to the Leads list. Restoring a lead that isn't archived changes nothing. Needs `leads:write`. A lead at another location is a 404.
|
|
302
|
+
*/
|
|
303
|
+
unarchiveLead<ThrowOnError extends boolean = true>(options: Options<UnarchiveLeadData, ThrowOnError>): RequestResult<UnarchiveLeadResponses, UnarchiveLeadErrors, ThrowOnError>;
|
|
304
|
+
/**
|
|
305
|
+
* Archive a client's leads
|
|
306
|
+
*
|
|
307
|
+
* Archives every enquiry this client has at the location, as archiving a person's row on the Leads page does, whatever filters you used to find them. Needs `leads:write`. A client at another location, or with no leads here, is a 404.
|
|
308
|
+
*/
|
|
309
|
+
archiveClientLeads<ThrowOnError extends boolean = true>(options: Options<ArchiveClientLeadsData, ThrowOnError>): RequestResult<ArchiveClientLeadsResponses, ArchiveClientLeadsErrors, ThrowOnError>;
|
|
310
|
+
/**
|
|
311
|
+
* Restore a client's leads
|
|
312
|
+
*
|
|
313
|
+
* Restores every archived enquiry this client has at the location. Needs `leads:write`. A client at another location, or with no leads here, is a 404.
|
|
314
|
+
*/
|
|
315
|
+
unarchiveClientLeads<ThrowOnError extends boolean = true>(options: Options<UnarchiveClientLeadsData, ThrowOnError>): RequestResult<UnarchiveClientLeadsResponses, UnarchiveClientLeadsErrors, ThrowOnError>;
|
|
316
|
+
/**
|
|
317
|
+
* List a client's possible duplicates
|
|
318
|
+
*
|
|
319
|
+
* Other clients at the location who share this client's email or phone (at most 5): who a lead's Needs merge flag is about. Merging happens in the booking platform; if they aren't the same person, POST /clients/{id}/not-duplicate clears the flag. Needs `leads:read`. A client at another location is a 404.
|
|
320
|
+
*/
|
|
321
|
+
listPossibleDuplicates<ThrowOnError extends boolean = true>(options: Options<ListPossibleDuplicatesData, ThrowOnError>): RequestResult<ListPossibleDuplicatesResponses, ListPossibleDuplicatesErrors, ThrowOnError>;
|
|
322
|
+
/**
|
|
323
|
+
* Clear Needs merge
|
|
324
|
+
*
|
|
325
|
+
* Records that this client isn't the same person as the clients sharing their email or phone, as "Not the same person" on the Leads page does: Needs merge is cleared on all of the client's leads. Clearing it when nothing is flagged changes nothing. Needs `leads:write`. A client at another location is a 404.
|
|
326
|
+
*/
|
|
327
|
+
markNotDuplicate<ThrowOnError extends boolean = true>(options: Options<MarkNotDuplicateData, ThrowOnError>): RequestResult<MarkNotDuplicateResponses, MarkNotDuplicateErrors, ThrowOnError>;
|
|
328
|
+
/**
|
|
329
|
+
* List conversations (the inbox)
|
|
330
|
+
*
|
|
331
|
+
* The location's inbox, newest activity first: one conversation per client per channel (SMS, email, WhatsApp, Instagram, Messenger and the rest), with the newest message and whether it's unread or awaiting a reply. Only conversations with at least one message are listed. Needs `conversations:read`; `contact_address` also needs `contact_details:read`.
|
|
332
|
+
*
|
|
333
|
+
* Pages don't repeat or skip conversations when new messages arrive meanwhile: a conversation that gets a new message moves to the top, ahead of the page you are on.
|
|
334
|
+
*
|
|
335
|
+
* Filter by `status`, `unread`, `awaiting_reply`, `needs_reply`, `client_id`, the kind of `channel` (`sms`, `email`…) or one `channel_id` from GET /channels. Filters combine with AND.
|
|
336
|
+
*/
|
|
337
|
+
listConversations<ThrowOnError extends boolean = true>(options?: Options<ListConversationsData, ThrowOnError>): RequestResult<ListConversationsResponses, ListConversationsErrors, ThrowOnError>;
|
|
338
|
+
/**
|
|
339
|
+
* Get a conversation
|
|
340
|
+
*
|
|
341
|
+
* One conversation at the credential's location. Needs `conversations:read`. A conversation at another location is a 404.
|
|
342
|
+
*/
|
|
343
|
+
getConversation<ThrowOnError extends boolean = true>(options: Options<GetConversationData, ThrowOnError>): RequestResult<GetConversationResponses, GetConversationErrors, ThrowOnError>;
|
|
344
|
+
/**
|
|
345
|
+
* List a conversation's messages
|
|
346
|
+
*
|
|
347
|
+
* Every message in one conversation, newest first: what the client sent in (`inbound`) and what the location sent (`outbound`, by staff, Recovr AI, a workflow, or from outside Recovr). Drafts not yet sent aren't listed. Needs `conversations:read`; `from_address` and `to_address` also need `contact_details:read`. A conversation at another location is a 404.
|
|
348
|
+
*
|
|
349
|
+
* Filter by `direction`, delivery `status` (`failed` finds sends that didn't arrive) or `channel_id` (one number of several in an SMS conversation). A client's conversations on other channels are listed by GET /conversations?client_id=…. Reading messages here doesn't mark them read in Recovr; POST /conversations/{id}/read does.
|
|
350
|
+
*/
|
|
351
|
+
listConversationMessages<ThrowOnError extends boolean = true>(options: Options<ListConversationMessagesData, ThrowOnError>): RequestResult<ListConversationMessagesResponses, ListConversationMessagesErrors, ThrowOnError>;
|
|
352
|
+
/**
|
|
353
|
+
* Reply to a conversation
|
|
354
|
+
*
|
|
355
|
+
* Sends a message to the client in this conversation, on its own channel (SMS, email, WhatsApp, Instagram, Messenger…), from the channel it last used unless you name one. It reaches a real person and can't be undone, and it appears in the inbox and the client's timeline as sent by you through this app or token. Needs `messages:send`. A conversation at another location is a 404.
|
|
356
|
+
*
|
|
357
|
+
* The send is checked as one from Recovr AI is: a client with do-not-contact on for the channel is refused (`do_not_contact`); a client on a bulk send that is waiting, going or paused is refused (`in_bulk_send`); and, unless the client messaged the location in the last day, the same text can't go to more than 3 other people a day (`same_text_limit`) and only a limited number of messages can go out in any ten minutes (`outreach_limited`, with `Retry-After`). The location's own sending rules then apply: a channel with sending turned off, an opted-out client, Meta's reply window for Instagram, Messenger and WhatsApp, credits. Those refusals are a 422 with the reason (`send_refused` or a more specific code).
|
|
358
|
+
*
|
|
359
|
+
* Send an `Idempotency-Key` and never retry a send without one: after a timeout or a 5xx, read the conversation's messages to see whether it went before sending again.
|
|
360
|
+
*/
|
|
361
|
+
replyToConversation<ThrowOnError extends boolean = true>(options: Options<ReplyToConversationData, ThrowOnError>): RequestResult<ReplyToConversationResponses, ReplyToConversationErrors, ThrowOnError>;
|
|
362
|
+
/**
|
|
363
|
+
* Send a message to a client
|
|
364
|
+
*
|
|
365
|
+
* Sends one text or email to a client, as the message box on a client's profile does, whether or not you've messaged them before. Name the channel by `channel_id` (GET /channels) or by kind with `channel`. A new message goes by SMS or email only, the channels the outreach checks cover; on WhatsApp, Instagram or Messenger, reply in the client's conversation instead. It goes to the client's phone number or email, lands in their conversation for it (a new one if there is none), reaches a real person and can't be undone. It appears in the inbox and the client's timeline as sent by you through this app or token. Needs `messages:send`. A client at another location is a 404.
|
|
366
|
+
*
|
|
367
|
+
* The same checks apply as to a reply: do-not-contact for the channel (`do_not_contact`), an open bulk send (`in_bulk_send`), the same text to many people (`same_text_limit`), the outreach cap (`outreach_limited`, with `Retry-After`), then the location's own sending rules (sending turned off, an opted-out client, Meta's messaging window, credits), refused as a 422 with the reason. A message to someone who hasn't written in the last day counts toward the outreach cap.
|
|
368
|
+
*
|
|
369
|
+
* Send an `Idempotency-Key` and never retry a send without one: after a timeout or a 5xx, check the client's conversations before sending again.
|
|
370
|
+
*/
|
|
371
|
+
sendClientMessage<ThrowOnError extends boolean = true>(options: Options<SendClientMessageData, ThrowOnError>): RequestResult<SendClientMessageResponses, SendClientMessageErrors, ThrowOnError>;
|
|
372
|
+
/**
|
|
373
|
+
* Mark a conversation read
|
|
374
|
+
*
|
|
375
|
+
* Marks the conversation's messages read, as opening it in the inbox does, and clears its unread badge for the team. For an Instagram or Messenger conversation the change is passed on to the platform where the connection supports it. Marking a read conversation read changes nothing. Needs `conversations:write`. A conversation at another location is a 404.
|
|
376
|
+
*/
|
|
377
|
+
markConversationRead<ThrowOnError extends boolean = true>(options: Options<MarkConversationReadData, ThrowOnError>): RequestResult<MarkConversationReadResponses, MarkConversationReadErrors, ThrowOnError>;
|
|
378
|
+
/**
|
|
379
|
+
* Mark a conversation unread
|
|
380
|
+
*
|
|
381
|
+
* Marks the client's newest message unread, as Mark as unread in the inbox does, so the conversation shows as unread for the team. A conversation with no message from the client is left as it is. Needs `conversations:write`. A conversation at another location is a 404.
|
|
382
|
+
*/
|
|
383
|
+
markConversationUnread<ThrowOnError extends boolean = true>(options: Options<MarkConversationUnreadData, ThrowOnError>): RequestResult<MarkConversationUnreadResponses, MarkConversationUnreadErrors, ThrowOnError>;
|
|
384
|
+
/**
|
|
385
|
+
* Archive a conversation
|
|
386
|
+
*
|
|
387
|
+
* Moves the conversation out of the inbox into Archived, as Archive in the inbox does. It no longer awaits a reply, and it keeps its read or unread state. It comes back to the inbox by itself when the client writes again. For an Instagram or Messenger conversation the change is passed on to the platform where the connection supports it. Needs `conversations:write`. A conversation at another location is a 404.
|
|
388
|
+
*/
|
|
389
|
+
archiveConversation<ThrowOnError extends boolean = true>(options: Options<ArchiveConversationData, ThrowOnError>): RequestResult<ArchiveConversationResponses, ArchiveConversationErrors, ThrowOnError>;
|
|
390
|
+
/**
|
|
391
|
+
* Unarchive a conversation
|
|
392
|
+
*
|
|
393
|
+
* Brings the conversation back to the inbox, as Unarchive does. When the client's message is still the newest it awaits a reply again, unless it was marked as needing no reply. Needs `conversations:write`. A conversation at another location is a 404.
|
|
394
|
+
*/
|
|
395
|
+
unarchiveConversation<ThrowOnError extends boolean = true>(options: Options<UnarchiveConversationData, ThrowOnError>): RequestResult<UnarchiveConversationResponses, UnarchiveConversationErrors, ThrowOnError>;
|
|
396
|
+
/**
|
|
397
|
+
* Undo no reply needed
|
|
398
|
+
*
|
|
399
|
+
* Clears the mark. When the client's message is still the newest and the conversation isn't archived, it awaits a reply again. A conversation with no mark is left as it is. Needs `conversations:write`. A conversation at another location is a 404.
|
|
400
|
+
*/
|
|
401
|
+
undoConversationNoReplyNeeded<ThrowOnError extends boolean = true>(options: Options<UndoConversationNoReplyNeededData, ThrowOnError>): RequestResult<UndoConversationNoReplyNeededResponses, UndoConversationNoReplyNeededErrors, ThrowOnError>;
|
|
402
|
+
/**
|
|
403
|
+
* Mark a conversation as needing no reply
|
|
404
|
+
*
|
|
405
|
+
* Marks the client's waiting message as needing no answer, as Mark done does in the inbox: the conversation stops awaiting a reply until the client writes again, so it leaves Awaiting Reply and the client's "Owed a reply" Next Up moment, and Recovr AI's unsent reply draft for it is discarded.
|
|
406
|
+
*
|
|
407
|
+
* A conversation whose newest message isn't the client's is a 409 `not_awaiting_reply`. DELETE on the same path undoes it. Needs `conversations:write`. A conversation at another location is a 404.
|
|
408
|
+
*/
|
|
409
|
+
markConversationNoReplyNeeded<ThrowOnError extends boolean = true>(options: Options<MarkConversationNoReplyNeededData, ThrowOnError>): RequestResult<MarkConversationNoReplyNeededResponses, MarkConversationNoReplyNeededErrors, ThrowOnError>;
|
|
410
|
+
/**
|
|
411
|
+
* Link a conversation to a client
|
|
412
|
+
*
|
|
413
|
+
* Files the conversation and its messages under a client, as Assign to client in the inbox does: use it for a message from a number or account Recovr didn't match. Recovr remembers the match for later conversations: the phone number for SMS, WhatsApp and calls, the account for Instagram and Messenger. Linking to another client moves it; `null` unlinks it and forgets the match.
|
|
414
|
+
*
|
|
415
|
+
* A group conversation has many people in it, so it can't be linked (422 `group_conversation`). A `client_id` that isn't a client at the location is a 400. Needs `conversations:write`. A conversation at another location is a 404.
|
|
416
|
+
*/
|
|
417
|
+
linkConversationToClient<ThrowOnError extends boolean = true>(options: Options<LinkConversationToClientData, ThrowOnError>): RequestResult<LinkConversationToClientResponses, LinkConversationToClientErrors, ThrowOnError>;
|
|
418
|
+
/**
|
|
419
|
+
* List communication channels
|
|
420
|
+
*
|
|
421
|
+
* The location's communication channels: SMS numbers, email addresses, WhatsApp, Instagram and Messenger accounts and the rest, with whether each is connected and can send. Default channels first. Every conversation and message names its channel as `channel_id`. Needs `channels:read`.
|
|
422
|
+
*/
|
|
423
|
+
listChannels<ThrowOnError extends boolean = true>(options?: Options<ListChannelsData, ThrowOnError>): RequestResult<ListChannelsResponses, ListChannelsErrors, ThrowOnError>;
|
|
424
|
+
/**
|
|
425
|
+
* Get a communication channel
|
|
426
|
+
*
|
|
427
|
+
* One of the location's channels, connected or not, for resolving the `channel_id` on a conversation or message. Needs `channels:read`. A channel at another location, or one removed in Settings → Communication Channels, is a 404.
|
|
428
|
+
*/
|
|
429
|
+
getChannel<ThrowOnError extends boolean = true>(options: Options<GetChannelData, ThrowOnError>): RequestResult<GetChannelResponses, GetChannelErrors, ThrowOnError>;
|
|
430
|
+
/**
|
|
431
|
+
* Get today's Next Up list
|
|
432
|
+
*
|
|
433
|
+
* Who to contact today and what is waiting for a person, in the order the app's Next Up page shows them: moments, approvals and due reminders together, ranked. The whole list comes back in one response. Items you skipped are left out for you only. Reading it never uses AI credits. Needs `next_up:read`; `why`, `callout` and an approval's message text also need `conversations:read`, and a reminder's `note` needs `notes:read`.
|
|
434
|
+
*/
|
|
435
|
+
listNextUp<ThrowOnError extends boolean = true>(options?: Options<ListNextUpData, ThrowOnError>): RequestResult<ListNextUpResponses, ListNextUpErrors, ThrowOnError>;
|
|
436
|
+
/**
|
|
437
|
+
* Open the next batch of moments
|
|
438
|
+
*
|
|
439
|
+
* Moments come in batches from today's committed order (`batch` on GET /next-up). Once you've worked through one, this opens the next lot, as Keep going does in the app, and returns the list. A batch belongs to the list, so it opens for the whole team. Never uses AI credits. Needs `next_up:write`.
|
|
440
|
+
*/
|
|
441
|
+
openNextUpBatch<ThrowOnError extends boolean = true>(options: Options<OpenNextUpBatchData, ThrowOnError>): RequestResult<OpenNextUpBatchResponses, OpenNextUpBatchErrors, ThrowOnError>;
|
|
442
|
+
/**
|
|
443
|
+
* Get a client's open Next Up items
|
|
444
|
+
*
|
|
445
|
+
* The client's items on today's list that nobody has dealt with yet: their moment, if today's order includes them, their approvals and their due reminders. For a sidebar or a check-in screen. Moments appear once today's list is built, which Recovr does early each morning. Never uses AI credits. Needs `next_up:read`, with the same extra permissions as GET /next-up for `why`, `callout`, message text and `note`. A client at another location is a 404.
|
|
446
|
+
*/
|
|
447
|
+
getClientNextUp<ThrowOnError extends boolean = true>(options: Options<GetClientNextUpData, ThrowOnError>): RequestResult<GetClientNextUpResponses, GetClientNextUpErrors, ThrowOnError>;
|
|
448
|
+
/**
|
|
449
|
+
* Mark a Next Up item done
|
|
450
|
+
*
|
|
451
|
+
* Ticks the item off as the credential's owner, as Done does in the app. A moment leaves the list and stays off it until something new happens for the client, and "Marked done in Next Up" goes on their timeline. Done on an "Owed a reply" moment also marks the conversation as needing no reply. An alert closes its reminder. An `agent_could_not_reply` or `human_handoff` approval is marked answered, with an optional `reason`. Done never snoozes the client. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
452
|
+
*/
|
|
453
|
+
markNextUpItemDone<ThrowOnError extends boolean = true>(options: Options<MarkNextUpItemDoneData, ThrowOnError>): RequestResult<MarkNextUpItemDoneResponses, MarkNextUpItemDoneErrors, ThrowOnError>;
|
|
454
|
+
/**
|
|
455
|
+
* Skip a Next Up item for today
|
|
456
|
+
*
|
|
457
|
+
* Hides the item from the credential owner's list for the rest of today, as Skip does in the app. It stays on everyone else's list, and nothing changes for the client. Moments and held drafts. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
458
|
+
*/
|
|
459
|
+
skipNextUpItem<ThrowOnError extends boolean = true>(options: Options<SkipNextUpItemData, ThrowOnError>): RequestResult<SkipNextUpItemResponses, SkipNextUpItemErrors, ThrowOnError>;
|
|
460
|
+
/**
|
|
461
|
+
* Snooze a Next Up item's client
|
|
462
|
+
*
|
|
463
|
+
* Snoozes the client, as Snooze does on a Next Up card: they leave the list until the snooze ends, and the snooze goes on their timeline. Send `days` or `until`, or neither for the location's default snooze for the client's risk level (Settings → Snooze; 7 days when it's never been set). Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
464
|
+
*/
|
|
465
|
+
snoozeNextUpItem<ThrowOnError extends boolean = true>(options: Options<SnoozeNextUpItemData, ThrowOnError>): RequestResult<SnoozeNextUpItemResponses, SnoozeNextUpItemErrors, ThrowOnError>;
|
|
466
|
+
/**
|
|
467
|
+
* Approve a Next Up approval
|
|
468
|
+
*
|
|
469
|
+
* Approves an approval, as Approve does in the app. A held draft is sent to the client, with your own `text` if you send one (edit and send); that also needs `messages:send`, and the send is checked as POST /conversations/{id}/messages is (`do_not_contact`, `in_bulk_send`, `same_text_limit`, `outreach_limited`, then the location's own sending rules). A booking, platform action or task is approved and starts: it writes to the booking platform as the credential's owner. A sent message reaches a real person and a platform change can't be undone from here. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
470
|
+
*/
|
|
471
|
+
approveNextUpItem<ThrowOnError extends boolean = true>(options: Options<ApproveNextUpItemData, ThrowOnError>): RequestResult<ApproveNextUpItemResponses, ApproveNextUpItemErrors, ThrowOnError>;
|
|
472
|
+
/**
|
|
473
|
+
* Reject a Next Up approval
|
|
474
|
+
*
|
|
475
|
+
* Rejects an approval, as Reject does in the app. A held draft is discarded and never sent, with an optional `reason`. A booking, platform action or task is not done. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
476
|
+
*/
|
|
477
|
+
rejectNextUpItem<ThrowOnError extends boolean = true>(options: Options<RejectNextUpItemData, ThrowOnError>): RequestResult<RejectNextUpItemResponses, RejectNextUpItemErrors, ThrowOnError>;
|
|
478
|
+
/**
|
|
479
|
+
* Recheck an uncertain booking
|
|
480
|
+
*
|
|
481
|
+
* For a booking Recovr couldn't confirm (`action.status` `uncertain`): reads the booking platform again and settles it to what the platform shows. Writes nothing to the platform. `settled` is false when the platform couldn't be read. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
482
|
+
*/
|
|
483
|
+
recheckNextUpItem<ThrowOnError extends boolean = true>(options: Options<RecheckNextUpItemData, ThrowOnError>): RequestResult<RecheckNextUpItemResponses, RecheckNextUpItemErrors, ThrowOnError>;
|
|
484
|
+
/**
|
|
485
|
+
* Settle an uncertain booking
|
|
486
|
+
*
|
|
487
|
+
* For a change Recovr couldn't confirm (`action.status` `uncertain`): records what the booking platform shows, as the card's answer does in the app. Needs the credential to act as a team member. Needs `next_up:write`. Works only on items at the credential's location: any other id is a 404. An item's `operations` say which actions it takes.
|
|
488
|
+
*/
|
|
489
|
+
settleNextUpItem<ThrowOnError extends boolean = true>(options: Options<SettleNextUpItemData, ThrowOnError>): RequestResult<SettleNextUpItemResponses, SettleNextUpItemErrors, ThrowOnError>;
|
|
490
|
+
/**
|
|
491
|
+
* List a client's sessions
|
|
492
|
+
*
|
|
493
|
+
* The client's bookings on the location's days from `from` to `to`, every status, newest first: what the attendance calendar on their profile shows. Read-only, because the booking platform owns bookings. Needs `clients:read`. A client at another location is a 404.
|
|
494
|
+
*/
|
|
495
|
+
listClientSessions<ThrowOnError extends boolean = true>(options: Options<ListClientSessionsData, ThrowOnError>): RequestResult<ListClientSessionsResponses, ListClientSessionsErrors, ThrowOnError>;
|
|
496
|
+
/**
|
|
497
|
+
* Get a client's attendance summary
|
|
498
|
+
*
|
|
499
|
+
* How many sessions the client booked, attended, cancelled and missed on the location's days from `from` to `to` (the 30 days to today when you send neither), with the figures their profile shows: lifetime sessions attended, last visit, next booking and attendance trend. Needs `clients:read`. A client at another location is a 404.
|
|
500
|
+
*/
|
|
501
|
+
getClientAttendance<ThrowOnError extends boolean = true>(options: Options<GetClientAttendanceData, ThrowOnError>): RequestResult<GetClientAttendanceResponses, GetClientAttendanceErrors, ThrowOnError>;
|
|
502
|
+
/**
|
|
503
|
+
* Get a client's session milestones
|
|
504
|
+
*
|
|
505
|
+
* The client's lifetime milestone count, the gym's milestones they've reached and when, and how far they are from the next: the Milestones section of their profile, counted as the Milestones report counts. The gym sets its milestones and exclusions in Settings → Milestones. Needs `clients:read`. A client at another location is a 404.
|
|
506
|
+
*/
|
|
507
|
+
getClientMilestones<ThrowOnError extends boolean = true>(options: Options<GetClientMilestonesData, ThrowOnError>): RequestResult<GetClientMilestonesResponses, GetClientMilestonesErrors, ThrowOnError>;
|
|
508
|
+
/**
|
|
509
|
+
* List the location's classes and their bookings
|
|
510
|
+
*
|
|
511
|
+
* The location's classes on its days from `from` to `to`, each with its bookings by status: the app's Session Report. Door check-ins and visits to other sites are left out, as they are there. Up to 14 days in one request. Needs `sessions:read`; who booked (`attendees`) also needs `clients:read`. For classes nobody has booked, use GET /class-timetable.
|
|
512
|
+
*/
|
|
513
|
+
listSessions<ThrowOnError extends boolean = true>(options?: Options<ListSessionsData, ThrowOnError>): RequestResult<ListSessionsResponses, ListSessionsErrors, ThrowOnError>;
|
|
514
|
+
/**
|
|
515
|
+
* Get the class timetable
|
|
516
|
+
*
|
|
517
|
+
* The classes the studio's booking platform publishes on the location's days from `from` to `to`, booked or not, with capacity and the platform's booked count. Recovr reads the timetable from the platform (daily for most, weekly for Mindbody API sites), so check `trusted` before treating a missing class as not running. Not every booking platform sends a timetable: without one, `classes` is empty and `last_read_at` is null. Up to 42 days in one request. Needs `sessions:read`.
|
|
518
|
+
*/
|
|
519
|
+
getClassTimetable<ThrowOnError extends boolean = true>(options?: Options<GetClassTimetableData, ThrowOnError>): RequestResult<GetClassTimetableResponses, GetClassTimetableErrors, ThrowOnError>;
|
|
520
|
+
/**
|
|
521
|
+
* List custom fields
|
|
522
|
+
*
|
|
523
|
+
* The location's custom fields, in the order profiles show them. Archived fields only with `include_archived=true`. Fields are set up in the app (Settings → Custom Fields). Needs `clients:read`.
|
|
524
|
+
*/
|
|
525
|
+
listCustomFields<ThrowOnError extends boolean = true>(options?: Options<ListCustomFieldsData, ThrowOnError>): RequestResult<ListCustomFieldsResponses, ListCustomFieldsErrors, ThrowOnError>;
|
|
526
|
+
/**
|
|
527
|
+
* Get a client's custom field values
|
|
528
|
+
*
|
|
529
|
+
* Every live custom field with this client's value, null where it isn't set, in the order the profile shows them. Archived fields are left out. Needs `clients:read`. Works only on clients at the credential's location: any other id is a 404.
|
|
530
|
+
*/
|
|
531
|
+
getClientCustomFields<ThrowOnError extends boolean = true>(options: Options<GetClientCustomFieldsData, ThrowOnError>): RequestResult<GetClientCustomFieldsResponses, GetClientCustomFieldsErrors, ThrowOnError>;
|
|
532
|
+
/**
|
|
533
|
+
* Set or clear a client's custom field value
|
|
534
|
+
*
|
|
535
|
+
* Sets one field's value for one client, as editing it on their profile does, or clears it with `value: null`. Setting the value a field already holds changes nothing. A value the field can't hold (text in a `number` field, a `select` value that isn't one of its `options`) is a 400. An archived field, or a field or client at another location, is a 404. Needs `clients:write`.
|
|
536
|
+
*/
|
|
537
|
+
setClientCustomField<ThrowOnError extends boolean = true>(options: Options<SetClientCustomFieldData, ThrowOnError>): RequestResult<SetClientCustomFieldResponses, SetClientCustomFieldErrors, ThrowOnError>;
|
|
538
|
+
/**
|
|
539
|
+
* Rename or recolour a label
|
|
540
|
+
*
|
|
541
|
+
* Renames a label or changes its colour, as Settings → Labels does. Every client with the label keeps it, and workflows that use it follow the new name. A name another label at the location already has (ignoring case) is a 409 `label_name_exists`. Works on manual and smart labels. Needs `labels:manage`.
|
|
542
|
+
*/
|
|
543
|
+
updateClientLabel<ThrowOnError extends boolean = true>(options: Options<UpdateClientLabelData, ThrowOnError>): RequestResult<UpdateClientLabelResponses, UpdateClientLabelErrors, ThrowOnError>;
|
|
544
|
+
/**
|
|
545
|
+
* Archive a label
|
|
546
|
+
*
|
|
547
|
+
* Archives a label, as Settings → Labels does: it leaves the label pickers and **comes off every client who has it**. Their timelines keep the history. The app lists the workflows that use a label before you archive it there, so check those first. Restore it with POST /client-labels/{label_id}/restore (clients don't get it back). Archiving an archived label changes nothing. Needs `labels:manage`.
|
|
548
|
+
*/
|
|
549
|
+
archiveClientLabel<ThrowOnError extends boolean = true>(options: Options<ArchiveClientLabelData, ThrowOnError>): RequestResult<ArchiveClientLabelResponses, ArchiveClientLabelErrors, ThrowOnError>;
|
|
550
|
+
/**
|
|
551
|
+
* Restore an archived label
|
|
552
|
+
*
|
|
553
|
+
* Brings an archived label back to the pickers, as Settings → Labels does. A manual label comes back on nobody; a smart label goes back on the clients its rule matches, without starting workflows. Restoring a label that isn't archived changes nothing. Needs `labels:manage`.
|
|
554
|
+
*/
|
|
555
|
+
restoreClientLabel<ThrowOnError extends boolean = true>(options: Options<RestoreClientLabelData, ThrowOnError>): RequestResult<RestoreClientLabelResponses, RestoreClientLabelErrors, ThrowOnError>;
|
|
556
|
+
/**
|
|
557
|
+
* Get a client's timeline
|
|
558
|
+
*
|
|
559
|
+
* Everything that happened with a client, newest first, as their profile's timeline shows it: messages, calls, notes, logged contact, reminders, sessions, labels, suspensions, forms and more. Each message in a bulk send is listed on its own rather than folded into a group, and drafts aren't listed.
|
|
560
|
+
*
|
|
561
|
+
* Needs `clients:read`. An entry's text needs the permission that guards it elsewhere: `conversations:read` for messages, `notes:read` for notes, calls, logged contact and reminders, `forms:read` for form submissions. Without it the entry is still listed, without `content`. Only for clients at the key's location: any other id is a 404.
|
|
562
|
+
*
|
|
563
|
+
* Pages don't repeat or skip entries when new ones are added meanwhile.
|
|
564
|
+
*/
|
|
565
|
+
getClientTimeline<ThrowOnError extends boolean = true>(options: Options<GetClientTimelineData, ThrowOnError>): RequestResult<GetClientTimelineResponses, GetClientTimelineErrors, ThrowOnError>;
|
|
566
|
+
/**
|
|
567
|
+
* List team members
|
|
568
|
+
*
|
|
569
|
+
* The team at the credential's location, oldest first: the `id` every endpoint uses for a team member (`assigned_to`, an author's or activity's `team_member`, GET /activity `team_member_id`), each person's role, and whether they're still an open invite. Someone removed from the team isn't listed, though their past activity keeps their id and name. Needs `clients:read`.
|
|
570
|
+
*/
|
|
571
|
+
listTeamMembers<ThrowOnError extends boolean = true>(options?: Options<ListTeamMembersData, ThrowOnError>): RequestResult<ListTeamMembersResponses, ListTeamMembersErrors, ThrowOnError>;
|
|
572
|
+
/**
|
|
573
|
+
* Invite a team member
|
|
574
|
+
*
|
|
575
|
+
* Invites one person to the location's team with a role, as the app's Team page does: Recovr emails them an invite with a link to set their password, and they're listed with `status: invited` until they sign in. Refusals: `already_on_team` (that email is already on the team; resend their invite instead), `team_not_supported` (the location's team is still managed outside Recovr). Needs `team:manage`, which works only for a credential acting for an owner or Manager. It never acts on that person's own membership (`own_membership`), gives a role above theirs or acts on someone ranked above them (`above_own_role`), or changes an owner's role (`owner_role`): ownership is handed over in the app.
|
|
576
|
+
*/
|
|
577
|
+
inviteTeamMember<ThrowOnError extends boolean = true>(options: Options<InviteTeamMemberData, ThrowOnError>): RequestResult<InviteTeamMemberResponses, InviteTeamMemberErrors, ThrowOnError>;
|
|
578
|
+
/**
|
|
579
|
+
* Remove a team member
|
|
580
|
+
*
|
|
581
|
+
* Removes someone from the location's team, as the Team page's Remove does: they lose access to the location at once, including every personal access token and app connection they hold for it, and leave Team Chat. Their past activity keeps their id and name. Recovr has no separate deactivate; inviting them again later gives them a new id. Removing someone already removed is a 404. Refusals: `last_owner`. Needs `team:manage`, which works only for a credential acting for an owner or Manager. It never acts on that person's own membership (`own_membership`), gives a role above theirs or acts on someone ranked above them (`above_own_role`), or changes an owner's role (`owner_role`): ownership is handed over in the app.
|
|
582
|
+
*/
|
|
583
|
+
removeTeamMember<ThrowOnError extends boolean = true>(options: Options<RemoveTeamMemberData, ThrowOnError>): RequestResult<RemoveTeamMemberResponses, RemoveTeamMemberErrors, ThrowOnError>;
|
|
584
|
+
/**
|
|
585
|
+
* Change a team member's role
|
|
586
|
+
*
|
|
587
|
+
* Makes a team member a Manager or a Team member. Their new role applies from their next request, in the app and through any token they hold. Setting the role they already have changes nothing. Refusals: `no_membership` (they have no Recovr login at this location to give a role to), `last_owner`. Needs `team:manage`, which works only for a credential acting for an owner or Manager. It never acts on that person's own membership (`own_membership`), gives a role above theirs or acts on someone ranked above them (`above_own_role`), or changes an owner's role (`owner_role`): ownership is handed over in the app.
|
|
588
|
+
*/
|
|
589
|
+
updateTeamMember<ThrowOnError extends boolean = true>(options: Options<UpdateTeamMemberData, ThrowOnError>): RequestResult<UpdateTeamMemberResponses, UpdateTeamMemberErrors, ThrowOnError>;
|
|
590
|
+
/**
|
|
591
|
+
* Resend an invite
|
|
592
|
+
*
|
|
593
|
+
* Emails an invited team member their invite again, with a new link to set their password, as the Team page's Resend does. Refusals: `not_an_invite` (they've already signed in), `no_login` (they have no Recovr login to invite; remove and invite them again). Needs `team:manage`, which works only for a credential acting for an owner or Manager. It never acts on that person's own membership (`own_membership`), gives a role above theirs or acts on someone ranked above them (`above_own_role`), or changes an owner's role (`owner_role`): ownership is handed over in the app.
|
|
594
|
+
*/
|
|
595
|
+
resendTeamMemberInvite<ThrowOnError extends boolean = true>(options: Options<ResendTeamMemberInviteData, ThrowOnError>): RequestResult<ResendTeamMemberInviteResponses, ResendTeamMemberInviteErrors, ThrowOnError>;
|
|
596
|
+
/**
|
|
597
|
+
* Cancel an invite
|
|
598
|
+
*
|
|
599
|
+
* Takes back an invite someone hasn't accepted: they leave the team list and their invite link stops giving them access to the location. Someone who has already signed in is refused with `not_an_invite`; remove them with DELETE /team-members/{id} instead. Needs `team:manage`, which works only for a credential acting for an owner or Manager. It never acts on that person's own membership (`own_membership`), gives a role above theirs or acts on someone ranked above them (`above_own_role`), or changes an owner's role (`owner_role`): ownership is handed over in the app.
|
|
600
|
+
*/
|
|
601
|
+
cancelTeamMemberInvite<ThrowOnError extends boolean = true>(options: Options<CancelTeamMemberInviteData, ThrowOnError>): RequestResult<CancelTeamMemberInviteResponses, CancelTeamMemberInviteErrors, ThrowOnError>;
|
|
224
602
|
}
|
|
225
603
|
export {};
|