Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
790fa3f
codegen metadata
stainless-app[bot] Feb 16, 2026
08f56aa
codegen metadata
stainless-app[bot] Feb 16, 2026
c66a715
codegen metadata
stainless-app[bot] Feb 16, 2026
fa479f9
codegen metadata
stainless-app[bot] Feb 16, 2026
8cef060
codegen metadata
stainless-app[bot] Feb 16, 2026
c18503b
codegen metadata
stainless-app[bot] Feb 16, 2026
021dfa9
codegen metadata
stainless-app[bot] Feb 17, 2026
8048dfc
codegen metadata
stainless-app[bot] Feb 17, 2026
e84d278
codegen metadata
stainless-app[bot] Feb 17, 2026
a758fc8
codegen metadata
stainless-app[bot] Feb 17, 2026
9fdc120
codegen metadata
stainless-app[bot] Feb 17, 2026
446e12e
codegen metadata
stainless-app[bot] Feb 17, 2026
7bdc185
codegen metadata
stainless-app[bot] Feb 17, 2026
38197e5
codegen metadata
stainless-app[bot] Feb 17, 2026
0ec981c
codegen metadata
stainless-app[bot] Feb 17, 2026
8940847
codegen metadata
stainless-app[bot] Feb 17, 2026
b65fdcc
codegen metadata
stainless-app[bot] Feb 17, 2026
c71b6e3
codegen metadata
stainless-app[bot] Feb 17, 2026
88db633
codegen metadata
stainless-app[bot] Feb 17, 2026
e36615a
codegen metadata
stainless-app[bot] Feb 17, 2026
9a053dc
codegen metadata
stainless-app[bot] Feb 17, 2026
4bda6bd
codegen metadata
stainless-app[bot] Feb 17, 2026
1ad4b1b
codegen metadata
stainless-app[bot] Feb 17, 2026
16e0e72
codegen metadata
stainless-app[bot] Feb 17, 2026
ec85416
codegen metadata
stainless-app[bot] Feb 17, 2026
a2be803
codegen metadata
stainless-app[bot] Feb 18, 2026
b8b8863
codegen metadata
stainless-app[bot] Feb 18, 2026
cf48b05
codegen metadata
stainless-app[bot] Feb 18, 2026
97a27d6
codegen metadata
stainless-app[bot] Feb 18, 2026
e772750
codegen metadata
stainless-app[bot] Feb 18, 2026
0e0c505
codegen metadata
stainless-app[bot] Feb 18, 2026
7b1e6f7
codegen metadata
stainless-app[bot] Feb 18, 2026
58356c5
codegen metadata
stainless-app[bot] Feb 18, 2026
e2c71e0
codegen metadata
stainless-app[bot] Feb 18, 2026
1362fa1
codegen metadata
stainless-app[bot] Feb 18, 2026
cddb8e7
codegen metadata
stainless-app[bot] Feb 18, 2026
6eab03d
codegen metadata
stainless-app[bot] Feb 18, 2026
014aea7
codegen metadata
stainless-app[bot] Feb 18, 2026
c839787
feat(api): manual updates
stainless-app[bot] Feb 18, 2026
3635da5
feat(api): manual updates
stainless-app[bot] Feb 18, 2026
360738f
feat(api): manual updates
stainless-app[bot] Feb 18, 2026
4728c1c
release: 0.8.0
stainless-app[bot] Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.7.0"
".": "0.8.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-a02f66b4c3837ff1b6d38b924856b9afad2b3bfbc3152c1b4dfbe1ee895008a5.yml
openapi_spec_hash: 30e666a2b17c0768213eaa74e0aec11b
config_hash: 804a43c36c8e58c8d0ff2e57dd6545ec
configured_endpoints: 44
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-433bfd8c688a6b6d2d4f964bb59121d692798f4e2bb6cb47f6110c4f0e1f638d.yml
openapi_spec_hash: 5378295d401c8c1152c1946cc7dbd69f
config_hash: 43a0daa5b05d44a1620e3da0ea6f4fdc
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.8.0 (2026-02-18)

