Skip to content

Commit 6c5357e

Browse files
author
stlc-bot
committed
feat(api): sync OpenAPI spec from production
Stainless-Generated-From: c6fc73e611b365090249bd47a206eeff9f919050
1 parent a539816 commit 6c5357e

18 files changed

Lines changed: 498 additions & 237 deletions

api.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,19 @@ Types:
114114

115115
```python
116116
from sent_dm.types.profiles import (
117-
APIResponseOfTcrCampaignWithUseCases,
118-
BaseDto,
119117
CampaignData,
120118
MessagingUseCaseUs,
121119
SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
122-
TcrCampaignWithUseCases,
120+
CampaignCreateResponse,
121+
CampaignUpdateResponse,
123122
CampaignListResponse,
124123
)
125124
```
126125

127126
Methods:
128127

129-
- <code title="post /v3/profiles/{profileId}/campaigns">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">create</a>(profile_id, \*\*<a href="src/sent_dm/types/profiles/campaign_create_params.py">params</a>) -> <a href="./src/sent_dm/types/profiles/api_response_of_tcr_campaign_with_use_cases.py">APIResponseOfTcrCampaignWithUseCases</a></code>
130-
- <code title="put /v3/profiles/{profileId}/campaigns/{campaignId}">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">update</a>(campaign_id, \*, profile_id, \*\*<a href="src/sent_dm/types/profiles/campaign_update_params.py">params</a>) -> <a href="./src/sent_dm/types/profiles/api_response_of_tcr_campaign_with_use_cases.py">APIResponseOfTcrCampaignWithUseCases</a></code>
128+
- <code title="post /v3/profiles/{profileId}/campaigns">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">create</a>(profile_id, \*\*<a href="src/sent_dm/types/profiles/campaign_create_params.py">params</a>) -> <a href="./src/sent_dm/types/profiles/campaign_create_response.py">CampaignCreateResponse</a></code>
129+
- <code title="put /v3/profiles/{profileId}/campaigns/{campaignId}">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">update</a>(campaign_id, \*, profile_id, \*\*<a href="src/sent_dm/types/profiles/campaign_update_params.py">params</a>) -> <a href="./src/sent_dm/types/profiles/campaign_update_response.py">CampaignUpdateResponse</a></code>
131130
- <code title="get /v3/profiles/{profileId}/campaigns">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">list</a>(profile_id) -> <a href="./src/sent_dm/types/profiles/campaign_list_response.py">CampaignListResponse</a></code>
132131
- <code title="delete /v3/profiles/{profileId}/campaigns/{campaignId}">client.profiles.campaigns.<a href="./src/sent_dm/resources/profiles/campaigns.py">delete</a>(campaign_id, \*, profile_id, \*\*<a href="src/sent_dm/types/profiles/campaign_delete_params.py">params</a>) -> None</code>
133132

src/sent_dm/resources/messages.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ def send(
144144
multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
145145
"whatsapp"]), a separate message is created for each (recipient, channel) pair.
146146
Returns immediately with per-recipient message IDs for async tracking via
147-
webhooks or the GET /messages/{id} endpoint.
147+
webhooks or the GET /messages/{id} endpoint. Account-level preconditions such as
148+
insufficient balance do not reject the request: the send is accepted with 202
149+
and the affected messages are reported as BLOCKED on GET /messages/{id} and the
150+
message status webhook.
148151
149152
Args:
150153
channel: Channels to broadcast on, e.g. ["whatsapp", "sms"]. Each channel produces a
@@ -316,7 +319,10 @@ async def send(
316319
multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
317320
"whatsapp"]), a separate message is created for each (recipient, channel) pair.
318321
Returns immediately with per-recipient message IDs for async tracking via
319-
webhooks or the GET /messages/{id} endpoint.
322+
webhooks or the GET /messages/{id} endpoint. Account-level preconditions such as
323+
insufficient balance do not reject the request: the send is accepted with 202
324+
and the affected messages are reported as BLOCKED on GET /messages/{id} and the
325+
message status webhook.
320326
321327
Args:
322328
channel: Channels to broadcast on, e.g. ["whatsapp", "sms"]. Each channel produces a

