@recovr/sdk 0.0.0-stage → 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.
Files changed (89) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +307 -2
  4. package/dist/cjs/client.d.ts +36 -0
  5. package/dist/cjs/client.js +100 -0
  6. package/dist/cjs/errors.d.ts +31 -0
  7. package/dist/cjs/errors.js +69 -0
  8. package/dist/cjs/generated/client/client.gen.d.ts +2 -0
  9. package/dist/cjs/generated/client/client.gen.js +220 -0
  10. package/dist/cjs/generated/client/index.d.ts +10 -0
  11. package/dist/cjs/generated/client/index.js +17 -0
  12. package/dist/cjs/generated/client/types.gen.d.ts +120 -0
  13. package/dist/cjs/generated/client/types.gen.js +3 -0
  14. package/dist/cjs/generated/client/utils.gen.d.ts +37 -0
  15. package/dist/cjs/generated/client/utils.gen.js +239 -0
  16. package/dist/cjs/generated/client.gen.d.ts +12 -0
  17. package/dist/cjs/generated/client.gen.js +6 -0
  18. package/dist/cjs/generated/core/auth.gen.d.ts +25 -0
  19. package/dist/cjs/generated/core/auth.gen.js +18 -0
  20. package/dist/cjs/generated/core/bodySerializer.gen.d.ts +25 -0
  21. package/dist/cjs/generated/core/bodySerializer.gen.js +60 -0
  22. package/dist/cjs/generated/core/params.gen.d.ts +43 -0
  23. package/dist/cjs/generated/core/params.gen.js +112 -0
  24. package/dist/cjs/generated/core/pathSerializer.gen.d.ts +33 -0
  25. package/dist/cjs/generated/core/pathSerializer.gen.js +115 -0
  26. package/dist/cjs/generated/core/queryKeySerializer.gen.d.ts +18 -0
  27. package/dist/cjs/generated/core/queryKeySerializer.gen.js +98 -0
  28. package/dist/cjs/generated/core/serverSentEvents.gen.d.ts +71 -0
  29. package/dist/cjs/generated/core/serverSentEvents.gen.js +135 -0
  30. package/dist/cjs/generated/core/types.gen.d.ts +83 -0
  31. package/dist/cjs/generated/core/types.gen.js +3 -0
  32. package/dist/cjs/generated/core/utils.gen.d.ts +19 -0
  33. package/dist/cjs/generated/core/utils.gen.js +93 -0
  34. package/dist/cjs/generated/index.d.ts +2 -0
  35. package/dist/cjs/generated/index.js +6 -0
  36. package/dist/cjs/generated/sdk.gen.d.ts +603 -0
  37. package/dist/cjs/generated/sdk.gen.js +2315 -0
  38. package/dist/cjs/generated/types.gen.d.ts +7658 -0
  39. package/dist/cjs/generated/types.gen.js +3 -0
  40. package/dist/cjs/index.d.ts +4 -0
  41. package/dist/cjs/index.js +11 -0
  42. package/dist/cjs/package.json +3 -0
  43. package/dist/cjs/paginate.d.ts +24 -0
  44. package/dist/cjs/paginate.js +18 -0
  45. package/dist/esm/client.d.ts +36 -0
  46. package/dist/esm/client.js +95 -0
  47. package/dist/esm/errors.d.ts +31 -0
  48. package/dist/esm/errors.js +64 -0
  49. package/dist/esm/generated/client/client.gen.d.ts +2 -0
  50. package/dist/esm/generated/client/client.gen.js +216 -0
  51. package/dist/esm/generated/client/index.d.ts +10 -0
  52. package/dist/esm/generated/client/index.js +6 -0
  53. package/dist/esm/generated/client/types.gen.d.ts +120 -0
  54. package/dist/esm/generated/client/types.gen.js +2 -0
  55. package/dist/esm/generated/client/utils.gen.d.ts +37 -0
  56. package/dist/esm/generated/client/utils.gen.js +228 -0
  57. package/dist/esm/generated/client.gen.d.ts +12 -0
  58. package/dist/esm/generated/client.gen.js +3 -0
  59. package/dist/esm/generated/core/auth.gen.d.ts +25 -0
  60. package/dist/esm/generated/core/auth.gen.js +14 -0
  61. package/dist/esm/generated/core/bodySerializer.gen.d.ts +25 -0
  62. package/dist/esm/generated/core/bodySerializer.gen.js +57 -0
  63. package/dist/esm/generated/core/params.gen.d.ts +43 -0
  64. package/dist/esm/generated/core/params.gen.js +109 -0
  65. package/dist/esm/generated/core/pathSerializer.gen.d.ts +33 -0
  66. package/dist/esm/generated/core/pathSerializer.gen.js +106 -0
  67. package/dist/esm/generated/core/queryKeySerializer.gen.d.ts +18 -0
  68. package/dist/esm/generated/core/queryKeySerializer.gen.js +92 -0
  69. package/dist/esm/generated/core/serverSentEvents.gen.d.ts +71 -0
  70. package/dist/esm/generated/core/serverSentEvents.gen.js +132 -0
  71. package/dist/esm/generated/core/types.gen.d.ts +83 -0
  72. package/dist/esm/generated/core/types.gen.js +2 -0
  73. package/dist/esm/generated/core/utils.gen.d.ts +19 -0
  74. package/dist/esm/generated/core/utils.gen.js +87 -0
  75. package/dist/esm/generated/index.d.ts +2 -0
  76. package/dist/esm/generated/index.js +2 -0
  77. package/dist/esm/generated/sdk.gen.d.ts +603 -0
  78. package/dist/esm/generated/sdk.gen.js +2311 -0
  79. package/dist/esm/generated/types.gen.d.ts +7658 -0
  80. package/dist/esm/generated/types.gen.js +2 -0
  81. package/dist/esm/index.d.ts +4 -0
  82. package/dist/esm/index.js +3 -0
  83. package/dist/esm/paginate.d.ts +24 -0
  84. package/dist/esm/paginate.js +15 -0
  85. package/examples/add-lead.ts +45 -0
  86. package/examples/add-note.ts +34 -0
  87. package/examples/export-health-scores.ts +38 -0
  88. package/examples/set-suspension.ts +38 -0
  89. package/package.json +59 -4
