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.
Files changed (68) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +3 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/core/pagination.d.mts +15 -0
  9. package/core/pagination.d.mts.map +1 -1
  10. package/core/pagination.d.ts +15 -0
  11. package/core/pagination.d.ts.map +1 -1
  12. package/core/pagination.js +25 -1
  13. package/core/pagination.js.map +1 -1
  14. package/core/pagination.mjs +23 -0
  15. package/core/pagination.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/support/conversations/conversations.d.mts +817 -8
  18. package/resources/support/conversations/conversations.d.mts.map +1 -1
  19. package/resources/support/conversations/conversations.d.ts +817 -8
  20. package/resources/support/conversations/conversations.d.ts.map +1 -1
  21. package/resources/support/conversations/conversations.js +244 -4
  22. package/resources/support/conversations/conversations.js.map +1 -1
  23. package/resources/support/conversations/conversations.mjs +244 -4
  24. package/resources/support/conversations/conversations.mjs.map +1 -1
  25. package/resources/support/conversations/index.d.mts +1 -2
  26. package/resources/support/conversations/index.d.mts.map +1 -1
  27. package/resources/support/conversations/index.d.ts +1 -2
  28. package/resources/support/conversations/index.d.ts.map +1 -1
  29. package/resources/support/conversations/index.js +1 -3
  30. package/resources/support/conversations/index.js.map +1 -1
  31. package/resources/support/conversations/index.mjs +0 -1
  32. package/resources/support/conversations/index.mjs.map +1 -1
  33. package/resources/support/index.d.mts +1 -1
  34. package/resources/support/index.d.mts.map +1 -1
  35. package/resources/support/index.d.ts +1 -1
  36. package/resources/support/index.d.ts.map +1 -1
  37. package/resources/support/index.js.map +1 -1
  38. package/resources/support/index.mjs.map +1 -1
  39. package/resources/support/support.d.mts +2 -2
  40. package/resources/support/support.d.mts.map +1 -1
  41. package/resources/support/support.d.ts +2 -2
  42. package/resources/support/support.d.ts.map +1 -1
  43. package/resources/support/support.js.map +1 -1
  44. package/resources/support/support.mjs.map +1 -1
  45. package/src/client.ts +13 -1
  46. package/src/core/pagination.ts +49 -0
  47. package/src/resources/support/conversations/conversations.ts +1068 -88
  48. package/src/resources/support/conversations/index.ts +6 -7
  49. package/src/resources/support/index.ts +6 -0
  50. package/src/resources/support/support.ts +12 -0
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.mts.map +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.d.ts.map +1 -1
  56. package/version.js +1 -1
  57. package/version.js.map +1 -1
  58. package/version.mjs +1 -1
  59. package/version.mjs.map +1 -1
  60. package/resources/support/conversations/tags.d.mts +0 -200
  61. package/resources/support/conversations/tags.d.mts.map +0 -1
  62. package/resources/support/conversations/tags.d.ts +0 -200
  63. package/resources/support/conversations/tags.d.ts.map +0 -1
  64. package/resources/support/conversations/tags.js +0 -146
  65. package/resources/support/conversations/tags.js.map +0 -1
  66. package/resources/support/conversations/tags.mjs +0 -142
  67. package/resources/support/conversations/tags.mjs.map +0 -1
  68. package/src/resources/support/conversations/tags.ts +0 -260
@@ -3,8 +3,6 @@ import * as ConversationsAPI from "./conversations.mjs";
3
3
  import * as ConversationTagsAPI from "../conversation-tags.mjs";
4
4
  import * as ParticipantsAPI from "./participants.mjs";
5
5
  import { ParticipantAddParams, ParticipantRemoveParams, Participants } from "./participants.mjs";
6
- import * as TagsAPI from "./tags.mjs";
7
- import { AttachedConversationTag, ConversationTagMutationActor, TagAttachParams, TagDetachParams, Tags } from "./tags.mjs";
8
6
  import { APIPromise } from "../../../core/api-promise.mjs";
9
7
  import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
10
8
  import { RequestOptions } from "../../../internal/request-options.mjs";
@@ -12,7 +10,6 @@ import { RequestOptions } from "../../../internal/request-options.mjs";
12
10
  * Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
13
11
  */