Full Changelog: [v0.7.0...v0.8.0](https://github.com/sentdm/sent-dm-python/compare/v0.7.0...v0.8.0)

### Features

* **api:** manual updates ([360738f](https://github.com/sentdm/sent-dm-python/commit/360738fed511bd249fb75d9c1c263c28964a0e15))
* **api:** manual updates ([3635da5](https://github.com/sentdm/sent-dm-python/commit/3635da501ca023b5fe35f55946189a84933a9c54))
* **api:** manual updates ([c839787](https://github.com/sentdm/sent-dm-python/commit/c839787873794ed14357133cdc4eea6b97bbe422))

## 0.7.0 (2026-02-16)

Full Changelog: [v0.6.2...v0.7.0](https://github.com/sentdm/sent-dm-python/compare/v0.6.2...v0.7.0)
Expand Down
198 changes: 93 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,21 @@ from sent_dm import SentDm

client = SentDm(
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
)

client.messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
response = client.messages.send(
channel=["sms", "whatsapp"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234", "+14155555678"],
)
print(response.data)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -59,19 +63,23 @@ from sent_dm import AsyncSentDm

client = AsyncSentDm(
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
)


async def main() -> None:
await client.messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
response = await client.messages.send(
channel=["sms", "whatsapp"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234", "+14155555678"],
)
print(response.data)


asyncio.run(main())
Expand Down Expand Up @@ -102,17 +110,21 @@ from sent_dm import AsyncSentDm
async def main() -> None:
async with AsyncSentDm(
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
await client.messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
response = await client.messages.send(
channel=["sms", "whatsapp"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234", "+14155555678"],
)
print(response.data)


asyncio.run(main())
Expand All @@ -136,61 +148,17 @@ from sent_dm import SentDm

client = SentDm()

template_response_v2 = client.templates.create(
definition={
"body": {
"multi_channel": {
"template": "Hello {{1:variable}}, thank you for joining our service. We're excited to help you with your messaging needs!",
"type": None,
"variables": [
{
"id": 1,
"name": "customerName",
"props": {
"alt": None,
"media_type": None,
"sample": "John Doe",
"short_url": None,
"url": None,
"variable_type": "text",
},
"type": "variable",
}
],
},
"sms": {},
"whatsapp": {},
},
"authentication_config": {},
"buttons": [{}],
"definition_version": "1.0",
"footer": {
"template": "Best regards, The SentDM Team",
"type": "text",
"variables": [{}],
},
"header": {
"template": "Welcome to {{1:variable}}!",
"type": "text",
"variables": [
{
"id": 1,
"name": "companyName",
"props": {
"alt": None,
"media_type": None,
"sample": "SentDM",
"short_url": None,
"url": None,
"variable_type": "text",
},
"type": "variable",
}
],
response = client.messages.send(
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
)
print(template_response_v2.definition)
print(response.template)
```

## Handling errors
Expand All @@ -209,13 +177,17 @@ from sent_dm import SentDm
client = SentDm()

try:
client.messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
client.messages.send(
channel=["sms"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234"],
)
except sent_dm.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -259,13 +231,17 @@ client = SentDm(
)

# Or, configure per-request:
client.with_options(max_retries=5).messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
client.with_options(max_retries=5).messages.send(
channel=["sms"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234"],
)
```

Expand All @@ -289,13 +265,17 @@ client = SentDm(
)

# Override per-request:
client.with_options(timeout=5.0).messages.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
client.with_options(timeout=5.0).messages.send(
channel=["sms"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234"],
)
```

Expand Down Expand Up @@ -337,18 +317,22 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from sent_dm import SentDm

client = SentDm()
response = client.messages.with_raw_response.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
response = client.messages.with_raw_response.send(
channel=["sms"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234"],
)
print(response.headers.get('X-My-Header'))

message = response.parse() # get the object that `messages.send_to_phone()` would have returned
print(message)
message = response.parse() # get the object that `messages.send()` would have returned
print(message.data)
```

These methods return an [`APIResponse`](https://github.com/sentdm/sent-dm-python/tree/main/src/sent_dm/_response.py) object.
Expand All @@ -362,13 +346,17 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

```python
with client.messages.with_streaming_response.send_to_phone(
phone_number="+1234567890",
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
template_variables={
"name": "John Doe",
"order_id": "12345",
with client.messages.with_streaming_response.send(
channel=["sms"],
template={
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"name": "order_confirmation",
"parameters": {
"name": "John Doe",
"order_id": "12345",
},
},
to=["+14155551234"],
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
Loading