@@ -0,0 +1,603 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.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
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
+ /**
5
+ * You can provide a client instance returned by `createClient()` instead of
6
+ * individual options. This might be also useful if you want to implement a
7
+ * custom client.
8
+ */
9
+ client?: Client;
10
+ /**
11
+ * You can pass arbitrary values through the `meta` object. This can be
12
+ * used to access values that aren't defined as part of the SDK function.
13
+ */
14
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
15
+ };
16
+ declare class HeyApiClient {
17
+ protected client: Client;
18
+ constructor(args?: {
19
+ client?: Client;
20
+ });
21
+ }
22
+ declare class HeyApiRegistry<T> {
23
+ private readonly defaultKey;
24
+ private readonly instances;
25
+ get(key?: string): T;
26
+ set(value: T, key?: string): void;
27
+ }
28
+ export declare class RecovrSdk extends HeyApiClient {
29
+ static readonly __registry: HeyApiRegistry<RecovrSdk>;
30
+ constructor(args?: {
31
+ client?: Client;
32
+ key?: string;
33
+ });
34
+ /**
35
+ * The credential making this request
36
+ *
37
+ * How this request authenticated (a personal access token or an OAuth app), the credential's name, the permissions that apply, its location and rate-limit state. A good first call to check a credential works. Any valid personal access token or OAuth token can call it.
38
+ */
39
+ getMe<ThrowOnError extends boolean = true>(options?: Options<GetMeData, ThrowOnError>): RequestResult<GetMeResponses, GetMeErrors, ThrowOnError>;
40
+ /**
41
+ * The key's location
42
+ *
43
+ * The one location this key belongs to; every other endpoint reads and writes only there. Any valid key can call it.
44
+ */
45
+ getLocation<ThrowOnError extends boolean = true>(options?: Options<GetLocationData, ThrowOnError>): RequestResult<GetLocationResponses, GetLocationErrors, ThrowOnError>;
46
+ /**
47
+ * Get a client
48
+ *
49
+ * One client at the key's location, read fresh. Needs `clients:read`; `email` and `phone` are included only with `contact_details:read`. A client at another location is a 404.
50
+ */
51
+ getClient<ThrowOnError extends boolean = true>(options: Options<GetClientData, ThrowOnError>): RequestResult<GetClientResponses, GetClientErrors, ThrowOnError>;
52
+ /**
53
+ * List clients
54
+ *
55
+ * Clients at the key's location, filtered the way the Clients page filters them. Needs `clients:read`; filtering by `email` or `phone` also needs `contact_details:read`.
56
+ *
57
+ * Every filter you send must match (AND). Includes leads and former members unless you filter by `lifecycle_stage` or `is_active_member`. Exact filters (`external_client_id`, `email`, `phone`) can match several clients, for example a family sharing an email: all of them are returned.
58
+ *
59
+ * Pages are stable: a client added or removed between pages doesn't make the next page repeat or skip anyone else. Lists are read from data that can be up to a minute old; GET /clients/{id} reads one client fresh.
60
+ */
61
+ listClients<ThrowOnError extends boolean = true>(options?: Options<ListClientsData, ThrowOnError>): RequestResult<ListClientsResponses, ListClientsErrors, ThrowOnError>;
62
+ /**
63
+ * Assign a client to a team member
64
+ *
65
+ * Sets who looks after this client, as assigning a coach does on their profile. The team member is emailed unless they've turned assignment emails off. Send `assigned_to: null` to unassign. An id that isn't on the location's team is a 400. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
66
+ */
67
+ assignClient<ThrowOnError extends boolean = true>(options: Options<AssignClientData, ThrowOnError>): RequestResult<AssignClientResponses, AssignClientErrors, ThrowOnError>;
68
+ /**
69
+ * Flag a client
70
+ *
71
+ * Flags the client for the team's attention from now, and records it on their timeline. The body is optional. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
72
+ */
73
+ flagClient<ThrowOnError extends boolean = true>(options: Options<FlagClientData, ThrowOnError>): RequestResult<FlagClientResponses, FlagClientErrors, ThrowOnError>;
74
+ /**
75
+ * Remove a client's flag
76
+ *
77
+ * Unflagging a client who isn't flagged changes nothing. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
78
+ */
79
+ unflagClient<ThrowOnError extends boolean = true>(options: Options<UnflagClientData, ThrowOnError>): RequestResult<UnflagClientResponses, UnflagClientErrors, ThrowOnError>;
80
+ /**
81
+ * Snooze a client
82
+ *
83
+ * Takes the client out of Next Up until the snooze ends. Send `days` or `until`, not both. Snoozing a snoozed client replaces the end. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
84
+ */
85
+ snoozeClient<ThrowOnError extends boolean = true>(options: Options<SnoozeClientData, ThrowOnError>): RequestResult<SnoozeClientResponses, SnoozeClientErrors, ThrowOnError>;
86
+ /**
87
+ * End a client's snooze
88
+ *
89
+ * Ends the snooze now. Unsnoozing a client who isn't snoozed changes nothing. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
90
+ */
91
+ unsnoozeClient<ThrowOnError extends boolean = true>(options: Options<UnsnoozeClientData, ThrowOnError>): RequestResult<UnsnoozeClientResponses, UnsnoozeClientErrors, ThrowOnError>;
92
+ /**
93
+ * Set a client's do-not-contact channels
94
+ *
95
+ * Stops (or allows again) messages and calls to the client on the channels you name; the client's `do_not_contact` shows the result. Every send from Recovr, including workflows, checks this. At a location connected to GoHighLevel, a later sync from GoHighLevel can change it, and this doesn't change it in GoHighLevel. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
96
+ */
97
+ setClientDoNotContact<ThrowOnError extends boolean = true>(options: Options<SetClientDoNotContactData, ThrowOnError>): RequestResult<SetClientDoNotContactResponses, SetClientDoNotContactErrors, ThrowOnError>;
98
+ /**
99
+ * Add a label to a client
100
+ *
101
+ * Applies one of the location's labels, which can start workflows that trigger on it. Adding a label the client already has changes nothing. An archived label is restored. Smart labels can't be added by hand. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
102
+ */
103
+ addClientLabel<ThrowOnError extends boolean = true>(options: Options<AddClientLabelData, ThrowOnError>): RequestResult<AddClientLabelResponses, AddClientLabelErrors, ThrowOnError>;
104
+ /**
105
+ * Remove a label from a client
106
+ *
107
+ * Removing a label the client doesn't have changes nothing. Recovr won't re-apply a label you removed by itself. Smart labels can't be removed by hand. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
108
+ */
109
+ removeClientLabel<ThrowOnError extends boolean = true>(options: Options<RemoveClientLabelData, ThrowOnError>): RequestResult<RemoveClientLabelResponses, RemoveClientLabelErrors, ThrowOnError>;
110
+ /**
111
+ * Get a client's suspension details
112
+ *
113
+ * The Suspended Member details on the client's profile. A client who isn't suspended has `is_suspended: false`; details from an earlier suspension aren't returned. Needs `clients:read`. Works only on clients at the key's location: any other id is a 404.
114
+ */
115
+ getClientSuspension<ThrowOnError extends boolean = true>(options: Options<GetClientSuspensionData, ThrowOnError>): RequestResult<GetClientSuspensionResponses, GetClientSuspensionErrors, ThrowOnError>;
116
+ /**
117
+ * Update a client's suspension details
118
+ *
119
+ * Sets the reason, expected return date and notes on the client's Suspended Member card. Fields you leave out keep their value; null clears one. The client must already be Suspended in Recovr, which follows the booking platform: a hold made there shows up after Recovr's next sync of that client, and until then this returns 409 `client_not_suspended`. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
120
+ */
121
+ updateClientSuspension<ThrowOnError extends boolean = true>(options: Options<UpdateClientSuspensionData, ThrowOnError>): RequestResult<UpdateClientSuspensionResponses, UpdateClientSuspensionErrors, ThrowOnError>;
122
+ /**
123
+ * List client labels
124
+ *
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`.
126
+ */
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
+ /**
135
+ * List a client's notes
136
+ *
137
+ * Newest first; pages don't repeat or skip items when new ones are added meanwhile. Includes notes imported from the booking platform. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
138
+ */
139
+ listClientNotes<ThrowOnError extends boolean = true>(options: Options<ListClientNotesData, ThrowOnError>): RequestResult<ListClientNotesResponses, ListClientNotesErrors, ThrowOnError>;
140
+ /**
141
+ * Add a note
142
+ *
143
+ * Adds a note as the key's owner, exactly as the Note tab does: it shows on the client's timeline and counts as the team being in touch. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
144
+ */
145
+ createClientNote<ThrowOnError extends boolean = true>(options: Options<CreateClientNoteData, ThrowOnError>): RequestResult<CreateClientNoteResponses, CreateClientNoteErrors, ThrowOnError>;
146
+ /**
147
+ * Pin a note
148
+ *
149
+ * Pins it to the top of the client's profile, unpinning whichever note was pinned before. Needs `notes:write`. Only for notes at the key's location: any other id is a 404.
150
+ */
151
+ pinNote<ThrowOnError extends boolean = true>(options: Options<PinNoteData, ThrowOnError>): RequestResult<PinNoteResponses, PinNoteErrors, ThrowOnError>;
152
+ /**
153
+ * Unpin a note
154
+ *
155
+ * Unpinning a note that isn't pinned changes nothing. Needs `notes:write`. Only for notes at the key's location: any other id is a 404.
156
+ */
157
+ unpinNote<ThrowOnError extends boolean = true>(options: Options<UnpinNoteData, ThrowOnError>): RequestResult<UnpinNoteResponses, UnpinNoteErrors, ThrowOnError>;
158
+ /**
159
+ * List a client's interactions
160
+ *
161
+ * Calls, in-person conversations and messages the team logged, including contact logs imported from the booking platform. Snoozes, flags, assignments and other changes on the profile aren't contact and aren't listed. Newest first; pages don't repeat or skip items when new ones are added meanwhile. (ordered by when they were logged). Notes are at /clients/{id}/notes; messages sent through Recovr aren't listed here. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
162
+ */
163
+ listClientInteractions<ThrowOnError extends boolean = true>(options: Options<ListClientInteractionsData, ThrowOnError>): RequestResult<ListClientInteractionsResponses, ListClientInteractionsErrors, ThrowOnError>;
164
+ /**
165
+ * Log an interaction
166
+ *
167
+ * Records contact the team had with the client, as the key's owner: a `call` (as the profile's Call tab logs it), an `in_person` conversation (the Interact tab) or a `message` sent outside Recovr by `email`, `sms` or `whatsapp`. It counts as contact made in reports and Next Up, and doesn't send anything to the client. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
168
+ */
169
+ createClientInteraction<ThrowOnError extends boolean = true>(options: Options<CreateClientInteractionData, ThrowOnError>): RequestResult<CreateClientInteractionResponses, CreateClientInteractionErrors, ThrowOnError>;
170
+ /**
171
+ * List a client's open reminders
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. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
174
+ */
175
+ listClientReminders<ThrowOnError extends boolean = true>(options: Options<ListClientRemindersData, ThrowOnError>): RequestResult<ListClientRemindersResponses, ListClientRemindersErrors, ThrowOnError>;
176
+ /**
177
+ * Set a reminder
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), 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
+ */
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>;
188
+ /**
189
+ * Change a reminder
190
+ *
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.
192
+ */
193
+ updateReminder<ThrowOnError extends boolean = true>(options: Options<UpdateReminderData, ThrowOnError>): RequestResult<UpdateReminderResponses, UpdateReminderErrors, ThrowOnError>;
194
+ /**
195
+ * Close a reminder
196
+ *
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.
198
+ */
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>;
212
+ /**
213
+ * List forms
214
+ *
215
+ * The location's published forms, newest first. Use a form's id to list its submissions. Needs `forms:read`.
216
+ */
217
+ listForms<ThrowOnError extends boolean = true>(options?: Options<ListFormsData, ThrowOnError>): RequestResult<ListFormsResponses, ListFormsErrors, ThrowOnError>;
218
+ /**
219
+ * Get a form
220
+ *
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`.
222
+ */
223
+ getForm<ThrowOnError extends boolean = true>(options: Options<GetFormData, ThrowOnError>): RequestResult<GetFormResponses, GetFormErrors, ThrowOnError>;
224
+ /**
225
+ * List a form's submissions
226
+ *
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`.
228
+ */
229
+ listFormSubmissions<ThrowOnError extends boolean = true>(options: Options<ListFormSubmissionsData, ThrowOnError>): RequestResult<ListFormSubmissionsResponses, ListFormSubmissionsErrors, ThrowOnError>;
230
+ /**
231
+ * List a client's form submissions
232
+ *
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`.
234
+ */
235
+ listClientFormSubmissions<ThrowOnError extends boolean = true>(options: Options<ListClientFormSubmissionsData, ThrowOnError>): RequestResult<ListClientFormSubmissionsResponses, ListClientFormSubmissionsErrors, ThrowOnError>;
236
+ /**
237
+ * Get a form submission
238
+ *
239
+ * One submission with its answers. Answers can contain contact and health details. Needs `forms:read`.
240
+ */
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>;
602
+ }
603
+ export {};