14
12
  export declare class Conversations extends APIResource {
15
- tags: TagsAPI.Tags;
16
13
  participants: ParticipantsAPI.Participants;
17
14
  /**
18
15
  * Creates a new conversation. Supports both contact-initiated (customer/lead) and
@@ -487,6 +484,110 @@ export declare class Conversations extends APIResource {
487
484
  * ```
488
485
  */
489
486
  delete(id: string, params?: ConversationDeleteParams | null | undefined, options?: RequestOptions): APIPromise<ConversationDeleteResponse>;
487
+ /**
488
+ * Attaches a workspace tag to a conversation.
489
+ *
490
+ * This endpoint requires both the tag ID to attach and the `actingAdminId` of the
491
+ * admin on whose behalf the mutation is recorded.
492
+ *
493
+ * ### Path Parameters
494
+ *
495
+ * - `id` - The conversation ID (short ID)
496
+ *
497
+ * ### Request Body
498
+ *
499
+ * | Field | Type | Required | Description |
500
+ * | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
501
+ * | `tagId` | string | Yes | The Featurebase tag ID to attach |
502
+ * | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
503
+ *
504
+ * ### Behavior
505
+ *
506
+ * Featurebase resolves the latest taggable reply/message in the conversation and
507
+ * records the tag attachment against that part so audit metadata remains
508
+ * deterministic.
509
+ *
510
+ * ### Response
511
+ *
512
+ * Returns the affected tag plus attachment metadata such as `targetPartId`,
513
+ * `appliedAt`, and `appliedBy`.
514
+ *
515
+ * ### Example Request
516
+ *
517
+ * ```json
518
+ * {
519
+ * "tagId": "67ec1234abcd5678ef901234",
520
+ * "actingAdminId": "507f1f77bcf86cd799439011"
521
+ * }
522
+ * ```
523
+ *
524
+ * ### Version Availability
525
+ *
526
+ * This endpoint is only available in API version 2026-01-01.nova and newer.
527
+ *
528
+ * @example
529
+ * ```ts
530
+ * const response =
531
+ * await client.support.conversations.attachTag('12345', {
532
+ * actingAdminId: '507f1f77bcf86cd799439011',
533
+ * tagId: '67ec1234abcd5678ef901234',
534
+ * });
535
+ * ```
536
+ */
537
+ attachTag(id: string, params: ConversationAttachTagParams, options?: RequestOptions): APIPromise<ConversationAttachTagResponse>;
538
+ /**
539
+ * Removes a workspace tag from a conversation.
540
+ *
541
+ * This endpoint requires the `actingAdminId` of the admin on whose behalf the
542
+ * mutation is recorded.
543
+ *
544
+ * ### Path Parameters
545
+ *
546
+ * - `id` - The conversation ID (short ID)
547
+ * - `tagId` - The Featurebase tag ID to remove
548
+ *
549
+ * ### Request Body
550
+ *
551
+ * | Field | Type | Required | Description |
552
+ * | --------------- | ------ | -------- | ------------------------------------------------------------------------ |
553
+ * | `actingAdminId` | string | Yes | The admin performing the mutation. Must be a member of the organization. |
554
+ *
555
+ * ### Behavior
556
+ *
557
+ * Featurebase resolves the latest taggable reply/message in the conversation and
558
+ * records the tag removal against that part so audit metadata remains
559
+ * deterministic.
560
+ *
561
+ * ### Response
562
+ *
563
+ * Returns the affected tag payload with the most relevant attachment metadata
564
+ * available for that relationship.
565
+ *
566
+ * ### Example Request
567
+ *
568
+ * ```json
569
+ * {
570
+ * "actingAdminId": "507f1f77bcf86cd799439011"
571
+ * }
572
+ * ```
573
+ *
574
+ * ### Version Availability
575
+ *
576
+ * This endpoint is only available in API version 2026-01-01.nova and newer.
577
+ *
578
+ * @example
579
+ * ```ts
580
+ * const response =
581
+ * await client.support.conversations.detachTag(
582
+ * '67ec1234abcd5678ef901234',
583
+ * {
584
+ * id: '12345',
585
+ * actingAdminId: '507f1f77bcf86cd799439011',
586
+ * },
587
+ * );
588
+ * ```
589
+ */
590
+ detachTag(tagID: string, params: ConversationDetachTagParams, options?: RequestOptions): APIPromise<ConversationDetachTagResponse>;
490
591
  /**
491
592
  * Redacts a conversation part (message) from a conversation. Redaction permanently
492
593
  * removes the message content while preserving the conversation structure.
@@ -676,6 +777,104 @@ export declare class Conversations extends APIResource {
676
777
  * ```
677
778
  */
678
779
  reply(id: string, params: ConversationReplyParams, options?: RequestOptions): APIPromise<ConversationPart>;
780
+ /**
781
+ * Search conversations with a structured filter AST and an optional full-text
782
+ * query.
783
+ *
784
+ * The endpoint has two modes that are picked automatically from the body:
785
+ *
786
+ * - **Filter mode** (`query` set, `search` omitted): structured filtering against
787
+ * indexed conversation fields. Sorted by `lastActivityAt` desc by default; set
788
+ * `sort` to `last_activity_at:asc` for the inverse.
789
+ * - **Search mode** (`search` set, `query` optional): full-text search across
790
+ * conversation messages, then narrowed by the same `query` AST so the same
791
+ * filters apply. Results are ranked by relevance.
792
+ *
793
+ * ### Structured query AST
794
+ *
795
+ * Each clause has the shape `{ field, operator, value }`. You can pass a single
796
+ * clause or wrap up to 15 in a top-level `AND` group:
797
+ *
798
+ * ```json
799
+ * {
800
+ * "query": {
801
+ * "operator": "AND",
802
+ * "value": [
803
+ * { "field": "state", "operator": "=", "value": "open" },
804
+ * {
805
+ * "field": "admin_assignee_id",
806
+ * "operator": "=",
807
+ * "value": "507f1f77bcf86cd799439011"
808
+ * }
809
+ * ]
810
+ * }
811
+ * }
812
+ * ```
813
+ *
814
+ * Top-level `OR` groups and nested groups are not supported in this version.
815
+ *
816
+ * ### Supported fields and operators
817
+ *
818
+ * | Field | Type | Operators |
819
+ * | ---------------------------- | --------------------------------------------------------------------------- | ---------------------- |
820
+ * | `state` | enum (`open` / `closed` / `snoozed`) | `=`, `!=`, `IN`, `NIN` |
821
+ * | `priority` | boolean | `=`, `!=` |
822
+ * | `admin_assignee_id` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
823
+ * | `team_assignee_id` | id or null (unassigned) | `=`, `!=`, `IN`, `NIN` |
824
+ * | `brand_id` | id or null | `=`, `!=`, `IN`, `NIN` |
825
+ * | `tag_ids` | id (matches any conversation containing this tag) | `=`, `!=`, `IN`, `NIN` |
826
+ * | `user_id` / `participant_id` | id of a conversation participant | `=`, `!=`, `IN`, `NIN` |
827
+ * | `company_id` | company id (matches conversations whose participants belong to the company) | `=`, `!=`, `IN`, `NIN` |
828
+ * | `mentioned_admin_ids` | admin id | `=`, `!=`, `IN`, `NIN` |
829
+ * | `created_at` | unix seconds | `=`, `>`, `<` |
830
+ *
831
+ * For unbounded fields a query consisting only of `!=` or `NIN` clauses is
832
+ * rejected with `query_too_broad` to prevent full-org scans. Combine the negation
833
+ * with at least one positive clause (`=`, `IN`, `>`, `<`) instead. Bounded enum
834
+ * fields (`state`, `priority`) are exempt because their negation is naturally
835
+ * bounded.
836
+ *
837
+ * ### Pagination
838
+ *
839
+ * Cursor-based, `limit` between 1 and 100 (default 10). Pagination cursors are
840
+ * mode-specific - reusing a filter-mode cursor in search mode (or vice versa)
841
+ * returns `400`. `totalCount` is approximate and capped at 1000;
842
+ * `totalCountCapped` is `true` when the real count may be higher.
843
+ *
844
+ * ### Response
845
+ *
846
+ * Returns a slim conversation row optimised for inbox / list rendering - just the
847
+ * fields you need to render a row and link to the conversation. Fetch the full
848
+ * conversation via `GET /v2/conversations/{id}` when the user opens one.
849
+ *
850
+ * Search-specific additions on each row:
851
+ *
852
+ * - `conversationUser` - the customer / lead the conversation is with. Use this
853
+ * for the row identity.
854
+ * - `surroundingConversationParts` - context window of human messages around the
855
+ * matched message (≈15 before + 15 from the match onwards in search mode,
856
+ * sliding to first / last 30 if the match is near the conversation boundaries;
857
+ * falls back to the latest 30 messages in filter mode). Each `previewMarkdown`
858
+ * value is truncated server-side; fetch the full conversation for complete
859
+ * history and full bodies.
860
+ * - `matchingPartAuthor` - author of the specific message that matched the search
861
+ * query (search mode only). May be a teammate or bot.
862
+ * - `matchingPart` - reference to the matched message (search mode only).
863
+ * - `matchingBodyPreviewMarkdown` - plain-text / markdown preview of the matched
864
+ * body (search mode only).
865
+ * - `relevanceScore` - aggregate score (search mode only).
866
+ *
867
+ * ### Version Availability
868
+ *
869
+ * This endpoint is only available in API version 2026-01-01.nova and newer.
870
+ *
871
+ * @example
872
+ * ```ts
873
+ * const response =
874
+ * await client.support.conversations.search();
875
+ * ```
876
+ */
877
+ search(params: ConversationSearchParams, options?: RequestOptions): APIPromise<ConversationSearchResponse>;
679
878
  }
