Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.17.0"
".": "1.18.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: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-5cee858ce17e48e25e7503767dd979c6570a485511274e48129a1922eae67098.yml
openapi_spec_hash: 54c716ac4e888bfddc2c6402192bb33a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
config_hash: 13d10207114afb65f7ac4e21f4c0e358
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.18.0 (2026-05-06)

Full Changelog: [v1.17.0...v1.18.0](https://github.com/moderation-api/sdk-python/compare/v1.17.0...v1.18.0)

### Features

* **api:** api update ([9f119a9](https://github.com/moderation-api/sdk-python/commit/9f119a9f2586fd0454a0c37b0d2673840d5a4b34))


### Chores

* **internal:** reformat pyproject.toml ([d2e57b3](https://github.com/moderation-api/sdk-python/commit/d2e57b30bb588d023745bd0250e91846b609bf0a))

## 1.17.0 (2026-04-29)

Full Changelog: [v1.16.0...v1.17.0](https://github.com/moderation-api/sdk-python/compare/v1.16.0...v1.17.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "moderation_api"
version = "1.17.0"
version = "1.18.0"
description = "The official Python library for the moderation-api API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -154,7 +154,7 @@ show_error_codes = true
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/moderation_api/_files.py', '_dev/.*.py', 'tests/.*']
exclude = ["src/moderation_api/_files.py", "_dev/.*.py", "tests/.*"]

strict_equality = true
implicit_reexport = true
Expand Down
2 changes: 1 addition & 1 deletion src/moderation_api/_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__ = "moderation_api"
__version__ = "1.17.0" # x-release-please-version
__version__ = "1.18.0" # x-release-please-version
16 changes: 16 additions & 0 deletions src/moderation_api/resources/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def create(
self,
*,
external_id: str,
company: Optional[str] | Omit = omit,
email: Optional[str] | Omit = omit,
external_link: Optional[str] | Omit = omit,
first_seen: float | Omit = omit,
Expand All @@ -75,6 +76,8 @@ def create(
Args:
external_id: External ID of the user, typically the ID of the author in your database.

company: The author's company or organization

email: Author email address

external_link: URL of the author's external profile
Expand Down Expand Up @@ -103,6 +106,7 @@ def create(
body=maybe_transform(
{
"external_id": external_id,
"company": company,
"email": email,
"external_link": external_link,
"first_seen": first_seen,
Expand Down Expand Up @@ -160,6 +164,7 @@ def update(
self,
id: str,
*,
company: Optional[str] | Omit = omit,
email: Optional[str] | Omit = omit,
external_link: Optional[str] | Omit = omit,
first_seen: float | Omit = omit,
Expand All @@ -181,6 +186,8 @@ def update(
Args:
id: Either external ID or the ID assigned by moderation API.

company: The author's company or organization

email: Author email address

external_link: URL of the author's external profile
Expand Down Expand Up @@ -210,6 +217,7 @@ def update(
path_template("/authors/{id}", id=id),
body=maybe_transform(
{
"company": company,
"email": email,
"external_link": external_link,
"first_seen": first_seen,
Expand Down Expand Up @@ -353,6 +361,7 @@ async def create(
self,
*,
external_id: str,
company: Optional[str] | Omit = omit,
email: Optional[str] | Omit = omit,
external_link: Optional[str] | Omit = omit,
first_seen: float | Omit = omit,
Expand All @@ -376,6 +385,8 @@ async def create(
Args:
external_id: External ID of the user, typically the ID of the author in your database.

company: The author's company or organization

email: Author email address

external_link: URL of the author's external profile
Expand Down Expand Up @@ -404,6 +415,7 @@ async def create(
body=await async_maybe_transform(
{
"external_id": external_id,
"company": company,
"email": email,
"external_link": external_link,
"first_seen": first_seen,
Expand Down Expand Up @@ -461,6 +473,7 @@ async def update(
self,
id: str,
*,
company: Optional[str] | Omit = omit,
email: Optional[str] | Omit = omit,
external_link: Optional[str] | Omit = omit,
first_seen: float | Omit = omit,
Expand All @@ -482,6 +495,8 @@ async def update(
Args:
id: Either external ID or the ID assigned by moderation API.

company: The author's company or organization

email: Author email address

external_link: URL of the author's external profile
Expand Down Expand Up @@ -511,6 +526,7 @@ async def update(
path_template("/authors/{id}", id=id),
body=await async_maybe_transform(
{
"company": company,
"email": email,
"external_link": external_link,
"first_seen": first_seen,
Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class AuthorCreateParams(TypedDict, total=False):
external_id: Required[str]
"""External ID of the user, typically the ID of the author in your database."""

company: Optional[str]
"""The author's company or organization"""

email: Optional[str]
"""Author email address"""

Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class AuthorCreateResponse(BaseModel):

trust_level: TrustLevel

company: Optional[str] = None
"""The author's company or organization"""

email: Optional[str] = None
"""Author email address"""

Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ class Author(BaseModel):

trust_level: AuthorTrustLevel

company: Optional[str] = None
"""The author's company or organization"""

email: Optional[str] = None
"""Author email address"""

Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class AuthorRetrieveResponse(BaseModel):

trust_level: TrustLevel

company: Optional[str] = None
"""The author's company or organization"""

email: Optional[str] = None
"""Author email address"""

Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@


class AuthorUpdateParams(TypedDict, total=False):
company: Optional[str]
"""The author's company or organization"""

email: Optional[str]
"""Author email address"""

Expand Down
3 changes: 3 additions & 0 deletions src/moderation_api/types/author_update_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class AuthorUpdateResponse(BaseModel):

trust_level: TrustLevel

company: Optional[str] = None
"""The author's company or organization"""

email: Optional[str] = None
"""Author email address"""

Expand Down
6 changes: 6 additions & 0 deletions src/moderation_api/types/content_submit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ class PolicyURLRisk(TypedDict, total=False):
precedence over allowlists.
"""

flag_link_shorteners: Annotated[bool, PropertyInfo(alias="flagLinkShorteners")]
"""
When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl,
etc.) is always flagged regardless of risk score. Allowlist matches still win.
"""

threshold: float


Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/test_authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_method_create(self, client: ModerationAPI) -> None:
def test_method_create_with_all_params(self, client: ModerationAPI) -> None:
author = client.authors.create(
external_id="external_id",
company="company",
email="dev@stainless.com",
external_link="https://example.com",
first_seen=0,
Expand Down Expand Up @@ -133,6 +134,7 @@ def test_method_update(self, client: ModerationAPI) -> None:
def test_method_update_with_all_params(self, client: ModerationAPI) -> None:
author = client.authors.update(
id="id",
company="company",
email="dev@stainless.com",
external_link="https://example.com",
first_seen=0,
Expand Down Expand Up @@ -286,6 +288,7 @@ async def test_method_create(self, async_client: AsyncModerationAPI) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncModerationAPI) -> None:
author = await async_client.authors.create(
external_id="external_id",
company="company",
email="dev@stainless.com",
external_link="https://example.com",
first_seen=0,
Expand Down Expand Up @@ -383,6 +386,7 @@ async def test_method_update(self, async_client: AsyncModerationAPI) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncModerationAPI) -> None:
author = await async_client.authors.update(
id="id",
company="company",
email="dev@stainless.com",
external_link="https://example.com",
first_seen=0,
Expand Down
Loading