src/sent_dm/resources/profiles/campaigns.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
from ...types.profiles import campaign_create_params, campaign_delete_params, campaign_update_params
1919
from ...types.profiles.campaign_data_param import CampaignDataParam
2020
from ...types.profiles.campaign_list_response import CampaignListResponse
21-
from ...types.profiles.api_response_of_tcr_campaign_with_use_cases import APIResponseOfTcrCampaignWithUseCases
21+
from ...types.profiles.campaign_create_response import CampaignCreateResponse
22+
from ...types.profiles.campaign_update_response import CampaignUpdateResponse
2223

2324
__all__ = ["CampaignsResource", "AsyncCampaignsResource"]
2425

@@ -59,7 +60,7 @@ def create(
5960
extra_query: Query | None = None,
6061
extra_body: Body | None = None,
6162
timeout: float | httpx.Timeout | None | NotGiven = not_given,
62-
) -> APIResponseOfTcrCampaignWithUseCases:
63+
) -> CampaignCreateResponse:
6364
"""Creates a new campaign scoped under the brand of the specified profile.
6465
6566
Each
@@ -102,7 +103,7 @@ def create(
102103
options=make_request_options(
103104
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
104105
),
105-
cast_to=APIResponseOfTcrCampaignWithUseCases,
106+
cast_to=CampaignCreateResponse,
106107
)
107108

108109
def update(
@@ -120,7 +121,7 @@ def update(
120121
extra_query: Query | None = None,
121122
extra_body: Body | None = None,
122123
timeout: float | httpx.Timeout | None | NotGiven = not_given,
123-
) -> APIResponseOfTcrCampaignWithUseCases:
124+
) -> CampaignUpdateResponse:
124125
"""Updates an existing campaign under the brand of the specified profile.
125126
126127
Cannot
@@ -167,7 +168,7 @@ def update(
167168
options=make_request_options(
168169
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
169170
),
170-
cast_to=APIResponseOfTcrCampaignWithUseCases,
171+
cast_to=CampaignUpdateResponse,
171172
)
172173

173174
def list(
@@ -291,7 +292,7 @@ async def create(
291292
extra_query: Query | None = None,
292293
extra_body: Body | None = None,
293294
timeout: float | httpx.Timeout | None | NotGiven = not_given,
294-
) -> APIResponseOfTcrCampaignWithUseCases:
295+
) -> CampaignCreateResponse:
295296
"""Creates a new campaign scoped under the brand of the specified profile.
296297
297298
Each
@@ -334,7 +335,7 @@ async def create(
334335
options=make_request_options(
335336
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
336337
),
337-
cast_to=APIResponseOfTcrCampaignWithUseCases,
338+
cast_to=CampaignCreateResponse,
338339
)
339340

340341
async def update(
@@ -352,7 +353,7 @@ async def update(
352353
extra_query: Query | None = None,
353354
extra_body: Body | None = None,
354355
timeout: float | httpx.Timeout | None | NotGiven = not_given,
355-
) -> APIResponseOfTcrCampaignWithUseCases:
356+
) -> CampaignUpdateResponse:
356357
"""Updates an existing campaign under the brand of the specified profile.
357358
358359
Cannot
@@ -399,7 +400,7 @@ async def update(
399400
options=make_request_options(
400401
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
401402
),
402-
cast_to=APIResponseOfTcrCampaignWithUseCases,
403+
cast_to=CampaignUpdateResponse,
403404
)
404405

