@isnap/sdk 2.3.0 → 2.3.1-next.43615425532.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -40
- package/README.md +361 -167
- package/dist/client.d.ts +37 -49
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +47 -58
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +6 -6
- package/dist/config.js +6 -6
- package/dist/generated/openapi.d.ts +910 -91
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/sleep.d.ts +2 -2
- package/dist/internal/sleep.js +5 -5
- package/dist/internal/sleep.js.map +1 -1
- package/dist/resources/apps.d.ts +11 -18
- package/dist/resources/apps.d.ts.map +1 -1
- package/dist/resources/apps.js +11 -18
- package/dist/resources/apps.js.map +1 -1
- package/dist/resources/area-codes.d.ts +5 -6
- package/dist/resources/area-codes.d.ts.map +1 -1
- package/dist/resources/area-codes.js +5 -6
- package/dist/resources/area-codes.js.map +1 -1
- package/dist/resources/attachments.d.ts +51 -17
- package/dist/resources/attachments.d.ts.map +1 -1
- package/dist/resources/attachments.js +42 -22
- package/dist/resources/attachments.js.map +1 -1
- package/dist/resources/byod.d.ts +14 -4
- package/dist/resources/byod.d.ts.map +1 -1
- package/dist/resources/byod.js +14 -4
- package/dist/resources/byod.js.map +1 -1
- package/dist/resources/chats.d.ts +32 -22
- package/dist/resources/chats.d.ts.map +1 -1
- package/dist/resources/chats.js +31 -21
- package/dist/resources/chats.js.map +1 -1
- package/dist/resources/fleet.d.ts +23 -0
- package/dist/resources/fleet.d.ts.map +1 -0
- package/dist/resources/fleet.js +20 -0
- package/dist/resources/fleet.js.map +1 -0
- package/dist/resources/lines.d.ts +258 -268
- package/dist/resources/lines.d.ts.map +1 -1
- package/dist/resources/lines.js +251 -266
- package/dist/resources/lines.js.map +1 -1
- package/dist/resources/lookup.d.ts +10 -13
- package/dist/resources/lookup.d.ts.map +1 -1
- package/dist/resources/lookup.js +10 -13
- package/dist/resources/lookup.js.map +1 -1
- package/dist/resources/macos-sessions.d.ts +42 -36
- package/dist/resources/macos-sessions.d.ts.map +1 -1
- package/dist/resources/macos-sessions.js +24 -22
- package/dist/resources/macos-sessions.js.map +1 -1
- package/dist/resources/messages.d.ts +35 -25
- package/dist/resources/messages.d.ts.map +1 -1
- package/dist/resources/messages.js +30 -19
- package/dist/resources/messages.js.map +1 -1
- package/dist/resources/preorders.d.ts +42 -47
- package/dist/resources/preorders.d.ts.map +1 -1
- package/dist/resources/preorders.js +42 -47
- package/dist/resources/preorders.js.map +1 -1
- package/dist/resources/trial.d.ts +30 -21
- package/dist/resources/trial.d.ts.map +1 -1
- package/dist/resources/trial.js +30 -21
- package/dist/resources/trial.js.map +1 -1
- package/dist/resources/webhooks.d.ts +39 -22
- package/dist/resources/webhooks.d.ts.map +1 -1
- package/dist/resources/webhooks.js +39 -22
- package/dist/resources/webhooks.js.map +1 -1
- package/dist/retry.d.ts +9 -10
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +11 -12
- package/dist/retry.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +13 -37
- package/dist/version.js.map +1 -1
- package/dist/webhooks/parse.d.ts +10 -9
- package/dist/webhooks/parse.d.ts.map +1 -1
- package/dist/webhooks/parse.js +14 -13
- package/dist/webhooks/parse.js.map +1 -1
- package/dist/webhooks/types.d.ts +75 -111
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/types.js.map +1 -1
- package/dist/webhooks/verify.d.ts +27 -29
- package/dist/webhooks/verify.d.ts.map +1 -1
- package/dist/webhooks/verify.js +29 -35
- package/dist/webhooks/verify.js.map +1 -1
- package/examples/handle-webhook.ts +146 -0
- package/examples/paginate-messages.ts +54 -0
- package/examples/send-message.ts +37 -0
- package/examples/upload-attachment.ts +91 -0
- package/package.json +4 -8
|
@@ -505,7 +505,7 @@ export interface paths {
|
|
|
505
505
|
};
|
|
506
506
|
/**
|
|
507
507
|
* List your active and reserved lines
|
|
508
|
-
* @description Returns the lines you own whose `status` is `active` or `reserved`, of every kind: rented, BYOD, shared and test lines, and dedicated pool lines. Accepts an API key. Lines that are `suspended`, `provisioning` or `cancelled` are not returned. Lines are ordered by `created_at`, oldest first, with full phone numbers. The whole list comes in one response: there is no pagination and no filter, and the API sets no limit on its length. A line-scoped key gets only the lines in its list. `fulfillment_status` is present on this operation only. Each line carries its full phone number: this is personal data. Its `metadata` can contain personal data too.
|
|
508
|
+
* @description Returns the lines you own whose `status` is `active` or `reserved`, of every kind: rented, BYOD, shared and test lines, and dedicated pool lines. Accepts an API key. Lines that are `suspended`, `provisioning` or `cancelled` are not returned. Lines are ordered by `created_at`, oldest first, with full phone numbers. The whole list comes in one response: there is no pagination and no filter, and the API sets no limit on its length. A line-scoped key gets only the lines in its list. `fulfillment_status` is present on this operation only. Each line carries `health_score`: the latest stored health score of the line, or `null` when none is stored yet. Each line carries its full phone number: this is personal data. Its `metadata` can contain personal data too.
|
|
509
509
|
*/
|
|
510
510
|
get: {
|
|
511
511
|
parameters: {
|
|
@@ -591,7 +591,7 @@ export interface paths {
|
|
|
591
591
|
};
|
|
592
592
|
/**
|
|
593
593
|
* Get a line
|
|
594
|
-
* @description Returns one rented or BYOD line, in any status. Needs no credential: any caller that has the id gets the line object, `metadata` and billing dates included, with `phone_number` masked. Send an API key of the account that owns the line to get the full number; a line-scoped key gets it for any line of its account. A credential that is invalid, or that belongs to another account, gets the masked number and never a `401`. Shared lines, test lines and dedicated pool lines return `404 not_found` here, even to their owner: read them with `GET /v1/lines/my`.
|
|
594
|
+
* @description Returns one rented or BYOD line, in any status. Needs no credential: any caller that has the id gets the line object, `metadata` and billing dates included, with `phone_number` masked. Send an API key of the account that owns the line to get the full number; a line-scoped key gets it for any line of its account. A credential that is invalid, or that belongs to another account, gets the masked number and never a `401`. Shared lines, test lines and dedicated pool lines return `404 not_found` here, even to their owner: read them with `GET /v1/lines/my`. The line carries `health_score` only for the account that owns it (for a line-scoped key, only for a line in its list): the latest stored health score of the line, or `null` when none is stored yet. Any other caller gets the line without the `health_score` key.
|
|
595
595
|
*/
|
|
596
596
|
get: {
|
|
597
597
|
parameters: {
|
|
@@ -927,7 +927,7 @@ export interface paths {
|
|
|
927
927
|
*
|
|
928
928
|
* Without `inbound_first`, the line is a billed line, for wholesale partners only: any other account gets `402 payment_required`. It has no per-line subscription and is billed on the monthly wholesale invoice. Every call creates one more billable line, and the API sets no limit on their number.
|
|
929
929
|
*
|
|
930
|
-
* With `inbound_first: true` the line is an inbound-first line. It answers only contacts who wrote to it first, each from the number that contact wrote to, and never writes first: a send to any other contact gets `403 outbound_first_forbidden`.
|
|
930
|
+
* With `inbound_first: true` the line is an inbound-first line. It answers only contacts who wrote to it first, each from the number that contact wrote to, and never writes first: a send to any other contact gets `403 outbound_first_forbidden`. Inbound-first lines are a private alpha, enabled per account on request: an account they are not enabled on gets `403 inbound_pool_not_enabled`, and an account they are enabled on creates one whether or not it is a wholesale partner. The numbers its contacts write to come from the iSnap pool, one per invite (`POST /v1/lines/{line_id}/invites`). The line carries `inbound_only: true`. It has no anniversary, so it cannot be canceled at one: end it with `POST /v1/lines/{id}/terminate`.
|
|
931
931
|
*/
|
|
932
932
|
post: {
|
|
933
933
|
parameters: {
|
|
@@ -992,7 +992,7 @@ export interface paths {
|
|
|
992
992
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
993
993
|
};
|
|
994
994
|
};
|
|
995
|
-
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped. A line-scoped key cannot acquire a line. `
|
|
995
|
+
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped. A line-scoped key cannot acquire a line. `inbound_pool_not_enabled`: `inbound_first` is `true` and inbound-first lines are not enabled on the account, a private alpha enabled per account on request. No line is created. */
|
|
996
996
|
403: {
|
|
997
997
|
headers: {
|
|
998
998
|
[name: string]: unknown;
|
|
@@ -2496,7 +2496,7 @@ export interface paths {
|
|
|
2496
2496
|
};
|
|
2497
2497
|
/**
|
|
2498
2498
|
* Get the sending limits of a line
|
|
2499
|
-
* @description Returns the five sending limits of a line you own with their counters, the reply-lane allowance, the time at which each full counter drops back under its limit, and a flag per counter that is `true` from 80% of its limit. Accepts an API key. Every counter covers a rolling window: the last 60 seconds, the last 60 minutes or the last 24 hours. No counter resets at midnight. A held message counts when it is released, not when it is accepted.
|
|
2499
|
+
* @description Returns the five sending limits of a line you own with their counters, the reply-lane allowance, the priority allowance (`priority`), the time at which each full counter drops back under its limit, and a flag per counter that is `true` from 80% of its limit. Accepts an API key. Every counter covers a rolling window: the last 60 seconds, the last 60 minutes or the last 24 hours. No counter resets at midnight. A held message counts when it is released, not when it is accepted.
|
|
2500
2500
|
*/
|
|
2501
2501
|
get: {
|
|
2502
2502
|
parameters: {
|
|
@@ -2784,6 +2784,102 @@ export interface paths {
|
|
|
2784
2784
|
patch?: never;
|
|
2785
2785
|
trace?: never;
|
|
2786
2786
|
};
|
|
2787
|
+
"/v1/lines/{id}/health-score/report": {
|
|
2788
|
+
parameters: {
|
|
2789
|
+
query?: never;
|
|
2790
|
+
header?: never;
|
|
2791
|
+
path?: never;
|
|
2792
|
+
cookie?: never;
|
|
2793
|
+
};
|
|
2794
|
+
/**
|
|
2795
|
+
* Get the health score report of a line
|
|
2796
|
+
* @description Returns, in plain language, why the latest health score of a line you own is what it is and what to do about it: the `score` and `band` as last computed, a `summary` sentence, and up to 3 `items`, the factors that add the most risk, largest first, each with an `explanation` and an `action`. Accepts an API key. Works for every line you own. On a BYOD line the factors include the ones about your own device; on any other line only the factors you can act on are listed, and the ones iSnap resolves say so. A line with no stored score yet, or with too little traffic to judge, returns `200` with `band` `unknown`, no `items` and `score` `null`. A `low` band with no item means no risk is observed.
|
|
2797
|
+
*/
|
|
2798
|
+
get: {
|
|
2799
|
+
parameters: {
|
|
2800
|
+
query?: never;
|
|
2801
|
+
header?: never;
|
|
2802
|
+
path: {
|
|
2803
|
+
/** @description Id of a line: `line_` followed by 25 letters or digits. */
|
|
2804
|
+
id: string;
|
|
2805
|
+
};
|
|
2806
|
+
cookie?: never;
|
|
2807
|
+
};
|
|
2808
|
+
requestBody?: never;
|
|
2809
|
+
responses: {
|
|
2810
|
+
/** @description The report of the latest health score of the line. */
|
|
2811
|
+
200: {
|
|
2812
|
+
headers: {
|
|
2813
|
+
[name: string]: unknown;
|
|
2814
|
+
};
|
|
2815
|
+
content: {
|
|
2816
|
+
"application/json": components["schemas"]["LineHealthReportEnvelope"];
|
|
2817
|
+
};
|
|
2818
|
+
};
|
|
2819
|
+
/** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. */
|
|
2820
|
+
400: {
|
|
2821
|
+
headers: {
|
|
2822
|
+
[name: string]: unknown;
|
|
2823
|
+
};
|
|
2824
|
+
content: {
|
|
2825
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2826
|
+
};
|
|
2827
|
+
};
|
|
2828
|
+
/** @description No valid credential. `error.code` is `unauthorized`. */
|
|
2829
|
+
401: {
|
|
2830
|
+
headers: {
|
|
2831
|
+
[name: string]: unknown;
|
|
2832
|
+
};
|
|
2833
|
+
content: {
|
|
2834
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2835
|
+
};
|
|
2836
|
+
};
|
|
2837
|
+
/** @description Refused. `forbidden`: the key is line-scoped and this line is outside its list. */
|
|
2838
|
+
403: {
|
|
2839
|
+
headers: {
|
|
2840
|
+
[name: string]: unknown;
|
|
2841
|
+
};
|
|
2842
|
+
content: {
|
|
2843
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2844
|
+
};
|
|
2845
|
+
};
|
|
2846
|
+
/** @description Not found. `not_found`: the line does not exist, or it is not yours. */
|
|
2847
|
+
404: {
|
|
2848
|
+
headers: {
|
|
2849
|
+
[name: string]: unknown;
|
|
2850
|
+
};
|
|
2851
|
+
content: {
|
|
2852
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2853
|
+
};
|
|
2854
|
+
};
|
|
2855
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
2856
|
+
429: {
|
|
2857
|
+
headers: {
|
|
2858
|
+
[name: string]: unknown;
|
|
2859
|
+
};
|
|
2860
|
+
content: {
|
|
2861
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2862
|
+
};
|
|
2863
|
+
};
|
|
2864
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
2865
|
+
500: {
|
|
2866
|
+
headers: {
|
|
2867
|
+
[name: string]: unknown;
|
|
2868
|
+
};
|
|
2869
|
+
content: {
|
|
2870
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
2871
|
+
};
|
|
2872
|
+
};
|
|
2873
|
+
};
|
|
2874
|
+
};
|
|
2875
|
+
put?: never;
|
|
2876
|
+
post?: never;
|
|
2877
|
+
delete?: never;
|
|
2878
|
+
options?: never;
|
|
2879
|
+
head?: never;
|
|
2880
|
+
patch?: never;
|
|
2881
|
+
trace?: never;
|
|
2882
|
+
};
|
|
2787
2883
|
"/v1/lines/{id}/config": {
|
|
2788
2884
|
parameters: {
|
|
2789
2885
|
query?: never;
|
|
@@ -2793,7 +2889,7 @@ export interface paths {
|
|
|
2793
2889
|
};
|
|
2794
2890
|
/**
|
|
2795
2891
|
* Get the configuration of a line
|
|
2796
|
-
* @description Returns the sending configuration of a line you own, of any kind. Accepts an API key. `config` holds the value in force for every key, `overridden_keys` lists the keys that have an override on this line, `default_activity_curve` is the sending curve the line has without an override, and `knobs` gives, for
|
|
2892
|
+
* @description Returns the sending configuration of a line you own, of any kind. Accepts an API key. `config` holds the value in force for every key, `overridden_keys` lists the keys that have an override on this line, `default_activity_curve` is the sending curve the line has without an override, and `knobs` gives, for nine limits, the value in force (`current`), the `default`, and the bounds `min` and `max`. A value above `default` is accepted only for the five message limits of a BYOD line, up to `max`: for the three reply limits and the priority limit, and for the five message limits of any other line, `PATCH /v1/lines/{id}/config` returns `403 cannot_increase_limit`. A value above `max` is refused first, on every line, with `422 limit_out_of_bounds` or `400 validation_failed`. Default values depend on whether the line is an iMessage line or an Android line, and iSnap can change them: read them here instead of storing them.
|
|
2797
2893
|
*/
|
|
2798
2894
|
get: {
|
|
2799
2895
|
parameters: {
|
|
@@ -2979,9 +3075,9 @@ export interface paths {
|
|
|
2979
3075
|
put?: never;
|
|
2980
3076
|
/**
|
|
2981
3077
|
* Create an invite
|
|
2982
|
-
* @description Picks a phone number for one of your inbound-first lines and issues a code for it. Accepts an API key. Put the number and the code in the text you ask a visitor to send, for example in an `sms:` link: the text the visitor sends to that number with the code in it links the visitor to the line, and the line can then answer the visitor from that number. Never show the number without its code.
|
|
3078
|
+
* @description Picks a phone number from the iSnap pool for one of your inbound-first lines and issues a code for it. Accepts an API key. Put the number and the code in the text you ask a visitor to send, for example in an `sms:` link: the text the visitor sends to that number with the code in it links the visitor to the line, and the line can then answer the visitor from that number. Never show the number without its code.
|
|
2983
3079
|
*
|
|
2984
|
-
* Every call issues a new invite with a new code, even for the same visitor: `Idempotency-Key` is ignored, and a repeated call issues another invite. iSnap spreads the invites over the numbers that can take them; pass in `exclude` the numbers you do not want for this visitor. The body is optional; when you send one, send it as `application/json`: a body of any other type is refused with `400 validation_failed`. This operation sends no event.
|
|
3080
|
+
* Every call issues a new invite with a new code, even for the same visitor: `Idempotency-Key` is ignored, and a repeated call issues another invite. iSnap spreads the invites over the numbers that can take them; pass in `exclude` the numbers you do not want for this visitor. Inbound-first lines are a private alpha, enabled per account on request: an account they are not enabled on gets `403 inbound_pool_not_enabled`, whatever line it names. The body is optional; when you send one, send it as `application/json`: a body of any other type is refused with `400 validation_failed`. This operation sends no event.
|
|
2985
3081
|
*/
|
|
2986
3082
|
post: {
|
|
2987
3083
|
parameters: {
|
|
@@ -3037,7 +3133,7 @@ export interface paths {
|
|
|
3037
3133
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
3038
3134
|
};
|
|
3039
3135
|
};
|
|
3040
|
-
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped and this line is outside its list. */
|
|
3136
|
+
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped and this line is outside its list. `inbound_pool_not_enabled`: inbound-first lines are not enabled on the account, a private alpha enabled per account on request. No invite is issued. */
|
|
3041
3137
|
403: {
|
|
3042
3138
|
headers: {
|
|
3043
3139
|
[name: string]: unknown;
|
|
@@ -5009,11 +5105,11 @@ export interface paths {
|
|
|
5009
5105
|
};
|
|
5010
5106
|
/**
|
|
5011
5107
|
* List messages
|
|
5012
|
-
* @description Lists the messages your account sent and received that iSnap still keeps: it deletes a message at least 72 hours after it recorded it. Newest first by default. Filter with `line_id`, `status`, `direction`, `kind`, `since` and `until`.
|
|
5108
|
+
* @description Lists the messages your account sent and received that iSnap still keeps: it deletes a message at least 72 hours after it recorded it. Newest first by default. Filter with `line_id`, `contact`, `status`, `direction`, `kind`, `since` and `until`. `contact` selects one conversation of a line: with `line_id`, `contact` and `since`, the page holds only the messages exchanged with that handle from `since`, in both directions. A phone number is brought to E.164 and an email handle is compared without regard to case. `limit` counts the messages that match every filter. No filter selects one chat. A `line_id` that does not exist, or that is not a line of your account, returns an empty page and not `404`. Each item is the same message object as `GET /v1/messages/{id}` returns, with `queue_info` set to `null`. An item whose `kind` is `reaction` does not say which message it reacts to: filter with `kind=message` and read the `reactions` of each message.
|
|
5013
5109
|
*
|
|
5014
|
-
* The response carries `items`, `has_more` and `next_cursor`. Pass `next_cursor` as `cursor` to get the next page, and stop when `has_more` is `false`: `next_cursor` is then `null`. A cursor is valid only with the `sort`, `order` and filters of the request that returned it: write `since` and `until` the same way on every page. A malformed cursor, or one sent with another sort, order or filter, is not an error: the list restarts from the first page, and nothing in the response says so. With `sort=created_at`, a page that holds an id you already have means that the list restarted. Cursors do not expire.
|
|
5110
|
+
* The response carries `items`, `has_more` and `next_cursor`. Pass `next_cursor` as `cursor` to get the next page, and stop when `has_more` is `false`: `next_cursor` is then `null`. A cursor is valid only with the `sort`, `order` and filters of the request that returned it, `contact` included: write `since` and `until` the same way on every page. A malformed cursor, or one sent with another sort, order or filter, is not an error: the list restarts from the first page, and nothing in the response says so. With `sort=created_at`, a page that holds an id you already have means that the list restarted. Cursors do not expire.
|
|
5015
5111
|
*
|
|
5016
|
-
* Accepts an API key or a trial key. A line-scoped key lists only the messages of the lines in its `line_ids`. A trial key lists only the messages of its trial
|
|
5112
|
+
* Accepts an API key or a trial key. A line-scoped key lists only the messages of the lines in its `line_ids`. A trial key lists only the messages of its trial, and the notices iSnap sent to its paired handle since the trial started: those carry `system: true`. `GET /v1/messages` and `POST /v1/messages` share one budget of 60 requests in 60 seconds, per account with an API key and per network address with a trial key: above it the API returns `429 rate_limit_exceeded` with `Retry-After: 60`. Each item carries personal data: handles, message text, file names and `metadata`.
|
|
5017
5113
|
*/
|
|
5018
5114
|
get: {
|
|
5019
5115
|
parameters: {
|
|
@@ -5030,6 +5126,8 @@ export interface paths {
|
|
|
5030
5126
|
until?: string;
|
|
5031
5127
|
/** @description `message` leaves out voice notes and reaction entries. `voice` and `reaction` return only those. Omit it for all kinds. */
|
|
5032
5128
|
kind?: "message" | "voice" | "reaction";
|
|
5129
|
+
/** @description Only the messages exchanged with this contact: the inbound messages whose `from` is the handle and the outbound messages whose `to` is the handle. A phone number in any form that parses as a valid number (a number without a country code is read as a US number) is brought to E.164. An email handle is compared without regard to case. An invalid handle gives `400 validation_failed`. */
|
|
5130
|
+
contact?: string;
|
|
5033
5131
|
/** @description `created_at`, the default, orders by the time iSnap recorded each message. `scheduled_for` orders by planned departure, the value of the `scheduled_for` field: messages that have none, which are the inbound messages and the messages typed on the device of a line, come last in both directions. */
|
|
5034
5132
|
sort?: "created_at" | "scheduled_for";
|
|
5035
5133
|
/** @description `desc` or `asc`. When omitted: `desc` for `sort=created_at` (newest first) and `asc` for `sort=scheduled_for` (soonest first). */
|
|
@@ -5164,6 +5262,10 @@ export interface paths {
|
|
|
5164
5262
|
use_typing_indicator?: boolean;
|
|
5165
5263
|
/** @description `true` to let this message leave during the quiet hours of the line: the hours whose weight is 0 in the line's `activity_curve`, counted in the recipient's local time. Use it for a recipient of your own, such as an alert to your own phone number. The default is `false`. The message still waits for the sending limits of the line, for the spacing between messages and behind an earlier message to the same recipient that iSnap holds. No effect on a shared line. The response returns the value in effect. */
|
|
5166
5264
|
ignore_quiet_hours?: boolean;
|
|
5265
|
+
/** @description `true` to let this message skip the hourly sending limit of the line, within a small reserve per rolling 24 hours (`daily_priority_limit` in `GET /v1/lines/{id}/config`, 3 by default, `GET /v1/lines/{id}/quota` reports `priority`). The reserve is part of the line's daily limit, not added to it, and a message is counted against it only when the hourly limit would have held the message. The message still waits for the per-minute limit, for the spacing between messages, behind an earlier message to the same recipient that iSnap holds, and for `daily_new_contact_limit` and `daily_known_contact_limit`. When the reply lane already carries the message, the reply lane is used and the reserve is not. Once the reserve is spent, the message is held or refused like any other message, and a held message leaves before the messages of the line that are not priority. The default is `false`. The response returns the value in effect in `priority`. */
|
|
5266
|
+
priority?: boolean;
|
|
5267
|
+
/** @description `true` to cancel the message if its recipient writes to the line before the message is with the line's device. iSnap then cancels it as `DELETE /v1/messages/{message_id}` does (status `cancelled`, one `message.cancelled` event) and never sends it. A message that the device already holds, or that was sent, is not cancelled. Use it for a follow-up that is pointless once the recipient has answered. Only a message created before the recipient's message was received is cancelled. The default is `false`. The response returns the value in effect. */
|
|
5268
|
+
cancel_on_reply?: boolean;
|
|
5167
5269
|
/**
|
|
5168
5270
|
* @description Your own keys and values for this message: at most 20 keys and 8,192 bytes once serialized as JSON, otherwise the API returns `400 validation_failed`. iSnap stores the object as sent and returns it in `metadata` of the message, in every response and in the events of the message.
|
|
5169
5271
|
* @example {
|
|
@@ -6556,7 +6658,7 @@ export interface paths {
|
|
|
6556
6658
|
};
|
|
6557
6659
|
/**
|
|
6558
6660
|
* Get an attachment
|
|
6559
|
-
* @description Returns one attachment and, when its `status` is `ready`, a signed `download_url` valid for 15 minutes: until `download_expires_at`. Call again for a new URL. For any other `status`, `download_url` and `download_expires_at` are `null`. An account can read the attachments it created and the files received on its inbound messages: any other id returns `404 not_found`. Once `expires_at` has passed, 72 hours after the attachment was created, or after iSnap registered a received file, the API returns `410 attachment_expired` and iSnap deletes the file. No event announces a change of `status`. Accepts an API key. The `line_ids` of a line-scoped key are not checked: the key reads every attachment the account can read. `filename` can carry personal data.
|
|
6661
|
+
* @description Returns one attachment and, when its `status` is `ready`, a signed `download_url` valid for 15 minutes: until `download_expires_at`. Call again for a new URL. For any other `status`, `download_url` and `download_expires_at` are `null`. An account can read the attachments it created and the files received on its inbound messages: any other id returns `404 not_found`. Once `expires_at` has passed, 72 hours after the attachment was created, or after iSnap registered a received file, the API returns `410 attachment_expired` and iSnap deletes the file. No event announces a change of `status`. Accepts an API key or a trial key. The `line_ids` of a line-scoped key are not checked: the key reads every attachment the account can read. A trial key reads only the files received in its own trial thread, that is on messages on the line of the trial, to or from the phone number paired with the trial, and gets `404 not_found` for any other attachment, including those of another trial on the same line or of an earlier trial of the same number. A trial key cannot create attachments: `POST /v1/attachments` refuses it with `401`. `filename` can carry personal data.
|
|
6560
6662
|
*/
|
|
6561
6663
|
get: {
|
|
6562
6664
|
parameters: {
|
|
@@ -6608,7 +6710,7 @@ export interface paths {
|
|
|
6608
6710
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
6609
6711
|
};
|
|
6610
6712
|
};
|
|
6611
|
-
/** @description Not found. `error.code` is `not_found`: the attachment does not exist, or it is neither an attachment your account created nor a file received on one of its inbound messages. */
|
|
6713
|
+
/** @description Not found. `error.code` is `not_found`: the attachment does not exist, or it is neither an attachment your account created nor a file received on one of its inbound messages, or, with a trial key, it is not a file received in the thread of the trial. */
|
|
6612
6714
|
404: {
|
|
6613
6715
|
headers: {
|
|
6614
6716
|
[name: string]: unknown;
|
|
@@ -6924,6 +7026,8 @@ export interface paths {
|
|
|
6924
7026
|
since?: string;
|
|
6925
7027
|
/** @description Inclusive upper bound on `last_message_at`: an ISO 8601 timestamp with a UTC offset, for example `2026-01-15T15:00:00Z`. */
|
|
6926
7028
|
until?: string;
|
|
7029
|
+
/** @description Only the chats whose `health.status` is one of these statuses: a comma-separated list of `healthy`, `at_risk`, `critical` and `opted_out`. A chat whose `health` is `null`, a group or a chat of a trial line, is never returned. Any other value returns `400 validation_failed`. Omit it, or leave it blank, for no filter. */
|
|
7030
|
+
health?: string;
|
|
6927
7031
|
};
|
|
6928
7032
|
header?: never;
|
|
6929
7033
|
path?: never;
|
|
@@ -7073,6 +7177,96 @@ export interface paths {
|
|
|
7073
7177
|
patch?: never;
|
|
7074
7178
|
trace?: never;
|
|
7075
7179
|
};
|
|
7180
|
+
"/v1/chats/{chat_id}/participants": {
|
|
7181
|
+
parameters: {
|
|
7182
|
+
query?: never;
|
|
7183
|
+
header?: never;
|
|
7184
|
+
path?: never;
|
|
7185
|
+
cookie?: never;
|
|
7186
|
+
};
|
|
7187
|
+
/**
|
|
7188
|
+
* List the members of a chat
|
|
7189
|
+
* @description Returns the members of a chat, oldest first, each with its `handle` and `joined_at`. On a group (`is_group` is `true` on the chat), these are the members iSnap has recorded for it: the current ones, or, with `at`, the ones it had at that time. A group whose members iSnap has not recorded yet returns an empty list. A chat that is not a group returns its one contact, whatever `at` is. A malformed `at` returns `400 validation_failed`. Accepts an API key. A chat that does not exist, whose line is not yours, or that is on a line outside a line-scoped key's `line_ids` returns `404 not_found`. `handle` is personal data.
|
|
7190
|
+
*/
|
|
7191
|
+
get: {
|
|
7192
|
+
parameters: {
|
|
7193
|
+
query?: {
|
|
7194
|
+
/** @description An ISO 8601 timestamp with a UTC offset, for example `2026-01-15T14:00:00Z`. Returns the members the group had at that time. Omit it for the current members. It has no effect on a chat that is not a group. */
|
|
7195
|
+
at?: string;
|
|
7196
|
+
};
|
|
7197
|
+
header?: never;
|
|
7198
|
+
path: {
|
|
7199
|
+
/** @description Chat id: `chat_` followed by 25 letters or digits. */
|
|
7200
|
+
chat_id: string;
|
|
7201
|
+
};
|
|
7202
|
+
cookie?: never;
|
|
7203
|
+
};
|
|
7204
|
+
requestBody?: never;
|
|
7205
|
+
responses: {
|
|
7206
|
+
/** @description The members of the chat. */
|
|
7207
|
+
200: {
|
|
7208
|
+
headers: {
|
|
7209
|
+
[name: string]: unknown;
|
|
7210
|
+
};
|
|
7211
|
+
content: {
|
|
7212
|
+
"application/json": components["schemas"]["ChatParticipantListEnvelope"];
|
|
7213
|
+
};
|
|
7214
|
+
};
|
|
7215
|
+
/** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. */
|
|
7216
|
+
400: {
|
|
7217
|
+
headers: {
|
|
7218
|
+
[name: string]: unknown;
|
|
7219
|
+
};
|
|
7220
|
+
content: {
|
|
7221
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7222
|
+
};
|
|
7223
|
+
};
|
|
7224
|
+
/** @description No valid credential. `error.code` is `unauthorized`. */
|
|
7225
|
+
401: {
|
|
7226
|
+
headers: {
|
|
7227
|
+
[name: string]: unknown;
|
|
7228
|
+
};
|
|
7229
|
+
content: {
|
|
7230
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7231
|
+
};
|
|
7232
|
+
};
|
|
7233
|
+
/** @description Not found. `error.code` is `not_found`: the chat does not exist, its line is not yours, or it is on a line outside the key's `line_ids`. */
|
|
7234
|
+
404: {
|
|
7235
|
+
headers: {
|
|
7236
|
+
[name: string]: unknown;
|
|
7237
|
+
};
|
|
7238
|
+
content: {
|
|
7239
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7240
|
+
};
|
|
7241
|
+
};
|
|
7242
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
7243
|
+
429: {
|
|
7244
|
+
headers: {
|
|
7245
|
+
[name: string]: unknown;
|
|
7246
|
+
};
|
|
7247
|
+
content: {
|
|
7248
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7249
|
+
};
|
|
7250
|
+
};
|
|
7251
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
7252
|
+
500: {
|
|
7253
|
+
headers: {
|
|
7254
|
+
[name: string]: unknown;
|
|
7255
|
+
};
|
|
7256
|
+
content: {
|
|
7257
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7258
|
+
};
|
|
7259
|
+
};
|
|
7260
|
+
};
|
|
7261
|
+
};
|
|
7262
|
+
put?: never;
|
|
7263
|
+
post?: never;
|
|
7264
|
+
delete?: never;
|
|
7265
|
+
options?: never;
|
|
7266
|
+
head?: never;
|
|
7267
|
+
patch?: never;
|
|
7268
|
+
trace?: never;
|
|
7269
|
+
};
|
|
7076
7270
|
"/v1/chats/{chat_id}/share-contact-card": {
|
|
7077
7271
|
parameters: {
|
|
7078
7272
|
query?: never;
|
|
@@ -8656,81 +8850,421 @@ export interface paths {
|
|
|
8656
8850
|
patch?: never;
|
|
8657
8851
|
trace?: never;
|
|
8658
8852
|
};
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
/**
|
|
8666
|
-
* @description `ok` when every check passes, `degraded` otherwise.
|
|
8667
|
-
* @enum {string}
|
|
8668
|
-
*/
|
|
8669
|
-
status: "ok" | "degraded";
|
|
8670
|
-
/** @description Timestamp of the check (ISO 8601, UTC). */
|
|
8671
|
-
timestamp: string;
|
|
8672
|
-
/** @description One entry per dependency of the API. Each value is `ok` or `error`. */
|
|
8673
|
-
checks: {
|
|
8674
|
-
[key: string]: string;
|
|
8675
|
-
};
|
|
8676
|
-
};
|
|
8677
|
-
/** @description The body of an error response. */
|
|
8678
|
-
ErrorEnvelope: {
|
|
8679
|
-
/**
|
|
8680
|
-
* @description Always `false` on an error response.
|
|
8681
|
-
* @enum {boolean}
|
|
8682
|
-
*/
|
|
8683
|
-
success: false;
|
|
8684
|
-
/** @description Always `null` on an error response. */
|
|
8685
|
-
data: unknown;
|
|
8686
|
-
/** @description What went wrong. The six fields are always present; `retry_after`, `retry_at` and `issues` are `null` when they do not apply. */
|
|
8687
|
-
error: {
|
|
8688
|
-
/** @description The HTTP status of the response. */
|
|
8689
|
-
status: number;
|
|
8690
|
-
/** @description Stable machine-readable code that names the refusal. Branch on this value. */
|
|
8691
|
-
code: string;
|
|
8692
|
-
/** @description Text for a person. It can change between versions: do not branch on it. */
|
|
8693
|
-
message: string;
|
|
8694
|
-
/** @description Seconds to wait before the next attempt. Set on the `429` responses that know a delay, where the `Retry-After` header carries the same value. When it is above 60 seconds, do not wait in a request: schedule the call, or report the time. `null` on every other error. */
|
|
8695
|
-
retry_after: number | null;
|
|
8696
|
-
/** @description ISO 8601 timestamp at which the refusal ends. Set only on `429 rebind_cap_reached`. `null` on every other error. */
|
|
8697
|
-
retry_at: string | null;
|
|
8698
|
-
/** @description Problems found in the request, one entry each. Set on most `400 validation_failed` responses and on the refusals that name a field: a refused `handle` of `POST /v1/lookup` has `issues: null`. `null` on every other error. */
|
|
8699
|
-
issues: {
|
|
8700
|
-
/** @description Where the problem is: the field names and array indexes that lead to it. */
|
|
8701
|
-
path: (string | number)[];
|
|
8702
|
-
/** @description Text for a person. */
|
|
8703
|
-
message: string;
|
|
8704
|
-
/** @description Kind of problem. On `validation_failed`, for example `invalid_type`, `invalid_value`, `invalid_format`, `invalid_union`, `invalid_key`, `invalid_element`, `too_small`, `too_big`, `not_multiple_of`, `unrecognized_keys` or `custom`. The list is open: read `path` and `message`. */
|
|
8705
|
-
code: string;
|
|
8706
|
-
/** @description Smallest accepted value. Present only on `limit_out_of_bounds`, `mac_quantity_not_a_pack`, `byop_reduction_strands_mac_sessions` and `byop_reduction_strands_byod_lines`. */
|
|
8707
|
-
min?: number;
|
|
8708
|
-
/** @description Largest accepted value. Present only on `limit_out_of_bounds` and `mac_sessions_exceed_byop_lines`, and on the `too_big` issue of an `Idempotency-Key` header longer than 255 characters. */
|
|
8709
|
-
max?: number;
|
|
8710
|
-
}[] | null;
|
|
8711
|
-
};
|
|
8712
|
-
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
8713
|
-
trace_id: string;
|
|
8714
|
-
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
8715
|
-
request_id: string;
|
|
8853
|
+
"/v1/fleet/health": {
|
|
8854
|
+
parameters: {
|
|
8855
|
+
query?: never;
|
|
8856
|
+
header?: never;
|
|
8857
|
+
path?: never;
|
|
8858
|
+
cookie?: never;
|
|
8716
8859
|
};
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8860
|
+
/**
|
|
8861
|
+
* Get the fleet health report
|
|
8862
|
+
* @description Returns the latest daily two-way rate report of the iSnap fleet (`two-way-rate/1`): the share of the people each line texted first who wrote back, as figures for the whole fleet and one anonymous row per rated line. No row names a line, a phone number, a customer or an area code, and the rows come in an order that carries nothing: it changes each day and is the same on every read of one day. `as_of` is `null` and `lines` is empty until the first report is published. Needs no credential. The API keeps the answer for 5 minutes: read it again after 5 minutes.
|
|
8863
|
+
*/
|
|
8864
|
+
get: {
|
|
8865
|
+
parameters: {
|
|
8866
|
+
query?: never;
|
|
8867
|
+
header?: never;
|
|
8868
|
+
path?: never;
|
|
8869
|
+
cookie?: never;
|
|
8727
8870
|
};
|
|
8728
|
-
|
|
8871
|
+
requestBody?: never;
|
|
8872
|
+
responses: {
|
|
8873
|
+
/** @description The latest fleet health report. */
|
|
8874
|
+
200: {
|
|
8875
|
+
headers: {
|
|
8876
|
+
[name: string]: unknown;
|
|
8877
|
+
};
|
|
8878
|
+
content: {
|
|
8879
|
+
"application/json": components["schemas"]["FleetHealthEnvelope"];
|
|
8880
|
+
};
|
|
8881
|
+
};
|
|
8882
|
+
/** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. */
|
|
8883
|
+
400: {
|
|
8884
|
+
headers: {
|
|
8885
|
+
[name: string]: unknown;
|
|
8886
|
+
};
|
|
8887
|
+
content: {
|
|
8888
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8889
|
+
};
|
|
8890
|
+
};
|
|
8891
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
8892
|
+
429: {
|
|
8893
|
+
headers: {
|
|
8894
|
+
[name: string]: unknown;
|
|
8895
|
+
};
|
|
8896
|
+
content: {
|
|
8897
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8898
|
+
};
|
|
8899
|
+
};
|
|
8900
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
8901
|
+
500: {
|
|
8902
|
+
headers: {
|
|
8903
|
+
[name: string]: unknown;
|
|
8904
|
+
};
|
|
8905
|
+
content: {
|
|
8906
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8907
|
+
};
|
|
8908
|
+
};
|
|
8909
|
+
};
|
|
8910
|
+
};
|
|
8911
|
+
put?: never;
|
|
8912
|
+
post?: never;
|
|
8913
|
+
delete?: never;
|
|
8914
|
+
options?: never;
|
|
8915
|
+
head?: never;
|
|
8916
|
+
patch?: never;
|
|
8917
|
+
trace?: never;
|
|
8918
|
+
};
|
|
8919
|
+
"/v1/sandbox/inbound": {
|
|
8920
|
+
parameters: {
|
|
8921
|
+
query?: never;
|
|
8922
|
+
header?: never;
|
|
8923
|
+
path?: never;
|
|
8924
|
+
cookie?: never;
|
|
8925
|
+
};
|
|
8926
|
+
get?: never;
|
|
8927
|
+
put?: never;
|
|
8928
|
+
/**
|
|
8929
|
+
* Send a lead text to a sandbox number (staging only)
|
|
8930
|
+
* @description Staging only: in production this operation does not exist and answers `404 not_found`.
|
|
8931
|
+
*
|
|
8932
|
+
* Simulates a lead who texts a sandbox number of your inbound pool. Accepts an API key that is not line-scoped. On staging, the numbers your invites return (`POST /v1/lines/{line_id}/invites`) are sandbox numbers: fictional US numbers with no phone behind them. The text is received by that number exactly as a text from a real phone would be, so everything that follows is what production does: a text that carries the code of one of your invites for that number links the lead to the invite's inbound-first line, and `message.received` is sent on that line with `invite_id`; a text that cannot be linked is dropped. A reply you send to the lead (`POST /v1/messages`) is marked sent, then delivered a few seconds later, with `message.sent` and `message.delivered`. This operation sends no event itself, and `Idempotency-Key` is ignored: every call is a new text.
|
|
8933
|
+
*/
|
|
8934
|
+
post: {
|
|
8935
|
+
parameters: {
|
|
8936
|
+
query?: never;
|
|
8937
|
+
header?: never;
|
|
8938
|
+
path?: never;
|
|
8939
|
+
cookie?: never;
|
|
8940
|
+
};
|
|
8941
|
+
requestBody: {
|
|
8942
|
+
content: {
|
|
8943
|
+
"application/json": components["schemas"]["SandboxInbound"];
|
|
8944
|
+
};
|
|
8945
|
+
};
|
|
8946
|
+
responses: {
|
|
8947
|
+
/** @description The sandbox number received the text. */
|
|
8948
|
+
202: {
|
|
8949
|
+
headers: {
|
|
8950
|
+
[name: string]: unknown;
|
|
8951
|
+
};
|
|
8952
|
+
content: {
|
|
8953
|
+
"application/json": {
|
|
8954
|
+
/**
|
|
8955
|
+
* @description Always `true` on a success response.
|
|
8956
|
+
* @enum {boolean}
|
|
8957
|
+
*/
|
|
8958
|
+
success: true;
|
|
8959
|
+
data: components["schemas"]["SandboxInboundAccepted"];
|
|
8960
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
8961
|
+
trace_id: string;
|
|
8962
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
8963
|
+
request_id: string;
|
|
8964
|
+
};
|
|
8965
|
+
};
|
|
8966
|
+
};
|
|
8967
|
+
/** @description Invalid request. `validation_failed`: the body does not match its schema, for example a `phone_number` or a `from` that is not in E.164, or an empty `body`. `error.issues` lists each problem. */
|
|
8968
|
+
400: {
|
|
8969
|
+
headers: {
|
|
8970
|
+
[name: string]: unknown;
|
|
8971
|
+
};
|
|
8972
|
+
content: {
|
|
8973
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8974
|
+
};
|
|
8975
|
+
};
|
|
8976
|
+
/** @description No valid credential. `error.code` is `unauthorized`. */
|
|
8977
|
+
401: {
|
|
8978
|
+
headers: {
|
|
8979
|
+
[name: string]: unknown;
|
|
8980
|
+
};
|
|
8981
|
+
content: {
|
|
8982
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8983
|
+
};
|
|
8984
|
+
};
|
|
8985
|
+
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped. A line-scoped key cannot send a lead text: the code in it can link the lead to any inbound-first line of the account. */
|
|
8986
|
+
403: {
|
|
8987
|
+
headers: {
|
|
8988
|
+
[name: string]: unknown;
|
|
8989
|
+
};
|
|
8990
|
+
content: {
|
|
8991
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
8992
|
+
};
|
|
8993
|
+
};
|
|
8994
|
+
/** @description Not found. `sandbox_line_not_found`: `phone_number` is not a sandbox number of your inbound pool. `not_found`: the operation does not exist here (production). */
|
|
8995
|
+
404: {
|
|
8996
|
+
headers: {
|
|
8997
|
+
[name: string]: unknown;
|
|
8998
|
+
};
|
|
8999
|
+
content: {
|
|
9000
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9001
|
+
};
|
|
9002
|
+
};
|
|
9003
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
9004
|
+
429: {
|
|
9005
|
+
headers: {
|
|
9006
|
+
[name: string]: unknown;
|
|
9007
|
+
};
|
|
9008
|
+
content: {
|
|
9009
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9010
|
+
};
|
|
9011
|
+
};
|
|
9012
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
9013
|
+
500: {
|
|
9014
|
+
headers: {
|
|
9015
|
+
[name: string]: unknown;
|
|
9016
|
+
};
|
|
9017
|
+
content: {
|
|
9018
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9019
|
+
};
|
|
9020
|
+
};
|
|
9021
|
+
};
|
|
9022
|
+
};
|
|
9023
|
+
delete?: never;
|
|
9024
|
+
options?: never;
|
|
9025
|
+
head?: never;
|
|
9026
|
+
patch?: never;
|
|
9027
|
+
trace?: never;
|
|
9028
|
+
};
|
|
9029
|
+
"/v1/sandbox/lines": {
|
|
9030
|
+
parameters: {
|
|
9031
|
+
query?: never;
|
|
9032
|
+
header?: never;
|
|
9033
|
+
path?: never;
|
|
9034
|
+
cookie?: never;
|
|
9035
|
+
};
|
|
9036
|
+
get?: never;
|
|
9037
|
+
put?: never;
|
|
9038
|
+
/**
|
|
9039
|
+
* Add sandbox numbers to your inbound pool (staging only)
|
|
9040
|
+
* @description Staging only: in production this operation does not exist and answers `404 not_found`.
|
|
9041
|
+
*
|
|
9042
|
+
* Adds `count` sandbox numbers to your inbound pool and turns inbound-first lines on for your account. Accepts an API key that is not line-scoped. A sandbox number is a fictional US number (+1 202 555-0100 to 555-0199) with no phone behind it, which stands in on staging for the numbers of the iSnap pool in production: your invites (`POST /v1/lines/{line_id}/invites`) pick among them, `POST /v1/sandbox/inbound` sends a lead's text to one, and what you send from one is marked sent, then delivered a few seconds later. Your pool holds at most 5 sandbox numbers in all; they stay in it. This operation sends no event, and `Idempotency-Key` is ignored: every call adds numbers.
|
|
9043
|
+
*/
|
|
9044
|
+
post: {
|
|
9045
|
+
parameters: {
|
|
9046
|
+
query?: never;
|
|
9047
|
+
header?: never;
|
|
9048
|
+
path?: never;
|
|
9049
|
+
cookie?: never;
|
|
9050
|
+
};
|
|
9051
|
+
requestBody: {
|
|
9052
|
+
content: {
|
|
9053
|
+
"application/json": components["schemas"]["SandboxLinesRequest"];
|
|
9054
|
+
};
|
|
9055
|
+
};
|
|
9056
|
+
responses: {
|
|
9057
|
+
/** @description The sandbox numbers added to your inbound pool. */
|
|
9058
|
+
201: {
|
|
9059
|
+
headers: {
|
|
9060
|
+
[name: string]: unknown;
|
|
9061
|
+
};
|
|
9062
|
+
content: {
|
|
9063
|
+
"application/json": {
|
|
9064
|
+
/**
|
|
9065
|
+
* @description Always `true` on a success response.
|
|
9066
|
+
* @enum {boolean}
|
|
9067
|
+
*/
|
|
9068
|
+
success: true;
|
|
9069
|
+
data: components["schemas"]["SandboxLines"];
|
|
9070
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
9071
|
+
trace_id: string;
|
|
9072
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
9073
|
+
request_id: string;
|
|
9074
|
+
};
|
|
9075
|
+
};
|
|
9076
|
+
};
|
|
9077
|
+
/** @description Invalid request. `validation_failed`: the body does not match its schema, for example a `count` that is not a whole number from 1 to 5. `error.issues` lists each problem. */
|
|
9078
|
+
400: {
|
|
9079
|
+
headers: {
|
|
9080
|
+
[name: string]: unknown;
|
|
9081
|
+
};
|
|
9082
|
+
content: {
|
|
9083
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9084
|
+
};
|
|
9085
|
+
};
|
|
9086
|
+
/** @description No valid credential. `error.code` is `unauthorized`. */
|
|
9087
|
+
401: {
|
|
9088
|
+
headers: {
|
|
9089
|
+
[name: string]: unknown;
|
|
9090
|
+
};
|
|
9091
|
+
content: {
|
|
9092
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9093
|
+
};
|
|
9094
|
+
};
|
|
9095
|
+
/** @description Refused. `forbidden`: the request carries neither an API key in its `Authorization` header nor the header `X-Requested-With: XMLHttpRequest`, or the key is line-scoped. */
|
|
9096
|
+
403: {
|
|
9097
|
+
headers: {
|
|
9098
|
+
[name: string]: unknown;
|
|
9099
|
+
};
|
|
9100
|
+
content: {
|
|
9101
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9102
|
+
};
|
|
9103
|
+
};
|
|
9104
|
+
/** @description Not found. `not_found`: the operation does not exist here (production). */
|
|
9105
|
+
404: {
|
|
9106
|
+
headers: {
|
|
9107
|
+
[name: string]: unknown;
|
|
9108
|
+
};
|
|
9109
|
+
content: {
|
|
9110
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9111
|
+
};
|
|
9112
|
+
};
|
|
9113
|
+
/** @description Conflict. `sandbox_line_limit_reached`: your pool would hold more than 5 sandbox numbers. `sandbox_numbers_exhausted`: not enough sandbox numbers are free. Nothing is added. */
|
|
9114
|
+
409: {
|
|
9115
|
+
headers: {
|
|
9116
|
+
[name: string]: unknown;
|
|
9117
|
+
};
|
|
9118
|
+
content: {
|
|
9119
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9120
|
+
};
|
|
9121
|
+
};
|
|
9122
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
9123
|
+
429: {
|
|
9124
|
+
headers: {
|
|
9125
|
+
[name: string]: unknown;
|
|
9126
|
+
};
|
|
9127
|
+
content: {
|
|
9128
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9129
|
+
};
|
|
9130
|
+
};
|
|
9131
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
9132
|
+
500: {
|
|
9133
|
+
headers: {
|
|
9134
|
+
[name: string]: unknown;
|
|
9135
|
+
};
|
|
9136
|
+
content: {
|
|
9137
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
9138
|
+
};
|
|
9139
|
+
};
|
|
9140
|
+
};
|
|
9141
|
+
};
|
|
9142
|
+
delete?: never;
|
|
9143
|
+
options?: never;
|
|
9144
|
+
head?: never;
|
|
9145
|
+
patch?: never;
|
|
9146
|
+
trace?: never;
|
|
9147
|
+
};
|
|
9148
|
+
}
|
|
9149
|
+
export type webhooks = Record<string, never>;
|
|
9150
|
+
export interface components {
|
|
9151
|
+
schemas: {
|
|
9152
|
+
/** @description The health score of a line: a risk score and its band, with the factors that raise it. `null` where it is served means no score is computed for the line yet. */
|
|
9153
|
+
LineHealthScore: {
|
|
9154
|
+
/**
|
|
9155
|
+
* @description The risk score, from 0 (no risk observed) to 100 (most at risk). A higher number is worse. `null` exactly when `band` is `unknown`.
|
|
9156
|
+
* @example 24
|
|
9157
|
+
*/
|
|
9158
|
+
score: number | null;
|
|
9159
|
+
/**
|
|
9160
|
+
* @description The band of the score: `low` (0 to 29), `medium` (30 to 59), `high` (60 to 100), or `unknown` when the line has too little data to be scored.
|
|
9161
|
+
* @example low
|
|
9162
|
+
* @enum {string}
|
|
9163
|
+
*/
|
|
9164
|
+
band: "low" | "medium" | "high" | "unknown";
|
|
9165
|
+
/**
|
|
9166
|
+
* @description The version of the scoring that produced the score.
|
|
9167
|
+
* @example 1
|
|
9168
|
+
*/
|
|
9169
|
+
version: number;
|
|
9170
|
+
/**
|
|
9171
|
+
* Format: date-time
|
|
9172
|
+
* @description When the score was computed, ISO 8601 UTC. Use it to judge how fresh the score is.
|
|
9173
|
+
* @example 2026-11-14T10:00:12.000Z
|
|
9174
|
+
*/
|
|
9175
|
+
computed_at: string;
|
|
9176
|
+
/** @description Up to 3 factors that raise the score, largest contribution first. Empty when no factor adds to the score. */
|
|
9177
|
+
top_factors: components["schemas"]["LineHealthScoreFactor"][];
|
|
9178
|
+
};
|
|
9179
|
+
/** @description One factor behind a line health score. */
|
|
9180
|
+
LineHealthScoreFactor: {
|
|
9181
|
+
/**
|
|
9182
|
+
* @description The factor id. An open list: ignore the ids you do not know. The ids a customer can receive are listed in the API contract.
|
|
9183
|
+
* @example delivery_outcome
|
|
9184
|
+
*/
|
|
9185
|
+
id: string;
|
|
9186
|
+
/**
|
|
9187
|
+
* @description A short English name for the factor, fit to show to an end user.
|
|
9188
|
+
* @example Failed sends
|
|
9189
|
+
*/
|
|
9190
|
+
label: string;
|
|
9191
|
+
/**
|
|
9192
|
+
* @description How many points of the score the factor adds. Always above 0 in `top_factors`.
|
|
9193
|
+
* @example 12.5
|
|
9194
|
+
*/
|
|
9195
|
+
contribution: number;
|
|
9196
|
+
};
|
|
9197
|
+
/** @description The health of the API. This body is returned as is, without the standard envelope. */
|
|
9198
|
+
HealthResponse: {
|
|
9199
|
+
/**
|
|
9200
|
+
* @description `ok` when every check passes, `degraded` otherwise.
|
|
9201
|
+
* @enum {string}
|
|
9202
|
+
*/
|
|
9203
|
+
status: "ok" | "degraded";
|
|
9204
|
+
/** @description Timestamp of the check (ISO 8601, UTC). */
|
|
9205
|
+
timestamp: string;
|
|
9206
|
+
/** @description One entry per dependency of the API. Each value is `ok` or `error`. */
|
|
9207
|
+
checks: {
|
|
9208
|
+
[key: string]: string;
|
|
9209
|
+
};
|
|
9210
|
+
};
|
|
9211
|
+
/** @description The body of an error response. */
|
|
9212
|
+
ErrorEnvelope: {
|
|
9213
|
+
/**
|
|
9214
|
+
* @description Always `false` on an error response.
|
|
9215
|
+
* @enum {boolean}
|
|
9216
|
+
*/
|
|
9217
|
+
success: false;
|
|
9218
|
+
/** @description Always `null` on an error response. */
|
|
9219
|
+
data: unknown;
|
|
9220
|
+
/** @description What went wrong. The six fields are always present; `retry_after`, `retry_at` and `issues` are `null` when they do not apply. */
|
|
9221
|
+
error: {
|
|
9222
|
+
/** @description The HTTP status of the response. */
|
|
9223
|
+
status: number;
|
|
9224
|
+
/** @description Stable machine-readable code that names the refusal. Branch on this value. */
|
|
9225
|
+
code: string;
|
|
9226
|
+
/** @description Text for a person. It can change between versions: do not branch on it. */
|
|
9227
|
+
message: string;
|
|
9228
|
+
/** @description Seconds to wait before the next attempt. Set on the `429` responses that know a delay, where the `Retry-After` header carries the same value. When it is above 60 seconds, do not wait in a request: schedule the call, or report the time. `null` on every other error. */
|
|
9229
|
+
retry_after: number | null;
|
|
9230
|
+
/** @description ISO 8601 timestamp at which the refusal ends. Set only on `429 rebind_cap_reached`. `null` on every other error. */
|
|
9231
|
+
retry_at: string | null;
|
|
9232
|
+
/** @description Problems found in the request, one entry each. Set on most `400 validation_failed` responses and on the refusals that name a field: a refused `handle` of `POST /v1/lookup` has `issues: null`. `null` on every other error. */
|
|
9233
|
+
issues: {
|
|
9234
|
+
/** @description Where the problem is: the field names and array indexes that lead to it. */
|
|
9235
|
+
path: (string | number)[];
|
|
9236
|
+
/** @description Text for a person. */
|
|
9237
|
+
message: string;
|
|
9238
|
+
/** @description Kind of problem. On `validation_failed`, for example `invalid_type`, `invalid_value`, `invalid_format`, `invalid_union`, `invalid_key`, `invalid_element`, `too_small`, `too_big`, `not_multiple_of`, `unrecognized_keys` or `custom`. The list is open: read `path` and `message`. */
|
|
9239
|
+
code: string;
|
|
9240
|
+
/** @description Smallest accepted value. Present only on `limit_out_of_bounds`, `mac_quantity_not_a_pack`, `byop_reduction_strands_mac_sessions` and `byop_reduction_strands_byod_lines`. */
|
|
9241
|
+
min?: number;
|
|
9242
|
+
/** @description Largest accepted value. Present only on `limit_out_of_bounds` and `mac_sessions_exceed_byop_lines`, and on the `too_big` issue of an `Idempotency-Key` header longer than 255 characters. */
|
|
9243
|
+
max?: number;
|
|
9244
|
+
}[] | null;
|
|
9245
|
+
};
|
|
9246
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
9247
|
+
trace_id: string;
|
|
9248
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
9249
|
+
request_id: string;
|
|
9250
|
+
};
|
|
9251
|
+
VersionResponse: {
|
|
9252
|
+
/**
|
|
9253
|
+
* @description Always `true` on a success response.
|
|
9254
|
+
* @enum {boolean}
|
|
9255
|
+
*/
|
|
9256
|
+
success: true;
|
|
9257
|
+
/** @description The version of the API. */
|
|
9258
|
+
data: {
|
|
9259
|
+
/** @description The version of the API: three numbers separated by dots. The same value as `info.version` in the OpenAPI document. */
|
|
9260
|
+
version: string;
|
|
9261
|
+
};
|
|
9262
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
8729
9263
|
trace_id: string;
|
|
8730
9264
|
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
8731
9265
|
request_id: string;
|
|
8732
9266
|
};
|
|
8733
|
-
/** @description A line. `billing_tier`, `byod`, `shared`, `test_line` and `inbound_only` tell the kinds of line apart: a rented line (two-way or inbound-only), a BYOD line, a shared line, a test line. */
|
|
9267
|
+
/** @description A line. `billing_tier`, `byod`, `shared`, `test_line` and `inbound_only` tell the kinds of line apart: a rented line (two-way or inbound-only), a BYOD line, a shared line, a test line. `health_score` is present only on `GET /v1/lines/my` and on `GET /v1/lines/{id}` when the caller owns the line (for a line-scoped key, a line in its list), and absent on every other operation and webhook that returns a line. It is `null` when no score is stored for the line yet. */
|
|
8734
9268
|
Line: {
|
|
8735
9269
|
/** @description Id of a line: `line_` followed by 25 letters or digits. */
|
|
8736
9270
|
id: string;
|
|
@@ -8795,6 +9329,7 @@ export interface components {
|
|
|
8795
9329
|
shared: boolean;
|
|
8796
9330
|
/** @description Present only on `GET /v1/lines/my`. `open` while an order for this line is still being fulfilled, `null` otherwise. */
|
|
8797
9331
|
fulfillment_status?: string | null;
|
|
9332
|
+
health_score?: components["schemas"]["LineHealthScore"] & unknown;
|
|
8798
9333
|
};
|
|
8799
9334
|
/** @description A hosted macOS session that the account rents. */
|
|
8800
9335
|
MacosSession: {
|
|
@@ -8927,7 +9462,7 @@ export interface components {
|
|
|
8927
9462
|
metadata?: {
|
|
8928
9463
|
[key: string]: unknown;
|
|
8929
9464
|
};
|
|
8930
|
-
/** @description `true` to create an inbound-first line: it can only message a contact who wrote to it first, from the number that contact wrote to, and it never messages a contact first (`403 outbound_first_forbidden`).
|
|
9465
|
+
/** @description `true` to create an inbound-first line: it can only message a contact who wrote to it first, from the number that contact wrote to, and it never messages a contact first (`403 outbound_first_forbidden`). Inbound-first lines are a private alpha, enabled per account on request (`403 inbound_pool_not_enabled` otherwise). The numbers its contacts write to come from the iSnap pool, one per invite (`POST /v1/lines/{line_id}/invites`). Defaults to `false`: an ordinary shared line. */
|
|
8931
9466
|
inbound_first?: boolean;
|
|
8932
9467
|
};
|
|
8933
9468
|
/** @description Optional settings of the activated line: its variant and its billing anchor. */
|
|
@@ -9051,8 +9586,18 @@ export interface components {
|
|
|
9051
9586
|
daily_known_frees_at: string | null;
|
|
9052
9587
|
/** @description Timestamp at which `daily_replies_used` drops back under its limit (ISO 8601, UTC). `null` when the counter is under its limit, when the limit is 0, or when the time is not known: read `null` as no known wait. */
|
|
9053
9588
|
daily_reply_frees_at: string | null;
|
|
9589
|
+
priority: components["schemas"]["PriorityMeter"];
|
|
9054
9590
|
buckets_warning: components["schemas"]["BucketsWarning"];
|
|
9055
9591
|
};
|
|
9592
|
+
/** @description The priority allowance of the line: a message sent with `priority: true` can pass the hourly limit while `remaining` is above 0. */
|
|
9593
|
+
PriorityMeter: {
|
|
9594
|
+
/** @description Priority allowance: the number of messages sent with `priority: true` per rolling 24 hours that can pass the hourly limit. The allowance is part of `daily_total_message_limit`, not added to it. 0 means priority is off for the line. */
|
|
9595
|
+
limit: number;
|
|
9596
|
+
/** @description Messages that used the priority allowance to pass the hourly limit in the last 24 hours. A priority message sent under every limit does not use it. */
|
|
9597
|
+
used: number;
|
|
9598
|
+
/** @description `limit` minus `used`, never below 0. */
|
|
9599
|
+
remaining: number;
|
|
9600
|
+
};
|
|
9056
9601
|
/** @description One flag per sending limit: `true` from 80% of the limit. A flag is `false` when its limit is 0. */
|
|
9057
9602
|
BucketsWarning: {
|
|
9058
9603
|
/** @description `true` when `daily_new_contacts_used` is at 80% of `daily_new_contact_limit` or more. */
|
|
@@ -9205,6 +9750,51 @@ export interface components {
|
|
|
9205
9750
|
device_state: "online" | "degraded" | "offline" | "initializing" | "blocked" | null;
|
|
9206
9751
|
/** @description Free storage on the device, in bytes, as last reported. `null` means not reported, not zero. */
|
|
9207
9752
|
storage_free_bytes: number | null;
|
|
9753
|
+
/** @description The reason codes of the warnings the device currently raises, each a setting of the Mac that the customer can change: `messages_spam_filter_on` means Filter spam is on in Messages, so iMessages from new contacts can be held back. An open list: ignore the values you do not know. `[]` means no warning among the checks the device reports. `null` means not measured: the line has no active device session, the device is not reporting (it has not reported since it was paired, or for 5 minutes or more), it has sent no diagnostics, or the line is suspended or cancelled. `null` is never "no warning". */
|
|
9754
|
+
warnings: string[] | null;
|
|
9755
|
+
};
|
|
9756
|
+
LineHealthReportEnvelope: {
|
|
9757
|
+
/**
|
|
9758
|
+
* @description Always `true` on a success response.
|
|
9759
|
+
* @enum {boolean}
|
|
9760
|
+
*/
|
|
9761
|
+
success: true;
|
|
9762
|
+
data: components["schemas"]["LineHealthReport"];
|
|
9763
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
9764
|
+
trace_id: string;
|
|
9765
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
9766
|
+
request_id: string;
|
|
9767
|
+
};
|
|
9768
|
+
/** @description Why the latest health score of a line is what it is, and what to do about it. */
|
|
9769
|
+
LineHealthReport: {
|
|
9770
|
+
/** @description Id of a line: `line_` followed by 25 letters or digits. */
|
|
9771
|
+
line_id: string;
|
|
9772
|
+
/** @description The version of the scoring that produced the stored score. `null` when the line has no stored score yet. */
|
|
9773
|
+
version: number | null;
|
|
9774
|
+
/** @description When the stored score was computed (ISO 8601, UTC). `null` when the line has no stored score yet. */
|
|
9775
|
+
computed_at: string | null;
|
|
9776
|
+
/** @description The score, from 0 (no risk observed) to 100 (most at risk): a higher number is worse. `null` when `band` is `unknown`. */
|
|
9777
|
+
score: number | null;
|
|
9778
|
+
/**
|
|
9779
|
+
* @description `low` (0 to 29): no action needed. `medium` (30 to 59): worth watching. `high` (60 to 100): the line is at risk. `unknown`: not enough traffic to judge.
|
|
9780
|
+
* @enum {string}
|
|
9781
|
+
*/
|
|
9782
|
+
band: "low" | "medium" | "high" | "unknown";
|
|
9783
|
+
/** @description One sentence that reads the band. */
|
|
9784
|
+
summary: string;
|
|
9785
|
+
/** @description The factors that add the most risk, largest first, at most 3, each with what to do. Empty when `band` is `unknown` or when no factor adds risk. */
|
|
9786
|
+
items: components["schemas"]["LineHealthReportItem"][];
|
|
9787
|
+
};
|
|
9788
|
+
LineHealthReportItem: {
|
|
9789
|
+
/**
|
|
9790
|
+
* @description The factor that adds risk. An open list: ignore the values you do not know. `delivery_outcome`: sends that fail. `first_contact_reply_rate`: few first messages get a reply. `reply_rate_drop`: the reply rate fell below its earlier level. `inbound_outbound_balance`: few messages received for the messages sent. `burstiness`: sends are not spread like the activity of the line. `quota_headroom`: the sending limits are almost used. `apple_id_flag`: the Apple ID of the line is flagged. `suspected_dead`, `phone_drift`, `private_api_attention`, `open_incidents` and `line_proof`: device factors, listed on a BYOD line only.
|
|
9791
|
+
* @enum {string}
|
|
9792
|
+
*/
|
|
9793
|
+
factor_id: "delivery_outcome" | "first_contact_reply_rate" | "reply_rate_drop" | "inbound_outbound_balance" | "burstiness" | "quota_headroom" | "apple_id_flag" | "suspected_dead" | "phone_drift" | "private_api_attention" | "open_incidents" | "line_proof";
|
|
9794
|
+
/** @description What the factor means for this line, in a sentence. */
|
|
9795
|
+
explanation: string;
|
|
9796
|
+
/** @description What to do about it. On a line that is not a BYOD line, a factor that iSnap resolves says so. */
|
|
9797
|
+
action: string;
|
|
9208
9798
|
};
|
|
9209
9799
|
LineConfigEnvelope: {
|
|
9210
9800
|
/**
|
|
@@ -9265,6 +9855,8 @@ export interface components {
|
|
|
9265
9855
|
reply_max_per_inbound: number;
|
|
9266
9856
|
/** @description Reply-lane allowance: the number of replies per rolling 24 hours that can pass a sending limit through the reply lane. 0 means the reply lane is off. */
|
|
9267
9857
|
daily_reply_limit: number;
|
|
9858
|
+
/** @description Priority allowance: the number of messages sent with `priority: true` per rolling 24 hours that can pass the hourly limit. It is part of `daily_total_message_limit`, not added to it. 0 means priority is off. */
|
|
9859
|
+
daily_priority_limit: number;
|
|
9268
9860
|
/** @description IANA time zone of the line. Without an override, iSnap derives it from the North American area code of the line, else from its country when that country has a single time zone; otherwise it is `Europe/London` for a `+44` number and `America/Chicago` for any other number. */
|
|
9269
9861
|
timezone: string;
|
|
9270
9862
|
/** @description The sending hours in force on the line, as a list of hours with a weight: the override of the line where it has one, `default_activity_curve` otherwise. Never empty. An hour with weight 0, or with no entry, is a quiet hour. */
|
|
@@ -9275,7 +9867,7 @@ export interface components {
|
|
|
9275
9867
|
weight: number;
|
|
9276
9868
|
}[];
|
|
9277
9869
|
};
|
|
9278
|
-
/** @description The
|
|
9870
|
+
/** @description The nine limits that have a default and bounds: the five message limits, the three reply limits and the priority limit. Each has its value in force, its default and its bounds `min` and `max`. A value above `default` is accepted only for the five message limits of a BYOD line, up to `max`. */
|
|
9279
9871
|
LineConfigKnobs: {
|
|
9280
9872
|
daily_new_contact_limit: components["schemas"]["LineConfigKnobBounds"];
|
|
9281
9873
|
daily_known_contact_limit: components["schemas"]["LineConfigKnobBounds"];
|
|
@@ -9285,6 +9877,7 @@ export interface components {
|
|
|
9285
9877
|
reply_window_hours: components["schemas"]["LineConfigKnobBounds"];
|
|
9286
9878
|
reply_max_per_inbound: components["schemas"]["LineConfigKnobBounds"];
|
|
9287
9879
|
daily_reply_limit: components["schemas"]["LineConfigKnobBounds"];
|
|
9880
|
+
daily_priority_limit: components["schemas"]["LineConfigKnobBounds"];
|
|
9288
9881
|
};
|
|
9289
9882
|
/** @description One limit of the line: the value in force, its default, and its bounds. A value above the default is accepted only for the five message limits of a BYOD line. */
|
|
9290
9883
|
LineConfigKnobBounds: {
|
|
@@ -9294,7 +9887,7 @@ export interface components {
|
|
|
9294
9887
|
default: number;
|
|
9295
9888
|
/** @description The smallest value the API accepts for this key. */
|
|
9296
9889
|
min: number;
|
|
9297
|
-
/** @description The upper bound of this key. A value above `default` is accepted, up to `max`, only on a BYOD line and only for `daily_new_contact_limit`, `daily_known_contact_limit`, `daily_total_message_limit`, `hourly_message_limit` and `minute_message_limit`. On any other line, and for the three reply limits on every line, a value above `default` returns `403 cannot_increase_limit`. A value above `max` is refused first, on every line, with `422 limit_out_of_bounds` or `400 validation_failed`. */
|
|
9890
|
+
/** @description The upper bound of this key. A value above `default` is accepted, up to `max`, only on a BYOD line and only for `daily_new_contact_limit`, `daily_known_contact_limit`, `daily_total_message_limit`, `hourly_message_limit` and `minute_message_limit`. On any other line, and for the three reply limits and `daily_priority_limit` on every line, a value above `default` returns `403 cannot_increase_limit`. A value above `max` is refused first, on every line, with `422 limit_out_of_bounds` or `400 validation_failed`. */
|
|
9298
9891
|
max: number;
|
|
9299
9892
|
};
|
|
9300
9893
|
/** @description The keys to override on this line. Send a key with its default value to remove its override. `null` and unknown keys return `400 validation_failed`. */
|
|
@@ -9328,6 +9921,8 @@ export interface components {
|
|
|
9328
9921
|
reply_max_per_inbound?: number;
|
|
9329
9922
|
/** @description Reply-lane allowance: the number of replies per rolling 24 hours that can pass a sending limit through the reply lane. 0 turns the reply lane off. Accepted values: 0 to 1,000. It can only be lowered below the default (`403 cannot_increase_limit`). */
|
|
9330
9923
|
daily_reply_limit?: number;
|
|
9924
|
+
/** @description Priority allowance: the number of messages sent with `priority: true` per rolling 24 hours that can pass the hourly limit. It is part of `daily_total_message_limit`, not added to it. 0 turns priority off. Accepted values: 0 to 50. It can only be lowered below the default (`403 cannot_increase_limit`), on a BYOD line too. */
|
|
9925
|
+
daily_priority_limit?: number;
|
|
9331
9926
|
/** @description IANA time zone name of the line, for example `America/New_York` (`400 validation_failed` otherwise). iSnap reads quiet hours in it for a recipient whose own time zone it does not know. Once set, it can be replaced but not removed. */
|
|
9332
9927
|
timezone?: string;
|
|
9333
9928
|
/** @description The sending hours of the line, as a list of hours with a weight. An hour with weight 0, or with no entry, is a quiet hour: a message accepted then is held until the next hour that has a weight. Messages held by a 24-hour sending limit are placed in the hours in proportion to their weights. It needs at least one entry, no hour twice, and a total weight above 0 (`422 invalid_activity_curve` otherwise). A curve the same as `default_activity_curve` (returned by `GET /v1/lines/{id}/config`) removes the override instead of setting one. Two curves are the same when every hour from 0 to 23 has the same weight in both, an hour with no entry counting as 0: the order of the entries does not matter, and a curve that lists only its weighted hours is the same as the 24-hour curve with 0 everywhere else. */
|
|
@@ -9375,6 +9970,8 @@ export interface components {
|
|
|
9375
9970
|
/** @description Estimated time of the hand-over of the line: the time the build starts plus 72 hours. Set once, when the build starts, and never revised. `null` while the pre-order is `draft` or `awaiting_payment`, and on a pre-order canceled before its build started. */
|
|
9376
9971
|
estimated_fulfillment: string | null;
|
|
9377
9972
|
device_status?: components["schemas"]["DeviceFulfillmentStatus"];
|
|
9973
|
+
/** @description The four build steps of the pre-order, always in the order `number_secured`, `phone_prepared`, `account_prepared`, `connected`, each with the time it was completed or `null` until it is done. Present on every pre-order response. A `draft`, an `awaiting_payment` and a `cancelled` pre-order show four steps with `completed_at: null`. */
|
|
9974
|
+
progress?: components["schemas"]["PreOrderProgressStep"][];
|
|
9378
9975
|
/** @description Timestamp of creation, ISO 8601 in UTC. */
|
|
9379
9976
|
created_at: string;
|
|
9380
9977
|
/** @description Timestamp of the last change of the pre-order, ISO 8601 in UTC. */
|
|
@@ -9399,6 +9996,16 @@ export interface components {
|
|
|
9399
9996
|
* @enum {string|null}
|
|
9400
9997
|
*/
|
|
9401
9998
|
DeviceFulfillmentStatus: "awaiting_hardware" | "received" | "setup_in_progress" | "ready" | "deployed" | null;
|
|
9999
|
+
/** @description One build step of a pre-order and the time it was completed. */
|
|
10000
|
+
PreOrderProgressStep: {
|
|
10001
|
+
/**
|
|
10002
|
+
* @description The step: `number_secured` (the number of the line is secured), `phone_prepared` (the phone of the line is prepared), `account_prepared` (the accounts the line needs are prepared) or `connected` (the line is connected and handed over).
|
|
10003
|
+
* @enum {string}
|
|
10004
|
+
*/
|
|
10005
|
+
step: "number_secured" | "phone_prepared" | "account_prepared" | "connected";
|
|
10006
|
+
/** @description When the step was completed, ISO 8601 in UTC. `null` until the step is done. */
|
|
10007
|
+
completed_at: string | null;
|
|
10008
|
+
};
|
|
9402
10009
|
PreOrderList: {
|
|
9403
10010
|
/**
|
|
9404
10011
|
* @description Always `true` on a success response.
|
|
@@ -9819,10 +10426,12 @@ export interface components {
|
|
|
9819
10426
|
reply_to_message_id: string | null;
|
|
9820
10427
|
/** @description On an outbound message, whether the line's device shows the typing indicator to the recipient before it sends the message. A message sent with an API key on a line that is not an iMessage line always has `false`. It has no meaning on an inbound message. */
|
|
9821
10428
|
use_typing_indicator: boolean;
|
|
9822
|
-
/** @description The `metadata` you sent with the message, unchanged. `null` when you sent none,
|
|
10429
|
+
/** @description The `metadata` you sent with the message, unchanged. `null` when you sent none, on an inbound message and on a message iSnap sent itself (`system: true`). */
|
|
9823
10430
|
metadata: {
|
|
9824
10431
|
[key: string]: unknown;
|
|
9825
10432
|
} | null;
|
|
10433
|
+
/** @description `true` on a message iSnap itself sent to a contact, such as the notices a free line sends to its paired phone. `false` on every message sent or received through your own lines and keys. A message with `system: true` does not count toward the limits of a free line. */
|
|
10434
|
+
system: boolean;
|
|
9826
10435
|
/** @description The files of the message, in order. Empty when the message has none. Files received with an inbound message are listed here too. */
|
|
9827
10436
|
attachments: components["schemas"]["MessageAttachmentV1"][];
|
|
9828
10437
|
/** @description The reactions on the message, at most one per author. Empty when the message has none, and always empty on an entry whose `kind` is `reaction`. The line's own reaction appears as soon as the API accepts it, and disappears as soon as the API accepts its removal, before the line's device confirms either. It stays listed when the device fails to place it. */
|
|
@@ -9833,8 +10442,12 @@ export interface components {
|
|
|
9833
10442
|
schedule_reason: string | null;
|
|
9834
10443
|
/** @description `true` when the message is in the reply lane: it answers a contact who wrote to the line in the last 24 hours, within the limits of the reply lane. Such a message is not held by the hourly limit, by the three 24-hour limits or by quiet hours. Set when the message is accepted. A held message enters the reply lane when its contact writes to the line while it waits, whatever held it, oldest first and within the same limits: the value then changes from `false` to `true`, once and never back, and the message is released without waiting for its `scheduled_for`, still after the earlier messages to the same recipient and within the per-minute limit and the spacing of the line. */
|
|
9835
10444
|
reply_lane: boolean;
|
|
10445
|
+
/** @description `true` when the message was sent with `priority: true`, the priority reserve of the line is on (`daily_priority_limit` above 0) and the reply lane does not carry the message. Such a message is not held by the hourly limit while the reserve has room, and a held one leaves before the messages that are not priority. `false` otherwise, on an inbound message and on a message typed on the device of the line. Set when the message is accepted. A held message that enters the reply lane while it waits changes from `true` to `false`, once and never back. */
|
|
10446
|
+
priority: boolean;
|
|
9836
10447
|
/** @description `true` when the message was sent with `ignore_quiet_hours: true` on a line that is not a shared line: quiet hours do not hold it. `false` otherwise, on a shared line, on an inbound message and on a message typed on the device of the line. Set when the message is accepted and never changed after that. */
|
|
9837
10448
|
ignore_quiet_hours: boolean;
|
|
10449
|
+
/** @description `true` when the message was sent with `cancel_on_reply: true`: iSnap cancels it if its recipient writes to the line before the message is with the line's device. `false` otherwise, on an inbound message and on a message typed on the device of the line. Set when the message is accepted and never changed after that. */
|
|
10450
|
+
cancel_on_reply: boolean;
|
|
9838
10451
|
/** @description The state of the line's sending limits when the message was accepted. Filled only in the response of `POST /v1/messages` to a new request: `null` on every read, in the response to a retry with the same `Idempotency-Key`, and in events. */
|
|
9839
10452
|
queue_info: {
|
|
9840
10453
|
/** @description 0 when the message leaves immediately. Otherwise the rank of the message among the line's held messages, starting at 1. */
|
|
@@ -9886,7 +10499,7 @@ export interface components {
|
|
|
9886
10499
|
read_at: string | null;
|
|
9887
10500
|
/** @description When the message became `failed`. `null` otherwise. When the device of an iMessage line reports a failure after `sent`, `failed_at` holds the time of the send, not the time of the failure. */
|
|
9888
10501
|
failed_at: string | null;
|
|
9889
|
-
/** @description `null` unless the message is `failed`. When iSnap failed the message itself: `carrier_unavailable` (the message waited 48 hours without reaching a device), `no_terminal_ack` (the line's device took the message and never reported an outcome)
|
|
10502
|
+
/** @description `null` unless the message is `failed`. When iSnap failed the message itself: `carrier_unavailable` (the message waited 48 hours without reaching a device), `no_terminal_ack` (the line's device took the message and never reported an outcome), `carrier_terminated` (the line was terminated while the message was waiting) or `line_offline_stale` (the line stopped reporting and the message waited too long to be sent). `null` when the line's device reported the failure: read `error_message`. */
|
|
9890
10503
|
error_code: string | null;
|
|
9891
10504
|
/** @description `null` unless the message is `failed`. A text that describes the failure. When the line's device reported the failure, it is the text the device gave, or `null` when it gave none. */
|
|
9892
10505
|
error_message: string | null;
|
|
@@ -10066,7 +10679,7 @@ export interface components {
|
|
|
10066
10679
|
* @description An exact event type such as `message.received`, a family wildcard such as `line.*`, or `*` for every event. A wildcard for a family that does not exist is accepted and matches nothing. `webhook.test` is never delivered through an event filter: iSnap sends it only to a suspended webhook subscription, to check whether its URL responds again.
|
|
10067
10680
|
* @enum {string}
|
|
10068
10681
|
*/
|
|
10069
|
-
WebhookEventName: "message.queued" | "message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.received" | "message.scheduled" | "message.cancelled" | "message.fallback_triggered" | "reaction.added" | "reaction.received" | "reaction.removed" | "line.connected" | "line.disconnected" | "line.offline" | "line.degraded" | "line.apple_id_flagged" | "line.quota_warning" | "line.quota_exceeded" | "line.capability_changed" | "line.terminated" | "line.variant_changed" | "line.variant_scheduled" | "line.variant_unscheduled" | "typing_indicator.started" | "typing_indicator.stopped" | "trial.linked" | "trial.dormant" | "trial.reactivated" | "trial.bind_conflict" | "trial.revoked" | "binding.released" | "pre_order.fulfilled" | "pre_order.cancelled" | "macos_session.rented" | "macos_session.released" | "webhook.test" | "*" | "message.*" | "reaction.*" | "line.*" | "typing_indicator.*" | "trial.*" | "binding.*" | "pre_order.*" | "macos_session.*" | "webhook.*";
|
|
10682
|
+
WebhookEventName: "message.queued" | "message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.received" | "message.scheduled" | "message.cancelled" | "message.fallback_triggered" | "reaction.added" | "reaction.received" | "reaction.removed" | "line.connected" | "line.disconnected" | "line.offline" | "line.degraded" | "line.apple_id_flagged" | "line.quota_warning" | "line.quota_exceeded" | "line.capability_changed" | "line.terminated" | "line.variant_changed" | "line.variant_scheduled" | "line.variant_unscheduled" | "line.phone_number_changed" | "typing_indicator.started" | "typing_indicator.stopped" | "trial.linked" | "trial.dormant" | "trial.reactivated" | "trial.bind_conflict" | "trial.revoked" | "binding.released" | "pre_order.fulfilled" | "pre_order.cancelled" | "macos_session.rented" | "macos_session.released" | "webhook.test" | "*" | "message.*" | "reaction.*" | "line.*" | "typing_indicator.*" | "trial.*" | "binding.*" | "pre_order.*" | "macos_session.*" | "webhook.*";
|
|
10070
10683
|
/** @description The webhook subscriptions of the account. */
|
|
10071
10684
|
WebhookList: {
|
|
10072
10685
|
/** @description Every webhook subscription of the account, newest first. */
|
|
@@ -10459,7 +11072,7 @@ export interface components {
|
|
|
10459
11072
|
/** @description Pass it as `cursor` to get the next page. `null` on the last page. */
|
|
10460
11073
|
next_cursor: string | null;
|
|
10461
11074
|
};
|
|
10462
|
-
/** @description The messages between one line and one contact. iSnap creates a chat at the first message in either direction and never deletes it: a chat stays listed after its messages are deleted. It uses the same chat for both directions when the device of the line stores the handle of the contact in the form of the `to` you send to. A chat belongs to its line, not to an account: after a line changes owner, the account that owns the line lists its chats, those of earlier owners included, and their counters include the messages of earlier owners. */
|
|
11075
|
+
/** @description The messages between one line and one contact, or in one group. iSnap creates a chat at the first message in either direction and never deletes it: a chat stays listed after its messages are deleted. It uses the same chat for both directions when the device of the line stores the handle of the contact in the form of the `to` you send to. A chat belongs to its line, not to an account: after a line changes owner, the account that owns the line lists its chats, those of earlier owners included, and their counters include the messages of earlier owners. */
|
|
10463
11076
|
Chat: {
|
|
10464
11077
|
/**
|
|
10465
11078
|
* @description Chat id: `chat_` followed by 25 letters or digits.
|
|
@@ -10468,8 +11081,12 @@ export interface components {
|
|
|
10468
11081
|
id: string;
|
|
10469
11082
|
/** @description Id of the line of the chat. */
|
|
10470
11083
|
line_id: string;
|
|
10471
|
-
/** @description
|
|
11084
|
+
/** @description On a chat that is not a group, the handle that opened it: the E.164 form of `to` when a message you sent opened it, or the sender's handle as the line's device stores it, a phone number or an email address, when a received message opened it. The typing and read operations take only a chat whose `contact_handle` is a phone number in E.164. It is personal data. On a group (`is_group` is `true`), the identifier of the group, not a person: read its members with `GET /v1/chats/{chat_id}/participants`. A group that iSnap recorded before it told groups apart can still show the handle of one sender. */
|
|
10472
11085
|
contact_handle: string;
|
|
11086
|
+
/** @description `true` when the chat is a group conversation, `false` when it is between the line and one contact. */
|
|
11087
|
+
is_group: boolean;
|
|
11088
|
+
/** @description On a group, the number of members iSnap has recorded for it now: 0 while none is recorded yet. `null` on a chat that is not a group. */
|
|
11089
|
+
member_count: number | null;
|
|
10473
11090
|
/** @description On a shared line, the phone number that serves this contact, or `null` when none is assigned: the next message to the contact is then given a number. Always `null` on a line that is not a shared line. */
|
|
10474
11091
|
outbound_number: string | null;
|
|
10475
11092
|
/** @description Time of the last message of the chat, sent or received. Equals `created_at` while the chat has no message. */
|
|
@@ -10478,11 +11095,36 @@ export interface components {
|
|
|
10478
11095
|
message_count: number;
|
|
10479
11096
|
/** @description Number of inbound messages received in the chat since it was created. Marking the chat as read does not reset it. */
|
|
10480
11097
|
unread_count: number;
|
|
11098
|
+
health: components["schemas"]["ChatHealth"];
|
|
10481
11099
|
/** @description When iSnap created the chat: at the first message in either direction. */
|
|
10482
11100
|
created_at: string;
|
|
10483
11101
|
/** @description When the chat last changed. */
|
|
10484
11102
|
updated_at: string;
|
|
10485
11103
|
};
|
|
11104
|
+
/** @description The health of the chat. `null` on a group (`is_group` is `true`) and on a chat of a trial line. */
|
|
11105
|
+
ChatHealth: {
|
|
11106
|
+
/**
|
|
11107
|
+
* @description `opted_out` when the contact sent a stop keyword, whatever the streak. Otherwise `critical` from 4 consecutive messages you sent with no reply, `at_risk` from 2, and `healthy` below that.
|
|
11108
|
+
* @enum {string}
|
|
11109
|
+
*/
|
|
11110
|
+
status: "healthy" | "at_risk" | "critical" | "opted_out";
|
|
11111
|
+
/**
|
|
11112
|
+
* @description `opt_out_keyword` on `opted_out`, `no_reply_streak` on `at_risk` and `critical`, `null` on `healthy`.
|
|
11113
|
+
* @enum {string|null}
|
|
11114
|
+
*/
|
|
11115
|
+
reason: "opt_out_keyword" | "no_reply_streak" | null;
|
|
11116
|
+
/**
|
|
11117
|
+
* @description The version of the rule that produced the status. Always `chat-health/1`.
|
|
11118
|
+
* @enum {string}
|
|
11119
|
+
*/
|
|
11120
|
+
rule: "chat-health/1";
|
|
11121
|
+
/** @description Number of consecutive messages sent in the chat since the last message received from the contact. 0 when the contact wrote last. */
|
|
11122
|
+
unanswered_outbound: number;
|
|
11123
|
+
/** @description Time of the last message received from the contact, as an ISO 8601 timestamp. `null` when none was recorded. */
|
|
11124
|
+
last_inbound_at: string | null;
|
|
11125
|
+
/** @description Time of the last message sent to the contact, as an ISO 8601 timestamp. `null` when none was recorded. */
|
|
11126
|
+
last_outbound_at: string | null;
|
|
11127
|
+
} | null;
|
|
10486
11128
|
ChatEnvelope: {
|
|
10487
11129
|
/**
|
|
10488
11130
|
* @description Always `true` on a success response.
|
|
@@ -10495,6 +11137,30 @@ export interface components {
|
|
|
10495
11137
|
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
10496
11138
|
request_id: string;
|
|
10497
11139
|
};
|
|
11140
|
+
ChatParticipantListEnvelope: {
|
|
11141
|
+
/**
|
|
11142
|
+
* @description Always `true` on a success response.
|
|
11143
|
+
* @enum {boolean}
|
|
11144
|
+
*/
|
|
11145
|
+
success: true;
|
|
11146
|
+
data: components["schemas"]["ChatParticipantList"];
|
|
11147
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
11148
|
+
trace_id: string;
|
|
11149
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
11150
|
+
request_id: string;
|
|
11151
|
+
};
|
|
11152
|
+
/** @description The members of a chat. */
|
|
11153
|
+
ChatParticipantList: {
|
|
11154
|
+
/** @description The members, oldest first. On a chat that is not a group, its one contact. Empty on a group whose members iSnap has not recorded yet. */
|
|
11155
|
+
items: components["schemas"]["ChatParticipant"][];
|
|
11156
|
+
};
|
|
11157
|
+
/** @description One member of a chat. */
|
|
11158
|
+
ChatParticipant: {
|
|
11159
|
+
/** @description The handle of the member, a phone number or an email address. It is personal data. */
|
|
11160
|
+
handle: string;
|
|
11161
|
+
/** @description When iSnap first saw the member in the group, as an ISO 8601 timestamp. On a chat that is not a group, when iSnap created the chat. */
|
|
11162
|
+
joined_at: string;
|
|
11163
|
+
};
|
|
10498
11164
|
ShareContactCardEnvelope: {
|
|
10499
11165
|
/**
|
|
10500
11166
|
* @description Always `true` on a success response.
|
|
@@ -10954,6 +11620,159 @@ export interface components {
|
|
|
10954
11620
|
*/
|
|
10955
11621
|
available: boolean;
|
|
10956
11622
|
};
|
|
11623
|
+
FleetHealthEnvelope: {
|
|
11624
|
+
/**
|
|
11625
|
+
* @description Always `true` on a success response.
|
|
11626
|
+
* @enum {boolean}
|
|
11627
|
+
*/
|
|
11628
|
+
success: true;
|
|
11629
|
+
data: components["schemas"]["FleetHealthReport"];
|
|
11630
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
11631
|
+
trace_id: string;
|
|
11632
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
11633
|
+
request_id: string;
|
|
11634
|
+
};
|
|
11635
|
+
/** @description The two-way rate of the iSnap fleet on one UTC day, as figures with no line, number or customer in them. */
|
|
11636
|
+
FleetHealthReport: {
|
|
11637
|
+
/**
|
|
11638
|
+
* @description The definition this report follows.
|
|
11639
|
+
* @example two-way-rate/1
|
|
11640
|
+
* @enum {string}
|
|
11641
|
+
*/
|
|
11642
|
+
standard: "two-way-rate/1";
|
|
11643
|
+
/**
|
|
11644
|
+
* @description The UTC day (`YYYY-MM-DD`) of the report. `null` until the first report is published.
|
|
11645
|
+
* @example 2026-11-12
|
|
11646
|
+
*/
|
|
11647
|
+
as_of: string | null;
|
|
11648
|
+
/**
|
|
11649
|
+
* @description The length of the window the rates cover, in days.
|
|
11650
|
+
* @example 30
|
|
11651
|
+
*/
|
|
11652
|
+
window_days: number;
|
|
11653
|
+
/**
|
|
11654
|
+
* @description The days of the window the figures cover. From 0 to `window_days`.
|
|
11655
|
+
* @example 30
|
|
11656
|
+
*/
|
|
11657
|
+
coverage_days: number;
|
|
11658
|
+
/**
|
|
11659
|
+
* @description The fewest people a line must have contacted in the window to be rated.
|
|
11660
|
+
* @example 20
|
|
11661
|
+
*/
|
|
11662
|
+
min_contacted: number;
|
|
11663
|
+
/**
|
|
11664
|
+
* @description A rated line whose two-way rate is below this value counts as one-way.
|
|
11665
|
+
* @example 0.2
|
|
11666
|
+
*/
|
|
11667
|
+
one_way_below: number;
|
|
11668
|
+
/** @description The rated lines, in no meaningful order. */
|
|
11669
|
+
lines: components["schemas"]["FleetHealthLine"][];
|
|
11670
|
+
/**
|
|
11671
|
+
* @description The lines below `min_contacted`, not listed in `lines`.
|
|
11672
|
+
* @example 12
|
|
11673
|
+
*/
|
|
11674
|
+
unrated: number;
|
|
11675
|
+
/**
|
|
11676
|
+
* @description The lines left out of the fleet figures.
|
|
11677
|
+
* @example 3
|
|
11678
|
+
*/
|
|
11679
|
+
excluded: number;
|
|
11680
|
+
/**
|
|
11681
|
+
* @description The median two-way rate of the day, `null` when there is none.
|
|
11682
|
+
* @example 0.7
|
|
11683
|
+
*/
|
|
11684
|
+
daily_median: number | null;
|
|
11685
|
+
summary: components["schemas"]["FleetHealthSummary"];
|
|
11686
|
+
};
|
|
11687
|
+
/** @description One rated line of the fleet. A row names no line: it carries its kind and its counts only. */
|
|
11688
|
+
FleetHealthLine: {
|
|
11689
|
+
/**
|
|
11690
|
+
* @description The kind of line: `rented`, `byop` or `shared`.
|
|
11691
|
+
* @example rented
|
|
11692
|
+
* @enum {string}
|
|
11693
|
+
*/
|
|
11694
|
+
kind: "rented" | "byop" | "shared";
|
|
11695
|
+
/**
|
|
11696
|
+
* @description The people this line texted first in the window.
|
|
11697
|
+
* @example 42
|
|
11698
|
+
*/
|
|
11699
|
+
contacted: number;
|
|
11700
|
+
/**
|
|
11701
|
+
* @description The people among `contacted` who wrote back. At most `contacted`.
|
|
11702
|
+
* @example 30
|
|
11703
|
+
*/
|
|
11704
|
+
answered: number;
|
|
11705
|
+
/**
|
|
11706
|
+
* @description The messages this line sent in the window.
|
|
11707
|
+
* @example 310
|
|
11708
|
+
*/
|
|
11709
|
+
sent: number;
|
|
11710
|
+
/**
|
|
11711
|
+
* @description The messages this line received in the window.
|
|
11712
|
+
* @example 280
|
|
11713
|
+
*/
|
|
11714
|
+
received: number;
|
|
11715
|
+
};
|
|
11716
|
+
/** @description The figures of the whole rated fleet. */
|
|
11717
|
+
FleetHealthSummary: {
|
|
11718
|
+
/**
|
|
11719
|
+
* @description The number of rated lines: the length of `lines`.
|
|
11720
|
+
* @example 120
|
|
11721
|
+
*/
|
|
11722
|
+
rated: number;
|
|
11723
|
+
/**
|
|
11724
|
+
* @description The median two-way rate of the rated lines, `null` when no line is rated.
|
|
11725
|
+
* @example 0.71
|
|
11726
|
+
*/
|
|
11727
|
+
median: number | null;
|
|
11728
|
+
/**
|
|
11729
|
+
* @description The two-way rate below which the lowest tenth of the rated lines fall, `null` when no line is rated.
|
|
11730
|
+
* @example 0.34
|
|
11731
|
+
*/
|
|
11732
|
+
lowest_tenth: number | null;
|
|
11733
|
+
/**
|
|
11734
|
+
* @description The number of rated lines whose rate is below `one_way_below`.
|
|
11735
|
+
* @example 4
|
|
11736
|
+
*/
|
|
11737
|
+
one_way: number;
|
|
11738
|
+
/**
|
|
11739
|
+
* @description The answers coming back per 100 contacts, `null` when no line is rated.
|
|
11740
|
+
* @example 68.5
|
|
11741
|
+
*/
|
|
11742
|
+
back_per_100: number | null;
|
|
11743
|
+
};
|
|
11744
|
+
/** @description The text was received by the sandbox number. */
|
|
11745
|
+
SandboxInboundAccepted: {
|
|
11746
|
+
/** @description Id of the received text, as the number reported it. */
|
|
11747
|
+
event_id: string;
|
|
11748
|
+
/** @description When the text was received (ISO 8601, UTC). */
|
|
11749
|
+
accepted_at: string;
|
|
11750
|
+
};
|
|
11751
|
+
/** @description A text a lead sends to a sandbox number. */
|
|
11752
|
+
SandboxInbound: {
|
|
11753
|
+
/** @description The sandbox number the lead texts, in E.164: a number an invite of yours returned on staging. */
|
|
11754
|
+
phone_number: string;
|
|
11755
|
+
/** @description The phone number of the lead who sends the text, in E.164. */
|
|
11756
|
+
from: string;
|
|
11757
|
+
/** @description The text the lead sends, with the code in it to link the lead. */
|
|
11758
|
+
body: string;
|
|
11759
|
+
};
|
|
11760
|
+
/** @description The sandbox numbers added to your inbound pool. */
|
|
11761
|
+
SandboxLines: {
|
|
11762
|
+
lines: components["schemas"]["SandboxLine"][];
|
|
11763
|
+
};
|
|
11764
|
+
/** @description A sandbox number of your inbound pool. */
|
|
11765
|
+
SandboxLine: {
|
|
11766
|
+
/** @description Id of the sandbox line: `line_` followed by 25 letters or digits. */
|
|
11767
|
+
line_id: string;
|
|
11768
|
+
/** @description Its fictional number, in E.164 (+1 202 555-0100 to 555-0199). */
|
|
11769
|
+
phone_number: string;
|
|
11770
|
+
};
|
|
11771
|
+
/** @description How many sandbox numbers to add. */
|
|
11772
|
+
SandboxLinesRequest: {
|
|
11773
|
+
/** @description How many sandbox numbers to add to your inbound pool: 1 to 5. Your pool holds at most 5 in all. */
|
|
11774
|
+
count: number;
|
|
11775
|
+
};
|
|
10957
11776
|
};
|
|
10958
11777
|
responses: never;
|
|
10959
11778
|
parameters: never;
|