680
879
  export type ConversationsCursorPage = CursorPage<Conversation>;
681
880
  export interface Conversation {
@@ -1653,7 +1852,7 @@ export declare namespace ConversationPart {
1653
1852
  /**
1654
1853
  * Actor that applied the tag
1655
1854
  */
1656
- actor?: TagsAPI.ConversationTagMutationActor;
1855
+ actor?: TagUpdate.Actor;
1657
1856
  /**
1658
1857
  * Tag name at the time of the event or the best available current display name
1659
1858
  */
@@ -1663,6 +1862,25 @@ export declare namespace ConversationPart {
1663
1862
  */
1664
1863
  targetPartId?: string | null;
1665
1864
  }
1865
+ namespace TagUpdate {
1866
+ /**
1867
+ * Actor that applied the tag
1868
+ */
1869
+ interface Actor {
1870
+ /**
1871
+ * Actor that caused the tag mutation
1872
+ */
1873
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
1874
+ /**
1875
+ * Actor identifier when available
1876
+ */
1877
+ id?: string | null;
1878
+ /**
1879
+ * Actor display name when available
1880
+ */
1881
+ name?: string | null;
1882
+ }
1883
+ }
1666
1884
  /**
1667
1885
  * Represents a workflow wait start, finish, or interruption in the conversation
1668
1886
  * thread
@@ -1842,7 +2060,7 @@ export interface ConversationTagApplication {
1842
2060
  /**
1843
2061
  * Actor that applied the tag
1844
2062
  */
1845
- appliedBy?: TagsAPI.ConversationTagMutationActor;
2063
+ appliedBy?: ConversationTagApplication.AppliedBy;
1846
2064
  /**
1847
2065
  * ISO timestamp when the tag was removed from this reply, if it was removed
1848
2066
  */
@@ -1850,12 +2068,48 @@ export interface ConversationTagApplication {
1850
2068
  /**
1851
2069
  * Actor that applied the tag
1852
2070
  */
1853
- removedBy?: TagsAPI.ConversationTagMutationActor;
2071
+ removedBy?: ConversationTagApplication.RemovedBy;
1854
2072
  /**
1855
2073
  * Resolved tag object when the tag still exists in the shared workspace catalog
1856
2074
  */
1857
2075
  tag?: ConversationTagsAPI.ConversationTag;
1858
2076
  }
2077
+ export declare namespace ConversationTagApplication {
2078
+ /**
2079
+ * Actor that applied the tag
2080
+ */
2081
+ interface AppliedBy {
2082
+ /**
2083
+ * Actor that caused the tag mutation
2084
+ */
2085
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2086
+ /**
2087
+ * Actor identifier when available
2088
+ */
2089
+ id?: string | null;
2090
+ /**
2091
+ * Actor display name when available
2092
+ */
2093
+ name?: string | null;
2094
+ }
2095
+ /**
2096
+ * Actor that applied the tag
2097
+ */
2098
+ interface RemovedBy {
2099
+ /**
2100
+ * Actor that caused the tag mutation
2101
+ */
2102
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2103
+ /**
2104
+ * Actor identifier when available
2105
+ */
2106
+ id?: string | null;
2107
+ /**
2108
+ * Actor display name when available
2109
+ */
2110
+ name?: string | null;
2111
+ }
2112
+ }
1859
2113
  export interface CsatEmailDelivery {
1860
2114
  /**
1861
2115
  * Email delivery status for the CSAT request when applicable
@@ -1933,6 +2187,456 @@ export interface ConversationDeleteResponse {
1933
2187
  */
1934
2188
  object: 'conversation';
1935
2189
  }
2190
+ export interface ConversationAttachTagResponse {
2191
+ /**
2192
+ * Unique tag identifier
2193
+ */
2194
+ id: string;
2195
+ /**
2196
+ * Current tag name
2197
+ */
2198
+ name: string;
2199
+ /**
2200
+ * Object type identifier for a tag
2201
+ */
2202
+ type: 'tag';
2203
+ /**
2204
+ * ISO timestamp when the tag was applied
2205
+ */
2206
+ appliedAt?: string | null;
2207
+ /**
2208
+ * Actor that applied the tag
2209
+ */
2210
+ appliedBy?: ConversationAttachTagResponse.AppliedBy | null;
2211
+ /**
2212
+ * ISO timestamp when the tag was removed, if applicable
2213
+ */
2214
+ removedAt?: string | null;
2215
+ /**
2216
+ * Actor that applied the tag
2217
+ */
2218
+ removedBy?: ConversationAttachTagResponse.RemovedBy | null;
2219
+ /**
2220
+ * Reply/message ID used as the deterministic attachment target for this
2221
+ * conversation tag mutation.
2222
+ */
2223
+ targetPartId?: string | null;
2224
+ }
2225
+ export declare namespace ConversationAttachTagResponse {
2226
+ /**
2227
+ * Actor that applied the tag
2228
+ */
2229
+ interface AppliedBy {
2230
+ /**
2231
+ * Actor that caused the tag mutation
2232
+ */
2233
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2234
+ /**
2235
+ * Actor identifier when available
2236
+ */
2237
+ id?: string | null;
2238
+ /**
2239
+ * Actor display name when available
2240
+ */
2241
+ name?: string | null;
2242
+ }
2243
+ /**
2244
+ * Actor that applied the tag
2245
+ */
2246
+ interface RemovedBy {
2247
+ /**
2248
+ * Actor that caused the tag mutation
2249
+ */
2250
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2251
+ /**
2252
+ * Actor identifier when available
2253
+ */
2254
+ id?: string | null;
2255
+ /**
2256
+ * Actor display name when available
2257
+ */
2258
+ name?: string | null;
2259
+ }
2260
+ }
2261
+ export interface ConversationDetachTagResponse {
2262
+ /**
2263
+ * Unique tag identifier
2264
+ */
2265
+ id: string;
2266
+ /**
2267
+ * Current tag name
2268
+ */
2269
+ name: string;
2270
+ /**
2271
+ * Object type identifier for a tag
2272
+ */
2273
+ type: 'tag';
2274
+ /**
2275
+ * ISO timestamp when the tag was applied
2276
+ */
2277
+ appliedAt?: string | null;
2278
+ /**
2279
+ * Actor that applied the tag
2280
+ */
2281
+ appliedBy?: ConversationDetachTagResponse.AppliedBy | null;
2282
+ /**
2283
+ * ISO timestamp when the tag was removed, if applicable
2284
+ */
2285
+ removedAt?: string | null;
2286
+ /**
2287
+ * Actor that applied the tag
2288
+ */
2289
+ removedBy?: ConversationDetachTagResponse.RemovedBy | null;
2290
+ /**
2291
+ * Reply/message ID used as the deterministic attachment target for this
2292
+ * conversation tag mutation.
2293
+ */
2294
+ targetPartId?: string | null;
2295
+ }
2296
+ export declare namespace ConversationDetachTagResponse {
2297
+ /**
2298
+ * Actor that applied the tag
2299
+ */
2300
+ interface AppliedBy {
2301
+ /**
2302
+ * Actor that caused the tag mutation
2303
+ */
2304
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2305
+ /**
2306
+ * Actor identifier when available
2307
+ */
2308
+ id?: string | null;
2309
+ /**
2310
+ * Actor display name when available
2311
+ */
2312
+ name?: string | null;
2313
+ }
2314
+ /**
2315
+ * Actor that applied the tag
2316
+ */
2317
+ interface RemovedBy {
2318
+ /**
2319
+ * Actor that caused the tag mutation
2320
+ */
2321
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'integration' | 'system' | 'workflow';
2322
+ /**
2323
+ * Actor identifier when available
2324
+ */
2325
+ id?: string | null;
2326
+ /**
2327
+ * Actor display name when available
2328
+ */
2329
+ name?: string | null;
2330
+ }
2331
+ }
2332
+ export interface ConversationSearchResponse {
2333
+ /**
2334
+ * Array of search results
2335
+ */
2336
+ data: Array<ConversationSearchResponse.Data>;
2337
+ /**
2338
+ * Cursor for fetching the next page (null if no more results)
2339
+ */
2340
+ nextCursor: string | null;
2341
+ /**
2342
+ * Object type identifier
2343
+ */
2344
+ object: 'list';
2345
+ /**
2346
+ * Total number of conversations matching the query, capped at 200. When the actual
2347
+ * total is at or above the cap, `totalCountCapped` is true and the value is
2348
+ * exactly the cap.
2349
+ */
2350
+ totalCount?: number;
2351
+ /**
2352
+ * True when totalCount is exactly the cap and the real count is `>= totalCount`.
2353
+ * UI may render as "200+".
2354
+ */
2355
+ totalCountCapped?: boolean;
2356
+ }
2357
+ export declare namespace ConversationSearchResponse {
2358
+ interface Data {
2359
+ /**
2360
+ * Unique conversation identifier
2361
+ */
2362
+ id: string;
2363
+ /**
2364
+ * ID of the assigned admin
2365
+ */
2366
+ adminAssigneeId: string | null;
2367
+ /**
2368
+ * ID of the brand associated with this conversation
2369
+ */
2370
+ brandId: string | null;
2371
+ /**
2372
+ * ISO timestamp when conversation was created
2373
+ */
2374
+ createdAt: string;
2375
+ /**
2376
+ * ISO timestamp of last activity
2377
+ */
2378
+ lastActivityAt: string | null;
2379
+ /**
2380
+ * Object type identifier
2381
+ */
2382
+ object: 'conversation';
2383
+ /**
2384
+ * Participants in this conversation
2385
+ */
2386
+ participants: Array<ConversationsAPI.ConversationParticipant>;
2387
+ /**
2388
+ * Whether this conversation is marked as priority
2389
+ */
2390
+ priority: boolean;
2391
+ /**
2392
+ * ISO timestamp when priority was set
2393
+ */
2394
+ prioritySetAt: string | null;
2395
+ /**
2396
+ * Current state of the conversation
2397
+ */
2398
+ state: 'open' | 'closed' | 'snoozed';
2399
+ /**
2400
+ * Current tags applied anywhere in this conversation
2401
+ */
2402
+ tags: Array<ConversationTagsAPI.ConversationTag>;
2403
+ /**
2404
+ * ID of the assigned team
2405
+ */
2406
+ teamAssigneeId: string | null;
2407
+ /**
2408
+ * ISO timestamp when conversation was last updated
2409
+ */
2410
+ updatedAt: string;
2411
+ /**
2412
+ * Whether we are awaiting a customer reply
2413
+ */
2414
+ awaitingCustomerReply?: boolean;
2415
+ /**
2416
+ * The customer or lead the conversation is with. Use this for the row identity;
2417
+ * use `matchingPartAuthor` if you specifically want the message author.
2418
+ */
2419
+ conversationUser?: Data.ConversationUser | null;
2420
+ /**
2421
+ * Plain-text / markdown preview of the matching conversation part body (search
2422
+ * mode only)
2423
+ */
2424
+ matchingBodyPreviewMarkdown?: string | null;
2425
+ /**
2426
+ * Reference to the conversation part that best matched the search query (search
2427
+ * mode only)
2428
+ */
2429
+ matchingPart?: Data.MatchingPart | null;
2430
+ /**
2431
+ * The customer or lead the conversation is with. Use this for the row identity;
2432
+ * use `matchingPartAuthor` if you specifically want the message author.
2433
+ */
2434
+ matchingPartAuthor?: Data.MatchingPartAuthor | null;
2435
+ /**
2436
+ * Aggregate relevance score for the conversation (search mode only). Higher is
2437
+ * more relevant.
2438
+ */
2439
+ relevanceScore?: number | null;
2440
+ source?: Data.Source;
2441
+ /**
2442
+ * Window of conversation messages around the matching part for lightweight context
2443
+ * previews. In search mode this is up to 15 messages before plus 15 from the
2444
+ * matching message onwards (sliding to first 30 / last 30 if the match is near the
2445
+ * conversation boundaries). In filter mode (no matching message) this falls back
2446
+ * to the latest 30 messages. Always capped and truncated by the server; fetch the
2447
+ * full conversation for complete message history.
2448
+ */
2449
+ surroundingConversationParts?: Array<Data.SurroundingConversationPart>;
2450
+ /**
2451
+ * Conversation title
2452
+ */
2453
+ title?: string;
2454
+ }
2455
+ namespace Data {
2456
+ /**
2457
+ * The customer or lead the conversation is with. Use this for the row identity;
2458
+ * use `matchingPartAuthor` if you specifically want the message author.
2459
+ */
2460
+ interface ConversationUser {
2461
+ /**
2462
+ * Author id
2463
+ */
2464
+ id: string;
2465
+ /**
2466
+ * Author type
2467
+ */
2468
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
2469
+ /**
2470
+ * Companies the author belongs to (customers only)
2471
+ */
2472
+ companies?: Array<ConversationUser.Company>;
2473
+ /**
2474
+ * Email when known
2475
+ */
2476
+ email?: string | null;
2477
+ /**
2478
+ * Display name when known
2479
+ */
2480
+ name?: string | null;
2481
+ /**
2482
+ * Profile picture URL when known
2483
+ */
2484
+ profilePicture?: string | null;
2485
+ }
2486
+ namespace ConversationUser {
2487
+ interface Company {
2488
+ id: string;
2489
+ name?: string;
2490
+ }
2491
+ }
2492
+ /**
2493
+ * Reference to the conversation part that best matched the search query (search
2494
+ * mode only)
2495
+ */
2496
+ interface MatchingPart {
2497
+ /**
2498
+ * Conversation part id
2499
+ */
2500
+ id: string;
2501
+ /**
2502
+ * ISO timestamp when the matching part was created
2503
+ */
2504
+ createdAt?: string | null;
2505
+ /**
2506
+ * Conversation part type
2507
+ */
2508
+ partType?: string;
2509
+ }
2510
+ /**
2511
+ * The customer or lead the conversation is with. Use this for the row identity;
2512
+ * use `matchingPartAuthor` if you specifically want the message author.
2513
+ */
2514
+ interface MatchingPartAuthor {
2515
+ /**
2516
+ * Author id
2517
+ */
2518
+ id: string;
2519
+ /**
2520
+ * Author type
2521
+ */
2522
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
2523
+ /**
2524
+ * Companies the author belongs to (customers only)
2525
+ */
2526
+ companies?: Array<MatchingPartAuthor.Company>;
2527
+ /**
2528
+ * Email when known
2529
+ */
2530
+ email?: string | null;
2531
+ /**
2532
+ * Display name when known
2533
+ */
2534
+ name?: string | null;
2535
+ /**
2536
+ * Profile picture URL when known
2537
+ */
2538
+ profilePicture?: string | null;
2539
+ }
2540
+ namespace MatchingPartAuthor {
2541
+ interface Company {
2542
+ id: string;
2543
+ name?: string;
2544
+ }
2545
+ }
2546
+ interface Source {
2547
+ /**
2548
+ * Body of the initial message as HTML with signed image URLs
2549
+ */
2550
+ bodyHtml: string;
2551
+ /**
2552
+ * Body of the initial message as markdown
2553
+ */
2554
+ bodyMarkdown: string;
2555
+ /**
2556
+ * Channel through which the conversation was initiated
2557
+ */
2558
+ channel: 'unknown' | 'desktop' | 'android' | 'ios' | 'email';
2559
+ author?: ConversationsAPI.ConversationParticipant;
2560
+ /**
2561
+ * How the conversation was initiated
2562
+ */
2563
+ deliveredAs?: 'customer_initiated' | 'admin_initiated';
2564
+ /**
2565
+ * Subject line for email conversations
2566
+ */
2567
+ subject?: string;
2568
+ /**
2569
+ * URL where the conversation was initiated
2570
+ */
2571
+ url?: string;
2572
+ }
2573
+ interface SurroundingConversationPart {
2574
+ /**
2575
+ * Conversation part id
2576
+ */
2577
+ id: string;
2578
+ /**
2579
+ * Plain-text truncated preview of the part body
2580
+ */
2581
+ previewMarkdown: string | null;
2582
+ /**
2583
+ * True when previewMarkdown was truncated by the server
2584
+ */
2585
+ previewMarkdownTruncated: boolean;
2586
+ /**
2587
+ * The customer or lead the conversation is with. Use this for the row identity;
2588
+ * use `matchingPartAuthor` if you specifically want the message author.
2589
+ */
2590
+ author?: SurroundingConversationPart.Author | null;
2591
+ /**
2592
+ * ISO timestamp when the part was created
2593
+ */
2594
+ createdAt?: string | null;
2595
+ /**
2596
+ * Conversation part type
2597
+ */
2598
+ partType?: string;
2599
+ }
2600
+ namespace SurroundingConversationPart {
2601
+ /**
2602
+ * The customer or lead the conversation is with. Use this for the row identity;
2603
+ * use `matchingPartAuthor` if you specifically want the message author.
2604
+ */
2605
+ interface Author {
2606
+ /**
2607
+ * Author id
2608
+ */
2609
+ id: string;
2610
+ /**
2611
+ * Author type
2612
+ */
2613
+ type: 'admin' | 'customer' | 'lead' | 'bot' | 'guest' | 'integration';
2614
+ /**
2615
+ * Companies the author belongs to (customers only)
2616
+ */
2617
+ companies?: Array<Author.Company>;
2618
+ /**
2619
+ * Email when known
2620
+ */
2621
+ email?: string | null;
2622
+ /**
2623
+ * Display name when known
2624
+ */
2625
+ name?: string | null;
2626
+ /**
2627
+ * Profile picture URL when known
2628
+ */
2629
+ profilePicture?: string | null;
2630
+ }
2631
+ namespace Author {
2632
+ interface Company {
2633
+ id: string;
2634
+ name?: string;
2635
+ }
2636
+ }
2637
+ }
2638
+ }
2639
+ }
1936
2640
  export interface ConversationCreateParams {
1937
2641
  /**
1938
2642
  * Body param: The content of the initial message in markdown format. Images
@@ -2116,6 +2820,38 @@ export interface ConversationDeleteParams {
2116
2820
  */
2117
2821
  'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
2118
2822
  }
2823
+ export interface ConversationAttachTagParams {
2824
+ /**
2825
+ * Body param: Required admin ID performing this tag attachment. Must be a member
2826
+ * of the organization so the mutation can be attributed to a real admin actor.
2827
+ */
2828
+ actingAdminId: string;
2829
+ /**
2830
+ * Body param: The Featurebase tag ID to attach to the conversation.
2831
+ */
2832
+ tagId: string;
2833
+ /**
2834
+ * Header param: API version for this request. Defaults to your organization's
2835
+ * configured API version if not specified.
2836
+ */
2837
+ 'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
2838
+ }
2839
+ export interface ConversationDetachTagParams {
2840
+ /**
2841
+ * Path param: Conversation ID (short ID)
2842
+ */
2843
+ id: string;
2844
+ /**
2845
+ * Body param: Required admin ID performing this tag removal. Must be a member of
2846
+ * the organization so the mutation can be attributed to a real admin actor.
2847
+ */
2848
+ actingAdminId: string;
2849
+ /**
2850
+ * Header param: API version for this request. Defaults to your organization's
2851
+ * configured API version if not specified.
2852
+ */
2853
+ 'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
2854
+ }
2119
2855
  export interface ConversationRedactParams {
2120
2856
  /**
2121
2857
  * Body param: The conversation short ID that contains the part to redact
@@ -2209,9 +2945,82 @@ export declare namespace ConversationReplyParams {
2209
2945
  'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
2210
2946
  }
2211
2947
  }
2948
+ export interface ConversationSearchParams {
2949
+ /**
2950
+ * Body param: An opaque cursor for pagination. Use the nextCursor value from a
2951
+ * previous response to fetch the next page of results.
2952
+ */
2953
+ cursor?: string;
2954
+ /**
2955
+ * Body param: A limit on the number of objects to be returned, between 1 and 100.
2956
+ */
2957
+ limit?: number;
2958
+ /**
2959
+ * Body param: Structured filter AST. Either a single filter clause or one
2960
+ * top-level AND group. Use this for filtering by `state`, `tag_ids`,
2961
+ * `admin_assignee_id`, etc.
2962
+ */
2963
+ query?: ConversationSearchParams.ConversationSearchFilter | ConversationSearchParams.ConversationSearchFilterGroup;
2964
+ /**
2965
+ * Body param: Plain-text full-text search across conversation messages.
2966
+ * Server-managed - no operators, no field selection.
2967
+ */
2968
+ search?: string;
2969
+ /**
2970
+ * Body param: Sort direction for filter mode (ignored in search mode where results
2971
+ * are sorted by relevance). Defaults to last_activity_at:desc.
2972
+ */
2973
+ sort?: 'last_activity_at:desc' | 'last_activity_at:asc';
2974
+ /**
2975
+ * Header param: API version for this request. Defaults to your organization's
2976
+ * configured API version if not specified.
2977
+ */
2978
+ 'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
2979
+ }
2980
+ export declare namespace ConversationSearchParams {
2981
+ interface ConversationSearchFilter {
2982
+ /**
2983
+ * Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
2984
+ */
2985
+ field: string;
2986
+ /**
2987
+ * Comparison operator
2988
+ */
2989
+ operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '~' | '!~' | '^' | '$';
2990
+ /**
2991
+ * Value to compare against (primitive or array of primitives)
2992
+ */
2993
+ value: string | number | boolean | Array<string | number> | null;
2994
+ }
2995
+ interface ConversationSearchFilterGroup {
2996
+ /**
2997
+ * Group operator: AND (all match) or OR (any match)
2998
+ */
2999
+ operator: 'AND' | 'OR';
3000
+ /**
3001
+ * Array of filter clauses (1-15 entries)
3002
+ */
3003
+ value: Array<ConversationSearchFilterGroup.Value>;
3004
+ }
3005
+ namespace ConversationSearchFilterGroup {
3006
+ interface Value {
3007
+ /**
3008
+ * Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
3009
+ */
3010
+ field: string;
3011
+ /**
3012
+ * Comparison operator
3013
+ */
3014
+ operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '~' | '!~' | '^' | '$';
3015
+ /**
3016
+ * Value to compare against (primitive or array of primitives)
3017
+ */
3018
+ value: string | number | boolean | Array<string | number> | null;
3019
+ }
3020
+ }
3021
+ }
2212
3022
  export declare namespace Conversations {
2213
- export { type Conversation as Conversation, type ConversationPart as ConversationPart, type ConversationPartAuthor as ConversationPartAuthor, type ConversationParticipant as ConversationParticipant, type ConversationTagApplication as ConversationTagApplication, type CsatEmailDelivery as CsatEmailDelivery, type CsatRatedAgent as CsatRatedAgent, type CsatWorkflowLink as CsatWorkflowLink, type EmailRecipients as EmailRecipients, type ConversationDeleteResponse as ConversationDeleteResponse, type ConversationsCursorPage as ConversationsCursorPage, type ConversationCreateParams as ConversationCreateParams, type ConversationRetrieveParams as ConversationRetrieveParams, type ConversationUpdateParams as ConversationUpdateParams, type ConversationListParams as ConversationListParams, type ConversationDeleteParams as ConversationDeleteParams, type ConversationRedactParams as ConversationRedactParams, type ConversationReplyParams as ConversationReplyParams, };
2214
- export { Tags as Tags, type AttachedConversationTag as AttachedConversationTag, type ConversationTagMutationActor as ConversationTagMutationActor, type TagAttachParams as TagAttachParams, type TagDetachParams as TagDetachParams, };
3023
+ export { type Conversation as Conversation, type ConversationPart as ConversationPart, type ConversationPartAuthor as ConversationPartAuthor, type ConversationParticipant as ConversationParticipant, type ConversationTagApplication as ConversationTagApplication, type CsatEmailDelivery as CsatEmailDelivery, type CsatRatedAgent as CsatRatedAgent, type CsatWorkflowLink as CsatWorkflowLink, type EmailRecipients as EmailRecipients, type ConversationDeleteResponse as ConversationDeleteResponse, type ConversationAttachTagResponse as ConversationAttachTagResponse, type ConversationDetachTagResponse as ConversationDetachTagResponse, type ConversationSearchResponse as ConversationSearchResponse, type ConversationsCursorPage as ConversationsCursorPage, type ConversationCreateParams as ConversationCreateParams, type ConversationRetrieveParams as ConversationRetrieveParams, type ConversationUpdateParams as ConversationUpdateParams, type ConversationListParams as ConversationListParams, type ConversationDeleteParams as ConversationDeleteParams, type ConversationAttachTagParams as ConversationAttachTagParams, type ConversationDetachTagParams as ConversationDetachTagParams, type ConversationRedactParams as ConversationRedactParams, type ConversationReplyParams as ConversationReplyParams, type ConversationSearchParams as ConversationSearchParams, };
2215
3024
  export { Participants as Participants, type ParticipantAddParams as ParticipantAddParams, type ParticipantRemoveParams as ParticipantRemoveParams, };
2216
3025
  }
2217
3026
  //# sourceMappingURL=conversations.d.mts.map