405406
async def list(

src/sent_dm/resources/profiles/profiles.py

Lines changed: 66 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def update(
366366
367367
sending_phone_number: Direct phone number for SMS sending (optional)
368368
369-
sending_phone_number_profile_id: Reference to another profile to use for SMS/Telnyx configuration (optional)
369+
sending_phone_number_profile_id: Reference to another profile to use for SMS configuration (optional)
370370
371371
sending_whatsapp_number_profile_id: Reference to another profile to use for WhatsApp configuration (optional)
372372
@@ -521,26 +521,38 @@ def complete(
521521
extra_body: Body | None = None,
522522
timeout: float | httpx.Timeout | None | NotGiven = not_given,
523523
) -> ProfileCompleteResponse:
524-
"""Final step in profile compliance workflow.
525-
526-
Validates all prerequisites (general
527-
data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
528-
based on configuration. The process runs in the background and calls the
529-
provided webhook URL when finished.
530-
531-
Prerequisites:
532-
- Profile must be completed
533-
- If inheritTcrBrand=false: Profile must have existing brand
534-
- If inheritTcrBrand=true: Parent must have existing brand
535-
- If TCR application: Must have at least one campaign (own or inherited)
536-
- If inheritTcrCampaign=false: Profile should have campaigns
537-
- If inheritTcrCampaign=true: Parent must have campaigns
538-
539-
Status Logic:
540-
- If both SMS and WhatsApp channels are missing → SUBMITTED
541-
- If TCR application and not inheriting brand/campaigns → SUBMITTED
542-
- If non-TCR with destination country (IsMain=true) → SUBMITTED
543-
- Otherwise → COMPLETED
524+
"""Final step in the profile compliance workflow.
525+
526+
Validates all prerequisites (KYC,
527+
brand, campaigns, required documents), connects the profile to the SMS and
528+
WhatsApp channels, and sets its status based on configuration. Prerequisites are
529+
always validated first: if any fail the call returns 400. If they pass and the
530+
profile is already completed, the call returns 200 and does nothing. Otherwise
531+
it returns 202 and calls the provided webhook URL when background processing
532+
finishes.
533+
534+
Prerequisites:
535+
536+
- Profile must have a name, short name, and description (short name max 50
537+
characters, description max 5000)
538+
- webHookUrl must be supplied on the request
539+
- A KYC form submission is required
540+
- A brand is required, either on the profile or inherited from the parent
541+
organization
542+
- TCR applications must have at least one campaign, own or inherited
543+
- Destination countries marked as main must have their required compliance
544+
documents uploaded
545+
546+
Resulting status:
547+
548+
- If either the SMS or WhatsApp channel is unconfigured, the profile is
549+
SUBMITTED
550+
- For a TCR application that inherits both its brand and its campaigns, the
551+
profile is COMPLETED
552+
- For a TCR application that owns either its brand or its campaigns, the profile
553+
is COMPLETED once both have been submitted to TCR, and SUBMITTED until then
554+
- For a non-TCR application, the profile is SUBMITTED when a main destination
555+
country is set, and COMPLETED otherwise
544556
545557
Args:
546558
web_hook_url: Webhook URL to call when profile completion finishes (success or failure)
@@ -908,7 +920,7 @@ async def update(
908920
909921
sending_phone_number: Direct phone number for SMS sending (optional)
910922
911-
sending_phone_number_profile_id: Reference to another profile to use for SMS/Telnyx configuration (optional)
923+
sending_phone_number_profile_id: Reference to another profile to use for SMS configuration (optional)
912924
913925
sending_whatsapp_number_profile_id: Reference to another profile to use for WhatsApp configuration (optional)
914926
@@ -1063,26 +1075,38 @@ async def complete(
10631075
extra_body: Body | None = None,
10641076
timeout: float | httpx.Timeout | None | NotGiven = not_given,
10651077
) -> ProfileCompleteResponse:
1066-
"""Final step in profile compliance workflow.
1067-
1068-
Validates all prerequisites (general
1069-
data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
1070-
based on configuration. The process runs in the background and calls the
1071-
provided webhook URL when finished.
1072-
1073-
Prerequisites:
1074-
- Profile must be completed
1075-
- If inheritTcrBrand=false: Profile must have existing brand
1076-
- If inheritTcrBrand=true: Parent must have existing brand
1077-
- If TCR application: Must have at least one campaign (own or inherited)
1078-
- If inheritTcrCampaign=false: Profile should have campaigns
1079-
- If inheritTcrCampaign=true: Parent must have campaigns
1080-
1081-
Status Logic:
1082-
- If both SMS and WhatsApp channels are missing → SUBMITTED
1083-
- If TCR application and not inheriting brand/campaigns → SUBMITTED
1084-
- If non-TCR with destination country (IsMain=true) → SUBMITTED
1085-
- Otherwise → COMPLETED
1078+
"""Final step in the profile compliance workflow.
1079+
1080+
Validates all prerequisites (KYC,
1081+
brand, campaigns, required documents), connects the profile to the SMS and
1082+
WhatsApp channels, and sets its status based on configuration. Prerequisites are
1083+
always validated first: if any fail the call returns 400. If they pass and the
1084+
profile is already completed, the call returns 200 and does nothing. Otherwise
1085+
it returns 202 and calls the provided webhook URL when background processing
1086+
finishes.
1087+
1088+
Prerequisites:
1089+
1090+
- Profile must have a name, short name, and description (short name max 50
1091+
characters, description max 5000)
1092+
- webHookUrl must be supplied on the request
1093+
- A KYC form submission is required
1094+
- A brand is required, either on the profile or inherited from the parent
1095+
organization
1096+
- TCR applications must have at least one campaign, own or inherited
1097+
- Destination countries marked as main must have their required compliance
1098+
documents uploaded
1099+
1100+
Resulting status:
1101+
1102+
- If either the SMS or WhatsApp channel is unconfigured, the profile is
1103+
SUBMITTED
1104+
- For a TCR application that inherits both its brand and its campaigns, the
1105+
profile is COMPLETED
1106+
- For a TCR application that owns either its brand or its campaigns, the profile
1107+
is COMPLETED once both have been submitted to TCR, and SUBMITTED until then
1108+
- For a non-TCR application, the profile is SUBMITTED when a main destination
1109+
country is set, and COMPLETED otherwise
10861110
10871111
Args:
10881112
web_hook_url: Webhook URL to call when profile completion finishes (success or failure)

src/sent_dm/types/message_send_response.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ class Data(BaseModel):
3838
"""Per-recipient message results"""
3939

4040
status: Optional[str] = None
41-
"""
42-
Overall request status: "QUEUED" when the batch has been accepted and published
43-
to Kafka.
44-
"""
41+
"""Overall request status: "QUEUED" when the batch has been accepted for delivery."""
4542

4643
template_id: Optional[str] = None
4744
"""Template ID that was used"""

src/sent_dm/types/profile_detail.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ class BrandCompliance(BaseModel):
6969
destination_countries: Optional[List[DestinationCountry]] = None
7070
"""List of destination countries for messaging"""
7171

72-
expected_messaging_volume: Optional[str] = None
73-
"""Expected daily messaging volume"""
74-
7572
is_tcr_application: Optional[bool] = None
7673
"""Whether this is a TCR (Campaign Registry) application"""
7774

@@ -216,7 +213,7 @@ class ProfileDetail(BaseModel):
216213
"""Direct SMS phone number"""
217214

218215
sending_phone_number_profile_id: Optional[str] = None
219-
"""Reference to another profile for SMS/Telnyx configuration"""
216+
"""Reference to another profile whose SMS configuration this profile uses"""
220217

221218
sending_whatsapp_number_profile_id: Optional[str] = None
222219
"""Reference to another profile for WhatsApp configuration"""

src/sent_dm/types/profile_update_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ProfileUpdateParams(TypedDict, total=False):
8080
"""Direct phone number for SMS sending (optional)"""
8181

8282
sending_phone_number_profile_id: Optional[str]
83-
"""Reference to another profile to use for SMS/Telnyx configuration (optional)"""
83+
"""Reference to another profile to use for SMS configuration (optional)"""
8484

8585
sending_whatsapp_number_profile_id: Optional[str]
8686
"""Reference to another profile to use for WhatsApp configuration (optional)"""

src/sent_dm/types/profiles/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
from __future__ import annotations
44

5-
from .base_dto import BaseDto as BaseDto
65
from .campaign_data_param import CampaignDataParam as CampaignDataParam
76
from .messaging_use_case_us import MessagingUseCaseUs as MessagingUseCaseUs
87
from .campaign_create_params import CampaignCreateParams as CampaignCreateParams
98
from .campaign_delete_params import CampaignDeleteParams as CampaignDeleteParams
109
from .campaign_list_response import CampaignListResponse as CampaignListResponse
1110
from .campaign_update_params import CampaignUpdateParams as CampaignUpdateParams
12-
from .tcr_campaign_with_use_cases import TcrCampaignWithUseCases as TcrCampaignWithUseCases
13-
from .api_response_of_tcr_campaign_with_use_cases import (
14-
APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases,
15-
)
11+
from .campaign_create_response import CampaignCreateResponse as CampaignCreateResponse
12+
from .campaign_update_response import CampaignUpdateResponse as CampaignUpdateResponse
1613
from .sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data_param import (
1714
SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseDataParam as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseDataParam,
1815
)

src/sent_dm/types/profiles/api_response_of_tcr_campaign_with_use_cases.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/sent_dm/types/profiles/base_dto.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)