featurebase-node 0.8.1 → 0.10.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 +18 -0
- package/client.d.mts +3 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -1
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +15 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +15 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +25 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +23 -0
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/support/conversations/conversations.d.mts +817 -8
- package/resources/support/conversations/conversations.d.mts.map +1 -1
- package/resources/support/conversations/conversations.d.ts +817 -8
- package/resources/support/conversations/conversations.d.ts.map +1 -1
- package/resources/support/conversations/conversations.js +244 -4
- package/resources/support/conversations/conversations.js.map +1 -1
- package/resources/support/conversations/conversations.mjs +244 -4
- package/resources/support/conversations/conversations.mjs.map +1 -1
- package/resources/support/conversations/index.d.mts +1 -2
- package/resources/support/conversations/index.d.mts.map +1 -1
- package/resources/support/conversations/index.d.ts +1 -2
- package/resources/support/conversations/index.d.ts.map +1 -1
- package/resources/support/conversations/index.js +1 -3
- package/resources/support/conversations/index.js.map +1 -1
- package/resources/support/conversations/index.mjs +0 -1
- package/resources/support/conversations/index.mjs.map +1 -1
- package/resources/support/index.d.mts +1 -1
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts +1 -1
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/index.js.map +1 -1
- package/resources/support/index.mjs.map +1 -1
- package/resources/support/support.d.mts +2 -2
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts +2 -2
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.js.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/src/client.ts +13 -1
- package/src/core/pagination.ts +49 -0
- package/src/resources/support/conversations/conversations.ts +1068 -88
- package/src/resources/support/conversations/index.ts +6 -7
- package/src/resources/support/index.ts +6 -0
- package/src/resources/support/support.ts +12 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/support/conversations/tags.d.mts +0 -200
- package/resources/support/conversations/tags.d.mts.map +0 -1
- package/resources/support/conversations/tags.d.ts +0 -200
- package/resources/support/conversations/tags.d.ts.map +0 -1
- package/resources/support/conversations/tags.js +0 -146
- package/resources/support/conversations/tags.js.map +0 -1
- package/resources/support/conversations/tags.mjs +0 -142
- package/resources/support/conversations/tags.mjs.map +0 -1
- package/src/resources/support/conversations/tags.ts +0 -260
|
@@ -5,14 +5,6 @@ import * as ConversationsAPI from './conversations';
|
|
|
5
5
|
import * as ConversationTagsAPI from '../conversation-tags';
|
|
6
6
|
import * as ParticipantsAPI from './participants';
|
|
7
7
|
import { ParticipantAddParams, ParticipantRemoveParams, Participants } from './participants';
|
|
8
|
-
import * as TagsAPI from './tags';
|
|
9
|
-
import {
|
|
10
|
-
AttachedConversationTag,
|
|
11
|
-
ConversationTagMutationActor,
|
|
12
|
-
TagAttachParams,
|
|
13
|
-
TagDetachParams,
|
|
14
|
-
Tags,
|
|
15
|
-
} from './tags';
|
|
16
8
|
import { APIPromise } from '../../../core/api-promise';
|
|
17
9
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
18
10
|
import { buildHeaders } from '../../../internal/headers';
|
|
@@ -23,7 +15,6 @@ import { path } from '../../../internal/utils/path';
|
|
|
23
15
|
* Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
|
|
24
16
|
*/
|
|
25
17
|
export class Conversations extends APIResource {
|
|
26
|
-
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
|
|
27
18
|
participants: ParticipantsAPI.Participants = new ParticipantsAPI.Participants(this._client);
|
|
28
19
|
|
|
29
20
|
/**
|
|
@@ -583,6 +574,148 @@ export class Conversations extends APIResource {
|
|
|
583
574
|
});
|
|
584
575
|
}
|
|
585
576
|
|
|
577
|
+
/**
|
|
578
|
+
* Attaches a workspace tag to a conversation.
|
|
579
|
+
*
|
|
580
|
+
* This endpoint requires both the tag ID to attach and the `actingAdminId` of the
|
|
581
|
+
* admin on whose behalf the mutation is recorded.
|
|
582
|
+
*
|
|
583
|
+
* ### Path Parameters
|
|
584
|
+
*
|
|
585
|
+
* - `id` - The conversation ID (short ID)
|
|
586
|
+
*
|
|
587
|
+
* ### Request Body
|
|
588
|
+
*
|
|
589
|
+
* | Field | Type | Required | Description |
|
|
590
|
+
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
591
|
+
* | `tagId` | string | Yes | The Featurebase tag ID to attach |
|
|
592
|
+
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
593
|
+
*
|
|
594
|
+
* ### Behavior
|
|
595
|
+
*
|
|
596
|
+
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
597
|
+
* records the tag attachment against that part so audit metadata remains
|
|
598
|
+
* deterministic.
|
|
599
|
+
*
|
|
600
|
+
* ### Response
|
|
601
|
+
*
|
|
602
|
+
* Returns the affected tag plus attachment metadata such as `targetPartId`,
|
|
603
|
+
* `appliedAt`, and `appliedBy`.
|
|
604
|
+
*
|
|
605
|
+
* ### Example Request
|
|
606
|
+
*
|
|
607
|
+
* ```json
|
|
608
|
+
* {
|
|
609
|
+
* "tagId": "67ec1234abcd5678ef901234",
|
|
610
|
+
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
611
|
+
* }
|
|
612
|
+
* ```
|
|
613
|
+
*
|
|
614
|
+
* ### Version Availability
|
|
615
|
+
*
|
|
616
|
+
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* ```ts
|
|
620
|
+
* const response =
|
|
621
|
+
* await client.support.conversations.attachTag('12345', {
|
|
622
|
+
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
623
|
+
* tagId: '67ec1234abcd5678ef901234',
|
|
624
|
+
* });
|
|
625
|
+
* ```
|
|
626
|
+
*/
|
|
627
|
+
attachTag(
|
|
628
|
+
id: string,
|
|
629
|
+
params: ConversationAttachTagParams,
|
|
630
|
+
options?: RequestOptions,
|
|
631
|
+
): APIPromise<ConversationAttachTagResponse> {
|
|
632
|
+
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
633
|
+
return this._client.post(path`/v2/conversations/${id}/tags`, {
|
|
634
|
+
body,
|
|
635
|
+
...options,
|
|
636
|
+
headers: buildHeaders([
|
|
637
|
+
{
|
|
638
|
+
...(featurebaseVersion?.toString() != null ?
|
|
639
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
640
|
+
: undefined),
|
|
641
|
+
},
|
|
642
|
+
options?.headers,
|
|
643
|
+
]),
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Removes a workspace tag from a conversation.
|
|
649
|
+
*
|
|
650
|
+
* This endpoint requires the `actingAdminId` of the admin on whose behalf the
|
|
651
|
+
* mutation is recorded.
|
|
652
|
+
*
|
|
653
|
+
* ### Path Parameters
|
|
654
|
+
*
|
|
655
|
+
* - `id` - The conversation ID (short ID)
|
|
656
|
+
* - `tagId` - The Featurebase tag ID to remove
|
|
657
|
+
*
|
|
658
|
+
* ### Request Body
|
|
659
|
+
*
|
|
660
|
+
* | Field | Type | Required | Description |
|
|
661
|
+
* | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
|
662
|
+
* | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
|
|
663
|
+
*
|
|
664
|
+
* ### Behavior
|
|
665
|
+
*
|
|
666
|
+
* Featurebase resolves the latest taggable reply/message in the conversation and
|
|
667
|
+
* records the tag removal against that part so audit metadata remains
|
|
668
|
+
* deterministic.
|
|
669
|
+
*
|
|
670
|
+
* ### Response
|
|
671
|
+
*
|
|
672
|
+
* Returns the affected tag payload with the most relevant attachment metadata
|
|
673
|
+
* available for that relationship.
|
|
674
|
+
*
|
|
675
|
+
* ### Example Request
|
|
676
|
+
*
|
|
677
|
+
* ```json
|
|
678
|
+
* {
|
|
679
|
+
* "actingAdminId": "507f1f77bcf86cd799439011"
|
|
680
|
+
* }
|
|
681
|
+
* ```
|
|
682
|
+
*
|
|
683
|
+
* ### Version Availability
|
|
684
|
+
*
|
|
685
|
+
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* ```ts
|
|
689
|
+
* const response =
|
|
690
|
+
* await client.support.conversations.detachTag(
|
|
691
|
+
* '67ec1234abcd5678ef901234',
|
|
692
|
+
* {
|
|
693
|
+
* id: '12345',
|
|
694
|
+
* actingAdminId: '507f1f77bcf86cd799439011',
|
|
695
|
+
* },
|
|
696
|
+
* );
|
|
697
|
+
* ```
|
|
698
|
+
*/
|
|
699
|
+
detachTag(
|
|
700
|
+
tagID: string,
|
|
701
|
+
params: ConversationDetachTagParams,
|
|
702
|
+
options?: RequestOptions,
|
|
703
|
+
): APIPromise<ConversationDetachTagResponse> {
|
|
704
|
+
const { id, 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
705
|
+
return this._client.delete(path`/v2/conversations/${id}/tags/${tagID}`, {
|
|
706
|
+
body,
|
|
707
|
+
...options,
|
|
708
|
+
headers: buildHeaders([
|
|
709
|
+
{
|
|
710
|
+
...(featurebaseVersion?.toString() != null ?
|
|
711
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
712
|
+
: undefined),
|
|
713
|
+
},
|
|
714
|
+
options?.headers,
|
|
715
|
+
]),
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
|
|
586
719
|
/**
|
|
587
720
|
* Redacts a conversation part (message) from a conversation. Redaction permanently
|
|
588
721
|
* removes the message content while preserving the conversation structure.
|
|
@@ -801,6 +934,119 @@ export class Conversations extends APIResource {
|
|
|
801
934
|
]),
|
|
802
935
|
});
|
|
803
936
|
}
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Search conversations with a structured filter AST and an optional full-text
|
|
940
|
+
* query.
|
|
941
|
+
*
|
|
942
|
+
* The endpoint has two modes that are picked automatically from the body:
|
|
943
|
+
*
|
|
944
|
+
* - **Filter mode** (`query` set, `search` omitted): structured filtering against
|
|
945
|
+
* indexed conversation fields. Sorted by `lastActivityAt` desc by default; set
|
|
946
|
+
* `sort` to `last_activity_at:asc` for the inverse.
|
|
947
|
+
* - **Search mode** (`search` set, `query` optional): full-text search across
|
|
948
|
+
* conversation messages, then narrowed by the same `query` AST so the same
|
|
949
|
+
* filters apply. Results are ranked by relevance.
|
|
950
|
+
*
|
|
951
|
+
* ### Structured query AST
|
|
952
|
+
*
|
|
953
|
+
* Each clause has the shape `{ field, operator, value }`. You can pass a single
|
|
954
|
+
* clause or wrap up to 15 in a top-level `AND` group:
|
|
955
|
+
*
|
|
956
|
+
* ```json
|
|
957
|
+
* {
|
|
958
|
+
* "query": {
|
|
959
|
+
* "operator": "AND",
|
|
960
|
+
* "value": [
|
|
961
|
+
* { "field": "state", "operator": "=", "value": "open" },
|
|
962
|
+
* {
|
|
963
|
+
* "field": "admin_assignee_id",
|
|
964
|
+
* "operator": "=",
|
|
965
|
+
* "value": "507f1f77bcf86cd799439011"
|
|
966
|
+
* }
|
|
967
|
+
* ]
|
|
968
|
+
* }
|
|
969
|
+
* }
|
|
970
|
+
* ```
|
|
971
|
+
*
|
|
972
|
+
* Top-level `OR` groups and nested groups are not supported in this version.
|
|
973
|
+
*
|
|
974
|
+
* ### Supported fields and operators
|
|
975
|
+
*
|
|
976
|
+
* | Field | Type | Operators |
|
|
977
|
+
* | ---------------------------- | --------------------------------------------------------------------------- | ---------------------- |
|
|
978
|
+
* | `state` | enum (`open` / `closed` / `snoozed`) | `=`, `!=`, `IN`, `NIN` |
|
|
979
|
+
* | `priority` | boolean | `=`, `!=` |
|
|
980
|
+
* | `admin_assignee_id` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
981
|
+
* | `team_assignee_id` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
|
|
982
|
+
* | `brand_id` | id or null | `=`, `!=`, `IN`, `NIN` |
|
|
983
|
+
* | `tag_ids` | id (matches any conversation containing this tag) | `=`, `!=`, `IN`, `NIN` |
|
|
984
|
+
* | `user_id` / `participant_id` | id of a conversation participant | `=`, `!=`, `IN`, `NIN` |
|
|
985
|
+
* | `company_id` | company id (matches conversations whose participants belong to the company) | `=`, `!=`, `IN`, `NIN` |
|
|
986
|
+
* | `mentioned_admin_ids` | admin id | `=`, `!=`, `IN`, `NIN` |
|
|
987
|
+
* | `created_at` | unix seconds | `=`, `>`, `<` |
|
|
988
|
+
*
|
|
989
|
+
* For unbounded fields a query consisting only of `!=` or `NIN` clauses is
|
|
990
|
+
* rejected with `query_too_broad` to prevent full-org scans. Combine the negation
|
|
991
|
+
* with at least one positive clause (`=`, `IN`, `>`, `<`) instead. Bounded enum
|
|
992
|
+
* fields (`state`, `priority`) are exempt because their negation is naturally
|
|
993
|
+
* bounded.
|
|
994
|
+
*
|
|
995
|
+
* ### Pagination
|
|
996
|
+
*
|
|
997
|
+
* Cursor-based, `limit` between 1 and 100 (default 10). Pagination cursors are
|
|
998
|
+
* mode-specific - reusing a filter-mode cursor in search mode (or vice versa)
|
|
999
|
+
* returns `400`. `totalCount` is approximate and capped at 1000;
|
|
1000
|
+
* `totalCountCapped` is `true` when the real count may be higher.
|
|
1001
|
+
*
|
|
1002
|
+
* ### Response
|
|
1003
|
+
*
|
|
1004
|
+
* Returns a slim conversation row optimised for inbox / list rendering - just the
|
|
1005
|
+
* fields you need to render a row and link to the conversation. Fetch the full
|
|
1006
|
+
* conversation via `GET /v2/conversations/{id}` when the user opens one.
|
|
1007
|
+
*
|
|
1008
|
+
* Search-specific additions on each row:
|
|
1009
|
+
*
|
|
1010
|
+
* - `conversationUser` - the customer / lead the conversation is with. Use this
|
|
1011
|
+
* for the row identity.
|
|
1012
|
+
* - `surroundingConversationParts` - context window of human messages around the
|
|
1013
|
+
* matched message (≈15 before + 15 from the match onwards in search mode,
|
|
1014
|
+
* sliding to first / last 30 if the match is near the conversation boundaries;
|
|
1015
|
+
* falls back to the latest 30 messages in filter mode). Each `previewMarkdown`
|
|
1016
|
+
* value is truncated server-side; fetch the full conversation for complete
|
|
1017
|
+
* history and full bodies.
|
|
1018
|
+
* - `matchingPartAuthor` - author of the specific message that matched the search
|
|
1019
|
+
* query (search mode only). May be a teammate or bot.
|
|
1020
|
+
* - `matchingPart` - reference to the matched message (search mode only).
|
|
1021
|
+
* - `matchingBodyPreviewMarkdown` - plain-text / markdown preview of the matched
|
|
1022
|
+
* body (search mode only).
|
|
1023
|
+
* - `relevanceScore` - aggregate score (search mode only).
|
|
1024
|
+
*
|
|
1025
|
+
* ### Version Availability
|
|
1026
|
+
*
|
|
1027
|
+
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
1028
|
+
*
|
|
1029
|
+
* @example
|
|
1030
|
+
* ```ts
|
|
1031
|
+
* const response =
|
|
1032
|
+
* await client.support.conversations.search();
|
|
1033
|
+
* ```
|
|
1034
|
+
*/
|
|
1035
|
+
search(params: ConversationSearchParams, options?: RequestOptions): APIPromise<ConversationSearchResponse> {
|
|
1036
|
+
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
1037
|
+
return this._client.post('/v2/conversations/search', {
|
|
1038
|
+
body,
|
|
1039
|
+
...options,
|
|
1040
|
+
headers: buildHeaders([
|
|
1041
|
+
{
|
|
1042
|
+
...(featurebaseVersion?.toString() != null ?
|
|
1043
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
1044
|
+
: undefined),
|
|
1045
|
+
},
|
|
1046
|
+
options?.headers,
|
|
1047
|
+
]),
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
804
1050
|
}
|
|
805
1051
|
|
|
806
1052
|
export type ConversationsCursorPage = CursorPage<Conversation>;
|
|
@@ -2022,7 +2268,7 @@ export namespace ConversationPart {
|
|
|
2022
2268
|
/**
|
|
2023
2269
|
* Actor that applied the tag
|
|
2024
2270
|
*/
|
|
2025
|
-
actor?:
|
|
2271
|
+
actor?: TagUpdate.Actor;
|
|
2026
2272
|
|
|
2027
2273
|
/**
|
|
2028
2274
|
* Tag name at the time of the event or the best available current display name
|
|
@@ -2035,6 +2281,28 @@ export namespace ConversationPart {
|
|
|
2035
2281
|
targetPartId?: string | null;
|
|
2036
2282
|
}
|
|
2037
2283
|
|
|
2284
|
+
export namespace TagUpdate {
|
|
2285
|
+
/**
|
|
2286
|
+
* Actor that applied the tag
|
|
2287
|
+
*/
|
|
2288
|
+
export interface Actor {
|
|
2289
|
+
/**
|
|
2290
|
+
* Actor that caused the tag mutation
|
|
2291
|
+
*/
|
|
2292
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Actor identifier when available
|
|
2296
|
+
*/
|
|
2297
|
+
id?: string | null;
|
|
2298
|
+
|
|
2299
|
+
/**
|
|
2300
|
+
* Actor display name when available
|
|
2301
|
+
*/
|
|
2302
|
+
name?: string | null;
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2038
2306
|
/**
|
|
2039
2307
|
* Represents a workflow wait start, finish, or interruption in the conversation
|
|
2040
2308
|
* thread
|
|
@@ -2249,7 +2517,7 @@ export interface ConversationTagApplication {
|
|
|
2249
2517
|
/**
|
|
2250
2518
|
* Actor that applied the tag
|
|
2251
2519
|
*/
|
|
2252
|
-
appliedBy?:
|
|
2520
|
+
appliedBy?: ConversationTagApplication.AppliedBy;
|
|
2253
2521
|
|
|
2254
2522
|
/**
|
|
2255
2523
|
* ISO timestamp when the tag was removed from this reply, if it was removed
|
|
@@ -2259,7 +2527,7 @@ export interface ConversationTagApplication {
|
|
|
2259
2527
|
/**
|
|
2260
2528
|
* Actor that applied the tag
|
|
2261
2529
|
*/
|
|
2262
|
-
removedBy?:
|
|
2530
|
+
removedBy?: ConversationTagApplication.RemovedBy;
|
|
2263
2531
|
|
|
2264
2532
|
/**
|
|
2265
2533
|
* Resolved tag object when the tag still exists in the shared workspace catalog
|
|
@@ -2267,6 +2535,48 @@ export interface ConversationTagApplication {
|
|
|
2267
2535
|
tag?: ConversationTagsAPI.ConversationTag;
|
|
2268
2536
|
}
|
|
2269
2537
|
|
|
2538
|
+
export namespace ConversationTagApplication {
|
|
2539
|
+
/**
|
|
2540
|
+
* Actor that applied the tag
|
|
2541
|
+
*/
|
|
2542
|
+
export interface AppliedBy {
|
|
2543
|
+
/**
|
|
2544
|
+
* Actor that caused the tag mutation
|
|
2545
|
+
*/
|
|
2546
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Actor identifier when available
|
|
2550
|
+
*/
|
|
2551
|
+
id?: string | null;
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* Actor display name when available
|
|
2555
|
+
*/
|
|
2556
|
+
name?: string | null;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
/**
|
|
2560
|
+
* Actor that applied the tag
|
|
2561
|
+
*/
|
|
2562
|
+
export interface RemovedBy {
|
|
2563
|
+
/**
|
|
2564
|
+
* Actor that caused the tag mutation
|
|
2565
|
+
*/
|
|
2566
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* Actor identifier when available
|
|
2570
|
+
*/
|
|
2571
|
+
id?: string | null;
|
|
2572
|
+
|
|
2573
|
+
/**
|
|
2574
|
+
* Actor display name when available
|
|
2575
|
+
*/
|
|
2576
|
+
name?: string | null;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2270
2580
|
export interface CsatEmailDelivery {
|
|
2271
2581
|
/**
|
|
2272
2582
|
* Email delivery status for the CSAT request when applicable
|
|
@@ -2360,131 +2670,676 @@ export interface ConversationDeleteResponse {
|
|
|
2360
2670
|
object: 'conversation';
|
|
2361
2671
|
}
|
|
2362
2672
|
|
|
2363
|
-
export interface
|
|
2673
|
+
export interface ConversationAttachTagResponse {
|
|
2364
2674
|
/**
|
|
2365
|
-
*
|
|
2366
|
-
* referenced by URL or as base64 data URIs will be automatically uploaded and
|
|
2367
|
-
* stored.
|
|
2675
|
+
* Unique tag identifier
|
|
2368
2676
|
*/
|
|
2369
|
-
|
|
2677
|
+
id: string;
|
|
2370
2678
|
|
|
2371
2679
|
/**
|
|
2372
|
-
*
|
|
2373
|
-
* customer/lead or "admin" for outreach.
|
|
2680
|
+
* Current tag name
|
|
2374
2681
|
*/
|
|
2375
|
-
|
|
2682
|
+
name: string;
|
|
2376
2683
|
|
|
2377
2684
|
/**
|
|
2378
|
-
*
|
|
2379
|
-
* (SDK/widget).
|
|
2685
|
+
* Object type identifier for a tag
|
|
2380
2686
|
*/
|
|
2381
|
-
|
|
2687
|
+
type: 'tag';
|
|
2382
2688
|
|
|
2383
2689
|
/**
|
|
2384
|
-
*
|
|
2385
|
-
* provided, the current time will be used. This field is recommended for migrating
|
|
2386
|
-
* past conversations from another source.
|
|
2690
|
+
* ISO timestamp when the tag was applied
|
|
2387
2691
|
*/
|
|
2388
|
-
|
|
2692
|
+
appliedAt?: string | null;
|
|
2389
2693
|
|
|
2390
2694
|
/**
|
|
2391
|
-
*
|
|
2392
|
-
* "admin". Specify at least one recipient in the "to" field.
|
|
2695
|
+
* Actor that applied the tag
|
|
2393
2696
|
*/
|
|
2394
|
-
|
|
2697
|
+
appliedBy?: ConversationAttachTagResponse.AppliedBy | null;
|
|
2395
2698
|
|
|
2396
2699
|
/**
|
|
2397
|
-
*
|
|
2398
|
-
* from.type is "admin".
|
|
2700
|
+
* ISO timestamp when the tag was removed, if applicable
|
|
2399
2701
|
*/
|
|
2400
|
-
|
|
2702
|
+
removedAt?: string | null;
|
|
2401
2703
|
|
|
2402
2704
|
/**
|
|
2403
|
-
*
|
|
2404
|
-
* configured API version if not specified.
|
|
2705
|
+
* Actor that applied the tag
|
|
2405
2706
|
*/
|
|
2406
|
-
|
|
2407
|
-
}
|
|
2707
|
+
removedBy?: ConversationAttachTagResponse.RemovedBy | null;
|
|
2408
2708
|
|
|
2409
|
-
export namespace ConversationCreateParams {
|
|
2410
2709
|
/**
|
|
2411
|
-
*
|
|
2710
|
+
* Reply/message ID used as the deterministic attachment target for this
|
|
2711
|
+
* conversation tag mutation.
|
|
2412
2712
|
*/
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
* The Featurebase contact ID
|
|
2416
|
-
*/
|
|
2417
|
-
id: string;
|
|
2713
|
+
targetPartId?: string | null;
|
|
2714
|
+
}
|
|
2418
2715
|
|
|
2716
|
+
export namespace ConversationAttachTagResponse {
|
|
2717
|
+
/**
|
|
2718
|
+
* Actor that applied the tag
|
|
2719
|
+
*/
|
|
2720
|
+
export interface AppliedBy {
|
|
2419
2721
|
/**
|
|
2420
|
-
*
|
|
2722
|
+
* Actor that caused the tag mutation
|
|
2421
2723
|
*/
|
|
2422
|
-
type: '
|
|
2423
|
-
}
|
|
2724
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2424
2725
|
|
|
2425
|
-
/**
|
|
2426
|
-
* Conversation initiated by an admin (outreach)
|
|
2427
|
-
*/
|
|
2428
|
-
export interface AdminFrom {
|
|
2429
2726
|
/**
|
|
2430
|
-
*
|
|
2727
|
+
* Actor identifier when available
|
|
2431
2728
|
*/
|
|
2432
|
-
id
|
|
2729
|
+
id?: string | null;
|
|
2433
2730
|
|
|
2434
2731
|
/**
|
|
2435
|
-
*
|
|
2732
|
+
* Actor display name when available
|
|
2436
2733
|
*/
|
|
2437
|
-
|
|
2734
|
+
name?: string | null;
|
|
2438
2735
|
}
|
|
2439
2736
|
|
|
2440
2737
|
/**
|
|
2441
|
-
*
|
|
2442
|
-
* Specify at least one recipient in the "to" field.
|
|
2738
|
+
* Actor that applied the tag
|
|
2443
2739
|
*/
|
|
2444
|
-
export interface
|
|
2740
|
+
export interface RemovedBy {
|
|
2445
2741
|
/**
|
|
2446
|
-
*
|
|
2742
|
+
* Actor that caused the tag mutation
|
|
2447
2743
|
*/
|
|
2448
|
-
|
|
2744
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2449
2745
|
|
|
2450
2746
|
/**
|
|
2451
|
-
*
|
|
2747
|
+
* Actor identifier when available
|
|
2452
2748
|
*/
|
|
2453
|
-
|
|
2749
|
+
id?: string | null;
|
|
2454
2750
|
|
|
2455
2751
|
/**
|
|
2456
|
-
*
|
|
2752
|
+
* Actor display name when available
|
|
2457
2753
|
*/
|
|
2458
|
-
|
|
2754
|
+
name?: string | null;
|
|
2459
2755
|
}
|
|
2460
2756
|
}
|
|
2461
2757
|
|
|
2462
|
-
export interface
|
|
2758
|
+
export interface ConversationDetachTagResponse {
|
|
2463
2759
|
/**
|
|
2464
|
-
*
|
|
2465
|
-
* version if not specified.
|
|
2760
|
+
* Unique tag identifier
|
|
2466
2761
|
*/
|
|
2467
|
-
|
|
2468
|
-
}
|
|
2762
|
+
id: string;
|
|
2469
2763
|
|
|
2470
|
-
export interface ConversationUpdateParams {
|
|
2471
2764
|
/**
|
|
2472
|
-
*
|
|
2473
|
-
* this admin. If not provided, changes are attributed to the system bot user. The
|
|
2474
|
-
* admin must be a member of the organization.
|
|
2765
|
+
* Current tag name
|
|
2475
2766
|
*/
|
|
2476
|
-
|
|
2767
|
+
name: string;
|
|
2477
2768
|
|
|
2478
2769
|
/**
|
|
2479
|
-
*
|
|
2770
|
+
* Object type identifier for a tag
|
|
2480
2771
|
*/
|
|
2481
|
-
|
|
2772
|
+
type: 'tag';
|
|
2482
2773
|
|
|
2483
2774
|
/**
|
|
2484
|
-
*
|
|
2485
|
-
* validation as v1 API.
|
|
2775
|
+
* ISO timestamp when the tag was applied
|
|
2486
2776
|
*/
|
|
2487
|
-
|
|
2777
|
+
appliedAt?: string | null;
|
|
2778
|
+
|
|
2779
|
+
/**
|
|
2780
|
+
* Actor that applied the tag
|
|
2781
|
+
*/
|
|
2782
|
+
appliedBy?: ConversationDetachTagResponse.AppliedBy | null;
|
|
2783
|
+
|
|
2784
|
+
/**
|
|
2785
|
+
* ISO timestamp when the tag was removed, if applicable
|
|
2786
|
+
*/
|
|
2787
|
+
removedAt?: string | null;
|
|
2788
|
+
|
|
2789
|
+
/**
|
|
2790
|
+
* Actor that applied the tag
|
|
2791
|
+
*/
|
|
2792
|
+
removedBy?: ConversationDetachTagResponse.RemovedBy | null;
|
|
2793
|
+
|
|
2794
|
+
/**
|
|
2795
|
+
* Reply/message ID used as the deterministic attachment target for this
|
|
2796
|
+
* conversation tag mutation.
|
|
2797
|
+
*/
|
|
2798
|
+
targetPartId?: string | null;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
export namespace ConversationDetachTagResponse {
|
|
2802
|
+
/**
|
|
2803
|
+
* Actor that applied the tag
|
|
2804
|
+
*/
|
|
2805
|
+
export interface AppliedBy {
|
|
2806
|
+
/**
|
|
2807
|
+
* Actor that caused the tag mutation
|
|
2808
|
+
*/
|
|
2809
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2810
|
+
|
|
2811
|
+
/**
|
|
2812
|
+
* Actor identifier when available
|
|
2813
|
+
*/
|
|
2814
|
+
id?: string | null;
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* Actor display name when available
|
|
2818
|
+
*/
|
|
2819
|
+
name?: string | null;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* Actor that applied the tag
|
|
2824
|
+
*/
|
|
2825
|
+
export interface RemovedBy {
|
|
2826
|
+
/**
|
|
2827
|
+
* Actor that caused the tag mutation
|
|
2828
|
+
*/
|
|
2829
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
|
|
2830
|
+
|
|
2831
|
+
/**
|
|
2832
|
+
* Actor identifier when available
|
|
2833
|
+
*/
|
|
2834
|
+
id?: string | null;
|
|
2835
|
+
|
|
2836
|
+
/**
|
|
2837
|
+
* Actor display name when available
|
|
2838
|
+
*/
|
|
2839
|
+
name?: string | null;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
export interface ConversationSearchResponse {
|
|
2844
|
+
/**
|
|
2845
|
+
* Array of search results
|
|
2846
|
+
*/
|
|
2847
|
+
data: Array<ConversationSearchResponse.Data>;
|
|
2848
|
+
|
|
2849
|
+
/**
|
|
2850
|
+
* Cursor for fetching the next page (null if no more results)
|
|
2851
|
+
*/
|
|
2852
|
+
nextCursor: string | null;
|
|
2853
|
+
|
|
2854
|
+
/**
|
|
2855
|
+
* Object type identifier
|
|
2856
|
+
*/
|
|
2857
|
+
object: 'list';
|
|
2858
|
+
|
|
2859
|
+
/**
|
|
2860
|
+
* Total number of conversations matching the query, capped at 200. When the actual
|
|
2861
|
+
* total is at or above the cap, `totalCountCapped` is true and the value is
|
|
2862
|
+
* exactly the cap.
|
|
2863
|
+
*/
|
|
2864
|
+
totalCount?: number;
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* True when totalCount is exactly the cap and the real count is `>= totalCount`.
|
|
2868
|
+
* UI may render as "200+".
|
|
2869
|
+
*/
|
|
2870
|
+
totalCountCapped?: boolean;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
export namespace ConversationSearchResponse {
|
|
2874
|
+
export interface Data {
|
|
2875
|
+
/**
|
|
2876
|
+
* Unique conversation identifier
|
|
2877
|
+
*/
|
|
2878
|
+
id: string;
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* ID of the assigned admin
|
|
2882
|
+
*/
|
|
2883
|
+
adminAssigneeId: string | null;
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* ID of the brand associated with this conversation
|
|
2887
|
+
*/
|
|
2888
|
+
brandId: string | null;
|
|
2889
|
+
|
|
2890
|
+
/**
|
|
2891
|
+
* ISO timestamp when conversation was created
|
|
2892
|
+
*/
|
|
2893
|
+
createdAt: string;
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* ISO timestamp of last activity
|
|
2897
|
+
*/
|
|
2898
|
+
lastActivityAt: string | null;
|
|
2899
|
+
|
|
2900
|
+
/**
|
|
2901
|
+
* Object type identifier
|
|
2902
|
+
*/
|
|
2903
|
+
object: 'conversation';
|
|
2904
|
+
|
|
2905
|
+
/**
|
|
2906
|
+
* Participants in this conversation
|
|
2907
|
+
*/
|
|
2908
|
+
participants: Array<ConversationsAPI.ConversationParticipant>;
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Whether this conversation is marked as priority
|
|
2912
|
+
*/
|
|
2913
|
+
priority: boolean;
|
|
2914
|
+
|
|
2915
|
+
/**
|
|
2916
|
+
* ISO timestamp when priority was set
|
|
2917
|
+
*/
|
|
2918
|
+
prioritySetAt: string | null;
|
|
2919
|
+
|
|
2920
|
+
/**
|
|
2921
|
+
* Current state of the conversation
|
|
2922
|
+
*/
|
|
2923
|
+
state: 'open' | 'closed' | 'snoozed';
|
|
2924
|
+
|
|
2925
|
+
/**
|
|
2926
|
+
* Current tags applied anywhere in this conversation
|
|
2927
|
+
*/
|
|
2928
|
+
tags: Array<ConversationTagsAPI.ConversationTag>;
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* ID of the assigned team
|
|
2932
|
+
*/
|
|
2933
|
+
teamAssigneeId: string | null;
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* ISO timestamp when conversation was last updated
|
|
2937
|
+
*/
|
|
2938
|
+
updatedAt: string;
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* Whether we are awaiting a customer reply
|
|
2942
|
+
*/
|
|
2943
|
+
awaitingCustomerReply?: boolean;
|
|
2944
|
+
|
|
2945
|
+
/**
|
|
2946
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
2947
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
2948
|
+
*/
|
|
2949
|
+
conversationUser?: Data.ConversationUser | null;
|
|
2950
|
+
|
|
2951
|
+
/**
|
|
2952
|
+
* Plain-text / markdown preview of the matching conversation part body (search
|
|
2953
|
+
* mode only)
|
|
2954
|
+
*/
|
|
2955
|
+
matchingBodyPreviewMarkdown?: string | null;
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* Reference to the conversation part that best matched the search query (search
|
|
2959
|
+
* mode only)
|
|
2960
|
+
*/
|
|
2961
|
+
matchingPart?: Data.MatchingPart | null;
|
|
2962
|
+
|
|
2963
|
+
/**
|
|
2964
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
2965
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
2966
|
+
*/
|
|
2967
|
+
matchingPartAuthor?: Data.MatchingPartAuthor | null;
|
|
2968
|
+
|
|
2969
|
+
/**
|
|
2970
|
+
* Aggregate relevance score for the conversation (search mode only). Higher is
|
|
2971
|
+
* more relevant.
|
|
2972
|
+
*/
|
|
2973
|
+
relevanceScore?: number | null;
|
|
2974
|
+
|
|
2975
|
+
source?: Data.Source;
|
|
2976
|
+
|
|
2977
|
+
/**
|
|
2978
|
+
* Window of conversation messages around the matching part for lightweight context
|
|
2979
|
+
* previews. In search mode this is up to 15 messages before plus 15 from the
|
|
2980
|
+
* matching message onwards (sliding to first 30 / last 30 if the match is near the
|
|
2981
|
+
* conversation boundaries). In filter mode (no matching message) this falls back
|
|
2982
|
+
* to the latest 30 messages. Always capped and truncated by the server; fetch the
|
|
2983
|
+
* full conversation for complete message history.
|
|
2984
|
+
*/
|
|
2985
|
+
surroundingConversationParts?: Array<Data.SurroundingConversationPart>;
|
|
2986
|
+
|
|
2987
|
+
/**
|
|
2988
|
+
* Conversation title
|
|
2989
|
+
*/
|
|
2990
|
+
title?: string;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
export namespace Data {
|
|
2994
|
+
/**
|
|
2995
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
2996
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
2997
|
+
*/
|
|
2998
|
+
export interface ConversationUser {
|
|
2999
|
+
/**
|
|
3000
|
+
* Author id
|
|
3001
|
+
*/
|
|
3002
|
+
id: string;
|
|
3003
|
+
|
|
3004
|
+
/**
|
|
3005
|
+
* Author type
|
|
3006
|
+
*/
|
|
3007
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
|
|
3008
|
+
|
|
3009
|
+
/**
|
|
3010
|
+
* Companies the author belongs to (customers only)
|
|
3011
|
+
*/
|
|
3012
|
+
companies?: Array<ConversationUser.Company>;
|
|
3013
|
+
|
|
3014
|
+
/**
|
|
3015
|
+
* Email when known
|
|
3016
|
+
*/
|
|
3017
|
+
email?: string | null;
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
* Display name when known
|
|
3021
|
+
*/
|
|
3022
|
+
name?: string | null;
|
|
3023
|
+
|
|
3024
|
+
/**
|
|
3025
|
+
* Profile picture URL when known
|
|
3026
|
+
*/
|
|
3027
|
+
profilePicture?: string | null;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
export namespace ConversationUser {
|
|
3031
|
+
export interface Company {
|
|
3032
|
+
id: string;
|
|
3033
|
+
|
|
3034
|
+
name?: string;
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
/**
|
|
3039
|
+
* Reference to the conversation part that best matched the search query (search
|
|
3040
|
+
* mode only)
|
|
3041
|
+
*/
|
|
3042
|
+
export interface MatchingPart {
|
|
3043
|
+
/**
|
|
3044
|
+
* Conversation part id
|
|
3045
|
+
*/
|
|
3046
|
+
id: string;
|
|
3047
|
+
|
|
3048
|
+
/**
|
|
3049
|
+
* ISO timestamp when the matching part was created
|
|
3050
|
+
*/
|
|
3051
|
+
createdAt?: string | null;
|
|
3052
|
+
|
|
3053
|
+
/**
|
|
3054
|
+
* Conversation part type
|
|
3055
|
+
*/
|
|
3056
|
+
partType?: string;
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
/**
|
|
3060
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
3061
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
3062
|
+
*/
|
|
3063
|
+
export interface MatchingPartAuthor {
|
|
3064
|
+
/**
|
|
3065
|
+
* Author id
|
|
3066
|
+
*/
|
|
3067
|
+
id: string;
|
|
3068
|
+
|
|
3069
|
+
/**
|
|
3070
|
+
* Author type
|
|
3071
|
+
*/
|
|
3072
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
|
|
3073
|
+
|
|
3074
|
+
/**
|
|
3075
|
+
* Companies the author belongs to (customers only)
|
|
3076
|
+
*/
|
|
3077
|
+
companies?: Array<MatchingPartAuthor.Company>;
|
|
3078
|
+
|
|
3079
|
+
/**
|
|
3080
|
+
* Email when known
|
|
3081
|
+
*/
|
|
3082
|
+
email?: string | null;
|
|
3083
|
+
|
|
3084
|
+
/**
|
|
3085
|
+
* Display name when known
|
|
3086
|
+
*/
|
|
3087
|
+
name?: string | null;
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* Profile picture URL when known
|
|
3091
|
+
*/
|
|
3092
|
+
profilePicture?: string | null;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
export namespace MatchingPartAuthor {
|
|
3096
|
+
export interface Company {
|
|
3097
|
+
id: string;
|
|
3098
|
+
|
|
3099
|
+
name?: string;
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
export interface Source {
|
|
3104
|
+
/**
|
|
3105
|
+
* Body of the initial message as HTML with signed image URLs
|
|
3106
|
+
*/
|
|
3107
|
+
bodyHtml: string;
|
|
3108
|
+
|
|
3109
|
+
/**
|
|
3110
|
+
* Body of the initial message as markdown
|
|
3111
|
+
*/
|
|
3112
|
+
bodyMarkdown: string;
|
|
3113
|
+
|
|
3114
|
+
/**
|
|
3115
|
+
* Channel through which the conversation was initiated
|
|
3116
|
+
*/
|
|
3117
|
+
channel: 'unknown' | 'desktop' | 'android' | 'ios' | 'email';
|
|
3118
|
+
|
|
3119
|
+
author?: ConversationsAPI.ConversationParticipant;
|
|
3120
|
+
|
|
3121
|
+
/**
|
|
3122
|
+
* How the conversation was initiated
|
|
3123
|
+
*/
|
|
3124
|
+
deliveredAs?: 'customer_initiated' | 'admin_initiated';
|
|
3125
|
+
|
|
3126
|
+
/**
|
|
3127
|
+
* Subject line for email conversations
|
|
3128
|
+
*/
|
|
3129
|
+
subject?: string;
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* URL where the conversation was initiated
|
|
3133
|
+
*/
|
|
3134
|
+
url?: string;
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
export interface SurroundingConversationPart {
|
|
3138
|
+
/**
|
|
3139
|
+
* Conversation part id
|
|
3140
|
+
*/
|
|
3141
|
+
id: string;
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* Plain-text truncated preview of the part body
|
|
3145
|
+
*/
|
|
3146
|
+
previewMarkdown: string | null;
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* True when previewMarkdown was truncated by the server
|
|
3150
|
+
*/
|
|
3151
|
+
previewMarkdownTruncated: boolean;
|
|
3152
|
+
|
|
3153
|
+
/**
|
|
3154
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
3155
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
3156
|
+
*/
|
|
3157
|
+
author?: SurroundingConversationPart.Author | null;
|
|
3158
|
+
|
|
3159
|
+
/**
|
|
3160
|
+
* ISO timestamp when the part was created
|
|
3161
|
+
*/
|
|
3162
|
+
createdAt?: string | null;
|
|
3163
|
+
|
|
3164
|
+
/**
|
|
3165
|
+
* Conversation part type
|
|
3166
|
+
*/
|
|
3167
|
+
partType?: string;
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
export namespace SurroundingConversationPart {
|
|
3171
|
+
/**
|
|
3172
|
+
* The customer or lead the conversation is with. Use this for the row identity;
|
|
3173
|
+
* use `matchingPartAuthor` if you specifically want the message author.
|
|
3174
|
+
*/
|
|
3175
|
+
export interface Author {
|
|
3176
|
+
/**
|
|
3177
|
+
* Author id
|
|
3178
|
+
*/
|
|
3179
|
+
id: string;
|
|
3180
|
+
|
|
3181
|
+
/**
|
|
3182
|
+
* Author type
|
|
3183
|
+
*/
|
|
3184
|
+
type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
|
|
3185
|
+
|
|
3186
|
+
/**
|
|
3187
|
+
* Companies the author belongs to (customers only)
|
|
3188
|
+
*/
|
|
3189
|
+
companies?: Array<Author.Company>;
|
|
3190
|
+
|
|
3191
|
+
/**
|
|
3192
|
+
* Email when known
|
|
3193
|
+
*/
|
|
3194
|
+
email?: string | null;
|
|
3195
|
+
|
|
3196
|
+
/**
|
|
3197
|
+
* Display name when known
|
|
3198
|
+
*/
|
|
3199
|
+
name?: string | null;
|
|
3200
|
+
|
|
3201
|
+
/**
|
|
3202
|
+
* Profile picture URL when known
|
|
3203
|
+
*/
|
|
3204
|
+
profilePicture?: string | null;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
export namespace Author {
|
|
3208
|
+
export interface Company {
|
|
3209
|
+
id: string;
|
|
3210
|
+
|
|
3211
|
+
name?: string;
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
export interface ConversationCreateParams {
|
|
3219
|
+
/**
|
|
3220
|
+
* Body param: The content of the initial message in markdown format. Images
|
|
3221
|
+
* referenced by URL or as base64 data URIs will be automatically uploaded and
|
|
3222
|
+
* stored.
|
|
3223
|
+
*/
|
|
3224
|
+
bodyMarkdown: string;
|
|
3225
|
+
|
|
3226
|
+
/**
|
|
3227
|
+
* Body param: The author initiating the conversation. Use type "contact" for
|
|
3228
|
+
* customer/lead or "admin" for outreach.
|
|
3229
|
+
*/
|
|
3230
|
+
from: ConversationCreateParams.ContactFrom | ConversationCreateParams.AdminFrom;
|
|
3231
|
+
|
|
3232
|
+
/**
|
|
3233
|
+
* Body param: The channel for the conversation. Defaults to "desktop"
|
|
3234
|
+
* (SDK/widget).
|
|
3235
|
+
*/
|
|
3236
|
+
channel?: 'desktop' | 'email';
|
|
3237
|
+
|
|
3238
|
+
/**
|
|
3239
|
+
* Body param: The time the conversation was created as an ISO timestamp. If not
|
|
3240
|
+
* provided, the current time will be used. This field is recommended for migrating
|
|
3241
|
+
* past conversations from another source.
|
|
3242
|
+
*/
|
|
3243
|
+
createdAt?: string | null;
|
|
3244
|
+
|
|
3245
|
+
/**
|
|
3246
|
+
* Body param: Recipients for admin-initiated outreach. Required when from.type is
|
|
3247
|
+
* "admin". Specify at least one recipient in the "to" field.
|
|
3248
|
+
*/
|
|
3249
|
+
recipients?: ConversationCreateParams.Recipients;
|
|
3250
|
+
|
|
3251
|
+
/**
|
|
3252
|
+
* Body param: Subject line for the email. Required when channel is "email" and
|
|
3253
|
+
* from.type is "admin".
|
|
3254
|
+
*/
|
|
3255
|
+
subject?: string;
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
3259
|
+
* configured API version if not specified.
|
|
3260
|
+
*/
|
|
3261
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
export namespace ConversationCreateParams {
|
|
3265
|
+
/**
|
|
3266
|
+
* Conversation initiated by a contact
|
|
3267
|
+
*/
|
|
3268
|
+
export interface ContactFrom {
|
|
3269
|
+
/**
|
|
3270
|
+
* The Featurebase contact ID
|
|
3271
|
+
*/
|
|
3272
|
+
id: string;
|
|
3273
|
+
|
|
3274
|
+
/**
|
|
3275
|
+
* The type of author. Use "contact" for customer/lead initiated conversations.
|
|
3276
|
+
*/
|
|
3277
|
+
type: 'contact';
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
/**
|
|
3281
|
+
* Conversation initiated by an admin (outreach)
|
|
3282
|
+
*/
|
|
3283
|
+
export interface AdminFrom {
|
|
3284
|
+
/**
|
|
3285
|
+
* The Featurebase admin ID
|
|
3286
|
+
*/
|
|
3287
|
+
id: string;
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* The type of author. Use "admin" for admin initiated outreach conversations.
|
|
3291
|
+
*/
|
|
3292
|
+
type: 'admin';
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* Recipients for admin-initiated outreach. Required when from.type is "admin".
|
|
3297
|
+
* Specify at least one recipient in the "to" field.
|
|
3298
|
+
*/
|
|
3299
|
+
export interface Recipients {
|
|
3300
|
+
/**
|
|
3301
|
+
* Primary recipients (To field)
|
|
3302
|
+
*/
|
|
3303
|
+
to: ConversationsAPI.EmailRecipients;
|
|
3304
|
+
|
|
3305
|
+
/**
|
|
3306
|
+
* Primary recipients (To field)
|
|
3307
|
+
*/
|
|
3308
|
+
bcc?: ConversationsAPI.EmailRecipients;
|
|
3309
|
+
|
|
3310
|
+
/**
|
|
3311
|
+
* Primary recipients (To field)
|
|
3312
|
+
*/
|
|
3313
|
+
cc?: ConversationsAPI.EmailRecipients;
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
export interface ConversationRetrieveParams {
|
|
3318
|
+
/**
|
|
3319
|
+
* API version for this request. Defaults to your organization's configured API
|
|
3320
|
+
* version if not specified.
|
|
3321
|
+
*/
|
|
3322
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
export interface ConversationUpdateParams {
|
|
3326
|
+
/**
|
|
3327
|
+
* Body param: The admin ID performing this action. Changes will be attributed to
|
|
3328
|
+
* this admin. If not provided, changes are attributed to the system bot user. The
|
|
3329
|
+
* admin must be a member of the organization.
|
|
3330
|
+
*/
|
|
3331
|
+
actingAdminId?: string;
|
|
3332
|
+
|
|
3333
|
+
/**
|
|
3334
|
+
* Body param: The admin ID to assign the conversation to, or null to unassign.
|
|
3335
|
+
*/
|
|
3336
|
+
adminAssigneeId?: string | null;
|
|
3337
|
+
|
|
3338
|
+
/**
|
|
3339
|
+
* Body param: Custom attributes to set on the conversation. Uses the same
|
|
3340
|
+
* validation as v1 API.
|
|
3341
|
+
*/
|
|
3342
|
+
customAttributes?: { [key: string]: unknown };
|
|
2488
3343
|
|
|
2489
3344
|
/**
|
|
2490
3345
|
* Body param: Mark the conversation as read for specific admins and/or contacts.
|
|
@@ -2572,6 +3427,44 @@ export interface ConversationDeleteParams {
|
|
|
2572
3427
|
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
2573
3428
|
}
|
|
2574
3429
|
|
|
3430
|
+
export interface ConversationAttachTagParams {
|
|
3431
|
+
/**
|
|
3432
|
+
* Body param: Required admin ID performing this tag attachment. Must be a member
|
|
3433
|
+
* of the organization so the mutation can be attributed to a real admin actor.
|
|
3434
|
+
*/
|
|
3435
|
+
actingAdminId: string;
|
|
3436
|
+
|
|
3437
|
+
/**
|
|
3438
|
+
* Body param: The Featurebase tag ID to attach to the conversation.
|
|
3439
|
+
*/
|
|
3440
|
+
tagId: string;
|
|
3441
|
+
|
|
3442
|
+
/**
|
|
3443
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
3444
|
+
* configured API version if not specified.
|
|
3445
|
+
*/
|
|
3446
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3449
|
+
export interface ConversationDetachTagParams {
|
|
3450
|
+
/**
|
|
3451
|
+
* Path param: Conversation ID (short ID)
|
|
3452
|
+
*/
|
|
3453
|
+
id: string;
|
|
3454
|
+
|
|
3455
|
+
/**
|
|
3456
|
+
* Body param: Required admin ID performing this tag removal. Must be a member of
|
|
3457
|
+
* the organization so the mutation can be attributed to a real admin actor.
|
|
3458
|
+
*/
|
|
3459
|
+
actingAdminId: string;
|
|
3460
|
+
|
|
3461
|
+
/**
|
|
3462
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
3463
|
+
* configured API version if not specified.
|
|
3464
|
+
*/
|
|
3465
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
3466
|
+
}
|
|
3467
|
+
|
|
2575
3468
|
export interface ConversationRedactParams {
|
|
2576
3469
|
/**
|
|
2577
3470
|
* Body param: The conversation short ID that contains the part to redact
|
|
@@ -2686,7 +3579,96 @@ export declare namespace ConversationReplyParams {
|
|
|
2686
3579
|
}
|
|
2687
3580
|
}
|
|
2688
3581
|
|
|
2689
|
-
|
|
3582
|
+
export interface ConversationSearchParams {
|
|
3583
|
+
/**
|
|
3584
|
+
* Body param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
3585
|
+
* previous response to fetch the next page of results.
|
|
3586
|
+
*/
|
|
3587
|
+
cursor?: string;
|
|
3588
|
+
|
|
3589
|
+
/**
|
|
3590
|
+
* Body param: A limit on the number of objects to be returned, between 1 and 100.
|
|
3591
|
+
*/
|
|
3592
|
+
limit?: number;
|
|
3593
|
+
|
|
3594
|
+
/**
|
|
3595
|
+
* Body param: Structured filter AST. Either a single filter clause or one
|
|
3596
|
+
* top-level AND group. Use this for filtering by `state`, `tag_ids`,
|
|
3597
|
+
* `admin_assignee_id`, etc.
|
|
3598
|
+
*/
|
|
3599
|
+
query?:
|
|
3600
|
+
| ConversationSearchParams.ConversationSearchFilter
|
|
3601
|
+
| ConversationSearchParams.ConversationSearchFilterGroup;
|
|
3602
|
+
|
|
3603
|
+
/**
|
|
3604
|
+
* Body param: Plain-text full-text search across conversation messages.
|
|
3605
|
+
* Server-managed - no operators, no field selection.
|
|
3606
|
+
*/
|
|
3607
|
+
search?: string;
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* Body param: Sort direction for filter mode (ignored in search mode where results
|
|
3611
|
+
* are sorted by relevance). Defaults to last_activity_at:desc.
|
|
3612
|
+
*/
|
|
3613
|
+
sort?: 'last_activity_at:desc' | 'last_activity_at:asc';
|
|
3614
|
+
|
|
3615
|
+
/**
|
|
3616
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
3617
|
+
* configured API version if not specified.
|
|
3618
|
+
*/
|
|
3619
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
export namespace ConversationSearchParams {
|
|
3623
|
+
export interface ConversationSearchFilter {
|
|
3624
|
+
/**
|
|
3625
|
+
* Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
|
|
3626
|
+
*/
|
|
3627
|
+
field: string;
|
|
3628
|
+
|
|
3629
|
+
/**
|
|
3630
|
+
* Comparison operator
|
|
3631
|
+
*/
|
|
3632
|
+
operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '~' | '!~' | '^' | '$';
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* Value to compare against (primitive or array of primitives)
|
|
3636
|
+
*/
|
|
3637
|
+
value: string | number | boolean | Array<string | number> | null;
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
export interface ConversationSearchFilterGroup {
|
|
3641
|
+
/**
|
|
3642
|
+
* Group operator: AND (all match) or OR (any match)
|
|
3643
|
+
*/
|
|
3644
|
+
operator: 'AND' | 'OR';
|
|
3645
|
+
|
|
3646
|
+
/**
|
|
3647
|
+
* Array of filter clauses (1-15 entries)
|
|
3648
|
+
*/
|
|
3649
|
+
value: Array<ConversationSearchFilterGroup.Value>;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
export namespace ConversationSearchFilterGroup {
|
|
3653
|
+
export interface Value {
|
|
3654
|
+
/**
|
|
3655
|
+
* Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
|
|
3656
|
+
*/
|
|
3657
|
+
field: string;
|
|
3658
|
+
|
|
3659
|
+
/**
|
|
3660
|
+
* Comparison operator
|
|
3661
|
+
*/
|
|
3662
|
+
operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '~' | '!~' | '^' | '$';
|
|
3663
|
+
|
|
3664
|
+
/**
|
|
3665
|
+
* Value to compare against (primitive or array of primitives)
|
|
3666
|
+
*/
|
|
3667
|
+
value: string | number | boolean | Array<string | number> | null;
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3671
|
+
|
|
2690
3672
|
Conversations.Participants = Participants;
|
|
2691
3673
|
|
|
2692
3674
|
export declare namespace Conversations {
|
|
@@ -2701,22 +3683,20 @@ export declare namespace Conversations {
|
|
|
2701
3683
|
type CsatWorkflowLink as CsatWorkflowLink,
|
|
2702
3684
|
type EmailRecipients as EmailRecipients,
|
|
2703
3685
|
type ConversationDeleteResponse as ConversationDeleteResponse,
|
|
3686
|
+
type ConversationAttachTagResponse as ConversationAttachTagResponse,
|
|
3687
|
+
type ConversationDetachTagResponse as ConversationDetachTagResponse,
|
|
3688
|
+
type ConversationSearchResponse as ConversationSearchResponse,
|
|
2704
3689
|
type ConversationsCursorPage as ConversationsCursorPage,
|
|
2705
3690
|
type ConversationCreateParams as ConversationCreateParams,
|
|
2706
3691
|
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
2707
3692
|
type ConversationUpdateParams as ConversationUpdateParams,
|
|
2708
3693
|
type ConversationListParams as ConversationListParams,
|
|
2709
3694
|
type ConversationDeleteParams as ConversationDeleteParams,
|
|
3695
|
+
type ConversationAttachTagParams as ConversationAttachTagParams,
|
|
3696
|
+
type ConversationDetachTagParams as ConversationDetachTagParams,
|
|
2710
3697
|
type ConversationRedactParams as ConversationRedactParams,
|
|
2711
3698
|
type ConversationReplyParams as ConversationReplyParams,
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
export {
|
|
2715
|
-
Tags as Tags,
|
|
2716
|
-
type AttachedConversationTag as AttachedConversationTag,
|
|
2717
|
-
type ConversationTagMutationActor as ConversationTagMutationActor,
|
|
2718
|
-
type TagAttachParams as TagAttachParams,
|
|
2719
|
-
type TagDetachParams as TagDetachParams,
|
|
3699
|
+
type ConversationSearchParams as ConversationSearchParams,
|
|
2720
3700
|
};
|
|
2721
3701
|
|
|
2722
3702
|
export {
|