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
218 changes: 126 additions & 92 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: false
python:
version: 2.1.1
version: 2.2.0
additionalDependencies:
dev: {}
main: {}
Expand Down
232 changes: 192 additions & 40 deletions .speakeasy/openapi.json

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Changelog

## 2.2.0 (2026-10-23)

Full Changelog: [v2.1.1...v2.2.0](https://github.com/moderation-api/sdk-python/compare/v2.1.1...v2.2.0)

### API changes

- `GET /actions`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /actions`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /actions/execute`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /actions/{actionId}/execute`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `DELETE /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /auth`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /auth`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /authors`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /authors`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `DELETE /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `DELETE /channels/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /channels/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /channels/{id}/duplicate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /moderate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /moderate/image`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /moderate/text`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /projects`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /projects/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /projects/{id}/duplicate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /projects/{projectId}/channels`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /queue/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /queue/{id}/items`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /queue/{id}/items/{itemId}/resolve`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /queue/{id}/items/{itemId}/unresolve`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /queue/{id}/stats`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /webhooks`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /webhooks/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /wordlist`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /wordlist/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `PUT /wordlist/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `GET /wordlist/{id}/embedding-status`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `DELETE /wordlist/{id}/words`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- `POST /wordlist/{id}/words`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400`
- a breaking change was detected but the version is still `1.1.0`
- `POST /projects/{id}/api-keys`: endpoint added

## 2.1.1 (2026-10-22)

Full Changelog: [v2.1.0...v2.1.1](https://github.com/moderation-api/sdk-python/compare/v2.1.0...v2.1.1)
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ with ModerationAPI(
Moderation API has two kinds of API keys:

- A **project key** works with one project: content, authors, review queues, actions, wordlists, webhooks and the account. Most integrations need only this key.
- An **organization key** works with the [management API](https://docs.moderationapi.com/api-reference/management-api): projects and channels. The management API is available on Enterprise plans.
- An **organization key** works with the [management API](https://docs.moderationapi.com/api-reference/management-api): projects and channels. It can also use any project's endpoints: name the project with `projectId`.

Each key works only with its own endpoints. With the wrong key the API returns `403` with the code `project_key_required` or `organization_key_required`. If you use both, create one client for each key:
A project key can't call the management API: the API returns `403` with the code `organization_key_required`. If you use both kinds of key, create one client for each:

```python
import os
Expand Down Expand Up @@ -383,6 +383,10 @@ Create the organization client only where you manage projects and channels, for
* [delete](docs/sdks/projects/README.md#delete) - Delete a project
* [duplicate](docs/sdks/projects/README.md#duplicate) - Duplicate a project

#### [Projects.ApiKeys](docs/sdks/apikeys/README.md)

* [create](docs/sdks/apikeys/README.md#create) - Create a project API key

### [Queue](docs/sdks/queuesdk/README.md)

* [retrieve](docs/sdks/queuesdk/README.md#retrieve) - Get a queue
Expand Down Expand Up @@ -565,11 +569,11 @@ with ModerationAPI(


**Inherit from [`ModerationAPIError`](./src/moderation_api/errors/moderationapierror.py)**:
* [`BadRequestError`](./src/moderation_api/errors/badrequesterror.py): The request is malformed or a parameter is invalid. Status code `400`. Applicable to 32 of 42 methods.*
* [`NotFoundError`](./src/moderation_api/errors/notfounderror.py): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 31 of 42 methods.*
* [`PermissionDeniedError`](./src/moderation_api/errors/permissiondeniederror.py): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 27 of 42 methods.*
* [`InternalServerError`](./src/moderation_api/errors/internalservererror.py): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 15 of 42 methods.*
* [`ConflictError`](./src/moderation_api/errors/conflicterror.py): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 42 methods.*
* [`BadRequestError`](./src/moderation_api/errors/badrequesterror.py): The request is malformed or a parameter is invalid. Status code `400`. Applicable to 33 of 43 methods.*
* [`NotFoundError`](./src/moderation_api/errors/notfounderror.py): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 32 of 43 methods.*
* [`PermissionDeniedError`](./src/moderation_api/errors/permissiondeniederror.py): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 28 of 43 methods.*
* [`InternalServerError`](./src/moderation_api/errors/internalservererror.py): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 15 of 43 methods.*
* [`ConflictError`](./src/moderation_api/errors/conflicterror.py): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 43 methods.*
* [`ResponseValidationError`](./src/moderation_api/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.

</details>
Expand Down
Loading
Loading