@relaymessenger/mcp 0.1.7-staging.3 → 0.1.7-staging.30
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/README.md +20 -0
- package/dist/generated-docs.d.ts.map +1 -1
- package/dist/generated-docs.js +586 -257
- package/dist/generated-docs.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -2
- package/dist/server.js.map +1 -1
- package/package.json +5 -5
package/dist/generated-docs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const DOCS_SOURCE = {
|
|
2
|
-
"contract": "
|
|
3
|
-
"client": "
|
|
4
|
-
"types": "
|
|
2
|
+
"contract": "d724f38784e54027775e518fd70190147fc1af7baaec74943b58e60a98611640",
|
|
3
|
+
"client": "b8089a99b0be17fda35f4a093a7fe563506164241429c7eff4852cc9404fa3b2",
|
|
4
|
+
"types": "1b570316e03c852da9f193da37a65f70f03845dc25e22a82bf746bce084efb5f"
|
|
5
5
|
};
|
|
6
6
|
export const METHOD_DOCS = [
|
|
7
7
|
{
|
|
@@ -176,164 +176,6 @@ export const METHOD_DOCS = [
|
|
|
176
176
|
"executable": true,
|
|
177
177
|
"optionsIndex": 1
|
|
178
178
|
},
|
|
179
|
-
{
|
|
180
|
-
"method": "client.calls.accept",
|
|
181
|
-
"signature": "client.calls.accept(callID: string, options?: RequestOptions): Promise<CallResponse>",
|
|
182
|
-
"parameters": [
|
|
183
|
-
"callID: string",
|
|
184
|
-
"options?: RequestOptions"
|
|
185
|
-
],
|
|
186
|
-
"httpMethod": "POST",
|
|
187
|
-
"path": "/v1/calls/{callId}/accept",
|
|
188
|
-
"operationId": "acceptCall",
|
|
189
|
-
"summary": "Accept a call",
|
|
190
|
-
"description": "The recipient accepts a ringing Call. The Call becomes connecting, not active.",
|
|
191
|
-
"definitions": [
|
|
192
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
193
|
-
"export interface CallResponse {\n call: Call;\n}",
|
|
194
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n mode: \"audio\";\n status: \"ringing\" | \"connecting\" | \"active\" | \"ended\";\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n connected_at: string | null;\n ended_at: string | null;\n end_reason: \"completed\" | \"declined\" | \"canceled\" | \"no_answer\" | \"disconnected\" | \"failed\" | null;\n}",
|
|
195
|
-
"export type UUID = string;",
|
|
196
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
197
|
-
],
|
|
198
|
-
"requestBody": {
|
|
199
|
-
"required": true,
|
|
200
|
-
"content": {
|
|
201
|
-
"application/json": {
|
|
202
|
-
"schema": {
|
|
203
|
-
"$ref": "#/components/schemas/CallEmptyRequest"
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
"executable": true,
|
|
209
|
-
"optionsIndex": 1
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"method": "client.calls.connected",
|
|
213
|
-
"signature": "client.calls.connected(callID: string, options?: RequestOptions): Promise<CallResponse>",
|
|
214
|
-
"parameters": [
|
|
215
|
-
"callID: string",
|
|
216
|
-
"options?: RequestOptions"
|
|
217
|
-
],
|
|
218
|
-
"httpMethod": "POST",
|
|
219
|
-
"path": "/v1/calls/{callId}/connected",
|
|
220
|
-
"operationId": "markCallConnected",
|
|
221
|
-
"summary": "Report connected media",
|
|
222
|
-
"description": "Report that this Contact has connected media. The Call becomes active only after both Contacts have reported media readiness.",
|
|
223
|
-
"definitions": [
|
|
224
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
225
|
-
"export interface CallResponse {\n call: Call;\n}",
|
|
226
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n mode: \"audio\";\n status: \"ringing\" | \"connecting\" | \"active\" | \"ended\";\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n connected_at: string | null;\n ended_at: string | null;\n end_reason: \"completed\" | \"declined\" | \"canceled\" | \"no_answer\" | \"disconnected\" | \"failed\" | null;\n}",
|
|
227
|
-
"export type UUID = string;",
|
|
228
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
229
|
-
],
|
|
230
|
-
"requestBody": {
|
|
231
|
-
"required": true,
|
|
232
|
-
"content": {
|
|
233
|
-
"application/json": {
|
|
234
|
-
"schema": {
|
|
235
|
-
"$ref": "#/components/schemas/CallEmptyRequest"
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
"executable": true,
|
|
241
|
-
"optionsIndex": 1
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"method": "client.calls.connections.create",
|
|
245
|
-
"signature": "client.calls.connections.create(callID: string, body: CallConnectionCreateParams, options?: RequestOptions): Promise<CallConnectionResponse>",
|
|
246
|
-
"parameters": [
|
|
247
|
-
"callID: string",
|
|
248
|
-
"body: CallConnectionCreateParams",
|
|
249
|
-
"options?: RequestOptions"
|
|
250
|
-
],
|
|
251
|
-
"httpMethod": "POST",
|
|
252
|
-
"path": "/v1/calls/{callId}/connections",
|
|
253
|
-
"operationId": "createCallConnection",
|
|
254
|
-
"summary": "Connect call audio",
|
|
255
|
-
"description": "Connect an accepted Call. Users connect with WebRTC; agent backends connect a live audio WebSocket. The returned media grant is scoped to the authenticated Contact and Call. Provider credentials remain on Relay servers.",
|
|
256
|
-
"definitions": [
|
|
257
|
-
"export type CallConnectionCreateParams =\n | { transport: \"websocket\" }\n | {\n transport: \"webrtc\";\n session_description: { type: \"offer\"; sdp: string };\n tracks: [{ mid: string; name: \"microphone\" }];\n };",
|
|
258
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
259
|
-
"export interface CallConnectionResponse {\n connection: CallWebSocketConnection | CallWebRTCConnection;\n}",
|
|
260
|
-
"export interface CallWebSocketConnection {\n id: UUID;\n call_id: UUID;\n transport: \"websocket\";\n url: string;\n /** Ephemeral Relay grant, supplied as the media WebSocket bearer token. */\n token: string;\n expires_at: string;\n audio_format: CallAudioFormat;\n}",
|
|
261
|
-
"export type UUID = string;",
|
|
262
|
-
"export interface CallAudioFormat {\n encoding: \"pcm_s16le\";\n sample_rate: 48000;\n channels: 2;\n}",
|
|
263
|
-
"export interface CallWebRTCConnection {\n id: UUID;\n call_id: UUID;\n transport: \"webrtc\";\n session_description: { type: \"answer\"; sdp: string };\n}"
|
|
264
|
-
],
|
|
265
|
-
"requestBody": {
|
|
266
|
-
"required": true,
|
|
267
|
-
"content": {
|
|
268
|
-
"application/json": {
|
|
269
|
-
"schema": {
|
|
270
|
-
"$ref": "#/components/schemas/CallConnectionRequest"
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
"executable": true,
|
|
276
|
-
"optionsIndex": 2
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"method": "client.calls.connections.renegotiate",
|
|
280
|
-
"signature": "client.calls.connections.renegotiate(callID: string, connectionID: string, body: { session_description: { type: \"answer\"; sdp: string } }, options?: RequestOptions): Promise<{ success: true }>",
|
|
281
|
-
"parameters": [
|
|
282
|
-
"callID: string",
|
|
283
|
-
"connectionID: string",
|
|
284
|
-
"body: { session_description: { type: \"answer\"; sdp: string } }",
|
|
285
|
-
"options?: RequestOptions"
|
|
286
|
-
],
|
|
287
|
-
"httpMethod": "POST",
|
|
288
|
-
"path": "/v1/calls/{callId}/connections/{connectionId}/renegotiate",
|
|
289
|
-
"operationId": "renegotiateCallAudio",
|
|
290
|
-
"summary": "Finish audio negotiation",
|
|
291
|
-
"description": "Submit the WebRTC answer to an offer returned by subscribe.",
|
|
292
|
-
"definitions": [
|
|
293
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}"
|
|
294
|
-
],
|
|
295
|
-
"requestBody": {
|
|
296
|
-
"required": true,
|
|
297
|
-
"content": {
|
|
298
|
-
"application/json": {
|
|
299
|
-
"schema": {
|
|
300
|
-
"$ref": "#/components/schemas/CallRenegotiateRequest"
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
"executable": true,
|
|
306
|
-
"optionsIndex": 3
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"method": "client.calls.connections.subscribe",
|
|
310
|
-
"signature": "client.calls.connections.subscribe(callID: string, connectionID: string, options?: RequestOptions): Promise<{ session_description: { type: \"offer\"; sdp: string } }>",
|
|
311
|
-
"parameters": [
|
|
312
|
-
"callID: string",
|
|
313
|
-
"connectionID: string",
|
|
314
|
-
"options?: RequestOptions"
|
|
315
|
-
],
|
|
316
|
-
"httpMethod": "POST",
|
|
317
|
-
"path": "/v1/calls/{callId}/connections/{connectionId}/subscribe",
|
|
318
|
-
"operationId": "subscribeCallAudio",
|
|
319
|
-
"summary": "Receive the other side’s audio",
|
|
320
|
-
"description": "For a WebRTC connection, request the other side’s audio track. Apply the returned offer and submit your answer through renegotiate. A 409 means the other track is not ready; retry only during connection setup.",
|
|
321
|
-
"definitions": [
|
|
322
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}"
|
|
323
|
-
],
|
|
324
|
-
"requestBody": {
|
|
325
|
-
"required": true,
|
|
326
|
-
"content": {
|
|
327
|
-
"application/json": {
|
|
328
|
-
"schema": {
|
|
329
|
-
"$ref": "#/components/schemas/CallEmptyRequest"
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
"executable": true,
|
|
335
|
-
"optionsIndex": 2
|
|
336
|
-
},
|
|
337
179
|
{
|
|
338
180
|
"method": "client.calls.create",
|
|
339
181
|
"signature": "client.calls.create(chatID: string, body: CallCreateParams, options: CallCreateOptions): Promise<CallResponse>",
|
|
@@ -346,15 +188,16 @@ export const METHOD_DOCS = [
|
|
|
346
188
|
"path": "/v1/chats/{chatId}/calls",
|
|
347
189
|
"operationId": "createCall",
|
|
348
190
|
"summary": "Start an individual call",
|
|
349
|
-
"description": "Start an audio Call in an existing individual Chat containing one user and one agent. The caller comes from authentication. The user must have added the agent; sending or replying to a Message establishes that relationship. A block in either direction prevents the call. A group Chat is rejected even when it has only two current members. Reuse the same Idempotency-Key and body after an uncertain response.
|
|
191
|
+
"description": "Start an audio Call in an existing individual Chat containing exactly one user and one agent. The caller comes from authentication. The user must have added the agent; sending or replying to a Message establishes that relationship. A block in either direction prevents the call. A group Chat is rejected even when it has only two current members. Reuse the same Idempotency-Key and body after an uncertain response. Relay emits `call.created` through the agent's configured event transport. Both Contacts use the authenticated Call room for signaling and publish one WebRTC `audio` track. The callee answers by sending `join` within the 10-second ring lease; silence ends `no-answer`. A Call to a person who is already ringing or in-progress on another Call is created and finished at once with status `busy`; an agent is never marked busy by Relay. An answered Call has no duration limit.",
|
|
350
192
|
"definitions": [
|
|
351
|
-
"export interface CallCreateParams {\n to: [string];\n
|
|
193
|
+
"export interface CallCreateParams {\n to: [string];\n}",
|
|
352
194
|
"export interface CallCreateOptions extends RequestOptions {\n /** Reuse this key and request after an uncertain response. */\n idempotencyKey: string;\n}",
|
|
353
195
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
354
196
|
"export interface CallResponse {\n call: Call;\n}",
|
|
355
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n
|
|
197
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
356
198
|
"export type UUID = string;",
|
|
357
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
199
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
200
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";"
|
|
358
201
|
],
|
|
359
202
|
"requestBody": {
|
|
360
203
|
"required": true,
|
|
@@ -369,38 +212,6 @@ export const METHOD_DOCS = [
|
|
|
369
212
|
"executable": true,
|
|
370
213
|
"optionsIndex": 2
|
|
371
214
|
},
|
|
372
|
-
{
|
|
373
|
-
"method": "client.calls.decline",
|
|
374
|
-
"signature": "client.calls.decline(callID: string, options?: RequestOptions): Promise<CallResponse>",
|
|
375
|
-
"parameters": [
|
|
376
|
-
"callID: string",
|
|
377
|
-
"options?: RequestOptions"
|
|
378
|
-
],
|
|
379
|
-
"httpMethod": "POST",
|
|
380
|
-
"path": "/v1/calls/{callId}/decline",
|
|
381
|
-
"operationId": "declineCall",
|
|
382
|
-
"summary": "Decline a call",
|
|
383
|
-
"description": "The recipient declines a ringing Call. The Call ends with reason declined.",
|
|
384
|
-
"definitions": [
|
|
385
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
386
|
-
"export interface CallResponse {\n call: Call;\n}",
|
|
387
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n mode: \"audio\";\n status: \"ringing\" | \"connecting\" | \"active\" | \"ended\";\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n connected_at: string | null;\n ended_at: string | null;\n end_reason: \"completed\" | \"declined\" | \"canceled\" | \"no_answer\" | \"disconnected\" | \"failed\" | null;\n}",
|
|
388
|
-
"export type UUID = string;",
|
|
389
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
390
|
-
],
|
|
391
|
-
"requestBody": {
|
|
392
|
-
"required": true,
|
|
393
|
-
"content": {
|
|
394
|
-
"application/json": {
|
|
395
|
-
"schema": {
|
|
396
|
-
"$ref": "#/components/schemas/CallEmptyRequest"
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
},
|
|
401
|
-
"executable": true,
|
|
402
|
-
"optionsIndex": 1
|
|
403
|
-
},
|
|
404
215
|
{
|
|
405
216
|
"method": "client.calls.end",
|
|
406
217
|
"signature": "client.calls.end(callID: string, options?: RequestOptions): Promise<CallResponse>",
|
|
@@ -412,13 +223,14 @@ export const METHOD_DOCS = [
|
|
|
412
223
|
"path": "/v1/calls/{callId}/end",
|
|
413
224
|
"operationId": "endCall",
|
|
414
225
|
"summary": "End a call",
|
|
415
|
-
"description": "Either Contact ends the Call. A ringing Call ends canceled; an answered Call ends completed. Cleanup remains available after a block or removal. Repeated terminal actions never restart the Call.",
|
|
226
|
+
"description": "Either Contact ends the Call. A ringing Call ends canceled when its caller ends it and no-answer when its recipient does; an answered Call ends completed. A participant may also send `end` over its authenticated Call room. Cleanup remains available after a block or removal. Repeated terminal actions never restart the Call.",
|
|
416
227
|
"definitions": [
|
|
417
228
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
418
229
|
"export interface CallResponse {\n call: Call;\n}",
|
|
419
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n
|
|
230
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
420
231
|
"export type UUID = string;",
|
|
421
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
232
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
233
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";"
|
|
422
234
|
],
|
|
423
235
|
"requestBody": {
|
|
424
236
|
"required": true,
|
|
@@ -450,9 +262,10 @@ export const METHOD_DOCS = [
|
|
|
450
262
|
"export interface CallListParams {\n cursor?: string;\n limit?: number;\n}",
|
|
451
263
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
452
264
|
"export interface CallListResponse {\n calls: Call[];\n next_cursor: string | null;\n}",
|
|
453
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n
|
|
265
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
454
266
|
"export type UUID = string;",
|
|
455
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
267
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
268
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";"
|
|
456
269
|
],
|
|
457
270
|
"requestBody": null,
|
|
458
271
|
"executable": true,
|
|
@@ -473,14 +286,37 @@ export const METHOD_DOCS = [
|
|
|
473
286
|
"definitions": [
|
|
474
287
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
475
288
|
"export interface CallResponse {\n call: Call;\n}",
|
|
476
|
-
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n
|
|
289
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
477
290
|
"export type UUID = string;",
|
|
478
|
-
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}"
|
|
291
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
292
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";"
|
|
479
293
|
],
|
|
480
294
|
"requestBody": null,
|
|
481
295
|
"executable": true,
|
|
482
296
|
"optionsIndex": 1
|
|
483
297
|
},
|
|
298
|
+
{
|
|
299
|
+
"method": "client.chats.clearActivity",
|
|
300
|
+
"signature": "client.chats.clearActivity(chatID: string, query: ChatClearActivityParams = {}, options?: RequestOptions): Promise<void>",
|
|
301
|
+
"parameters": [
|
|
302
|
+
"chatID: string",
|
|
303
|
+
"query: ChatClearActivityParams = {}",
|
|
304
|
+
"options?: RequestOptions"
|
|
305
|
+
],
|
|
306
|
+
"httpMethod": "DELETE",
|
|
307
|
+
"path": "/v1/chats/{chatId}/activity",
|
|
308
|
+
"operationId": "clearActivity",
|
|
309
|
+
"summary": "Clear your activity",
|
|
310
|
+
"description": "Clear the authenticated agent's activity in this chat. Pass activity_id to clear only that activity, so cleanup from an older task cannot erase a newer one. An absent activity or a nonmatching id is a successful no-op.",
|
|
311
|
+
"definitions": [
|
|
312
|
+
"export interface ChatClearActivityParams {\n /** Clear only this task. A stale or missing activity is a successful no-op. */\n activity_id?: UUID;\n}",
|
|
313
|
+
"export type UUID = string;",
|
|
314
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}"
|
|
315
|
+
],
|
|
316
|
+
"requestBody": null,
|
|
317
|
+
"executable": true,
|
|
318
|
+
"optionsIndex": 2
|
|
319
|
+
},
|
|
484
320
|
{
|
|
485
321
|
"method": "client.chats.create",
|
|
486
322
|
"signature": "client.chats.create(body: ChatCreateParams, options?: RequestOptions): Promise<ChatCreateResponse>",
|
|
@@ -495,22 +331,56 @@ export const METHOD_DOCS = [
|
|
|
495
331
|
"description": "Create a direct or group Chat with its first Message.",
|
|
496
332
|
"definitions": [
|
|
497
333
|
"export interface ChatCreateParams {\n from: string;\n to: string[];\n message: MessageContent;\n}",
|
|
498
|
-
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
499
|
-
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n |
|
|
500
|
-
"export interface
|
|
501
|
-
"export interface
|
|
502
|
-
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
503
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
504
|
-
"export interface ChatCreateResponse {\n chat: Pick<\n Chat,\n \"id\" | \"display_name\" | \"is_group\" | \"handles\"\n > & { message: SentMessage };\n}",
|
|
505
|
-
"export interface SentMessage {\n id: UUID;\n parts: Array<\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | ButtonReplyPartResponse\n >;\n created_at: string;\n sent_at: string | null;\n delivered_at?: string | null;\n delivery_status: DeliveryStatus;\n from_handle?: ChatHandle | null;\n reply_to?: ReplyTo | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n is_system_message: false;\n}",
|
|
334
|
+
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n /**\n * A2A Message metadata. A tap (an A2UI `action`) on a surface that set\n * `sendDataModel` must carry `a2uiClientDataModel`.\n */\n metadata?: MessageMetadata;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
335
|
+
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n | SelectionPart\n | SelectionResponsePart\n | PaymentPart\n | DataPart\n | PlacePart;",
|
|
336
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
337
|
+
"export interface MediaPart {\n type: \"media\";\n url?: string;\n attachment_id?: UUID;\n}",
|
|
506
338
|
"export type UUID = string;",
|
|
339
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
340
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
341
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
342
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
343
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
344
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
345
|
+
"export interface PaymentPart {\n type: \"payment\";\n /** At most 2048 characters. */\n checkout_url: string;\n}",
|
|
346
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
347
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
348
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
349
|
+
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
350
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
351
|
+
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
352
|
+
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
353
|
+
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
354
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
507
355
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
508
356
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
509
357
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
510
358
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
511
|
-
"export interface
|
|
359
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
360
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
361
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
362
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
363
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
364
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
365
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
366
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
367
|
+
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
368
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
369
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
370
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
371
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
372
|
+
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
373
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
374
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
512
375
|
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
513
|
-
"export
|
|
376
|
+
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}",
|
|
377
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
378
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
379
|
+
"export interface ChatCreateResponse {\n /**\n * The A2UI messages of the send that were not applied, each with its place\n * in the request and A2UI's `error` message for it. The rest was applied.\n */\n a2ui_errors?: A2uiFailure[];\n chat: Pick<\n Chat,\n \"id\" | \"display_name\" | \"is_group\" | \"handles\"\n > & { message: SentMessage };\n}",
|
|
380
|
+
"export interface A2uiFailure {\n /** The data part's index in `parts`; null when the fault is in `metadata.a2uiClientDataModel`. */\n part_index: number | null;\n /** The message's index in that part's `data`; null when the part itself, or the metadata, is at fault. */\n data_index: number | null;\n a2ui_message: A2uiValidationErrorMessage;\n}",
|
|
381
|
+
"export interface A2uiValidationErrorMessage {\n version: \"v0.9.1\";\n error: A2uiValidationError;\n}",
|
|
382
|
+
"export interface A2uiValidationError {\n code: \"VALIDATION_FAILED\";\n surfaceId: string;\n path: string;\n message: string;\n}",
|
|
383
|
+
"export interface SentMessage {\n id: UUID;\n parts: Array<\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n >;\n metadata?: MessageMetadata;\n created_at: string;\n sent_at: string | null;\n delivered_at?: string | null;\n delivery_status: DeliveryStatus;\n from_handle?: ChatHandle | null;\n reply_to?: ReplyTo | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n is_system_message: false;\n}"
|
|
514
384
|
],
|
|
515
385
|
"requestBody": {
|
|
516
386
|
"required": true,
|
|
@@ -525,6 +395,28 @@ export const METHOD_DOCS = [
|
|
|
525
395
|
"executable": true,
|
|
526
396
|
"optionsIndex": 1
|
|
527
397
|
},
|
|
398
|
+
{
|
|
399
|
+
"method": "client.chats.getActivity",
|
|
400
|
+
"signature": "client.chats.getActivity(chatID: string, options?: RequestOptions): Promise<ChatActivityResponse>",
|
|
401
|
+
"parameters": [
|
|
402
|
+
"chatID: string",
|
|
403
|
+
"options?: RequestOptions"
|
|
404
|
+
],
|
|
405
|
+
"httpMethod": "GET",
|
|
406
|
+
"path": "/v1/chats/{chatId}/activity",
|
|
407
|
+
"operationId": "getActivity",
|
|
408
|
+
"summary": "Get your activity",
|
|
409
|
+
"description": "Read the authenticated agent's activity in this chat. Empty, cleared, and expired activity is null. The version remains available after clearing.",
|
|
410
|
+
"definitions": [
|
|
411
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
412
|
+
"export interface ChatActivityResponse {\n chat_id: UUID;\n agent_id: UUID;\n version: string;\n activity: ChatActivity | null;\n}",
|
|
413
|
+
"export type UUID = string;",
|
|
414
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}"
|
|
415
|
+
],
|
|
416
|
+
"requestBody": null,
|
|
417
|
+
"executable": true,
|
|
418
|
+
"optionsIndex": 1
|
|
419
|
+
},
|
|
528
420
|
{
|
|
529
421
|
"method": "client.chats.leaveChat",
|
|
530
422
|
"signature": "client.chats.leaveChat(chatID: string, options?: RequestOptions): Promise<AcceptedResponse>",
|
|
@@ -564,12 +456,55 @@ export const METHOD_DOCS = [
|
|
|
564
456
|
"export type UUID = string;",
|
|
565
457
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
566
458
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
459
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
460
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
567
461
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}"
|
|
568
462
|
],
|
|
569
463
|
"requestBody": null,
|
|
570
464
|
"executable": true,
|
|
571
465
|
"optionsIndex": 1
|
|
572
466
|
},
|
|
467
|
+
{
|
|
468
|
+
"method": "client.chats.location.request",
|
|
469
|
+
"signature": "client.chats.location.request(chatID: string, options?: RequestOptions): Promise<LocationRequestResponse>",
|
|
470
|
+
"parameters": [
|
|
471
|
+
"chatID: string",
|
|
472
|
+
"options?: RequestOptions"
|
|
473
|
+
],
|
|
474
|
+
"httpMethod": "POST",
|
|
475
|
+
"path": "/v1/chats/{chatId}/location/request",
|
|
476
|
+
"operationId": "requestLocation",
|
|
477
|
+
"summary": "Request a person's location",
|
|
478
|
+
"description": "Ask the person in this one-to-one chat to share their location. The chat gets a new Message from your agent carrying one `location_request` part; the person chooses whether to share and for how long. The request does not return coordinates: subscribe to `location.sharing.started`, then read the location with `GET /v1/chats/{chatId}/location`. Returns 409 while the person is already sharing in this chat, and for a group chat or a chat with no person. Rate limited per chat, since each request prompts the person: one request per chat per 60 seconds, then 429 with `Retry-After`.",
|
|
479
|
+
"definitions": [
|
|
480
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
481
|
+
"export interface LocationRequestResponse {\n success: true;\n message: \"Location request sent\";\n}"
|
|
482
|
+
],
|
|
483
|
+
"requestBody": null,
|
|
484
|
+
"executable": true,
|
|
485
|
+
"optionsIndex": 1
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"method": "client.chats.location.retrieve",
|
|
489
|
+
"signature": "client.chats.location.retrieve(chatID: string, options?: RequestOptions): Promise<GetChatLocationResponse>",
|
|
490
|
+
"parameters": [
|
|
491
|
+
"chatID: string",
|
|
492
|
+
"options?: RequestOptions"
|
|
493
|
+
],
|
|
494
|
+
"httpMethod": "GET",
|
|
495
|
+
"path": "/v1/chats/{chatId}/location",
|
|
496
|
+
"operationId": "getLocation",
|
|
497
|
+
"summary": "Get shared locations",
|
|
498
|
+
"description": "Read the current location of everyone sharing with your agent in this chat. `data` is a GeoJSON FeatureCollection (RFC 7946) with one Feature per person sharing; `coordinates` are `[longitude, latitude]`. `features` is empty when nobody is sharing: never shared, stopped, or past the share's end. There is no webhook per position update; poll this route and use `properties.updated_at` to judge freshness. The response is not cached.",
|
|
499
|
+
"definitions": [
|
|
500
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
501
|
+
"export interface GetChatLocationResponse {\n success: true;\n data: {\n type: \"FeatureCollection\";\n features: LocationFeature[];\n };\n}",
|
|
502
|
+
"export interface LocationFeature {\n type: \"Feature\";\n geometry: {\n type: \"Point\";\n /** `[longitude, latitude]`, longitude first. */\n coordinates: [number, number];\n };\n properties: {\n /** Handle of the person sharing. */\n handle: string;\n /** When this position arrived. */\n updated_at: string;\n };\n}"
|
|
503
|
+
],
|
|
504
|
+
"requestBody": null,
|
|
505
|
+
"executable": true,
|
|
506
|
+
"optionsIndex": 1
|
|
507
|
+
},
|
|
573
508
|
{
|
|
574
509
|
"method": "client.chats.markAsRead",
|
|
575
510
|
"signature": "client.chats.markAsRead(chatID: string, options?: RequestOptions): Promise<void>",
|
|
@@ -605,23 +540,56 @@ export const METHOD_DOCS = [
|
|
|
605
540
|
"definitions": [
|
|
606
541
|
"export interface MessageListParams {\n cursor?: string;\n limit?: number;\n /**\n * `asc` (default) lists oldest first; `desc` opens on the newest Messages\n * and pages toward older ones. A cursor is only valid with the order it\n * was returned for.\n */\n order?: \"asc\" | \"desc\";\n}",
|
|
607
542
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
608
|
-
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
543
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
609
544
|
"export type UUID = string;",
|
|
610
545
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
611
546
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
547
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
548
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
612
549
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
613
|
-
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n |
|
|
550
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
614
551
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
552
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
553
|
+
"export interface Reaction {\n is_me: boolean;\n handle: ChatHandle;\n type: ReactionType;\n custom_emoji?: string | null;\n}",
|
|
554
|
+
"export type ReactionType =\n | \"love\"\n | \"like\"\n | \"dislike\"\n | \"laugh\"\n | \"emphasize\"\n | \"question\"\n | \"custom\";",
|
|
615
555
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
616
556
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
557
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
617
558
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
618
|
-
"export interface
|
|
559
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
560
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
561
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
562
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
563
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
564
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
565
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
566
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
567
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
568
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
569
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
570
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
571
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
572
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
573
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
574
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
575
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
576
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
577
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
578
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
579
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
619
580
|
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
620
581
|
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
621
|
-
"export interface
|
|
622
|
-
"export
|
|
582
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
583
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
584
|
+
"export type A2uiVersion = \"v0.9\" | \"v0.9.1\";",
|
|
585
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
586
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
623
587
|
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
624
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
588
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
589
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
590
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
591
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
592
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";",
|
|
625
593
|
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
626
594
|
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}"
|
|
627
595
|
],
|
|
@@ -644,22 +612,56 @@ export const METHOD_DOCS = [
|
|
|
644
612
|
"description": "Send a Message to an existing Chat.\n\nBlocking is silent on this path. The Message is accepted and stored for\nthe sender with `delivery_status` `sent`, no error is raised, and\nneither party is notified.\n\nIn a direct Chat, a block in either direction stops delivery: the\nMessage is stored for the sender and never delivered to the other\nparty.\n\nIn a group Chat, blocking is one way. A Message from a sender the\nrecipient has blocked is not delivered to that recipient, while a\nmember the sender has blocked still receives the sender's Messages.\nEvery other member receives the Message as normal.\n\nA Message that is not delivered leaves no trace for that recipient: no\nwebhook, no WebSocket event, no Chat activity, and no history, and it\nis never replayed after an unblock. The sender's `message.delivered`\nfires when at least one recipient was delivered.",
|
|
645
613
|
"definitions": [
|
|
646
614
|
"export interface MessageSendParams {\n message: MessageContent;\n}",
|
|
647
|
-
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
648
|
-
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n |
|
|
649
|
-
"export interface
|
|
650
|
-
"export interface
|
|
651
|
-
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
652
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
653
|
-
"export interface MessageSendResponse {\n chat_id: UUID;\n message: SentMessage;\n}",
|
|
615
|
+
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n /**\n * A2A Message metadata. A tap (an A2UI `action`) on a surface that set\n * `sendDataModel` must carry `a2uiClientDataModel`.\n */\n metadata?: MessageMetadata;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
616
|
+
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n | SelectionPart\n | SelectionResponsePart\n | PaymentPart\n | DataPart\n | PlacePart;",
|
|
617
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
618
|
+
"export interface MediaPart {\n type: \"media\";\n url?: string;\n attachment_id?: UUID;\n}",
|
|
654
619
|
"export type UUID = string;",
|
|
655
|
-
"export interface
|
|
620
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
621
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
622
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
623
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
624
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
625
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
626
|
+
"export interface PaymentPart {\n type: \"payment\";\n /** At most 2048 characters. */\n checkout_url: string;\n}",
|
|
627
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
628
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
629
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
630
|
+
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
631
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
632
|
+
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
633
|
+
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
634
|
+
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
635
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
656
636
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
657
637
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
658
638
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
659
639
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
660
|
-
"export interface
|
|
640
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
641
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
642
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
643
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
644
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
645
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
646
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
647
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
648
|
+
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
649
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
650
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
651
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
652
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
653
|
+
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
654
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
655
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
661
656
|
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
662
|
-
"export
|
|
657
|
+
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}",
|
|
658
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
659
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
660
|
+
"export interface MessageSendResponse {\n /**\n * The A2UI messages of the send that were not applied, each with its place\n * in the request and A2UI's `error` message for it. The rest was applied.\n */\n a2ui_errors?: A2uiFailure[];\n chat_id: UUID;\n message: SentMessage;\n}",
|
|
661
|
+
"export interface A2uiFailure {\n /** The data part's index in `parts`; null when the fault is in `metadata.a2uiClientDataModel`. */\n part_index: number | null;\n /** The message's index in that part's `data`; null when the part itself, or the metadata, is at fault. */\n data_index: number | null;\n a2ui_message: A2uiValidationErrorMessage;\n}",
|
|
662
|
+
"export interface A2uiValidationErrorMessage {\n version: \"v0.9.1\";\n error: A2uiValidationError;\n}",
|
|
663
|
+
"export interface A2uiValidationError {\n code: \"VALIDATION_FAILED\";\n surfaceId: string;\n path: string;\n message: string;\n}",
|
|
664
|
+
"export interface SentMessage {\n id: UUID;\n parts: Array<\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n >;\n metadata?: MessageMetadata;\n created_at: string;\n sent_at: string | null;\n delivered_at?: string | null;\n delivery_status: DeliveryStatus;\n from_handle?: ChatHandle | null;\n reply_to?: ReplyTo | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n is_system_message: false;\n}"
|
|
663
665
|
],
|
|
664
666
|
"requestBody": {
|
|
665
667
|
"required": true,
|
|
@@ -754,6 +756,8 @@ export const METHOD_DOCS = [
|
|
|
754
756
|
"export type UUID = string;",
|
|
755
757
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
756
758
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
759
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
760
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
757
761
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}"
|
|
758
762
|
],
|
|
759
763
|
"requestBody": null,
|
|
@@ -781,6 +785,8 @@ export const METHOD_DOCS = [
|
|
|
781
785
|
"export interface VoiceMemoAttachment {\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n /** Pixel width when known. Width and height are supplied together. */\n width?: number | null;\n /** Pixel height when known. Width and height are supplied together. */\n height?: number | null;\n}",
|
|
782
786
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
783
787
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
788
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
789
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
784
790
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}"
|
|
785
791
|
],
|
|
786
792
|
"requestBody": {
|
|
@@ -796,6 +802,39 @@ export const METHOD_DOCS = [
|
|
|
796
802
|
"executable": true,
|
|
797
803
|
"optionsIndex": 2
|
|
798
804
|
},
|
|
805
|
+
{
|
|
806
|
+
"method": "client.chats.setActivity",
|
|
807
|
+
"signature": "client.chats.setActivity(chatID: string, body: ChatSetActivityParams, options?: RequestOptions): Promise<ChatActivityResponse>",
|
|
808
|
+
"parameters": [
|
|
809
|
+
"chatID: string",
|
|
810
|
+
"body: ChatSetActivityParams",
|
|
811
|
+
"options?: RequestOptions"
|
|
812
|
+
],
|
|
813
|
+
"httpMethod": "PUT",
|
|
814
|
+
"path": "/v1/chats/{chatId}/activity",
|
|
815
|
+
"operationId": "setActivity",
|
|
816
|
+
"summary": "Set your activity",
|
|
817
|
+
"description": "Set a short description of what the authenticated agent is doing in this chat. Omitting activity_id starts or replaces the activity. Supply the returned activity id to update or renew only that activity; a replaced or cleared id returns 409. Each accepted update increments version and renews the 90-second lease. Renew every 60 seconds while work continues, then clear explicitly. Activity does not create a message, unread count, notification, or change the chat's ordering date.",
|
|
818
|
+
"definitions": [
|
|
819
|
+
"export interface ChatSetActivityParams {\n /** 1–21 visible characters, at most 1024 UTF-8 bytes. */\n text: string;\n /** One Unicode emoji, or null. */\n emoji?: string | null;\n /** Omit to start/replace; supply the current ID to refresh/update. */\n activity_id?: UUID;\n}",
|
|
820
|
+
"export type UUID = string;",
|
|
821
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
822
|
+
"export interface ChatActivityResponse {\n chat_id: UUID;\n agent_id: UUID;\n version: string;\n activity: ChatActivity | null;\n}",
|
|
823
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}"
|
|
824
|
+
],
|
|
825
|
+
"requestBody": {
|
|
826
|
+
"required": true,
|
|
827
|
+
"content": {
|
|
828
|
+
"application/json": {
|
|
829
|
+
"schema": {
|
|
830
|
+
"$ref": "#/components/schemas/SetActivityRequest"
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
"executable": true,
|
|
836
|
+
"optionsIndex": 2
|
|
837
|
+
},
|
|
799
838
|
{
|
|
800
839
|
"method": "client.chats.shareContactCard",
|
|
801
840
|
"signature": "client.chats.shareContactCard(chatID: string, options?: RequestOptions): Promise<void>",
|
|
@@ -904,10 +943,12 @@ export const METHOD_DOCS = [
|
|
|
904
943
|
"export type UUID = string;",
|
|
905
944
|
"export type AgentImageRecipe = AgentMonogramImageRecipe | AgentEmojiImageRecipe | AgentPhotoImageRecipe;",
|
|
906
945
|
"export interface AgentMonogramImageRecipe {\n recipe: { monogram: { initials: string }; emoji?: never; image?: never };\n background: AgentImageBackground;\n}",
|
|
946
|
+
"export interface AgentImageBackground {\n linearGradient: { colors: AgentImageGradient };\n}",
|
|
947
|
+
"export type AgentImageGradient =\n | readonly [\"EC8A3C\", \"C85F1C\"]\n | readonly [\"E0567A\", \"AD2A52\"]\n | readonly [\"D05FC6\", \"93217E\"]\n | readonly [\"8F6CF2\", \"5F38CF\"]\n | readonly [\"5B9BFA\", \"0B52C0\"]\n | readonly [\"2596A6\", \"116A79\"]\n | readonly [\"2FA46A\", \"137347\"];",
|
|
907
948
|
"export interface AgentEmojiImageRecipe {\n recipe: { emoji: { emoji: string }; monogram?: never; image?: never };\n background: AgentImageBackground;\n}",
|
|
908
949
|
"export interface AgentPhotoImageRecipe {\n recipe: { image: Record<string, never>; monogram?: never; emoji?: never };\n background?: never;\n}",
|
|
909
950
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
910
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
951
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
911
952
|
],
|
|
912
953
|
"requestBody": {
|
|
913
954
|
"required": true,
|
|
@@ -938,7 +979,7 @@ export const METHOD_DOCS = [
|
|
|
938
979
|
"export interface ContactCardRetrieveParams {\n handle?: string;\n}",
|
|
939
980
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
940
981
|
"export interface ContactCardRetrieveResponse {\n contact_cards: ContactCardItem[];\n}",
|
|
941
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
982
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
942
983
|
],
|
|
943
984
|
"requestBody": null,
|
|
944
985
|
"executable": true,
|
|
@@ -957,14 +998,16 @@ export const METHOD_DOCS = [
|
|
|
957
998
|
"summary": "Update contact card",
|
|
958
999
|
"description": "Update the authenticated agent's Contact Card.",
|
|
959
1000
|
"definitions": [
|
|
960
|
-
"export interface ContactCardUpdateParams {\n /**
|
|
1001
|
+
"export interface ContactCardUpdateParams {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n /** The one line under the name, 1 to 60 characters. */\n subtitle?: string;\n handle: string;\n first_name?: string;\n last_name?: string | null;\n image_url?: string | null;\n /** Caller-owned completed image upload; mutually exclusive with image_url, including null. */\n attachment_id?: UUID;\n /** Existing redraw metadata; requires an image URL or completed upload. */\n image_recipe?: AgentImageRecipe;\n}",
|
|
961
1002
|
"export type UUID = string;",
|
|
962
1003
|
"export type AgentImageRecipe = AgentMonogramImageRecipe | AgentEmojiImageRecipe | AgentPhotoImageRecipe;",
|
|
963
1004
|
"export interface AgentMonogramImageRecipe {\n recipe: { monogram: { initials: string }; emoji?: never; image?: never };\n background: AgentImageBackground;\n}",
|
|
1005
|
+
"export interface AgentImageBackground {\n linearGradient: { colors: AgentImageGradient };\n}",
|
|
1006
|
+
"export type AgentImageGradient =\n | readonly [\"EC8A3C\", \"C85F1C\"]\n | readonly [\"E0567A\", \"AD2A52\"]\n | readonly [\"D05FC6\", \"93217E\"]\n | readonly [\"8F6CF2\", \"5F38CF\"]\n | readonly [\"5B9BFA\", \"0B52C0\"]\n | readonly [\"2596A6\", \"116A79\"]\n | readonly [\"2FA46A\", \"137347\"];",
|
|
964
1007
|
"export interface AgentEmojiImageRecipe {\n recipe: { emoji: { emoji: string }; monogram?: never; image?: never };\n background: AgentImageBackground;\n}",
|
|
965
1008
|
"export interface AgentPhotoImageRecipe {\n recipe: { image: Record<string, never>; monogram?: never; emoji?: never };\n background?: never;\n}",
|
|
966
1009
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
967
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
1010
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}"
|
|
968
1011
|
],
|
|
969
1012
|
"requestBody": {
|
|
970
1013
|
"required": true,
|
|
@@ -979,6 +1022,73 @@ export const METHOD_DOCS = [
|
|
|
979
1022
|
"executable": true,
|
|
980
1023
|
"optionsIndex": 1
|
|
981
1024
|
},
|
|
1025
|
+
{
|
|
1026
|
+
"method": "client.contacts.lookup",
|
|
1027
|
+
"signature": "client.contacts.lookup(body: ContactLookupParams, options?: RequestOptions): Promise<ContactLookupResponse>",
|
|
1028
|
+
"parameters": [
|
|
1029
|
+
"body: ContactLookupParams",
|
|
1030
|
+
"options?: RequestOptions"
|
|
1031
|
+
],
|
|
1032
|
+
"httpMethod": "POST",
|
|
1033
|
+
"path": "/v1/contacts/lookup",
|
|
1034
|
+
"operationId": "lookupContact",
|
|
1035
|
+
"summary": "Look up a contact by handle or find agents by task",
|
|
1036
|
+
"description": "Send a handle to look up one active contact: a person resolves agents; an agent resolves people and agents. Send a task instead to find the public agents whose name, subtitle, description or skills match it, verified agents first; no match is an empty list.",
|
|
1037
|
+
"definitions": [
|
|
1038
|
+
"export type ContactLookupParams =\n /** Relay Handle, trimmed and lowercased by the Server before validation. */\n | { handle: string }\n /** What you need done, in plain words; at most 200 characters. */\n | { task: string };",
|
|
1039
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1040
|
+
"export type ContactLookupResponse =\n | { contact: ContactLookup }\n | { contacts: ContactLookup[] };",
|
|
1041
|
+
"export interface ContactLookup {\n id: UUID;\n handle: string;\n display_name: string;\n kind: \"user\" | \"agent\";\n image_url: string | null;\n image_color: string | null;\n verified: boolean;\n /** The agent's name. Agents only. */\n name?: string;\n /** The one line under the agent's name. Agents only. */\n subtitle?: string | null;\n /** The agent's paragraph. Agents only. */\n description?: string | null;\n /** Where the directory files the agent. Agents only. */\n category?: AgentCategory | null;\n /** What the agent does, at most ten skills. Agents only. */\n skills?: AgentSkill[];\n /** Whether the agent is listed in the directory. Agents only. */\n visibility?: AgentVisibility;\n /**\n * Who made the agent: its organization, by the name the organization gave\n * in the Relay Console. Null when the organization has not given a name.\n * Agents only.\n */\n creator?: AgentCreator | null;\n}",
|
|
1042
|
+
"export type UUID = string;",
|
|
1043
|
+
"export type AgentCategory =\n | \"productivity\"\n | \"business\"\n | \"finance\"\n | \"shopping\"\n | \"travel\"\n | \"health-fitness\"\n | \"lifestyle\"\n | \"social\"\n | \"education\"\n | \"entertainment\"\n | \"utilities\"\n | \"developer-tools\";",
|
|
1044
|
+
"export interface AgentSkill {\n id: string;\n name: string;\n description: string;\n tags: string[];\n examples: string[];\n}",
|
|
1045
|
+
"export type AgentVisibility = \"public\" | \"unlisted\";",
|
|
1046
|
+
"export interface AgentCreator {\n kind: \"organization\";\n name: string;\n /** The maker's Relay Handle. Null until Relay stores one. */\n handle: string | null;\n}"
|
|
1047
|
+
],
|
|
1048
|
+
"requestBody": {
|
|
1049
|
+
"required": true,
|
|
1050
|
+
"content": {
|
|
1051
|
+
"application/json": {
|
|
1052
|
+
"schema": {
|
|
1053
|
+
"oneOf": [
|
|
1054
|
+
{
|
|
1055
|
+
"type": "object",
|
|
1056
|
+
"additionalProperties": false,
|
|
1057
|
+
"required": [
|
|
1058
|
+
"handle"
|
|
1059
|
+
],
|
|
1060
|
+
"properties": {
|
|
1061
|
+
"handle": {
|
|
1062
|
+
"type": "string",
|
|
1063
|
+
"minLength": 1,
|
|
1064
|
+
"maxLength": 255,
|
|
1065
|
+
"description": "Relay Handle, trimmed and lowercased before validation."
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
"type": "object",
|
|
1071
|
+
"additionalProperties": false,
|
|
1072
|
+
"required": [
|
|
1073
|
+
"task"
|
|
1074
|
+
],
|
|
1075
|
+
"properties": {
|
|
1076
|
+
"task": {
|
|
1077
|
+
"type": "string",
|
|
1078
|
+
"minLength": 1,
|
|
1079
|
+
"maxLength": 200,
|
|
1080
|
+
"description": "What you need done, in plain words."
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
]
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
"executable": true,
|
|
1090
|
+
"optionsIndex": 1
|
|
1091
|
+
},
|
|
982
1092
|
{
|
|
983
1093
|
"method": "client.messages.addReaction",
|
|
984
1094
|
"signature": "client.messages.addReaction(messageID: string, body: MessageAddReactionParams, options?: RequestOptions): Promise<MessageAddReactionResponse>",
|
|
@@ -991,7 +1101,7 @@ export const METHOD_DOCS = [
|
|
|
991
1101
|
"path": "/v1/messages/{messageId}/reactions",
|
|
992
1102
|
"operationId": "sendReaction",
|
|
993
1103
|
"summary": "Add or remove a reaction to a message",
|
|
994
|
-
"description": "Add or remove a reaction on one Message part. Targeting a `buttons` part returns 422.
|
|
1104
|
+
"description": "Add or remove a reaction on one Message part. Targeting a `buttons`, `selection`, or `selection_response` part returns 422. Only a person can react to a `payment` part; an agent gets 403 (error code `2003`).",
|
|
995
1105
|
"definitions": [
|
|
996
1106
|
"export interface MessageAddReactionParams {\n operation: \"add\" | \"remove\";\n type: ReactionType;\n custom_emoji?: string;\n part_index?: number;\n}",
|
|
997
1107
|
"export type ReactionType =\n | \"love\"\n | \"like\"\n | \"dislike\"\n | \"laugh\"\n | \"emphasize\"\n | \"question\"\n | \"custom\";",
|
|
@@ -1026,24 +1136,56 @@ export const METHOD_DOCS = [
|
|
|
1026
1136
|
"description": "Resolve or create a Chat, then send a Message.\n\nBlocking is silent on this path. The Message is accepted and stored for\nthe sender with `delivery_status` `sent`, no error is raised, and\nneither party is notified.\n\nIn a direct Chat, a block in either direction stops delivery: the\nMessage is stored for the sender and never delivered to the other\nparty.\n\nIn a group Chat, blocking is one way. A Message from a sender the\nrecipient has blocked is not delivered to that recipient, while a\nmember the sender has blocked still receives the sender's Messages.\nEvery other member receives the Message as normal.\n\nA Message that is not delivered leaves no trace for that recipient: no\nwebhook, no WebSocket event, no Chat activity, and no history, and it\nis never replayed after an unblock. The sender's `message.delivered`\nfires when at least one recipient was delivered.",
|
|
1027
1137
|
"definitions": [
|
|
1028
1138
|
"export interface MessageCreateParams {\n to: string[];\n message: MessageContent;\n \"Idempotency-Key\"?: string;\n}",
|
|
1029
|
-
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
1030
|
-
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n |
|
|
1031
|
-
"export interface
|
|
1032
|
-
"export interface
|
|
1033
|
-
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
1034
|
-
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1035
|
-
"export interface MessageCreateResponse {\n from: string;\n chat_id: UUID;\n created_new_chat: boolean;\n is_group: boolean;\n handles: ChatHandle[];\n message: SentMessage;\n}",
|
|
1139
|
+
"export interface MessageContent {\n parts: MessagePart[];\n reply_to?: ReplyTo;\n /**\n * A2A Message metadata. A tap (an A2UI `action`) on a surface that set\n * `sendDataModel` must carry `a2uiClientDataModel`.\n */\n metadata?: MessageMetadata;\n idempotency_key?: string;\n /**\n * Send the Message with no banner and no sound on the recipient's device.\n * The Message still arrives, still counts as unread, and still moves the\n * Chat to the top of the list. Defaults to `false`.\n */\n silent?: boolean;\n}",
|
|
1140
|
+
"export type MessagePart =\n | TextPart\n | MediaPart\n | LinkPart\n | ButtonsPart\n | SelectionPart\n | SelectionResponsePart\n | PaymentPart\n | DataPart\n | PlacePart;",
|
|
1141
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
1142
|
+
"export interface MediaPart {\n type: \"media\";\n url?: string;\n attachment_id?: UUID;\n}",
|
|
1036
1143
|
"export type UUID = string;",
|
|
1144
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
1145
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
1146
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
1147
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
1148
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
1149
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
1150
|
+
"export interface PaymentPart {\n type: \"payment\";\n /** At most 2048 characters. */\n checkout_url: string;\n}",
|
|
1151
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
1152
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
1153
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
1154
|
+
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
1155
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
1037
1156
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
1038
1157
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
1039
1158
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
1040
|
-
"export
|
|
1159
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
1041
1160
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
1042
1161
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
1043
1162
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
1044
1163
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
1045
|
-
"export interface
|
|
1046
|
-
"export
|
|
1164
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
1165
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
1166
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
1167
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
1168
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
1169
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
1170
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
1171
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
1172
|
+
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
1173
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
1174
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
1175
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
1176
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
1177
|
+
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
1178
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
1179
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
1180
|
+
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
1181
|
+
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}",
|
|
1182
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
1183
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1184
|
+
"export interface MessageCreateResponse {\n /**\n * The A2UI messages of the send that were not applied, each with its place\n * in the request and A2UI's `error` message for it. The rest was applied.\n */\n a2ui_errors?: A2uiFailure[];\n from: string;\n chat_id: UUID;\n created_new_chat: boolean;\n is_group: boolean;\n handles: ChatHandle[];\n message: SentMessage;\n}",
|
|
1185
|
+
"export interface A2uiFailure {\n /** The data part's index in `parts`; null when the fault is in `metadata.a2uiClientDataModel`. */\n part_index: number | null;\n /** The message's index in that part's `data`; null when the part itself, or the metadata, is at fault. */\n data_index: number | null;\n a2ui_message: A2uiValidationErrorMessage;\n}",
|
|
1186
|
+
"export interface A2uiValidationErrorMessage {\n version: \"v0.9.1\";\n error: A2uiValidationError;\n}",
|
|
1187
|
+
"export interface A2uiValidationError {\n code: \"VALIDATION_FAILED\";\n surfaceId: string;\n path: string;\n message: string;\n}",
|
|
1188
|
+
"export interface SentMessage {\n id: UUID;\n parts: Array<\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n >;\n metadata?: MessageMetadata;\n created_at: string;\n sent_at: string | null;\n delivered_at?: string | null;\n delivery_status: DeliveryStatus;\n from_handle?: ChatHandle | null;\n reply_to?: ReplyTo | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n is_system_message: false;\n}"
|
|
1047
1189
|
],
|
|
1048
1190
|
"requestBody": {
|
|
1049
1191
|
"required": true,
|
|
@@ -1075,23 +1217,56 @@ export const METHOD_DOCS = [
|
|
|
1075
1217
|
"export type MessageThreadParams = MessageListParams;",
|
|
1076
1218
|
"export interface MessageListParams {\n cursor?: string;\n limit?: number;\n /**\n * `asc` (default) lists oldest first; `desc` opens on the newest Messages\n * and pages toward older ones. A cursor is only valid with the order it\n * was returned for.\n */\n order?: \"asc\" | \"desc\";\n}",
|
|
1077
1219
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1078
|
-
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
1220
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
1079
1221
|
"export type UUID = string;",
|
|
1080
1222
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
1081
1223
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
1224
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
1225
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
1082
1226
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
1083
|
-
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n |
|
|
1227
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
1084
1228
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
1229
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
1230
|
+
"export interface Reaction {\n is_me: boolean;\n handle: ChatHandle;\n type: ReactionType;\n custom_emoji?: string | null;\n}",
|
|
1231
|
+
"export type ReactionType =\n | \"love\"\n | \"like\"\n | \"dislike\"\n | \"laugh\"\n | \"emphasize\"\n | \"question\"\n | \"custom\";",
|
|
1085
1232
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
1086
1233
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
1234
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
1087
1235
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
1088
|
-
"export interface
|
|
1236
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
1237
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
1238
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
1239
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
1240
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
1241
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
1242
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
1243
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
1244
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
1245
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1246
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1247
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1248
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1249
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
1250
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
1251
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
1252
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
1253
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
1254
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
1255
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
1256
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
1089
1257
|
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
1090
1258
|
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
1091
|
-
"export interface
|
|
1092
|
-
"export
|
|
1259
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
1260
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
1261
|
+
"export type A2uiVersion = \"v0.9\" | \"v0.9.1\";",
|
|
1262
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
1263
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
1093
1264
|
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
1094
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
1265
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
1266
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
1267
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
1268
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
1269
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";",
|
|
1095
1270
|
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
1096
1271
|
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}"
|
|
1097
1272
|
],
|
|
@@ -1113,23 +1288,56 @@ export const METHOD_DOCS = [
|
|
|
1113
1288
|
"description": "Retrieve one visible Message.",
|
|
1114
1289
|
"definitions": [
|
|
1115
1290
|
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1116
|
-
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
1291
|
+
"export interface Message {\n id: UUID;\n chat_id: UUID;\n from?: string | null;\n from_handle?: ChatHandle | null;\n parts?: MessagePartResponse[] | null;\n reply_to?: ReplyTo | null;\n metadata?: MessageMetadata;\n is_system_message: boolean;\n system_event?: SystemEvent | null;\n is_from_me: boolean;\n delivery_status: DeliveryStatus;\n created_at: string;\n updated_at: string;\n sent_at?: string | null;\n delivered_at?: string | null;\n read_at?: string | null;\n /** When the Message was last edited, or null if it was never edited. */\n edited_at?: string | null;\n /**\n * When the sender unsent the Message, or null. An unsent Message keeps its\n * place in the transcript and carries no parts.\n */\n unsent_at?: string | null;\n /**\n * Whether the sender sent this Message silently, so the recipient's device\n * showed no banner and played no sound.\n */\n silent?: boolean;\n deliveries?: MessageDelivery[];\n}",
|
|
1117
1292
|
"export type UUID = string;",
|
|
1118
1293
|
"export type ChatHandle = UserChatHandle | AgentChatHandle;",
|
|
1119
1294
|
"export interface UserChatHandle extends ChatHandleBase {\n kind: \"user\";\n}",
|
|
1295
|
+
"interface ChatHandleBase {\n id: UUID;\n handle: string;\n status?: \"active\" | \"left\" | \"removed\" | null;\n joined_at: string;\n left_at?: string | null;\n is_me?: boolean | null;\n display_name: string | null;\n image_url: string | null;\n subtitle: string | null;\n verified: boolean;\n /** True when the caller holds this Handle as a Contact. */\n is_contact: boolean;\n activity_version?: string;\n activity?: ChatActivity | null;\n}",
|
|
1296
|
+
"export interface ChatActivity {\n id: UUID;\n text: string;\n emoji: string | null;\n updated_at: string;\n expires_at: string;\n}",
|
|
1120
1297
|
"export interface AgentChatHandle extends ChatHandleBase {\n kind: \"agent\";\n}",
|
|
1121
|
-
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n |
|
|
1298
|
+
"export type MessagePartResponse =\n | TextPartResponse\n | MediaPartResponse\n | LinkPartResponse\n | ButtonsPartResponse\n | SelectionPartResponse\n | SelectionResponsePartResponse\n | PaymentPartResponse\n | PaymentReceiptPartResponse\n | DataPartResponse\n | LocationRequestPartResponse\n | LocationPartResponse\n | PlacePartResponse\n | SystemPartResponse;",
|
|
1122
1299
|
"export interface TextPartResponse extends TextPart {\n mentions?: Array<{\n id: string;\n handle: string;\n is_me: boolean;\n range: [number, number];\n }> | null;\n /** @deprecated Use mentions instead. */\n mention?: string | null;\n /** @deprecated Use mentions instead. */\n mention_range?: [number, number] | null;\n reactions: Reaction[] | null;\n}",
|
|
1300
|
+
"export interface TextPart {\n type: \"text\";\n value: string;\n mention?: string | null;\n mention_range?: [number, number] | null;\n}",
|
|
1301
|
+
"export interface Reaction {\n is_me: boolean;\n handle: ChatHandle;\n type: ReactionType;\n custom_emoji?: string | null;\n}",
|
|
1302
|
+
"export type ReactionType =\n | \"love\"\n | \"like\"\n | \"dislike\"\n | \"laugh\"\n | \"emphasize\"\n | \"question\"\n | \"custom\";",
|
|
1123
1303
|
"export interface MediaPartResponse {\n type: \"media\";\n id: UUID;\n url: string;\n filename: string;\n mime_type: string;\n size_bytes: number;\n duration_ms?: number | null;\n width?: number | null;\n height?: number | null;\n reactions: Reaction[] | null;\n}",
|
|
1124
1304
|
"export interface LinkPartResponse extends LinkPart {\n reactions: Reaction[] | null;\n}",
|
|
1305
|
+
"export interface LinkPart {\n type: \"link\";\n value: string;\n}",
|
|
1125
1306
|
"export interface ButtonsPartResponse extends ButtonsPart {\n reactions: Reaction[] | null;\n}",
|
|
1126
|
-
"export interface
|
|
1307
|
+
"export interface ButtonsPart {\n type: \"buttons\";\n items: ButtonItem[];\n}",
|
|
1308
|
+
"export interface ButtonItem {\n /** Link button: the tap opens this HTTPS URL instead of sending the label. */\n url?: string;\n /** The button's visible text, 1 to 80 characters, and what a tap sends. */\n label: string;\n}",
|
|
1309
|
+
"export interface SelectionPartResponse extends SelectionPart {\n /** Durable response state for this viewer across devices. Existing Chat rules allow at most one human user; only that user can respond, once; reopening an answered selection shows what they chose without letting them change it. */\n readonly has_responded: boolean;\n /** The values the authenticated viewer chose, in source-option order, identical on every one of that user's devices; null until the viewer answers, when the answer Message no longer exists, and always for an agent viewer. */\n readonly selected_values: string[] | null;\n reactions: null;\n}",
|
|
1310
|
+
"export interface SelectionPart {\n type: \"selection\";\n /** The text is the prompt's title; the person checks any number of options and submits them once, and checking sends nothing. */\n options: SelectionOption[];\n}",
|
|
1311
|
+
"export interface SelectionOption {\n /** Unique case-sensitive ASCII token, 1–100 characters. Never derived from label. */\n value: string;\n /** Trimmed visible label, 1–80 characters. */\n label: string;\n}",
|
|
1312
|
+
"export interface Chat {\n id: UUID;\n display_name: string | null;\n group_chat_icon?: string | null;\n handles: ChatHandle[];\n is_group: boolean;\n /**\n * The caller's side of a message request on this Chat: `pending` while a\n * sender with no Contact edge to the caller wrote to them and they have not\n * answered, `accepted` or `deleted` once they have. Absent when the caller\n * was never asked; an agent never is.\n */\n created_at: string;\n updated_at: string;\n}",
|
|
1313
|
+
"export interface SelectionResponsePartResponse extends SelectionResponsePart {}",
|
|
1314
|
+
"export interface SelectionResponsePart {\n type: \"selection_response\";\n /**\n * Unique known values, nonempty and in source-option order, authoritative with\n * reply_to. New preceding text is literal '• ' + each source label joined with\n * '\\n'. The server accepts exact legacy comma-joined labels for compatibility\n * only, never arbitrary label parsing. iOS may draw a checkmark in place of\n * each bullet and repeat the prompt's title, as presentation only; portable\n * text remains bullets.\n */\n selected_values: string[];\n}",
|
|
1315
|
+
"export interface PaymentPartResponse {\n type: \"payment\";\n payment_request_id: UUID;\n checkout_url: string;\n /** Minor units. For a subscription, what the first period costs. */\n amount: number;\n currency: string;\n /** The card's title line. */\n description: string;\n category: PaymentCategory;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n /** The request's product picture, when it has one. */\n image_url?: string;\n status: PaymentStatus;\n /** Only a person can react to a payment. */\n reactions: Reaction[] | null;\n}",
|
|
1316
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1317
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1318
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1319
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1320
|
+
"export interface PaymentReceiptPartResponse {\n type: \"payment_receipt\";\n payment_request_id: UUID;\n description: string;\n /** What was paid, in minor units. For a subscription, what the first period cost. */\n amount: number;\n currency: string;\n mode: PaymentMode;\n recurring?: PaymentRecurring;\n reactions: Reaction[] | null;\n}",
|
|
1321
|
+
"export interface DataPartResponse extends DataPart {\n reactions: Reaction[] | null;\n}",
|
|
1322
|
+
"export interface DataPart {\n type: \"data\";\n media_type: \"application/a2ui+json\";\n data: A2uiMessage[];\n}",
|
|
1323
|
+
"export type A2uiMessage = A2uiServerToClientMessage | A2uiClientToServerMessage;",
|
|
1324
|
+
"export interface LocationRequestPartResponse {\n type: \"location_request\";\n reactions: Reaction[] | null;\n}",
|
|
1325
|
+
"export interface LocationPartResponse {\n type: \"location\";\n state: \"live\" | \"ended\";\n began_at: string | null;\n /** When the share ends by itself; null when it has no end. */\n ends_at: string | null;\n ended_at: string | null;\n reactions: Reaction[] | null;\n}",
|
|
1326
|
+
"export interface PlacePartResponse extends PlacePart {\n reactions: Reaction[] | null;\n}",
|
|
1327
|
+
"export interface PlacePart {\n type: \"place\";\n /** Latitude in degrees (WGS 84), -90 to 90. */\n latitude: number;\n /** Longitude in degrees (WGS 84), -180 to 180. */\n longitude: number;\n name?: string;\n address?: string;\n}",
|
|
1127
1328
|
"export interface SystemPartResponse {\n type: \"system\";\n value: string;\n reactions: null;\n}",
|
|
1128
1329
|
"export interface ReplyTo {\n message_id: UUID;\n part_index?: number;\n}",
|
|
1129
|
-
"export interface
|
|
1130
|
-
"export
|
|
1330
|
+
"export interface MessageMetadata {\n a2uiClientDataModel?: A2uiClientDataModel;\n}",
|
|
1331
|
+
"export interface A2uiClientDataModel {\n version: A2uiVersion;\n surfaces: Record<string, Record<string, unknown>>;\n}",
|
|
1332
|
+
"export type A2uiVersion = \"v0.9\" | \"v0.9.1\";",
|
|
1333
|
+
"export interface SystemEvent {\n type: SystemEventType;\n actor: SystemEventParty;\n subject: SystemEventParty | null;\n value: string | null;\n icon_attachment_id: UUID | null;\n contact_card: ContactCardItem | null;\n call: CallMarker | null;\n}",
|
|
1334
|
+
"export type SystemEventType =\n | \"chat_created\"\n | \"participant_added\"\n | \"participant_removed\"\n | \"group_name_updated\"\n | \"group_icon_updated\"\n | \"contact_card_shared\"\n | \"call\";",
|
|
1131
1335
|
"export interface SystemEventParty {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
1132
|
-
"export interface ContactCardItem {\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
1336
|
+
"export interface ContactCardItem {\n /** Detailed agent description, up to 2000 characters. Public agents cannot clear it. */\n description?: string | null;\n handle: string;\n first_name: string;\n last_name: string | null;\n image_url: string | null;\n is_active: boolean;\n /** Whether Relay has verified this agent. Always false for a user. */\n is_verified?: boolean;\n kind: \"user\" | \"agent\";\n}",
|
|
1337
|
+
"export interface CallMarker {\n id: UUID;\n status: Call[\"status\"];\n answered_at: string | null;\n ended_at: string | null;\n from: CallContact;\n to: [CallContact];\n duration_seconds: number | null;\n}",
|
|
1338
|
+
"export interface Call {\n id: UUID;\n chat_id: UUID;\n from: CallContact;\n to: [CallContact];\n /** `ringing` and `in-progress` are live. Terminal states set `ended_at`. */\n status: \"ringing\" | \"in-progress\" | CallTerminalStatus;\n revision: number;\n created_at: string;\n ringing_at: string;\n answered_at: string | null;\n ended_at: string | null;\n}",
|
|
1339
|
+
"export interface CallContact {\n id: UUID;\n handle: string;\n kind: \"user\" | \"agent\";\n}",
|
|
1340
|
+
"export type CallTerminalStatus =\n | \"completed\"\n | \"no-answer\"\n | \"canceled\"\n | \"busy\"\n | \"failed\";",
|
|
1133
1341
|
"export type DeliveryStatus =\n | \"sent\"\n | \"delivered\"\n | \"read\";",
|
|
1134
1342
|
"export interface MessageDelivery {\n contact: ChatHandle;\n delivered_at: string | null;\n read_at: string | null;\n}"
|
|
1135
1343
|
],
|
|
@@ -1137,6 +1345,127 @@ export const METHOD_DOCS = [
|
|
|
1137
1345
|
"executable": true,
|
|
1138
1346
|
"optionsIndex": 1
|
|
1139
1347
|
},
|
|
1348
|
+
{
|
|
1349
|
+
"method": "client.paymentRequests.cancel",
|
|
1350
|
+
"signature": "client.paymentRequests.cancel(paymentRequestID: string, options?: RequestOptions): Promise<PaymentRequest>",
|
|
1351
|
+
"parameters": [
|
|
1352
|
+
"paymentRequestID: string",
|
|
1353
|
+
"options?: RequestOptions"
|
|
1354
|
+
],
|
|
1355
|
+
"httpMethod": "POST",
|
|
1356
|
+
"path": "/v1/payment_requests/{paymentRequestId}/cancel",
|
|
1357
|
+
"operationId": "cancelPaymentRequest",
|
|
1358
|
+
"summary": "Cancel a payment request",
|
|
1359
|
+
"description": "Cancel a request that has not been paid: its PaymentIntent is\ncanceled (in subscription mode, the first-period invoice is voided and\nthe incomplete Subscription canceled), the request moves to\n`canceled`, every card that carries it changes in place, and your\nagent gets `payment.canceled`. A request that is already `succeeded`,\n`canceled` or `expired`, or that was paid before the cancel reached\nStripe, returns 409.\n",
|
|
1360
|
+
"definitions": [
|
|
1361
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1362
|
+
"export interface PaymentRequest {\n id: UUID;\n object: \"payment_request\";\n status: PaymentStatus;\n mode: PaymentMode;\n /** What the person is charged at checkout, in minor units. */\n amount: number;\n /** Relay's 5% fee in minor units. */\n application_fee_amount: number;\n currency: string;\n description: string;\n category: PaymentCategory;\n /** Relay's pay page for this request. Send it back unchanged in a `payment` part. */\n checkout_url: string;\n /** 23 hours after creation; the request then moves to `expired`. */\n expires_at: string;\n metadata: Record<string, string>;\n image_url?: string;\n price_id?: string;\n quantity?: number;\n interval?: PaymentRecurring[\"interval\"];\n interval_count?: number;\n discount?: PaymentDiscount;\n stripe: PaymentRequestStripe;\n /** Absent until the request succeeds. */\n paid_at?: string;\n created_at: string;\n updated_at: string;\n}",
|
|
1363
|
+
"export type UUID = string;",
|
|
1364
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1365
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1366
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1367
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1368
|
+
"export interface PaymentDiscount {\n /** The id of a coupon on your connected Stripe account. */\n coupon?: string;\n /** The id of a promotion code (`promo_...`), not the code a customer types. */\n promotion_code?: string;\n /** Your own name for the discount, stored and returned with the request. */\n label?: string;\n}",
|
|
1369
|
+
"export interface PaymentRequestStripe {\n /** The one PaymentIntent the person pays (`pi_...`). */\n payment_intent_id: string;\n customer_id?: string;\n /** Subscription mode (`sub_...`). */\n subscription_id?: string;\n}"
|
|
1370
|
+
],
|
|
1371
|
+
"requestBody": null,
|
|
1372
|
+
"executable": true,
|
|
1373
|
+
"optionsIndex": 1
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"method": "client.paymentRequests.create",
|
|
1377
|
+
"signature": "client.paymentRequests.create(body: PaymentRequestCreateParams, options?: PaymentRequestCreateOptions): Promise<PaymentRequest>",
|
|
1378
|
+
"parameters": [
|
|
1379
|
+
"body: PaymentRequestCreateParams",
|
|
1380
|
+
"options?: PaymentRequestCreateOptions"
|
|
1381
|
+
],
|
|
1382
|
+
"httpMethod": "POST",
|
|
1383
|
+
"path": "/v1/payment_requests",
|
|
1384
|
+
"operationId": "createPaymentRequest",
|
|
1385
|
+
"summary": "Create a payment request",
|
|
1386
|
+
"description": "Create a payment request and get back the `checkout_url`, Relay's pay\npage for it. Relay creates one Stripe PaymentIntent on your\norganization's own connected Stripe account, as a direct charge (in\nsubscription mode, an incomplete Subscription whose first-period\nPaymentIntent is that one object): the money settles to your Stripe\naccount, you are the merchant of record, and Relay never holds the\nfunds. Relay takes a 5% fee on every payment, as a Stripe application\nfee (`application_fee_amount`); in subscription mode it is 5% of every\nperiod. The pay page and the Relay app's payment sheet both pay that\nsame PaymentIntent, so a person can never pay twice. Refunds and\ndisputes are handled in your own Stripe Dashboard; when you refund a\npayment, Relay returns the same share of its fee.\n\nA request is payable for 23 hours (`expires_at`); after that Relay\nstops the payment and the request moves to `expired`.\n\nSend the request to a person as a `payment` message part. Its status\nmoves only on Stripe's word: `payment.succeeded`, `payment.canceled`\nand `payment.expired` tell your agent, and every card that carries\nthe request changes in place.\n\nReturns 403 until your organization has connected Stripe in the Relay\nConsole and the account can accept charges. Stripe's own validation\n(currency, minimum amount, an unknown price, customer or coupon) comes\nback as 400 carrying Stripe's message. Returns 503 while payments are\nnot available on this server.\n",
|
|
1387
|
+
"definitions": [
|
|
1388
|
+
"export interface PaymentRequestCreateParams {\n /** Payment mode: what to charge, in the currency's minor units. */\n amount?: number;\n /** Payment mode: a 3-letter ISO 4217 code, returned lowercase. */\n currency?: string;\n /** The card's title line and the checkout's product name. Trimmed; 1 to 32 characters. */\n description: string;\n category: PaymentCategory;\n /** Up to 49 keys of your own; keys starting with `relay_` are reserved. */\n metadata?: Record<string, string>;\n /** Defaults to `payment`. */\n mode?: PaymentMode;\n /** Subscription mode: an active recurring Price on your connected Stripe account. */\n price_id?: string;\n /** Subscription mode: units of the price. Defaults to 1. */\n quantity?: number;\n /** An existing Customer on your connected Stripe account (`cus_...`). */\n customer_id?: string;\n discount?: PaymentDiscount;\n /** Optional HTTPS product picture; Relay copies it into its own image store. */\n image_url?: string;\n}",
|
|
1389
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1390
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1391
|
+
"export interface PaymentDiscount {\n /** The id of a coupon on your connected Stripe account. */\n coupon?: string;\n /** The id of a promotion code (`promo_...`), not the code a customer types. */\n promotion_code?: string;\n /** Your own name for the discount, stored and returned with the request. */\n label?: string;\n}",
|
|
1392
|
+
"export interface PaymentRequestCreateOptions extends RequestOptions {\n /** Reusing a key with the same body returns the first request (200); with a different body, 409. */\n idempotencyKey?: string;\n}",
|
|
1393
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1394
|
+
"export interface PaymentRequest {\n id: UUID;\n object: \"payment_request\";\n status: PaymentStatus;\n mode: PaymentMode;\n /** What the person is charged at checkout, in minor units. */\n amount: number;\n /** Relay's 5% fee in minor units. */\n application_fee_amount: number;\n currency: string;\n description: string;\n category: PaymentCategory;\n /** Relay's pay page for this request. Send it back unchanged in a `payment` part. */\n checkout_url: string;\n /** 23 hours after creation; the request then moves to `expired`. */\n expires_at: string;\n metadata: Record<string, string>;\n image_url?: string;\n price_id?: string;\n quantity?: number;\n interval?: PaymentRecurring[\"interval\"];\n interval_count?: number;\n discount?: PaymentDiscount;\n stripe: PaymentRequestStripe;\n /** Absent until the request succeeds. */\n paid_at?: string;\n created_at: string;\n updated_at: string;\n}",
|
|
1395
|
+
"export type UUID = string;",
|
|
1396
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1397
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1398
|
+
"export interface PaymentRequestStripe {\n /** The one PaymentIntent the person pays (`pi_...`). */\n payment_intent_id: string;\n customer_id?: string;\n /** Subscription mode (`sub_...`). */\n subscription_id?: string;\n}"
|
|
1399
|
+
],
|
|
1400
|
+
"requestBody": {
|
|
1401
|
+
"required": true,
|
|
1402
|
+
"content": {
|
|
1403
|
+
"application/json": {
|
|
1404
|
+
"schema": {
|
|
1405
|
+
"$ref": "#/components/schemas/CreatePaymentRequestRequest"
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
"executable": true,
|
|
1411
|
+
"optionsIndex": 1
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
"method": "client.paymentRequests.list",
|
|
1415
|
+
"signature": "client.paymentRequests.list(query: PaymentRequestListParams = {}, options?: RequestOptions): Promise<PaymentRequestListResponse>",
|
|
1416
|
+
"parameters": [
|
|
1417
|
+
"query: PaymentRequestListParams = {}",
|
|
1418
|
+
"options?: RequestOptions"
|
|
1419
|
+
],
|
|
1420
|
+
"httpMethod": "GET",
|
|
1421
|
+
"path": "/v1/payment_requests",
|
|
1422
|
+
"operationId": "listPaymentRequests",
|
|
1423
|
+
"summary": "List payment requests",
|
|
1424
|
+
"description": "Your agent's payment requests, newest first.",
|
|
1425
|
+
"definitions": [
|
|
1426
|
+
"export interface PaymentRequestListParams {\n cursor?: string;\n /** 1 to 100; defaults to 20. */\n limit?: number;\n status?: PaymentStatus;\n}",
|
|
1427
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1428
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1429
|
+
"export interface PaymentRequestListResponse {\n payment_requests: PaymentRequest[];\n next_cursor: string | null;\n}",
|
|
1430
|
+
"export interface PaymentRequest {\n id: UUID;\n object: \"payment_request\";\n status: PaymentStatus;\n mode: PaymentMode;\n /** What the person is charged at checkout, in minor units. */\n amount: number;\n /** Relay's 5% fee in minor units. */\n application_fee_amount: number;\n currency: string;\n description: string;\n category: PaymentCategory;\n /** Relay's pay page for this request. Send it back unchanged in a `payment` part. */\n checkout_url: string;\n /** 23 hours after creation; the request then moves to `expired`. */\n expires_at: string;\n metadata: Record<string, string>;\n image_url?: string;\n price_id?: string;\n quantity?: number;\n interval?: PaymentRecurring[\"interval\"];\n interval_count?: number;\n discount?: PaymentDiscount;\n stripe: PaymentRequestStripe;\n /** Absent until the request succeeds. */\n paid_at?: string;\n created_at: string;\n updated_at: string;\n}",
|
|
1431
|
+
"export type UUID = string;",
|
|
1432
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1433
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1434
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1435
|
+
"export interface PaymentDiscount {\n /** The id of a coupon on your connected Stripe account. */\n coupon?: string;\n /** The id of a promotion code (`promo_...`), not the code a customer types. */\n promotion_code?: string;\n /** Your own name for the discount, stored and returned with the request. */\n label?: string;\n}",
|
|
1436
|
+
"export interface PaymentRequestStripe {\n /** The one PaymentIntent the person pays (`pi_...`). */\n payment_intent_id: string;\n customer_id?: string;\n /** Subscription mode (`sub_...`). */\n subscription_id?: string;\n}"
|
|
1437
|
+
],
|
|
1438
|
+
"requestBody": null,
|
|
1439
|
+
"executable": true,
|
|
1440
|
+
"optionsIndex": 1
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
"method": "client.paymentRequests.retrieve",
|
|
1444
|
+
"signature": "client.paymentRequests.retrieve(paymentRequestID: string, options?: RequestOptions): Promise<PaymentRequest>",
|
|
1445
|
+
"parameters": [
|
|
1446
|
+
"paymentRequestID: string",
|
|
1447
|
+
"options?: RequestOptions"
|
|
1448
|
+
],
|
|
1449
|
+
"httpMethod": "GET",
|
|
1450
|
+
"path": "/v1/payment_requests/{paymentRequestId}",
|
|
1451
|
+
"operationId": "getPaymentRequest",
|
|
1452
|
+
"summary": "Retrieve a payment request",
|
|
1453
|
+
"description": "A payment request belongs to the agent that created it; any other caller gets 404.",
|
|
1454
|
+
"definitions": [
|
|
1455
|
+
"export interface RequestOptions {\n signal?: AbortSignal;\n timeout?: number;\n maxRetries?: number;\n headers?: HeadersInit;\n}",
|
|
1456
|
+
"export interface PaymentRequest {\n id: UUID;\n object: \"payment_request\";\n status: PaymentStatus;\n mode: PaymentMode;\n /** What the person is charged at checkout, in minor units. */\n amount: number;\n /** Relay's 5% fee in minor units. */\n application_fee_amount: number;\n currency: string;\n description: string;\n category: PaymentCategory;\n /** Relay's pay page for this request. Send it back unchanged in a `payment` part. */\n checkout_url: string;\n /** 23 hours after creation; the request then moves to `expired`. */\n expires_at: string;\n metadata: Record<string, string>;\n image_url?: string;\n price_id?: string;\n quantity?: number;\n interval?: PaymentRecurring[\"interval\"];\n interval_count?: number;\n discount?: PaymentDiscount;\n stripe: PaymentRequestStripe;\n /** Absent until the request succeeds. */\n paid_at?: string;\n created_at: string;\n updated_at: string;\n}",
|
|
1457
|
+
"export type UUID = string;",
|
|
1458
|
+
"export type PaymentStatus = \"requested\" | \"succeeded\" | \"canceled\" | \"expired\";",
|
|
1459
|
+
"export type PaymentMode = \"payment\" | \"subscription\";",
|
|
1460
|
+
"export type PaymentCategory = \"physical_goods\" | \"digital_goods\" | \"donation\";",
|
|
1461
|
+
"export interface PaymentRecurring {\n interval: \"day\" | \"week\" | \"month\" | \"year\";\n /** Intervals per renewal (3 with `month` is quarterly). */\n interval_count: number;\n}",
|
|
1462
|
+
"export interface PaymentDiscount {\n /** The id of a coupon on your connected Stripe account. */\n coupon?: string;\n /** The id of a promotion code (`promo_...`), not the code a customer types. */\n promotion_code?: string;\n /** Your own name for the discount, stored and returned with the request. */\n label?: string;\n}",
|
|
1463
|
+
"export interface PaymentRequestStripe {\n /** The one PaymentIntent the person pays (`pi_...`). */\n payment_intent_id: string;\n customer_id?: string;\n /** Subscription mode (`sub_...`). */\n subscription_id?: string;\n}"
|
|
1464
|
+
],
|
|
1465
|
+
"requestBody": null,
|
|
1466
|
+
"executable": true,
|
|
1467
|
+
"optionsIndex": 1
|
|
1468
|
+
},
|
|
1140
1469
|
{
|
|
1141
1470
|
"method": "client.webhookEvents.list",
|
|
1142
1471
|
"signature": "client.webhookEvents.list(options?: RequestOptions): Promise<WebhookEventListResponse>",
|