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 @@
{
".": "4.2.0"
".": "4.3.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/moderation-api-cbf656f40e43acf60d9596f78204f031dc8c7205626df8f05ce8e88bcf49b597.yml
openapi_spec_hash: 23be5a56248a1a575b34833eb7e7fe49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-9c5291067ec36cba0c9ef772c5c8eb10238fb332f1f25d0e31f3f2ad87c24e5e.yml
openapi_spec_hash: 790cc0a36d6ed693c06a285c441ab977
config_hash: 9d144cc6c49d3fd53e5b4472c1e22165
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.3.0 (2026-06-02)

Full Changelog: [v4.2.0...v4.3.0](https://github.com/moderation-api/sdk-typescript/compare/v4.2.0...v4.3.0)

### Features

* **api:** api update ([8c2f693](https://github.com/moderation-api/sdk-typescript/commit/8c2f6939e9db7f566f4dbf9b39b7050750750a15))

## 4.2.0 (2026-06-01)

Full Changelog: [v4.1.1...v4.2.0](https://github.com/moderation-api/sdk-typescript/compare/v4.1.1...v4.2.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moderation-api/sdk",
"version": "4.2.0",
"version": "4.3.0",
"description": "The official TypeScript library for the Moderation API API",
"author": "Moderation API <support@moderationapi.com>",
"types": "dist/index.d.ts",
Expand Down
36 changes: 36 additions & 0 deletions src/resources/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ export namespace ContentSubmitResponse {
| 'rule_match'
| 'rule_default'
| 'rule_fallback'
| 'client_override'
>;

/**
Expand Down Expand Up @@ -460,6 +461,13 @@ export interface ContentSubmitParams {
*/
channel?: string;

/**
* A recommendation from your own client-side flagging (e.g. a banned-IP list or a
* third-party tool). Feeds the rules engine and can escalate or override the
* recommended action. Does not change whether our analysis flagged the content.
*/
clientAction?: ContentSubmitParams.ClientAction;

/**
* The unique ID of the content in your database.
*/
Expand Down Expand Up @@ -650,6 +658,34 @@ export namespace ContentSubmitParams {
}
}

/**
* A recommendation from your own client-side flagging (e.g. a banned-IP list or a
* third-party tool). Feeds the rules engine and can escalate or override the
* recommended action. Does not change whether our analysis flagged the content.
*/
export interface ClientAction {
/**
* Your recommendation for the content: allow, review, or reject.
*/
action: 'review' | 'allow' | 'reject';

/**
* How your recommendation combines with ours. Defaults to 'escalate', which only
* applies it when stricter than ours; 'override' replaces ours outright.
*/
behavior?: 'override' | 'escalate';

/**
* A human-readable explanation for your recommendation.
*/
reason?: string;

/**
* Where your recommendation came from, e.g. "banned-ip".
*/
source?: string;
}

export interface Toxicity {
id: 'toxicity';

Expand Down
124 changes: 124 additions & 0 deletions src/resources/queue/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,11 @@ export namespace WebhookEvent {
*/
channel_key: string | null;

/**
* A recommendation from your own client-side flagging.
*/
client_action: Item.ClientAction | null;

/**
* The original content payload
*/
Expand Down Expand Up @@ -1503,6 +1508,32 @@ export namespace WebhookEvent {
}

export namespace Item {
/**
* A recommendation from your own client-side flagging.
*/
export interface ClientAction {
/**
* Your recommendation for the content: allow, review, or reject.
*/
action: 'review' | 'allow' | 'reject';

/**
* How your recommendation combines with ours. Defaults to 'escalate', which only
* applies it when stricter than ours; 'override' replaces ours outright.
*/
behavior?: 'override' | 'escalate';

/**
* A human-readable explanation for your recommendation.
*/
reason?: string;

/**
* Where your recommendation came from, e.g. "banned-ip".
*/
source?: string;
}

/**
* Text
*/
Expand Down Expand Up @@ -2131,6 +2162,11 @@ export namespace WebhookEvent {
*/
channel_key: string | null;

/**
* A recommendation from your own client-side flagging.
*/
client_action: Item.ClientAction | null;

/**
* The original content payload
*/
Expand Down Expand Up @@ -2184,6 +2220,32 @@ export namespace WebhookEvent {
}

export namespace Item {
/**
* A recommendation from your own client-side flagging.
*/
export interface ClientAction {
/**
* Your recommendation for the content: allow, review, or reject.
*/
action: 'review' | 'allow' | 'reject';

/**
* How your recommendation combines with ours. Defaults to 'escalate', which only
* applies it when stricter than ours; 'override' replaces ours outright.
*/
behavior?: 'override' | 'escalate';

/**
* A human-readable explanation for your recommendation.
*/
reason?: string;

/**
* Where your recommendation came from, e.g. "banned-ip".
*/
source?: string;
}

/**
* Text
*/
Expand Down Expand Up @@ -2653,6 +2715,11 @@ export namespace WebhookEvent {
*/
channel_key: string | null;

/**
* A recommendation from your own client-side flagging.
*/
client_action: Item.ClientAction | null;

/**
* The original content payload
*/
Expand Down Expand Up @@ -2706,6 +2773,32 @@ export namespace WebhookEvent {
}

export namespace Item {
/**
* A recommendation from your own client-side flagging.
*/
export interface ClientAction {
/**
* Your recommendation for the content: allow, review, or reject.
*/
action: 'review' | 'allow' | 'reject';

/**
* How your recommendation combines with ours. Defaults to 'escalate', which only
* applies it when stricter than ours; 'override' replaces ours outright.
*/
behavior?: 'override' | 'escalate';

/**
* A human-readable explanation for your recommendation.
*/
reason?: string;

/**
* Where your recommendation came from, e.g. "banned-ip".
*/
source?: string;
}

/**
* Text
*/
Expand Down Expand Up @@ -3175,6 +3268,11 @@ export namespace WebhookEvent {
*/
channel_key: string | null;

/**
* A recommendation from your own client-side flagging.
*/
client_action: Item.ClientAction | null;

/**
* The original content payload
*/
Expand Down Expand Up @@ -3228,6 +3326,32 @@ export namespace WebhookEvent {
}

export namespace Item {
/**
* A recommendation from your own client-side flagging.
*/
export interface ClientAction {
/**
* Your recommendation for the content: allow, review, or reject.
*/
action: 'review' | 'allow' | 'reject';

/**
* How your recommendation combines with ours. Defaults to 'escalate', which only
* applies it when stricter than ours; 'override' replaces ours outright.
*/
behavior?: 'override' | 'escalate';

/**
* A human-readable explanation for your recommendation.
*/
reason?: string;

/**
* Where your recommendation came from, e.g. "banned-ip".
*/
source?: string;
}

/**
* Text
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.2.0'; // x-release-please-version
export const VERSION = '4.3.0'; // x-release-please-version
6 changes: 6 additions & 0 deletions tests/api-resources/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ describe('resource content', () => {
content: { text: 'text', type: 'text' },
authorId: 'authorId',
channel: 'channel',
clientAction: {
action: 'review',
behavior: 'override',
reason: 'reason',
source: 'source',
},
contentId: 'contentId',
conversationId: 'conversationId',
doNotStore: true,
Expand Down
Loading