@isnap/sdk 2.3.0-next.236 → 2.3.0-next.238

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.
@@ -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`. 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`. The right to create one then comes from an inbound pool on your account, whether or not you are a wholesale partner: without one the call gets `403 inbound_pool_required`. 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`.
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. `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. `inbound_pool_required`: `inbound_first` is `true` and the account has no inbound pool. No line is created. */
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;
@@ -2979,7 +2979,7 @@ export interface paths {
2979
2979
  put?: never;
2980
2980
  /**
2981
2981
  * 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.
2982
+ * @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
2983
  *
2984
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. 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
2985
  */
@@ -8656,6 +8656,235 @@ export interface paths {
8656
8656
  patch?: never;
8657
8657
  trace?: never;
8658
8658
  };
8659
+ "/v1/sandbox/inbound": {
8660
+ parameters: {
8661
+ query?: never;
8662
+ header?: never;
8663
+ path?: never;
8664
+ cookie?: never;
8665
+ };
8666
+ get?: never;
8667
+ put?: never;
8668
+ /**
8669
+ * Send a lead text to a sandbox number (staging only)
8670
+ * @description Staging only: in production this operation does not exist and answers `404 not_found`.
8671
+ *
8672
+ * 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.
8673
+ */
8674
+ post: {
8675
+ parameters: {
8676
+ query?: never;
8677
+ header?: never;
8678
+ path?: never;
8679
+ cookie?: never;
8680
+ };
8681
+ requestBody: {
8682
+ content: {
8683
+ "application/json": components["schemas"]["SandboxInbound"];
8684
+ };
8685
+ };
8686
+ responses: {
8687
+ /** @description The sandbox number received the text. */
8688
+ 202: {
8689
+ headers: {
8690
+ [name: string]: unknown;
8691
+ };
8692
+ content: {
8693
+ "application/json": {
8694
+ /**
8695
+ * @description Always `true` on a success response.
8696
+ * @enum {boolean}
8697
+ */
8698
+ success: true;
8699
+ data: components["schemas"]["SandboxInboundAccepted"];
8700
+ /** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
8701
+ trace_id: string;
8702
+ /** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
8703
+ request_id: string;
8704
+ };
8705
+ };
8706
+ };
8707
+ /** @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. */
8708
+ 400: {
8709
+ headers: {
8710
+ [name: string]: unknown;
8711
+ };
8712
+ content: {
8713
+ "application/json": components["schemas"]["ErrorEnvelope"];
8714
+ };
8715
+ };
8716
+ /** @description No valid credential. `error.code` is `unauthorized`. */
8717
+ 401: {
8718
+ headers: {
8719
+ [name: string]: unknown;
8720
+ };
8721
+ content: {
8722
+ "application/json": components["schemas"]["ErrorEnvelope"];
8723
+ };
8724
+ };
8725
+ /** @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. */
8726
+ 403: {
8727
+ headers: {
8728
+ [name: string]: unknown;
8729
+ };
8730
+ content: {
8731
+ "application/json": components["schemas"]["ErrorEnvelope"];
8732
+ };
8733
+ };
8734
+ /** @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). */
8735
+ 404: {
8736
+ headers: {
8737
+ [name: string]: unknown;
8738
+ };
8739
+ content: {
8740
+ "application/json": components["schemas"]["ErrorEnvelope"];
8741
+ };
8742
+ };
8743
+ /** @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. */
8744
+ 429: {
8745
+ headers: {
8746
+ [name: string]: unknown;
8747
+ };
8748
+ content: {
8749
+ "application/json": components["schemas"]["ErrorEnvelope"];
8750
+ };
8751
+ };
8752
+ /** @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. */
8753
+ 500: {
8754
+ headers: {
8755
+ [name: string]: unknown;
8756
+ };
8757
+ content: {
8758
+ "application/json": components["schemas"]["ErrorEnvelope"];
8759
+ };
8760
+ };
8761
+ };
8762
+ };
8763
+ delete?: never;
8764
+ options?: never;
8765
+ head?: never;
8766
+ patch?: never;
8767
+ trace?: never;
8768
+ };
8769
+ "/v1/sandbox/lines": {
8770
+ parameters: {
8771
+ query?: never;
8772
+ header?: never;
8773
+ path?: never;
8774
+ cookie?: never;
8775
+ };
8776
+ get?: never;
8777
+ put?: never;
8778
+ /**
8779
+ * Add sandbox numbers to your inbound pool (staging only)
8780
+ * @description Staging only: in production this operation does not exist and answers `404 not_found`.
8781
+ *
8782
+ * 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.
8783
+ */
8784
+ post: {
8785
+ parameters: {
8786
+ query?: never;
8787
+ header?: never;
8788
+ path?: never;
8789
+ cookie?: never;
8790
+ };
8791
+ requestBody: {
8792
+ content: {
8793
+ "application/json": components["schemas"]["SandboxLinesRequest"];
8794
+ };
8795
+ };
8796
+ responses: {
8797
+ /** @description The sandbox numbers added to your inbound pool. */
8798
+ 201: {
8799
+ headers: {
8800
+ [name: string]: unknown;
8801
+ };
8802
+ content: {
8803
+ "application/json": {
8804
+ /**
8805
+ * @description Always `true` on a success response.
8806
+ * @enum {boolean}
8807
+ */
8808
+ success: true;
8809
+ data: components["schemas"]["SandboxLines"];
8810
+ /** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
8811
+ trace_id: string;
8812
+ /** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
8813
+ request_id: string;
8814
+ };
8815
+ };
8816
+ };
8817
+ /** @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. */
8818
+ 400: {
8819
+ headers: {
8820
+ [name: string]: unknown;
8821
+ };
8822
+ content: {
8823
+ "application/json": components["schemas"]["ErrorEnvelope"];
8824
+ };
8825
+ };
8826
+ /** @description No valid credential. `error.code` is `unauthorized`. */
8827
+ 401: {
8828
+ headers: {
8829
+ [name: string]: unknown;
8830
+ };
8831
+ content: {
8832
+ "application/json": components["schemas"]["ErrorEnvelope"];
8833
+ };
8834
+ };
8835
+ /** @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. */
8836
+ 403: {
8837
+ headers: {
8838
+ [name: string]: unknown;
8839
+ };
8840
+ content: {
8841
+ "application/json": components["schemas"]["ErrorEnvelope"];
8842
+ };
8843
+ };
8844
+ /** @description Not found. `not_found`: the operation does not exist here (production). */
8845
+ 404: {
8846
+ headers: {
8847
+ [name: string]: unknown;
8848
+ };
8849
+ content: {
8850
+ "application/json": components["schemas"]["ErrorEnvelope"];
8851
+ };
8852
+ };
8853
+ /** @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. */
8854
+ 409: {
8855
+ headers: {
8856
+ [name: string]: unknown;
8857
+ };
8858
+ content: {
8859
+ "application/json": components["schemas"]["ErrorEnvelope"];
8860
+ };
8861
+ };
8862
+ /** @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. */
8863
+ 429: {
8864
+ headers: {
8865
+ [name: string]: unknown;
8866
+ };
8867
+ content: {
8868
+ "application/json": components["schemas"]["ErrorEnvelope"];
8869
+ };
8870
+ };
8871
+ /** @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. */
8872
+ 500: {
8873
+ headers: {
8874
+ [name: string]: unknown;
8875
+ };
8876
+ content: {
8877
+ "application/json": components["schemas"]["ErrorEnvelope"];
8878
+ };
8879
+ };
8880
+ };
8881
+ };
8882
+ delete?: never;
8883
+ options?: never;
8884
+ head?: never;
8885
+ patch?: never;
8886
+ trace?: never;
8887
+ };
8659
8888
  }
8660
8889
  export type webhooks = Record<string, never>;
8661
8890
  export interface components {
@@ -8927,7 +9156,7 @@ export interface components {
8927
9156
  metadata?: {
8928
9157
  [key: string]: unknown;
8929
9158
  };
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`). Inbound-first lines are a private alpha, enabled per account on request (`403 inbound_pool_not_enabled` otherwise), and require an inbound pool on your account (`403 inbound_pool_required` otherwise). Defaults to `false`: an ordinary shared line. */
9159
+ /** @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
9160
  inbound_first?: boolean;
8932
9161
  };
8933
9162
  /** @description Optional settings of the activated line: its variant and its billing anchor. */
@@ -10954,6 +11183,38 @@ export interface components {
10954
11183
  */
10955
11184
  available: boolean;
10956
11185
  };
11186
+ /** @description The text was received by the sandbox number. */
11187
+ SandboxInboundAccepted: {
11188
+ /** @description Id of the received text, as the number reported it. */
11189
+ event_id: string;
11190
+ /** @description When the text was received (ISO 8601, UTC). */
11191
+ accepted_at: string;
11192
+ };
11193
+ /** @description A text a lead sends to a sandbox number. */
11194
+ SandboxInbound: {
11195
+ /** @description The sandbox number the lead texts, in E.164: a number an invite of yours returned on staging. */
11196
+ phone_number: string;
11197
+ /** @description The phone number of the lead who sends the text, in E.164. */
11198
+ from: string;
11199
+ /** @description The text the lead sends, with the code in it to link the lead. */
11200
+ body: string;
11201
+ };
11202
+ /** @description The sandbox numbers added to your inbound pool. */
11203
+ SandboxLines: {
11204
+ lines: components["schemas"]["SandboxLine"][];
11205
+ };
11206
+ /** @description A sandbox number of your inbound pool. */
11207
+ SandboxLine: {
11208
+ /** @description Id of the sandbox line: `line_` followed by 25 letters or digits. */
11209
+ line_id: string;
11210
+ /** @description Its fictional number, in E.164 (+1 202 555-0100 to 555-0199). */
11211
+ phone_number: string;
11212
+ };
11213
+ /** @description How many sandbox numbers to add. */
11214
+ SandboxLinesRequest: {
11215
+ /** @description How many sandbox numbers to add to your inbound pool: 1 to 5. Your pool holds at most 5 in all. */
11216
+ count: number;
11217
+ };
10957
11218
  };
10958
11219
  responses: never;
10959
11220
  parameters: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isnap/sdk",
3
- "version": "2.3.0-next.236",
3
+ "version": "2.3.0-next.238",
4
4
  "description": "Official TypeScript SDK for the iSnap P2P telephony API",
5
5
  "license": "MIT",
6
6
  "type": "module",