Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
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.18.1"
".": "0.19.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 58
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/ark%2Fark-98a90852ffca49f4e26c613afff433b17023ee1f81f38ad38a5dad60a0d09881.yml
openapi_spec_hash: c6fd865dd6995df15cf9e6ada2ae791e
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/ark%2Fark-06c3025bf12b191c3906b28173c9b359e24481dd2839dbf3e6dd0b80c1de3fd6.yml
openapi_spec_hash: d8f8fb1f78579997b6381d64cba4e826
config_hash: b70b11b10fc614f91f1c6f028b40780f
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.19.0 (2026-02-27)

Full Changelog: [v0.18.1...v0.19.0](https://github.com/ArkHQ-io/ark-python/compare/v0.18.1...v0.19.0)

### Features

* **api:** add tenantId to send ([3eddd67](https://github.com/ArkHQ-io/ark-python/commit/3eddd677b69f387149336e11abe71a6143290ac4))


### Chores

* **ci:** bump uv version ([e7115ed](https://github.com/ArkHQ-io/ark-python/commit/e7115edad4dd96f45c7b87f76b00792b8d096647))
* **internal:** add request options to SSE classes ([fdc5e91](https://github.com/ArkHQ-io/ark-python/commit/fdc5e91d4774006a051e8a289bbd1b3c7eec1b8c))
* **internal:** make `test_proxy_environment_variables` more resilient ([709aff4](https://github.com/ArkHQ-io/ark-python/commit/709aff401224092c3e5059559951c8bc82c59866))
* **internal:** make `test_proxy_environment_variables` more resilient to env ([df5b863](https://github.com/ArkHQ-io/ark-python/commit/df5b8639e08e14c7a64e51081f60c41d0450617b))
* update mock server docs ([b4e4ce8](https://github.com/ArkHQ-io/ark-python/commit/b4e4ce8a56859a87137349e5f97ede2c8acaad25))

## 0.18.1 (2026-02-18)

Full Changelog: [v0.18.0...v0.18.1](https://github.com/ArkHQ-io/ark-python/compare/v0.18.0...v0.18.1)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
# you will need npm installed
$ npx prism mock path/to/your/openapi.yml
$ ./scripts/mock
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ark-email"
version = "0.18.1"
version = "0.19.0"
description = "The official Python library for the ark API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/ark/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=extract_stream_chunk_type(self._stream_cls),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=cast_to,
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand Down
11 changes: 8 additions & 3 deletions src/ark/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import inspect
from types import TracebackType
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable

import httpx
Expand All @@ -13,6 +13,7 @@

if TYPE_CHECKING:
from ._client import Ark, AsyncArk
from ._models import FinalRequestOptions


_T = TypeVar("_T")
Expand All @@ -22,7 +23,7 @@ class Stream(Generic[_T]):
"""Provides the core interface to iterate over a synchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEBytesDecoder

def __init__(
Expand All @@ -31,10 +32,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: Ark,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

Expand Down Expand Up @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
"""Provides the core interface to iterate over an asynchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEDecoder | SSEBytesDecoder

def __init__(
Expand All @@ -94,10 +97,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: AsyncArk,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

Expand Down
2 changes: 1 addition & 1 deletion src/ark/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "ark"
__version__ = "0.18.1" # x-release-please-version
__version__ = "0.19.0" # x-release-please-version
60 changes: 60 additions & 0 deletions src/ark/resources/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def send(
metadata: Optional[Dict[str, str]] | Omit = omit,
reply_to: Optional[str] | Omit = omit,
tag: Optional[str] | Omit = omit,
tenant_id: Optional[str] | Omit = omit,
text: Optional[str] | Omit = omit,
idempotency_key: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -396,6 +397,14 @@ def send(

tag: Tag for categorization and filtering (accepts null)

tenant_id: The tenant ID to send this email from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

text: Plain text body (accepts null, auto-generated from HTML if not provided).
Maximum 5MB (5,242,880 characters).

Expand Down Expand Up @@ -423,6 +432,7 @@ def send(
"metadata": metadata,
"reply_to": reply_to,
"tag": tag,
"tenant_id": tenant_id,
"text": text,
},
email_send_params.EmailSendParams,
Expand All @@ -438,6 +448,7 @@ def send_batch(
*,
emails: Iterable[email_send_batch_params.Email],
from_: str,
tenant_id: Optional[str] | Omit = omit,
idempotency_key: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -459,6 +470,14 @@ def send_batch(
Args:
from_: Sender email for all messages

tenant_id: The tenant ID to send this batch from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -474,6 +493,7 @@ def send_batch(
{
"emails": emails,
"from_": from_,
"tenant_id": tenant_id,
},
email_send_batch_params.EmailSendBatchParams,
),
Expand All @@ -490,6 +510,7 @@ def send_raw(
raw_message: str,
to: SequenceNotStr[str],
bounce: Optional[bool] | Omit = omit,
tenant_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -527,6 +548,14 @@ def send_raw(

bounce: Whether this is a bounce message (accepts null)

tenant_id: The tenant ID to send this email from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -543,6 +572,7 @@ def send_raw(
"raw_message": raw_message,
"to": to,
"bounce": bounce,
"tenant_id": tenant_id,
},
email_send_raw_params.EmailSendRawParams,
),
Expand Down Expand Up @@ -833,6 +863,7 @@ async def send(
metadata: Optional[Dict[str, str]] | Omit = omit,
reply_to: Optional[str] | Omit = omit,
tag: Optional[str] | Omit = omit,
tenant_id: Optional[str] | Omit = omit,
text: Optional[str] | Omit = omit,
idempotency_key: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -912,6 +943,14 @@ async def send(

tag: Tag for categorization and filtering (accepts null)

tenant_id: The tenant ID to send this email from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

text: Plain text body (accepts null, auto-generated from HTML if not provided).
Maximum 5MB (5,242,880 characters).

Expand Down Expand Up @@ -939,6 +978,7 @@ async def send(
"metadata": metadata,
"reply_to": reply_to,
"tag": tag,
"tenant_id": tenant_id,
"text": text,
},
email_send_params.EmailSendParams,
Expand All @@ -954,6 +994,7 @@ async def send_batch(
*,
emails: Iterable[email_send_batch_params.Email],
from_: str,
tenant_id: Optional[str] | Omit = omit,
idempotency_key: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -975,6 +1016,14 @@ async def send_batch(
Args:
from_: Sender email for all messages

tenant_id: The tenant ID to send this batch from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -990,6 +1039,7 @@ async def send_batch(
{
"emails": emails,
"from_": from_,
"tenant_id": tenant_id,
},
email_send_batch_params.EmailSendBatchParams,
),
Expand All @@ -1006,6 +1056,7 @@ async def send_raw(
raw_message: str,
to: SequenceNotStr[str],
bounce: Optional[bool] | Omit = omit,
tenant_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -1043,6 +1094,14 @@ async def send_raw(

bounce: Whether this is a bounce message (accepts null)

tenant_id: The tenant ID to send this email from. Determines which tenant's configuration
(domains, webhooks, tracking) is used.

- If your API key is scoped to a specific tenant, this must match that tenant or
be omitted.
- If your API key is org-level, specify the tenant to send from.
- If omitted, the organization's default tenant is used.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -1059,6 +1118,7 @@ async def send_raw(
"raw_message": raw_message,
"to": to,
"bounce": bounce,
"tenant_id": tenant_id,
},
email_send_raw_params.EmailSendRawParams,
),
Expand Down
3 changes: 3 additions & 0 deletions src/ark/types/email_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class EmailListResponse(BaseModel):

subject: str

tenant_id: str = FieldInfo(alias="tenantId")
"""The tenant ID this email belongs to"""

timestamp: float

timestamp_iso: datetime = FieldInfo(alias="timestampIso")
Expand Down
3 changes: 3 additions & 0 deletions src/ark/types/email_retrieve_deliveries_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class Data(BaseModel):
- `bounced` - Bounced by recipient server
"""

tenant_id: str = FieldInfo(alias="tenantId")
"""The tenant ID this email belongs to"""


class EmailRetrieveDeliveriesResponse(BaseModel):
data: Data
Expand Down
3 changes: 3 additions & 0 deletions src/ark/types/email_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ class Data(BaseModel):
subject: str
"""Email subject line"""

tenant_id: str = FieldInfo(alias="tenantId")
"""The tenant ID this email belongs to"""

timestamp: float
"""Unix timestamp when the email was sent"""

Expand Down
Loading