From b3acd179dff48dbdcddd9f9e44a77909b48f2afd Mon Sep 17 00:00:00 2001 From: chrisdengso <8185683+chrisdengso@users.noreply.github.com> Date: Thu, 22 Oct 2026 12:48:22 +0000 Subject: [PATCH] feat: v2.1.0, API changes --- .github/workflows/publish-pypi.yml | 13 +- .speakeasy/gen.lock | 198 +- .speakeasy/gen.yaml | 2 +- .speakeasy/openapi.json | 14224 ++++++++++++++++ CHANGELOG.md | 42 + README.md | 2 +- docs/errors/badrequesterror.md | 16 +- docs/errors/permissiondeniederror.md | 16 +- docs/models/addwordlistwordsrequest.md | 9 +- docs/models/badrequesterrorcode.md | 2 + docs/models/createactionrequest.md | 17 +- docs/models/createactionrequestbody.md | 18 + docs/models/createauthorrequest.md | 16 +- docs/models/createauthorrequestbody.md | 17 + docs/models/createwebhookrequest.md | 10 +- docs/models/createwebhookrequestbody.md | 11 + docs/models/deleteactionrequest.md | 7 +- docs/models/deleteauthorrequest.md | 7 +- docs/models/deletewebhookrequest.md | 7 +- docs/models/executeactionrequest.md | 14 +- docs/models/executeactionrequestbody.md | 15 + docs/models/getaccountrequest.md | 8 + docs/models/getactionrequest.md | 7 +- docs/models/getauthorrequest.md | 7 +- docs/models/getqueuerequest.md | 7 +- docs/models/getqueuestatsrequest.md | 9 +- docs/models/getwebhookrequest.md | 7 +- docs/models/getwebhooksecretrequest.md | 8 + .../getwordlistembeddingstatusrequest.md | 7 +- docs/models/getwordlistrequest.md | 7 +- docs/models/listactionsrequest.md | 11 +- docs/models/listauthorsrequest.md | 19 +- docs/models/listqueueitemsrequest.md | 29 +- docs/models/listwebhooksrequest.md | 9 +- docs/models/listwordlistsrequest.md | 9 +- docs/models/permissiondeniederrorcode.md | 2 - docs/models/removewordlistwordsrequest.md | 9 +- docs/models/resolvequeueitemrequest.md | 11 +- docs/models/submitcontentrequest.md | 17 +- docs/models/submitcontentrequestbody.md | 18 + docs/models/unresolvequeueitemrequest.md | 11 +- docs/models/updateactionrequest.md | 9 +- docs/models/updateauthorrequest.md | 9 +- docs/models/updatewebhookrequest.md | 9 +- docs/models/updatewordlistrequest.md | 9 +- docs/sdks/account/README.md | 7 +- docs/sdks/actions/README.md | 110 +- docs/sdks/authors/README.md | 72 +- docs/sdks/contentsdk/README.md | 5 +- docs/sdks/items/README.md | 57 +- docs/sdks/queuesdk/README.md | 20 +- docs/sdks/webhooks/README.md | 61 +- docs/sdks/webhooksecret/README.md | 7 +- docs/sdks/wordlist/README.md | 48 +- docs/sdks/words/README.md | 22 +- pyproject.toml | 2 +- src/moderation_api/_version.py | 4 +- src/moderation_api/account.py | 18 +- src/moderation_api/actions.py | 136 +- src/moderation_api/authors.py | 78 +- src/moderation_api/content_sdk.py | 76 +- src/moderation_api/errors/badrequesterror.py | 1 + .../errors/permissiondeniederror.py | 1 - src/moderation_api/items.py | 20 + src/moderation_api/models/__init__.py | 42 + .../models/addwordlistwordsop.py | 39 +- src/moderation_api/models/badrequesterror.py | 2 + src/moderation_api/models/createactionop.py | 43 +- src/moderation_api/models/createauthorop.py | 43 +- src/moderation_api/models/createwebhookop.py | 45 +- src/moderation_api/models/deleteactionop.py | 34 +- src/moderation_api/models/deleteauthorop.py | 34 +- src/moderation_api/models/deletewebhookop.py | 34 +- src/moderation_api/models/executeactionop.py | 43 +- src/moderation_api/models/getaccountop.py | 34 +- src/moderation_api/models/getactionop.py | 27 +- src/moderation_api/models/getauthorop.py | 34 +- src/moderation_api/models/getqueueop.py | 27 +- src/moderation_api/models/getqueuestatsop.py | 18 +- src/moderation_api/models/getwebhookop.py | 29 +- .../models/getwebhooksecretop.py | 38 +- .../models/getwordlistembeddingstatusop.py | 33 +- src/moderation_api/models/getwordlistop.py | 31 +- src/moderation_api/models/listactionsop.py | 13 +- src/moderation_api/models/listauthorsop.py | 12 +- src/moderation_api/models/listqueueitemsop.py | 17 +- src/moderation_api/models/listwebhooksop.py | 13 +- src/moderation_api/models/listwordlistsop.py | 13 +- .../models/permissiondeniederror.py | 2 - .../models/removewordlistwordsop.py | 39 +- .../models/resolvequeueitemop.py | 32 +- src/moderation_api/models/submitcontentop.py | 49 +- .../models/unresolvequeueitemop.py | 32 +- src/moderation_api/models/updateactionop.py | 32 +- src/moderation_api/models/updateauthorop.py | 32 +- src/moderation_api/models/updatewebhookop.py | 32 +- src/moderation_api/models/updatewordlistop.py | 32 +- src/moderation_api/queue_sdk.py | 12 + src/moderation_api/webhooks.py | 60 +- src/moderation_api/webhooksecret.py | 18 +- src/moderation_api/wordlist.py | 26 + src/moderation_api/words.py | 12 + 102 files changed, 16116 insertions(+), 648 deletions(-) create mode 100644 .speakeasy/openapi.json create mode 100644 docs/models/createactionrequestbody.md create mode 100644 docs/models/createauthorrequestbody.md create mode 100644 docs/models/createwebhookrequestbody.md create mode 100644 docs/models/executeactionrequestbody.md create mode 100644 docs/models/getaccountrequest.md create mode 100644 docs/models/getwebhooksecretrequest.md create mode 100644 docs/models/submitcontentrequestbody.md diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 56781b4..c4f9613 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,7 +1,6 @@ # Maintained in moderation-api/sdk-generator (custom/python). Edits here are overwritten. # Every push to main whose package version has no release tag yet publishes -# that version and creates the GitHub release (notes: .github/release-notes/vX.Y.Z.md -# if present, otherwise generated from the merged pull requests). +# that version and creates the GitHub release (notes: the CHANGELOG.md entry). name: Publish PyPI on: push: @@ -43,8 +42,14 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - notes=".github/release-notes/v${VERSION}.md" - if [ -f "$notes" ]; then + # Notes: the CHANGELOG.md entry of this version, then the release notes file, + # then the merged pull requests. + notes="$RUNNER_TEMP/notes.md" + awk -v v="$VERSION" 'index($0, "## " v " (") == 1 {f = 1; next} f && /^## / {exit} f' CHANGELOG.md > "$notes" || true + if [ ! -s "$notes" ] && [ -f ".github/release-notes/v${VERSION}.md" ]; then + cp ".github/release-notes/v${VERSION}.md" "$notes" + fi + if [ -s "$notes" ]; then gh release create "v${VERSION}" --target "$GITHUB_SHA" --title "v${VERSION}" --notes-file "$notes" else gh release create "v${VERSION}" --target "$GITHUB_SHA" --title "v${VERSION}" --generate-notes diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b59cc30..140cde9 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 9620bfba-8df9-4d0e-8796-8423b39f97f0 management: - docChecksum: 9e61a5512adcd4b1e0a74112ed775731 + docChecksum: c27787b45fc5b72aafff31ba945a9e61 docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 2.0.0 - configChecksum: eeab91f42de23d385040d77b9e9d21de + releaseVersion: 2.1.0 + configChecksum: dcbb9473f52855a62b1077cc63216b8d repoURL: https://github.com/moderation-api/sdk-python installationURL: https://github.com/moderation-api/sdk-python.git published: true @@ -47,7 +47,7 @@ trackedFiles: docs/errors/authenticationerror.md: last_write_checksum: sha1:cdb9eaf19220813ba7f8e63c39807eec5fb8f95f docs/errors/badrequesterror.md: - last_write_checksum: sha1:5c91688d22f321d3dcec650091bdcd61b01f34a4 + last_write_checksum: sha1:16a33340e3ef30ac7277ff3083ebd9867fd9ce7b docs/errors/conflicterror.md: last_write_checksum: sha1:f5e67eedc35f8a93c2ba9675a5bdf7ebd696e446 docs/errors/internalservererror.md: @@ -55,7 +55,7 @@ trackedFiles: docs/errors/notfounderror.md: last_write_checksum: sha1:f1b0b0c97c7796ee821c6312960fac56404600c4 docs/errors/permissiondeniederror.md: - last_write_checksum: sha1:5cbd352b22ff1b417d3529604fc6325e746a6df3 + last_write_checksum: sha1:20c2dec2f1672933d2f017f61faeff3bbf26e593 docs/errors/ratelimiterror.md: last_write_checksum: sha1:c3525f444f391db06263cef2cfe877ea8f015469 docs/models/actionrequest.md: @@ -63,7 +63,7 @@ trackedFiles: docs/models/actionstat.md: last_write_checksum: sha1:dd4e71ad441cb258bb22a3823e1b334637635546 docs/models/addwordlistwordsrequest.md: - last_write_checksum: sha1:67ecf74f25a496e8d3000e4903cc0de557d8ae18 + last_write_checksum: sha1:151b2ddef58b9281db21c8ef97c77531bcc239fb docs/models/addwordlistwordsrequestbody.md: last_write_checksum: sha1:2c2d0ee0bddfafe1779220ee07aee53179e3b6fe docs/models/addwordlistwordsresponse.md: @@ -83,7 +83,7 @@ trackedFiles: docs/models/authorstatus.md: last_write_checksum: sha1:7d7a67666c6ec82daa47ba9726c4d92792314ce1 docs/models/badrequesterrorcode.md: - last_write_checksum: sha1:db01c352f4c47ed2fb309d384daada84fa288601 + last_write_checksum: sha1:2da41def3827487b66d4ce2008312eedf98df9fc docs/models/block.md: last_write_checksum: sha1:a59f8f13228667d39879853ad05332c707c0afc8 docs/models/cannabis.md: @@ -133,7 +133,9 @@ trackedFiles: docs/models/createactionqueuebehaviourresponse.md: last_write_checksum: sha1:661904e9ebeff0db3f2fbb3db788c585ec3abb52 docs/models/createactionrequest.md: - last_write_checksum: sha1:aa2351b0ac02f2fb01dc9c49876286321a6cdf46 + last_write_checksum: sha1:26e01e3c84f4835a9d20cb4587cc491fbf2c189a + docs/models/createactionrequestbody.md: + last_write_checksum: sha1:7379ce37b676bbd8cb605846560593ef698eecf4 docs/models/createactionresponse.md: last_write_checksum: sha1:f72815df42b9c6296431df92f36615b4af72e131 docs/models/createactiontyperequest.md: @@ -143,7 +145,9 @@ trackedFiles: docs/models/createauthormetadata.md: last_write_checksum: sha1:ed6f2bb159071080f1ddde183b7e09a0033a693b docs/models/createauthorrequest.md: - last_write_checksum: sha1:3940374edcfb8174b20a0345fd5ac382ac96636f + last_write_checksum: sha1:cb9b5e36c24363526d703384ffbffb539a6c2cff + docs/models/createauthorrequestbody.md: + last_write_checksum: sha1:4accf2383553031d511b646f7e6c265d24c28a3d docs/models/createchannelcontenttype.md: last_write_checksum: sha1:b3757eb17490479fcec9b45bfaa758ccc75ffe02 docs/models/createchannelrequest.md: @@ -159,7 +163,9 @@ trackedFiles: docs/models/createwebhookpayloadversion.md: last_write_checksum: sha1:fc2b9c87fa4930fea544ebf72a0491d9ee5c2c77 docs/models/createwebhookrequest.md: - last_write_checksum: sha1:f39353f0fa80861118ecc5451344392aa9a037b6 + last_write_checksum: sha1:c81d03ae02e67bf4c844d2acf73daa8da3ca4ed8 + docs/models/createwebhookrequestbody.md: + last_write_checksum: sha1:0ada491dab35eb0baccb75dafa0628f034ad55e0 docs/models/createwebhookresponse.md: last_write_checksum: sha1:d3e4e95d3258e1a3e2c6f9b647eb035089a64022 docs/models/crypto.md: @@ -179,11 +185,11 @@ trackedFiles: docs/models/datavideorequest.md: last_write_checksum: sha1:948cd457b3bc2ed3c352ae6d4331807883a349f9 docs/models/deleteactionrequest.md: - last_write_checksum: sha1:10e359260d656c7788c04628c785c80f206d924a + last_write_checksum: sha1:fbad846593f5c5cdbfecbbec1b6ea4a49de69a54 docs/models/deleteactionresponse.md: last_write_checksum: sha1:d8128ce2a339c801bfa0c91ed1b1243cc974a3d1 docs/models/deleteauthorrequest.md: - last_write_checksum: sha1:93036cc1490c705a88d040faf0f7794b94f4b9be + last_write_checksum: sha1:a5728a965732ade72520ddab82c56050e20c5356 docs/models/deleteauthorresponse.md: last_write_checksum: sha1:470ec6b2dd0f1e3fa81c9b67bdf00524270de610 docs/models/deletechannelrequest.md: @@ -195,7 +201,7 @@ trackedFiles: docs/models/deleteprojectresponse.md: last_write_checksum: sha1:57597dca05a2fcd6f6b1ef129f7cd834cc5316ba docs/models/deletewebhookrequest.md: - last_write_checksum: sha1:1c8d21f01f7423bb195f37fb7fae5c01c6a4b4be + last_write_checksum: sha1:9dbb85c90303baca11b0c01ae365ab3931d0778b docs/models/deletewebhookresponse.md: last_write_checksum: sha1:9c274b660824d02e9fc18bab98ef18fd9027add1 docs/models/drugs.md: @@ -221,7 +227,9 @@ trackedFiles: docs/models/evaluation.md: last_write_checksum: sha1:dc81ec6315567fca488efc6da9a16b4ca6899925 docs/models/executeactionrequest.md: - last_write_checksum: sha1:4c6c1eb3e55d5125fc51d27c093cf522f672a6b3 + last_write_checksum: sha1:5d7370245564436d96d25779cdadaa17c1b8d83b + docs/models/executeactionrequestbody.md: + last_write_checksum: sha1:0d3920ab521ccbdb6a396510bcc6e626ffd634b7 docs/models/executeactionresponse.md: last_write_checksum: sha1:0295450e86664ce938a9b7bb2050e1e06b768543 docs/models/extremism.md: @@ -238,6 +246,8 @@ trackedFiles: last_write_checksum: sha1:2b62179f3ffb684c32dbd22701c564701c6f608e docs/models/gambling.md: last_write_checksum: sha1:343bbfe2f0a7f12e50f78e0c6da7eda073de026d + docs/models/getaccountrequest.md: + last_write_checksum: sha1:67a196a0b7940e0262cca727ab5dc8c1de909271 docs/models/getaccountresponse.md: last_write_checksum: sha1:7f88c1b881320e8cf86763cd05088e75e549a22e docs/models/getactionposition.md: @@ -247,13 +257,13 @@ trackedFiles: docs/models/getactionqueuebehaviour.md: last_write_checksum: sha1:3f1e1988781d3f52fec875063ee677bfba485db2 docs/models/getactionrequest.md: - last_write_checksum: sha1:debf92a4e624cd34b5c0be89e484f58b6ee249a6 + last_write_checksum: sha1:faf3a88059f30078a2fbb0f106d8f2a91905d9c6 docs/models/getactionresponse.md: last_write_checksum: sha1:bad30829267fbc4ba772be0f905f4a6537ec164f docs/models/getactiontype.md: last_write_checksum: sha1:2c93577a65ac4a4e32889986e486b5efd0848646 docs/models/getauthorrequest.md: - last_write_checksum: sha1:50606459859f66e5aad6dae61df11b93237c17ea + last_write_checksum: sha1:1f95a36d459b88f81511f18433ac1b58778955c6 docs/models/getchannelrequest.md: last_write_checksum: sha1:6f995844a8ce5166bcb1994a0d2ebe2458e98fa9 docs/models/getprojectrequest.md: @@ -265,11 +275,11 @@ trackedFiles: docs/models/getqueuerecommendationaction.md: last_write_checksum: sha1:bc6702b02de201c183034d644f701aa1afbd6901 docs/models/getqueuerequest.md: - last_write_checksum: sha1:1e58ca4255b8dfce11679ebdc0f425964c098161 + last_write_checksum: sha1:1eda4e3dfdc20027253291f438aa1841d005e6b8 docs/models/getqueueresponse.md: last_write_checksum: sha1:92fbe19cabcc7751157bd1043491e26bed955085 docs/models/getqueuestatsrequest.md: - last_write_checksum: sha1:7973e8c487c678f623912fb1da347b9aa716dbc1 + last_write_checksum: sha1:98538d9432b43fbabefd4a278f7ad7bd8432f194 docs/models/getqueuestatsresponse.md: last_write_checksum: sha1:fcbe4d64e0d11aa962ba42bdad4fb15c09a08d48 docs/models/getqueuetype.md: @@ -279,17 +289,19 @@ trackedFiles: docs/models/getwebhookpayloadversion.md: last_write_checksum: sha1:60b692ba995e47aa4a6207788a11c118717b48b9 docs/models/getwebhookrequest.md: - last_write_checksum: sha1:b0aec79d7152020859f0bf4d4fada8b5740d8704 + last_write_checksum: sha1:e93633db06a13556c00c384f27805b2d5421ceca docs/models/getwebhookresponse.md: last_write_checksum: sha1:aab2bc255c774bcb7e7c7f21fb349be95f021e98 + docs/models/getwebhooksecretrequest.md: + last_write_checksum: sha1:ada90bc34a17c3529199b7f8b0b15c1120f8ed35 docs/models/getwebhooksecretresponse.md: last_write_checksum: sha1:2b522faf79d9aeb7a83d515b6f9a9caf7e5c3e7e docs/models/getwordlistembeddingstatusrequest.md: - last_write_checksum: sha1:fab592cd4a7264d7f4e193e2e58a46d63c128ec7 + last_write_checksum: sha1:07638073c137b10148987b07c7d7866ad70e3706 docs/models/getwordlistembeddingstatusresponse.md: last_write_checksum: sha1:8a14bd9f775b10af8cc179aa5e7a072775c4e956 docs/models/getwordlistrequest.md: - last_write_checksum: sha1:e7b3e87e9c12fc9dd9f49d0f4d6a73a6470ef6ee + last_write_checksum: sha1:684c0944558456fe2f2a2d13c4099d646c0f99fc docs/models/getwordlistresponse.md: last_write_checksum: sha1:47a1730eb606700aba8d367e0f3613f741c9a31b docs/models/guideline.md: @@ -331,7 +343,7 @@ trackedFiles: docs/models/listactionsqueuebehaviour.md: last_write_checksum: sha1:64482ff4675f11131fce0dc1279544a67a94ee3a docs/models/listactionsrequest.md: - last_write_checksum: sha1:617592e0bcae925a030a2b267fa04c66173dc6e8 + last_write_checksum: sha1:c458b34df82f4783d638c5c47e7e2a79d0a726db docs/models/listactionsresponse.md: last_write_checksum: sha1:58f2ed5f656ee6cf7cd83b0565dc21d1a23ac034 docs/models/listactionsresponsebody.md: @@ -339,7 +351,7 @@ trackedFiles: docs/models/listactionstype.md: last_write_checksum: sha1:0acfca31cf44c1d30a705feb78bafa018407152c docs/models/listauthorsrequest.md: - last_write_checksum: sha1:9e56c7bd72b8886a4700f6404428f480166b2445 + last_write_checksum: sha1:3763ad95bb74fdd85c3c5fbd617d01fc053368e3 docs/models/listauthorsresponse.md: last_write_checksum: sha1:54190f4a9d6e175bcb07946f024079d9d75f73a1 docs/models/listauthorsresponsebody.md: @@ -365,7 +377,7 @@ trackedFiles: docs/models/listqueueitemslabel.md: last_write_checksum: sha1:0c4fcb2565877c1ba680c14f5931e031bb8d01e3 docs/models/listqueueitemsrequest.md: - last_write_checksum: sha1:906c170681dae9725ee465ef305ac37cde2fbdfa + last_write_checksum: sha1:356a48e77490eb1e9514e5d040ea6a5893d73005 docs/models/listqueueitemsresponse.md: last_write_checksum: sha1:e64d55d94911de55deceb1229745943edbd32f81 docs/models/listqueueitemsresponsebody.md: @@ -381,7 +393,7 @@ trackedFiles: docs/models/listwebhookspayloadversion.md: last_write_checksum: sha1:1e5703533be94f7611a849073310f8472c877b45 docs/models/listwebhooksrequest.md: - last_write_checksum: sha1:bb9bea952aa562a98b6c2e9a6dd4dea37e087714 + last_write_checksum: sha1:02d4e1a8fcc9707517094ef9f61a3d0f8b1c0d4e docs/models/listwebhooksresponse.md: last_write_checksum: sha1:0d455d264c8f505d8ece9be38a7eabf0296241cc docs/models/listwebhooksresponsebody.md: @@ -389,7 +401,7 @@ trackedFiles: docs/models/listwordlistsdata.md: last_write_checksum: sha1:c494cff76fdb516204f6e9e8e3b7c31648d36f12 docs/models/listwordlistsrequest.md: - last_write_checksum: sha1:c958bfb208d5b19743b33f13154de1ece52782f1 + last_write_checksum: sha1:96c18cb532e49cb86d0fea0feab40368f266c854 docs/models/listwordlistsresponse.md: last_write_checksum: sha1:42695dbad3b56ec850f5f607f68932de9ceaffac docs/models/listwordlistsresponsebody.md: @@ -421,7 +433,7 @@ trackedFiles: docs/models/path.md: last_write_checksum: sha1:08671134358fba8ec3f55d1cfdc6b79bfbe5a58f docs/models/permissiondeniederrorcode.md: - last_write_checksum: sha1:edbc722271cfa0fabce1468ca964302b35f0de7d + last_write_checksum: sha1:840b5074f3b1a9f68c0328f0d5b1c1ab9d8ba8b5 docs/models/personalinformation.md: last_write_checksum: sha1:89bb52124c85a33aeb6f76541153c7cad633bfb9 docs/models/personalstoryinsight.md: @@ -459,11 +471,11 @@ trackedFiles: docs/models/religion.md: last_write_checksum: sha1:5759f26a6aa19140b1595347d3284cfd22fa7a27 docs/models/removewordlistwordsrequest.md: - last_write_checksum: sha1:d988db8bd18157da2ffdeadf3026a65b4900f0fa + last_write_checksum: sha1:ae339bbf9b8b3c3f9c72477f9106500bfb5b8400 docs/models/removewordlistwordsresponse.md: last_write_checksum: sha1:5efef48f1d38df8e532615c71c4f05de2b0e28f8 docs/models/resolvequeueitemrequest.md: - last_write_checksum: sha1:3594c3dc472ebd170c6af8b99e52bf2c8dd99418 + last_write_checksum: sha1:ac952995d1bdd7d90a43194bea9efb28e613b36f docs/models/resolvequeueitemrequestbody.md: last_write_checksum: sha1:d9aa0601044346030a10359a0e1c42108aa116c7 docs/models/resolvequeueitemresponse.md: @@ -521,7 +533,9 @@ trackedFiles: docs/models/submitcontentrecommendationaction.md: last_write_checksum: sha1:06144cc93759541217b52422e5824aea219a3b79 docs/models/submitcontentrequest.md: - last_write_checksum: sha1:1ce333377608cd5dd272f90b4c88f2898fef28da + last_write_checksum: sha1:aba3be182385a7d35fbfc8f914adb951169f096a + docs/models/submitcontentrequestbody.md: + last_write_checksum: sha1:4efef96df742c08c58a789ac10466bde0078deb2 docs/models/submitcontentresponse.md: last_write_checksum: sha1:5ee6a1d316786c81e73bef8dfbd3dc83ef0bd4e2 docs/models/submitcontenttrustlevel.md: @@ -551,7 +565,7 @@ trackedFiles: docs/models/unicodespoofing.md: last_write_checksum: sha1:f226ab0193558bada5d79ae06526d468409f932e docs/models/unresolvequeueitemrequest.md: - last_write_checksum: sha1:3613c863d0130e2c32107ca84a294e1fcd4c4b1e + last_write_checksum: sha1:ffc8cff20a7c6e938c7336bfaaa3e160223e5135 docs/models/unresolvequeueitemrequestbody.md: last_write_checksum: sha1:c15925f824a99518690275583046a1a12bd8ac6f docs/models/unresolvequeueitemresponse.md: @@ -569,7 +583,7 @@ trackedFiles: docs/models/updateactionqueuebehaviourresponse.md: last_write_checksum: sha1:205931c65c91088e37bb6149a19dda68e5707747 docs/models/updateactionrequest.md: - last_write_checksum: sha1:4d5f7d7b5a44d7836c6fabb7e47a89549df5d643 + last_write_checksum: sha1:a5cee74f1520eaaab8a5a67013ab375a1565c03f docs/models/updateactionrequestbody.md: last_write_checksum: sha1:7e85045ea6a3b5572f4adacca145739c4162bb04 docs/models/updateactionresponse.md: @@ -581,7 +595,7 @@ trackedFiles: docs/models/updateauthormetadata.md: last_write_checksum: sha1:315bcc1ec596952c947cf2051dd69def9007069c docs/models/updateauthorrequest.md: - last_write_checksum: sha1:7d8a9d5d028ec52164f74e03e0d67459a4cf75e2 + last_write_checksum: sha1:906a01d465821e9172a9e9498eb8af2e115e1830 docs/models/updateauthorrequestbody.md: last_write_checksum: sha1:16944b8b257aff425b8eb79ef1e22d0832801e55 docs/models/updatechannelcontenttype.md: @@ -607,13 +621,13 @@ trackedFiles: docs/models/updatewebhookpayloadversion.md: last_write_checksum: sha1:3fb625590fd0e45de0ed945c6de287de6a411202 docs/models/updatewebhookrequest.md: - last_write_checksum: sha1:2f856f2d3c9e6e791ff44fe99a0ad3cdc5b7a76a + last_write_checksum: sha1:66f1f66f60a762e1dd08cc9f8a6fd4e975fc6164 docs/models/updatewebhookrequestbody.md: last_write_checksum: sha1:b7a27316af235c9c6cab03dd8424da0d42a5d95d docs/models/updatewebhookresponse.md: last_write_checksum: sha1:f9e9209f9c2ae24296c9349c891ef2bc2592f167 docs/models/updatewordlistrequest.md: - last_write_checksum: sha1:74d6cdcec18b85512667c324f8fe0ed950f650dc + last_write_checksum: sha1:99eeed30ea0922542fe10a34e141367fa934b47c docs/models/updatewordlistrequestbody.md: last_write_checksum: sha1:3f7ae7eee8f69e4f566d07bee25f7a4e9700b648 docs/models/updatewordlistresponse.md: @@ -639,35 +653,35 @@ trackedFiles: docs/models/withinunit.md: last_write_checksum: sha1:ca17d9ca4c86ddfec9b1808b0c10228fd81ac2c3 docs/sdks/account/README.md: - last_write_checksum: sha1:db3a8dbca78efa43f42d9f23e1b1547e6c1e0a19 + last_write_checksum: sha1:2451b51ed183ab247d05c5044df4c7a9a8be3573 docs/sdks/actions/README.md: - last_write_checksum: sha1:c4460f2cc7cd099c050ae82a392a3608a785235b + last_write_checksum: sha1:e00bb473366b6437b8e0ee78f162a2fc78e718d7 docs/sdks/authors/README.md: - last_write_checksum: sha1:6ba4a26ef3b113814303e844a05405d13f04246e + last_write_checksum: sha1:eed884a739b5df009fea277bc141689eb9db6b22 docs/sdks/channels/README.md: last_write_checksum: sha1:01c0e51bc630e4f5cb937e39faf535e894547fd3 docs/sdks/contentsdk/README.md: - last_write_checksum: sha1:f6e58b5addb3276b3713196774eebe39a5a81994 + last_write_checksum: sha1:b50dd8d8a1872e957df3da4fa36d189d7bb126d4 docs/sdks/items/README.md: - last_write_checksum: sha1:0e30c68ea1709057ded218b75d981f1384dcf717 + last_write_checksum: sha1:994cd5aa1e04b3646e24922f8b16a76e12e17942 docs/sdks/projects/README.md: last_write_checksum: sha1:a256679120b221c4cabb8026f7ccceaea7ca22c7 docs/sdks/queuesdk/README.md: - last_write_checksum: sha1:46831280e88b175731c5445b59ebf979f2f19a97 + last_write_checksum: sha1:9b7055228c0acc9e38f2796ed188fe6f5343bcc4 docs/sdks/webhooks/README.md: - last_write_checksum: sha1:8b6a1a57557bd3ade5be000a4c86d950886c5368 + last_write_checksum: sha1:306d9f6587191c859ff953ce731eebc3ccece232 docs/sdks/webhooksecret/README.md: - last_write_checksum: sha1:b725388cf13440a7c5b9c41678fcdf698f04acd5 + last_write_checksum: sha1:891943f7d09a8b3cfd886342e1d2fe169ad1a670 docs/sdks/wordlist/README.md: - last_write_checksum: sha1:3c9e2a62bb98649066c4d11eb9398e6ae9d00095 + last_write_checksum: sha1:47467527cf6316a4a5a09c7275f1abde64554b8d docs/sdks/words/README.md: - last_write_checksum: sha1:5ed80bd0483f466dbbde1bb12fdbedd35db3fe93 + last_write_checksum: sha1:3f411237e8fb54e99aafa7b6cdfb3fbcf9046286 py.typed: last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pylintrc: last_write_checksum: sha1:cb40e5fd2885dcf20f7c572a590b2656efe282a0 pyproject.toml: - last_write_checksum: sha1:27ffe316031b4b01b46112d983d5359914d4fb29 + last_write_checksum: sha1:6242aa9a213ddc4cc915474b6733bff06344c5d5 scripts/prepare_readme.py: last_write_checksum: sha1:7b330dc0eb57c916a1158fd90c6227f8dc517c83 scripts/publish.sh: @@ -681,25 +695,25 @@ trackedFiles: src/moderation_api/_hooks/types.py: last_write_checksum: sha1:bb2a67c388c536a910bd205bd9582065c5d2de39 src/moderation_api/_version.py: - last_write_checksum: sha1:add169876c532d6f961eb23dc56c92cb3cdc02e2 + last_write_checksum: sha1:f8a331162d341771db85dcce63b614858ab79d58 src/moderation_api/account.py: - last_write_checksum: sha1:4fbbbf7834d250353a52cb7d0a9752738c6ccea8 + last_write_checksum: sha1:b83155ed2e9ddea53715fef16adf03683ea99006 src/moderation_api/actions.py: - last_write_checksum: sha1:9125beb7c8ea7c0e0aa6f7b3355ad963f9ba8ef0 + last_write_checksum: sha1:1286e7aad3a4ceefc7e4577739dd69aca56d1187 src/moderation_api/authors.py: - last_write_checksum: sha1:846c678bfa45f5ee6afdc79ece4fb62fe87b639d + last_write_checksum: sha1:cf4951338154371c5b5cfd4c538b95f8782fb812 src/moderation_api/basesdk.py: last_write_checksum: sha1:026fbd5780e5d5c70d00c0e8503e124ce2cf9779 src/moderation_api/channels.py: last_write_checksum: sha1:427f7ba3e717e4cdadbff8bca70a602c9a2a9c81 src/moderation_api/content_sdk.py: - last_write_checksum: sha1:146690a11ff1ecb2f3e99d3026234c84f21beb69 + last_write_checksum: sha1:48fe6b376029b2cde3070cc39b062cb8e37cd536 src/moderation_api/errors/__init__.py: last_write_checksum: sha1:043e566785713d1aee1f2709cf3083cb51df01f6 src/moderation_api/errors/authenticationerror.py: last_write_checksum: sha1:25027f18db3e06adcae00114d10d346e19c47914 src/moderation_api/errors/badrequesterror.py: - last_write_checksum: sha1:2956ade602678ebaaf6dd406bb40e3435f8af599 + last_write_checksum: sha1:22b41329268d5e4f7101ca76891ee3c94895b077 src/moderation_api/errors/conflicterror.py: last_write_checksum: sha1:752e430486a83a8cc9b48bbf13a507dacc9607dd src/moderation_api/errors/internalservererror.py: @@ -713,7 +727,7 @@ trackedFiles: src/moderation_api/errors/notfounderror.py: last_write_checksum: sha1:8e16b46d89276693c817e89e107c72124c42fcd2 src/moderation_api/errors/permissiondeniederror.py: - last_write_checksum: sha1:45e587a5860c39b85743a6cfaadc10418a85f11a + last_write_checksum: sha1:ef715026496a1c44d5548a12e3838e80d95fd76b src/moderation_api/errors/ratelimiterror.py: last_write_checksum: sha1:b21ea5a561809730626bedac760606e2150706bf src/moderation_api/errors/responsevalidationerror.py: @@ -721,39 +735,39 @@ trackedFiles: src/moderation_api/httpclient.py: last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 src/moderation_api/items.py: - last_write_checksum: sha1:7dc42580494127c2b375b29304988888151494b9 + last_write_checksum: sha1:b4d7bab76c059007d3b3ef5adf3e2050ca94ebc8 src/moderation_api/models/__init__.py: - last_write_checksum: sha1:c4fa9982b774e655159dda1956668dbf9b0e43b3 + last_write_checksum: sha1:3824295e85fd397dac661d261f1dfb3b2df193b0 src/moderation_api/models/addwordlistwordsop.py: - last_write_checksum: sha1:c5c1894b1e51c5ce56a5d8646d45b4d3c1974095 + last_write_checksum: sha1:870752f7f9f29e5430b3beeecbd1bb7b158ab175 src/moderation_api/models/authenticationerror.py: last_write_checksum: sha1:63c299ddbc05b97c083d497836594c1619815fab src/moderation_api/models/badrequesterror.py: - last_write_checksum: sha1:98b0f2c371d65c3a66ae33e97a68bdaaf3798d15 + last_write_checksum: sha1:ea326d388bb1339930b2141d857571b470c711e4 src/moderation_api/models/channel.py: last_write_checksum: sha1:3f3a27e1b1c4d719244f22748c0af2b043729b27 src/moderation_api/models/conflicterror.py: last_write_checksum: sha1:43e729d2dcf16ae6791a6c4ee1b5cab373611296 src/moderation_api/models/createactionop.py: - last_write_checksum: sha1:3fb83d6d1beba89fb37af052a71af1147ac69358 + last_write_checksum: sha1:75512203ad595c2880c67ca595cc5d275f518d28 src/moderation_api/models/createauthorop.py: - last_write_checksum: sha1:e92acefb61096af66649fd37c23a2b72ef6046c9 + last_write_checksum: sha1:4928b8e9fc27f72ba565c1e5266824efd05c080e src/moderation_api/models/createchannelop.py: last_write_checksum: sha1:19f3857bbc2c1d66f906465518a4ae26e34ea666 src/moderation_api/models/createprojectop.py: last_write_checksum: sha1:dc16578de2a09db059dccfe18712b42d767f1a62 src/moderation_api/models/createwebhookop.py: - last_write_checksum: sha1:199fce3d361060801ee5d5cade7ae2e1aeab5aad + last_write_checksum: sha1:abe6642f63eba52524e5c1654dd65ee4d9fe761f src/moderation_api/models/deleteactionop.py: - last_write_checksum: sha1:e67d2d3bfe957f5fca569e2f7e525db0bc94dd34 + last_write_checksum: sha1:180aa4fa98d90dad14da78dbefb521f387bc0841 src/moderation_api/models/deleteauthorop.py: - last_write_checksum: sha1:771ce954981d79a62afd9c8eec14eec997b0b45b + last_write_checksum: sha1:5d1b8c36891f1b7247fe77b5de1f6bab1de98d1a src/moderation_api/models/deletechannelop.py: last_write_checksum: sha1:b1798fa3342ed1d046d89f40ae7f72a41c6a9e87 src/moderation_api/models/deleteprojectop.py: last_write_checksum: sha1:2e84a7999f679a87ef393eb0c44805bd687d2e7d src/moderation_api/models/deletewebhookop.py: - last_write_checksum: sha1:a939d8c4b658243b85a6a9c593a08df239a14ca2 + last_write_checksum: sha1:9e829c2b8f89f5801902f0dd6a78e7e83ec4f8bd src/moderation_api/models/duplicatechannelop.py: last_write_checksum: sha1:ac62e5fe7064a3b241935390d57002ed98bcc1e1 src/moderation_api/models/duplicateprojectop.py: @@ -761,51 +775,51 @@ trackedFiles: src/moderation_api/models/errorissue.py: last_write_checksum: sha1:12ac40f4f3533dad0cb604a67f2f70e6b07254f0 src/moderation_api/models/executeactionop.py: - last_write_checksum: sha1:923f75e923f5e10a1a0b3ff02d9bc611b63903c6 + last_write_checksum: sha1:6dff012c5267ec742e7f5ea852245d41bc881d8f src/moderation_api/models/getaccountop.py: - last_write_checksum: sha1:a47c301c8eefb64ef6468497247da0660b5faeb3 + last_write_checksum: sha1:2307dcddd805f86cf3cfc37a7754fc31da185191 src/moderation_api/models/getactionop.py: - last_write_checksum: sha1:dca3e65624e7408e9a0c9795e31c6dfe09974e85 + last_write_checksum: sha1:29badfdfa294cbfff429ce5f156cfed15084469b src/moderation_api/models/getauthorop.py: - last_write_checksum: sha1:a84b1ba037e1ae2a831d3f959aca22c3c3b01cbb + last_write_checksum: sha1:19551cefcdda8f89fa073ad4a7907d41cb154ded src/moderation_api/models/getchannelop.py: last_write_checksum: sha1:1ee37733cbe95895109c9e6c1d38b6d6bfd75b68 src/moderation_api/models/getprojectop.py: last_write_checksum: sha1:66b15cd300d9810dbb258211e2bb77f7d08fb2bd src/moderation_api/models/getqueueop.py: - last_write_checksum: sha1:e586fe5237231be4b08ab14f1a071f9bf9c4003b + last_write_checksum: sha1:9dee8b4291f66c5528d25a379a15f139ee119c14 src/moderation_api/models/getqueuestatsop.py: - last_write_checksum: sha1:32a13c31e6639df3c760e2a4e1f8257aba89ae20 + last_write_checksum: sha1:76e8d5d3b43288793e3a586d2e5053ec008a2bef src/moderation_api/models/getwebhookop.py: - last_write_checksum: sha1:cd0f09ad7fcd112799150e749d2f72fe4481ad39 + last_write_checksum: sha1:3bd33c8c94a39d956340f3251ff69badd27e3102 src/moderation_api/models/getwebhooksecretop.py: - last_write_checksum: sha1:713a5a666cbc7cfb8066e319a043edc6958df653 + last_write_checksum: sha1:dc87f26e4c211a3a876f4e569d445b5ab91b6883 src/moderation_api/models/getwordlistembeddingstatusop.py: - last_write_checksum: sha1:4545450042d151c39d73e754b2dfe7fb349176b5 + last_write_checksum: sha1:e0940ba3f64232c17cb7b5634099c21bf1309c1e src/moderation_api/models/getwordlistop.py: - last_write_checksum: sha1:74d2fcc7cb7743bc89a72067849df48de349afbd + last_write_checksum: sha1:f2a2503cad43bcc383f16215d0751d1b571021b7 src/moderation_api/models/internalservererror.py: last_write_checksum: sha1:aa2999b9b9209cf1a43bdf0d065ccf890f79007b src/moderation_api/models/listactionsop.py: - last_write_checksum: sha1:4339bba35f07346cac5fa6a11c458290f0b5c247 + last_write_checksum: sha1:17a8344a068530cc0c46d0b726a7b62c73bcc6b7 src/moderation_api/models/listauthorsop.py: - last_write_checksum: sha1:80b1a4e27d70205191258717c110f37c2444f73b + last_write_checksum: sha1:5b6e792705e6077f35db579fdbc2644636dabeff src/moderation_api/models/listchannelsop.py: last_write_checksum: sha1:cf3ab07af3ad06ae35fa6e3ed6783f292d77e914 src/moderation_api/models/listprojectsop.py: last_write_checksum: sha1:71cf5c9825f4f7e2a6aa31149946079f7a45cb08 src/moderation_api/models/listqueueitemsop.py: - last_write_checksum: sha1:dcc1020c38bf1082f0f11d81ff0fbc1e4d2a51ef + last_write_checksum: sha1:874a4353f6732e5d4dc523975c000b6c2cc042ab src/moderation_api/models/listwebhooksop.py: - last_write_checksum: sha1:50a7e8633bf1620d954efa3a172565ab4987e62a + last_write_checksum: sha1:5dd067d74745d7d832474830e75edc3e2fd3a16f src/moderation_api/models/listwordlistsop.py: - last_write_checksum: sha1:baf3d8259aace9098bb4d9f2c935f30e1cafe11f + last_write_checksum: sha1:4cb88caafa938d3b648f8a8833ae05eff67f0d8d src/moderation_api/models/notfounderror.py: last_write_checksum: sha1:a44e99269c4be4942eb84a4d9fa364a9b17f90db src/moderation_api/models/pagination.py: last_write_checksum: sha1:b39970391aa653cb9cf835c0fc185bad7117d86a src/moderation_api/models/permissiondeniederror.py: - last_write_checksum: sha1:f65ba7d760ec371c17688cf7c1de4ba9bd2c7a15 + last_write_checksum: sha1:10b6b6a23e0c8c67612ca46253ba07fc5c27f0f5 src/moderation_api/models/project.py: last_write_checksum: sha1:8b63414b298ed52321834567de4da1f6becb40e9 src/moderation_api/models/projectwithkey.py: @@ -815,33 +829,33 @@ trackedFiles: src/moderation_api/models/ratelimiterror.py: last_write_checksum: sha1:0e2a9611cd0b938fcdcab514d2f667fb6286bfe1 src/moderation_api/models/removewordlistwordsop.py: - last_write_checksum: sha1:be5d8c7bb7363b6b5e7ce7f3735f54bdeec5abb7 + last_write_checksum: sha1:d677c10b4b7ff4ba1c017b1acece737bf4266476 src/moderation_api/models/resolvequeueitemop.py: - last_write_checksum: sha1:ae162695dadc0b0fc4eced69b05a871624bd4b55 + last_write_checksum: sha1:664e811f1c8599aaa192272e3ad262fc79a371bf src/moderation_api/models/security.py: last_write_checksum: sha1:dc71db919301e2ed408358e7b2066a8cb30c581b src/moderation_api/models/submitcontentop.py: - last_write_checksum: sha1:a6fba99be7e4e3c70d6a4e9687802de74471c7da + last_write_checksum: sha1:748596299c2ae4a9ce0c11812adb73a502489e2d src/moderation_api/models/unresolvequeueitemop.py: - last_write_checksum: sha1:914c3ca13be46eaad14be65b5f46192bdd295bb9 + last_write_checksum: sha1:045ee159e02dad90f660dff7c733bd8f5f34aab3 src/moderation_api/models/updateactionop.py: - last_write_checksum: sha1:6c99e2fc62056160c68f81631c503d6a1eb5f8b0 + last_write_checksum: sha1:f43fb150a406c10f214416daa3c5af645f11411e src/moderation_api/models/updateauthorop.py: - last_write_checksum: sha1:72485f29fbcab4044a845c3151082ff0bac187e2 + last_write_checksum: sha1:e2867179b9158e38fc8433e32db233399c2b1824 src/moderation_api/models/updatechannelop.py: last_write_checksum: sha1:444b3b5c68884d846d8db28f07b031fdc4a27c76 src/moderation_api/models/updateprojectop.py: last_write_checksum: sha1:700ccc086f59950dcbbf78d2f52796064fa63c12 src/moderation_api/models/updatewebhookop.py: - last_write_checksum: sha1:b46ec55d7634cc70bf7bc79060df40748936e190 + last_write_checksum: sha1:52c4f9e3432d4fadf70d54d0ad82882a80323616 src/moderation_api/models/updatewordlistop.py: - last_write_checksum: sha1:64915feada242e2965189c5a9715226ca5271adf + last_write_checksum: sha1:6be4160c8a8ae9f64d2937e63075dd5d23c72aa5 src/moderation_api/projects.py: last_write_checksum: sha1:a4aece7aba0496936fd398d185c0de035fe4828f src/moderation_api/py.typed: last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 src/moderation_api/queue_sdk.py: - last_write_checksum: sha1:e7bce884630981420dc919f0e256f86e0b7e48f5 + last_write_checksum: sha1:83aa4d12c49541e692cf28eb5c93feef283e5833 src/moderation_api/sdk.py: last_write_checksum: sha1:580ff8ec9ef32cc4f9a4e488a4a4f319f3a0304c src/moderation_api/sdkconfiguration.py: @@ -891,13 +905,13 @@ trackedFiles: src/moderation_api/utils/values.py: last_write_checksum: sha1:c0eaaf8779a4ba3ae068579a57182667efef0cb7 src/moderation_api/webhooks.py: - last_write_checksum: sha1:936385719eb90b786be4a31af8d98e71aa7bf52f + last_write_checksum: sha1:151dc8211b7dc7dec6e5a8c3e67baee3cbfe2ade src/moderation_api/webhooksecret.py: - last_write_checksum: sha1:6081057d585229e1dc0bc9143c3803cbc65887b2 + last_write_checksum: sha1:168033acf81ec6f9d7feff2a7956f9db9fc58ed2 src/moderation_api/wordlist.py: - last_write_checksum: sha1:e1fcc0296b270714e3997e13a6c69e080cc3efd2 + last_write_checksum: sha1:ed4062ea524540feffe978990340a296b6c08b98 src/moderation_api/words.py: - last_write_checksum: sha1:ef2d2aba8e3067bbc9e1fb735a77bc2216d3f71f + last_write_checksum: sha1:d589167bc24d375b66088de2407faeb1a2209c5e examples: listAuthors: speakeasy-default-list-authors: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c1f98cf..21e708c 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false python: - version: 2.0.0 + version: 2.1.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json new file mode 100644 index 0000000..88ae723 --- /dev/null +++ b/.speakeasy/openapi.json @@ -0,0 +1,14224 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Moderation API", + "description": "Moderate text, images, video and audio in real time, manage authors, review queues and actions, and receive webhooks.", + "version": "1.1.0" + }, + "servers": [ + { + "url": "https://moderationapi.com/api/v1" + } + ], + "tags": [ + { + "name": "Content", + "description": "Submit content for moderation." + }, + { + "name": "Authors", + "description": "The users who create content, with their trust level and history." + }, + { + "name": "Review queues", + "description": "Queues of content for human review, and their items." + }, + { + "name": "Actions", + "description": "Moderation actions reviewers and rules can take." + }, + { + "name": "Wordlists", + "description": "Custom word and phrase lists used by policies." + }, + { + "name": "Webhooks", + "description": "Endpoints that receive events, and the events they receive." + }, + { + "name": "Account", + "description": "The account that owns the API key." + }, + { + "name": "Projects", + "description": "Projects in the organization. Needs an organization key." + }, + { + "name": "Channels", + "description": "Channels in a project. Needs an organization key." + }, + { + "name": "Voice", + "description": "Real-time voice moderation over WebSocket." + } + ], + "externalDocs": { + "url": "https://docs.moderationapi.com" + }, + "paths": { + "/authors": { + "get": { + "operationId": "listAuthors", + "summary": "List authors", + "description": "List authors with their activity metrics and reputation. The list is paginated.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "trustLevel", + "violationCount", + "reportCount", + "memberSince", + "lastActive", + "contentCount", + "flaggedContentRatio", + "averageSentiment" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "default": "desc", + "description": "Sort direction", + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + { + "in": "query", + "name": "memberSinceDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "lastActiveDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "contentTypes", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicAuthor" + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List authors", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + }, + "post": { + "operationId": "createAuthor", + "summary": "Create a new author", + "description": "Create a new author. Typically not needed as authors are created automatically when content is moderated.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + }, + "external_id": { + "type": "string", + "description": "External ID of the user, typically the ID of the author in your database." + } + }, + "required": [ + "external_id" + ] + }, + "example": { + "external_id": "user-1092", + "name": "Jamie Rivera", + "email": "jamie@example.com", + "metadata": { + "email_verified": true, + "is_paying_customer": false + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create a new author", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/authors/{id}": { + "get": { + "operationId": "getAuthor", + "summary": "Get author details", + "description": "Get detailed information about a specific author including historical data and analysis", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get author details", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateAuthor", + "summary": "Update author details", + "description": "Update the details of a specific author", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + } + } + }, + "example": { + "manual_trust_level": 2, + "metadata": { + "identity_verified": true + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update author details", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "deleteAuthor", + "summary": "Delete an author", + "description": "Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + }, + "required": [ + "success" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete an author", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/queue/{id}": { + "get": { + "operationId": "getQueue", + "summary": "Get a queue", + "description": "Get a queue", + "tags": [ + "Review queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "queue": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "filter": { + "type": "object", + "properties": { + "isFlagged": { + "type": "string", + "enum": [ + "ALL", + "FLAGGED", + "NOT_FLAGGED", + "SHADOW_FLAGGED" + ] + }, + "casebookAnswer": { + "type": "string", + "enum": [ + "ALL", + "ALLOWED", + "REJECTED", + "NO_ANSWER" + ] + }, + "casebookAgreement": { + "type": "string", + "enum": [ + "ALL", + "OVERRULED", + "AGREED" + ] + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "filterLabels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "FLAGGED", + "NOT_FLAGGED", + "THRESHOLDS", + "MATCHED" + ] + }, + "minThreshold": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + }, + "maxThreshold": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "label", + "type" + ], + "additionalProperties": false + } + }, + "metadataFilters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "value": { + "type": "string", + "maxLength": 512 + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + }, + "filteredChannelIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "filteredActionIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "languages": { + "type": "array", + "items": { + "type": "string" + } + }, + "contentTypes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + } + }, + "mediaTypes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "image", + "video", + "object", + "audio" + ] + } + }, + "authorTrustLevels": { + "type": "array", + "items": { + "type": "integer", + "minimum": -1, + "maximum": 4 + } + }, + "recommendationActions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ] + } + }, + "minSeverity": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "maxSeverity": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "afterDate": { + "type": "string" + }, + "beforeDate": { + "type": "string" + }, + "within": { + "type": "number", + "exclusiveMinimum": 0 + }, + "withinUnit": { + "type": "string", + "enum": [ + "MINUTES", + "HOURS", + "DAYS", + "WEEKS", + "MONTHS", + "YEARS" + ] + }, + "clearDateWindow": { + "type": "boolean" + }, + "checkStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "all", + "checked", + "unchecked" + ] + }, + { + "type": "null" + } + ] + }, + "authorID": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "conversationIds": { + "type": "array", + "items": { + "type": [ + "string", + "null" + ] + } + }, + "search": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "unresolvedItemsCount": { + "type": "number" + }, + "resolvedItemsCount": { + "type": "number" + }, + "totalItemsCount": { + "type": "number" + } + }, + "required": [ + "id", + "name", + "description", + "filter", + "unresolvedItemsCount", + "resolvedItemsCount", + "totalItemsCount" + ], + "additionalProperties": false + } + }, + "required": [ + "queue" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "queue", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get a queue", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + } + }, + "/queue/{id}/stats": { + "get": { + "operationId": "getQueueStats", + "summary": "Get queue statistics", + "description": "Get detailed statistics about a moderation queue including review times, action counts, and trends", + "tags": [ + "Review queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "withinDays", + "schema": { + "default": 30, + "description": "Number of days to analyze statistics for", + "type": "integer", + "minimum": 1, + "maximum": 365 + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reviewStats": { + "type": "object", + "properties": { + "averageTimeToReview": { + "type": "number", + "description": "Average time in milliseconds to review an item" + }, + "totalReviewed": { + "type": "number", + "description": "Total number of items reviewed" + }, + "totalPending": { + "type": "number", + "description": "Total number of items pending review" + } + }, + "required": [ + "averageTimeToReview", + "totalReviewed", + "totalPending" + ], + "additionalProperties": false + }, + "actionStats": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "type": "string", + "description": "ID of the moderation action" + }, + "actionName": { + "type": "string", + "description": "Name of the moderation action" + }, + "count": { + "type": "number", + "description": "Number of times this action was taken" + }, + "percentageOfTotal": { + "type": "number", + "description": "Percentage this action represents of all actions" + } + }, + "required": [ + "actionId", + "actionName", + "count", + "percentageOfTotal" + ], + "additionalProperties": false + } + }, + "topReviewers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "ID of the reviewer" + }, + "name": { + "type": "string", + "description": "Name of the reviewer" + }, + "reviewCount": { + "type": "number", + "description": "Number of items reviewed" + }, + "averageTimePerReview": { + "type": "number", + "description": "Average review time in milliseconds" + }, + "accuracyScore": { + "description": "Optional accuracy score based on review quality metrics", + "type": "number" + }, + "topActions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "type": "string", + "description": "Most used action by this reviewer" + }, + "actionName": { + "type": "string", + "description": "Name of the most used action" + }, + "count": { + "type": "number", + "description": "Number of times this action was used" + } + }, + "required": [ + "actionId", + "actionName", + "count" + ], + "additionalProperties": false + }, + "description": "Most common actions taken by this reviewer" + } + }, + "required": [ + "userId", + "name", + "reviewCount", + "averageTimePerReview", + "topActions" + ], + "additionalProperties": false + }, + "description": "List of top reviewers and their statistics" + }, + "trends": { + "type": "object", + "properties": { + "dailyReviewCounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date in YYYY-MM-DD format" + }, + "count": { + "type": "number", + "description": "Number of reviews on this date" + } + }, + "required": [ + "date", + "count" + ], + "additionalProperties": false + } + }, + "flaggedContentTrends": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Content flag/label" + }, + "trend": { + "type": "number", + "description": "Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing" + } + }, + "required": [ + "label", + "trend" + ], + "additionalProperties": false + } + } + }, + "required": [ + "dailyReviewCounts", + "flaggedContentTrends" + ], + "additionalProperties": false + } + }, + "required": [ + "reviewStats", + "actionStats", + "topReviewers", + "trends" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "queue", + "x-speakeasy-name-override": "getStats", + "x-speakeasy-mcp": { + "title": "Get queue statistics", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + } + }, + "/queue/{id}/items": { + "get": { + "operationId": "listQueueItems", + "summary": "Get queue items", + "description": "Get paginated list of items in a moderation queue with filtering options", + "tags": [ + "Review queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "query", + "name": "sortField", + "schema": { + "type": "string", + "enum": [ + "createdAt", + "severity", + "reviewedAt" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "default": "desc", + "description": "Sort direction", + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + { + "in": "query", + "name": "conversationIds", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "labels", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "afterDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "beforeDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "includeResolved", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "authorId", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "filteredActionIds", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Content ID" + }, + "content": { + "type": "string", + "description": "The content to be moderated" + }, + "language": { + "description": "Content language", + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Label name" + }, + "score": { + "type": "number", + "description": "Confidence score of the label" + }, + "flagged": { + "type": "boolean", + "description": "Whether this label caused a flag" + } + }, + "required": [ + "label", + "score", + "flagged" + ], + "additionalProperties": false + } + }, + "conversationId": { + "description": "Conversation ID", + "type": "string" + }, + "authorId": { + "description": "Author ID", + "type": "string" + }, + "actions": { + "description": "Action IDs taken on this item", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Action ID" + }, + "name": { + "type": "string", + "description": "Action name" + }, + "comment": { + "description": "Action comment", + "type": "string" + }, + "timestamp": { + "type": "number", + "description": "Unix timestamp of when the action was taken" + }, + "reviewer": { + "description": "Moderator userID", + "type": "string" + } + }, + "required": [ + "id", + "name", + "timestamp" + ], + "additionalProperties": false + } + }, + "flagged": { + "type": "boolean", + "description": "Whether the item is flagged by any label" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "resolved" + ], + "description": "Status of the item" + }, + "timestamp": { + "type": "number", + "description": "Unix timestamp of when the item was created" + }, + "contentType": { + "description": "Type of the content object", + "type": "string" + } + }, + "required": [ + "id", + "content", + "labels", + "flagged", + "status", + "timestamp" + ], + "additionalProperties": false + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "Get queue items", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + } + }, + "/queue/{id}/items/{itemId}/resolve": { + "post": { + "operationId": "resolveQueueItem", + "summary": "Resolve a queue item", + "description": "Mark a queue item as resolved with a specific moderation action", + "tags": [ + "Review queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "type": "string", + "description": "The item ID to resolve" + }, + "required": true, + "description": "The item ID to resolve" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "comment": { + "description": "Optional comment", + "type": "string" + } + } + }, + "example": { + "comment": "Reviewed: no violation." + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "resolvedAt": { + "type": "string", + "description": "Timestamp when the item was resolved" + }, + "comment": { + "description": "Optional comment", + "type": "string" + } + }, + "required": [ + "success", + "resolvedAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "resolve", + "x-speakeasy-mcp": { + "title": "Resolve a queue item", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/queue/{id}/items/{itemId}/unresolve": { + "post": { + "operationId": "unresolveQueueItem", + "summary": "Unresolve a queue item", + "description": "Mark a previously resolved queue item as unresolved/pending", + "tags": [ + "Review queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "type": "string", + "description": "The item ID to unresolve" + }, + "required": true, + "description": "The item ID to unresolve" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "comment": { + "description": "Optional reason for unresolving the item", + "type": "string" + } + } + }, + "example": { + "comment": "Reopened after an appeal." + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "status": { + "type": "string", + "description": "New status of the item" + }, + "unresolvedAt": { + "type": "string", + "description": "Timestamp when the item was unresolved" + } + }, + "required": [ + "success", + "status", + "unresolvedAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "unresolve", + "x-speakeasy-mcp": { + "title": "Unresolve a queue item", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/actions": { + "get": { + "operationId": "listActions", + "summary": "List moderation actions", + "description": "List the moderation actions of the project. The list is paginated.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "queueId", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List moderation actions", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + }, + "post": { + "operationId": "createAction", + "summary": "Create an action", + "description": "Create an action.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "name" + ] + }, + "example": { + "name": "Suspend for 24 hours", + "key": "suspend-24h", + "type": "AUTHOR_BLOCK_TEMP", + "queueBehaviour": "REMOVE" + } + } + } + }, + "responses": { + "200": { + "description": "Action created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "409": { + "description": "Action with this key already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create an action", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/actions/{id}": { + "get": { + "operationId": "getAction", + "summary": "Get an action", + "description": "Get an action by ID.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to get." + }, + "required": true, + "description": "The ID of the action to get." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Action retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get an action", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateAction", + "summary": "Update an action", + "description": "Update an action.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to update." + }, + "required": true, + "description": "The ID of the action to update." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "409": { + "description": "Action with this key already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update an action", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "deleteAction", + "summary": "Delete an action", + "description": "Delete an action and all of its webhooks.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to delete." + }, + "required": true, + "description": "The ID of the action to delete." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Action deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the action was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the action." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete an action", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/actions/execute": { + "post": { + "operationId": "executeAction", + "summary": "Execute moderation action", + "description": "Execute a moderation action on one or more content items.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "actionKey": { + "type": "string", + "description": "ID or key of the action to execute" + }, + "contentIds": { + "description": "IDs of the content items to apply the action to. Provide this or authorIds.", + "type": "array", + "items": { + "type": "string" + } + }, + "authorIds": { + "description": "IDs of the authors to apply the action to. Provide this or contentIds.", + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "description": "Optional value to provide with the action", + "type": "string" + }, + "queueId": { + "description": "Optional queue ID if the action is queue-specific", + "type": "string" + }, + "duration": { + "description": "Optional duration in milliseconds for actions with timeouts", + "type": "number", + "minimum": 0 + } + }, + "required": [ + "actionKey" + ], + "description": "Input parameters" + }, + "example": { + "actionKey": "suspend-24h", + "authorIds": [ + "user-1092" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "execute", + "x-speakeasy-mcp": { + "title": "Execute moderation action", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/actions/{actionId}/execute": { + "post": { + "operationId": "executeActionById", + "summary": "Execute an action", + "description": "Execute an action on a set of content items in a queue.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "path", + "name": "actionId", + "schema": { + "type": "string", + "description": "The ID or key of the action to execute." + }, + "required": true, + "description": "The ID or key of the action to execute." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentIds": { + "description": "The IDs of the content items to perform the action on.", + "type": "array", + "items": { + "type": "string" + } + }, + "authorIds": { + "description": "IDs of the authors to apply the action to", + "type": "array", + "items": { + "type": "string" + } + }, + "queueId": { + "description": "The ID of the queue the action was performed from if any.", + "type": "string" + }, + "value": { + "description": "The value of the action. Useful to set a reason for the action etc.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Action executed successfully." + }, + "actionId": { + "type": "string", + "description": "The ID of the action." + }, + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the content items." + } + }, + "required": [ + "success", + "actionId", + "ids" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-ignore": true + } + }, + "/webhooks": { + "get": { + "operationId": "listWebhooks", + "summary": "List webhooks", + "description": "List the webhooks of the project. The list is paginated.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Webhooks retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List webhooks", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + }, + "post": { + "operationId": "createWebhook", + "summary": "Create a webhook", + "description": "Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint).", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The webhook's name, used to identify it in the dashboard" + }, + "description": { + "description": "The webhook's description", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "format": "uri", + "description": "The webhook's URL. We'll call this URL when an event occurs." + }, + "eventTypes": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + }, + "description": "Event types this webhook subscribes to. One webhook URL receives all events you list here." + } + }, + "required": [ + "name", + "url", + "eventTypes" + ] + }, + "example": { + "name": "Moderation events", + "url": "https://example.com/webhooks/moderation", + "eventTypes": [ + "QUEUE_ITEM_REJECTED", + "AUTHOR_BLOCKED" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Webhook created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create a webhook", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/webhooks/{id}": { + "get": { + "operationId": "getWebhook", + "summary": "Get a webhook", + "description": "Get a webhook by ID.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to get." + }, + "required": true, + "description": "The ID of the webhook to get." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Webhook retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get a webhook", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateWebhook", + "summary": "Update a webhook", + "description": "Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to update." + }, + "required": true, + "description": "The ID of the webhook to update." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The webhook's name, used to identify it in the dashboard" + }, + "description": { + "description": "The webhook's description", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "format": "uri", + "description": "The webhook's URL. We'll call this URL when an event occurs." + }, + "eventTypes": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + }, + "description": "Event types this webhook subscribes to. One webhook URL receives all events you list here." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Webhook updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update a webhook", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "deleteWebhook", + "summary": "Delete a webhook", + "description": "Delete a webhook.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to delete." + }, + "required": true, + "description": "The ID of the webhook to delete." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Webhook deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the webhook was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the webhook." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete a webhook", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/webhook-secret": { + "get": { + "operationId": "getWebhookSecret", + "summary": "Get the webhook signing secret", + "description": "Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Signing secret retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header." + } + }, + "required": [ + "secret" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "webhookSecret", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "disabled": true + } + } + }, + "/moderate/text": { + "post": { + "operationId": "moderateText", + "summary": "Analyze text", + "description": "(Deprecated \u2014 use https://api.moderationapi.com/v1/moderate) Analyze text content. Runs the same policy engine as POST /moderate; the per-model result blocks are approximated from the policies it ran.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "channelKey": { + "description": "The key of the channel.", + "type": "string" + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "contextId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "value": { + "type": "string", + "maxLength": 100000, + "description": "The text you'd like to analyze. We recommend to submit plain text or HTML" + } + }, + "required": [ + "value" + ], + "description": "Input parameters for text moderation" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Success if the request was successful" + }, + "contentId": { + "description": "The ID of the content.", + "type": "string" + }, + "request": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "The timestamp of the request" + }, + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false, + "description": "Information about the request" + }, + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any models" + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "content_moderated": { + "type": "boolean", + "description": "Whether the content was moderated or not. Same as `content` !== `original`" + }, + "unicode_spoofing": { + "type": "boolean", + "description": "Whether the content is using look-alike characters. Often used by spammers." + }, + "data_found": { + "type": "boolean", + "description": "Whether any entity matchers found data for the content" + }, + "original": { + "type": "string", + "description": "The original content" + }, + "content": { + "type": "string", + "description": "The content after moderation. With all mask replacements applied and look-alike characters replaced with the original characters." + } + }, + "required": [ + "status", + "request", + "flagged", + "author", + "content_moderated", + "unicode_spoofing", + "data_found", + "original", + "content" + ], + "additionalProperties": false + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-ignore": true + } + }, + "/moderate/image": { + "post": { + "operationId": "moderateImage", + "summary": "Analyze image", + "description": "(Deprecated \u2014 use https://api.moderationapi.com/v1/moderate) Analyze an image. Runs the same policy engine as POST /moderate; `labels` is approximated from the policies it ran and `texts` is no longer populated.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "channelKey": { + "description": "The key of the channel.", + "type": "string" + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "contextId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the image you want to analyze." + } + }, + "required": [ + "url" + ], + "description": "Input parameters for image moderation" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Success if the request was successful" + }, + "contentId": { + "description": "The ID of the content.", + "type": "string" + }, + "request": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "The timestamp of the request" + }, + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false, + "description": "Information about the request" + }, + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any models" + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "data_found": { + "type": "boolean", + "description": "Whether any entity matchers found data for the content" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "score": { + "type": "number" + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + }, + "description": "Legacy image labels, approximated from the equivalent policies. Use POST /moderate for the policy probabilities themselves." + } + }, + "required": [ + "status", + "request", + "flagged", + "author", + "data_found", + "labels" + ], + "additionalProperties": false + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-ignore": true + } + }, + "/account": { + "get": { + "operationId": "getAccount", + "summary": "Get account details", + "description": "Get account details", + "tags": [ + "Account" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Account details retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the account" + }, + "paid_plan_name": { + "type": "string", + "description": "Name of the paid plan" + }, + "text_api_quota": { + "type": "number", + "description": "Text API quota" + }, + "remaining_quota": { + "type": "number", + "description": "Remaining quota" + }, + "current_project": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the current project" + }, + "name": { + "type": "string", + "description": "Name of the current project" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "paid_plan_name", + "text_api_quota", + "remaining_quota" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "account", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get account details", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + } + }, + "/auth": { + "get": { + "operationId": "getAuth", + "tags": [ + "Account" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the authentication" + }, + "message": { + "type": "string", + "description": "Message of the authentication" + } + }, + "required": [ + "status", + "message" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-ignore": true + }, + "post": { + "operationId": "createAuth", + "tags": [ + "Account" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the authentication" + }, + "message": { + "type": "string", + "description": "Message of the authentication" + }, + "project": { + "type": "string", + "description": "Name of the authenticated project" + } + }, + "required": [ + "status", + "message", + "project" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-ignore": true + } + }, + "/wordlist": { + "get": { + "operationId": "listWordlists", + "summary": "List wordlists", + "description": "List the wordlists of the organization. The list is paginated.", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the wordlist" + }, + "name": { + "description": "Name of the wordlist", + "type": [ + "string", + "null" + ] + }, + "description": { + "description": "Description of the wordlist", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "When the wordlist was created", + "type": [ + "string", + "null" + ] + }, + "userId": { + "description": "User who created the wordlist", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "description", + "createdAt", + "userId" + ], + "additionalProperties": false + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List wordlists", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + } + }, + "/wordlist/{id}": { + "get": { + "operationId": "getWordlist", + "summary": "Get wordlist", + "description": "Get a specific wordlist by ID", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to get" + }, + "required": true, + "description": "ID of the wordlist to get" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the wordlist" + }, + "name": { + "anyOf": [ + { + "type": "string", + "description": "Name of the wordlist" + }, + { + "type": "null" + } + ] + }, + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Words in the wordlist" + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "type": "string", + "description": "ID of the organization" + }, + "userId": { + "anyOf": [ + { + "type": "string", + "description": "ID of the user" + }, + { + "type": "null" + } + ] + }, + "strict": { + "type": "boolean", + "description": "Strict mode" + } + }, + "required": [ + "id", + "name", + "words", + "createdAt", + "organizationId", + "userId", + "strict" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get wordlist", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateWordlist", + "summary": "Update wordlist", + "description": "Update a wordlist", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to update" + }, + "required": true, + "description": "ID of the wordlist to update" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "New name for the wordlist", + "type": "string" + }, + "key": { + "description": "New key for the wordlist", + "type": "string" + }, + "description": { + "description": "New description for the wordlist", + "type": "string" + }, + "words": { + "description": "New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored.", + "type": "array", + "items": { + "type": "string" + } + }, + "strict": { + "description": "Deprecated. Now using threshold in project settings.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Wordlist updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the wordlist" + }, + "name": { + "anyOf": [ + { + "type": "string", + "description": "Name of the wordlist" + }, + { + "type": "null" + } + ] + }, + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Words in the wordlist" + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "type": "string", + "description": "ID of the organization" + }, + "userId": { + "anyOf": [ + { + "type": "string", + "description": "ID of the user" + }, + { + "type": "null" + } + ] + }, + "strict": { + "type": "boolean", + "description": "Strict mode" + } + }, + "required": [ + "id", + "name", + "words", + "createdAt", + "organizationId", + "userId", + "strict" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update wordlist", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/wordlist/{id}/embedding-status": { + "get": { + "operationId": "getWordlistEmbeddingStatus", + "summary": "Get embedding status", + "description": "Get the current embedding progress status for a wordlist", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to check embedding status for" + }, + "required": true, + "description": "ID of the wordlist to check embedding status for" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "progress": { + "type": "number", + "description": "Percentage of words that have been embedded (0-100)" + }, + "totalWords": { + "type": "number", + "description": "Total number of words in the wordlist" + }, + "remainingWords": { + "type": "number", + "description": "Number of words still waiting to be embedded" + } + }, + "required": [ + "progress", + "totalWords", + "remainingWords" + ], + "additionalProperties": false, + "description": "Embedding status details" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist", + "x-speakeasy-name-override": "getEmbeddingStatus", + "x-speakeasy-mcp": { + "title": "Get embedding status", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + } + }, + "/wordlist/{id}/words": { + "post": { + "operationId": "addWordlistWords", + "summary": "Add words to wordlist", + "description": "Add words to an existing wordlist", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to add words to" + }, + "required": true, + "description": "ID of the wordlist to add words to" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of words to add to the wordlist. Duplicate words will be ignored." + } + }, + "required": [ + "words" + ] + }, + "example": { + "words": [ + "free money", + "click here" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Words successfully added to wordlist", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "addedCount": { + "type": "number", + "description": "Number of words added" + }, + "totalCount": { + "type": "number", + "description": "Total number of words in wordlist" + }, + "addedWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of words that were added" + } + }, + "required": [ + "addedCount", + "totalCount", + "addedWords" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist.words", + "x-speakeasy-name-override": "add", + "x-speakeasy-mcp": { + "title": "Add words to wordlist", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "removeWordlistWords", + "summary": "Remove words from wordlist", + "description": "Remove words from an existing wordlist", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to remove words from" + }, + "required": true, + "description": "ID of the wordlist to remove words from" + }, + { + "in": "query", + "name": "words", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of words to remove from the wordlist" + }, + "required": true, + "description": "Array of words to remove from the wordlist" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Words successfully removed from wordlist", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "removedCount": { + "type": "number", + "description": "Number of words removed" + }, + "totalCount": { + "type": "number", + "description": "Total number of words in wordlist" + }, + "removedWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of words removed" + } + }, + "required": [ + "removedCount", + "totalCount", + "removedWords" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist.words", + "x-speakeasy-name-override": "remove", + "x-speakeasy-mcp": { + "title": "Remove words from wordlist", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/moderate": { + "post": { + "operationId": "submitContent", + "summary": "Submit content", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Audio", + "title": "Audio" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string", + "description": "The key of the content node" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "description": "Values in the object. Can be mixed content types." + } + }, + "required": [ + "type", + "data" + ], + "description": "Object", + "title": "Object" + } + ], + "description": "The content sent for moderation", + "type": "object" + }, + "timestamp": { + "description": "Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time.", + "type": "number" + }, + "channel": { + "description": "Provide a channel ID or key. Will use the project's default channel if not provided.", + "type": "string" + }, + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "maxLength": 100 + }, + "metaType": { + "description": "The meta type of content being moderated", + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "conversationId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "clientAction": { + "description": "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.", + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "Your recommendation for the content: allow, review, or reject." + }, + "behavior": { + "description": "How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright.", + "type": "string", + "enum": [ + "override", + "escalate" + ] + }, + "source": { + "description": "Where your recommendation came from, e.g. \"banned-ip\".", + "type": "string", + "maxLength": 100 + }, + "reason": { + "description": "A human-readable explanation for your recommendation.", + "type": "string", + "maxLength": 500 + } + }, + "required": [ + "action" + ] + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "policies": { + "description": "(Enterprise) override the channel policies for this moderation request only.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "toxicity" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Toxicity" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "personal_information" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Personal Information" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "hate" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Hate" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_drugs" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Drugs" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_alcohol" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Alcohol" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_firearms" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Firearms" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_tobacco" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Tobacco" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_gambling" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Gambling" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "cannabis" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Cannabis" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "adult" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Adult" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "crypto" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Crypto" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Sexual" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual_minors" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Sexual Minors" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "profanity" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Profanity" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "violence" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Violence" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_harm" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Self Harm" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "spam" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Spam" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "low_quality" + }, + "minWords": { + "description": "Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting.", + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "flag", + "id" + ], + "title": "Low-quality content" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "face_detection" + }, + "comparator": { + "description": "Flag images that contain \"at least\" or \"fewer than\" the configured number of faces. Defaults to at_least.", + "type": "string", + "enum": [ + "at_least", + "fewer_than" + ] + }, + "count": { + "description": "Number of faces the comparator applies to. Defaults to 1, so the default rule flags any image containing a face.", + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "flag", + "id" + ], + "title": "Face detection" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_promotion" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Self Promotion" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "political" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Political" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "religion" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Religion" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "threat" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Threat" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual_solicitation" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Sexual Solicitation" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "channel_circumvent" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Channel Circumvention" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illegal_trade" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illegal Trade" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "alcohol" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Alcohol" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "drugs" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Drugs" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "gambling" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Gambling" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "tobacco" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Tobacco" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "weapons" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Weapons" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "promotion" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Promotion" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "extremism" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Extremism" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "code_abuse" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Code Abuse" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "unicode_spoofing" + }, + "signals": { + "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy.", + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "mixed_script", + "confusable_word", + "invisible", + "zalgo", + "illegal", + "encoding_damage" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + } + } + } + } + }, + "required": [ + "flag", + "id" + ], + "title": "Unicode Spoofing" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "pii" + }, + "entities": { + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "email", + "phone", + "url", + "address", + "name", + "username", + "ip_address", + "credit_card", + "sensitive_other" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "enable": { + "type": "boolean" + }, + "flag": { + "type": "boolean" + }, + "shouldMask": { + "type": "boolean" + }, + "mask": { + "type": "string" + } + }, + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "entities" + ], + "title": "PII Masking" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "url" + }, + "entities": { + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "email", + "phone", + "url", + "address", + "name", + "username", + "ip_address", + "credit_card", + "sensitive_other" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "enable": { + "type": "boolean" + }, + "flag": { + "type": "boolean" + }, + "shouldMask": { + "type": "boolean" + }, + "mask": { + "type": "string" + } + }, + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "entities" + ], + "title": "URL Masking" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "url_risk" + }, + "allowlistWordlistIds": { + "description": "IDs of wordlists whose entries are treated as allowed URL domains. Matches short-circuit the risk model and are never flagged.", + "type": "array", + "items": { + "type": "string" + } + }, + "blocklistWordlistIds": { + "description": "IDs of wordlists whose entries are treated as blocked URL domains. Matches short-circuit the risk model and are always flagged. Blocklists take precedence over allowlists.", + "type": "array", + "items": { + "type": "string" + } + }, + "flagLinkShorteners": { + "description": "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.", + "type": "boolean" + } + }, + "required": [ + "flag", + "id" + ], + "title": "URL Risk" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "guideline" + }, + "instructions": { + "type": "string" + }, + "guidelineKey": { + "type": "string" + } + }, + "required": [ + "flag", + "id", + "instructions", + "guidelineKey" + ], + "title": "Guideline" + } + ], + "type": "object" + } + } + }, + "required": [ + "content" + ] + }, + "example": { + "content": { + "type": "text", + "text": "Hey, check out my profile for a deal!" + }, + "contentId": "message-48213", + "authorId": "user-1092", + "conversationId": "room-general", + "metadata": { + "platform": "ios" + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier for the content. Either the contentId provided by you or an autogenerated ID." + }, + "masked": { + "type": "boolean", + "description": "Whether any values have been masked." + }, + "unicode_cleaned": { + "type": "boolean", + "description": "Whether Unicode spoofing normalization rewrote the content \u2014 confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped." + }, + "modified": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string", + "title": "Modified string content" + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "title": "Modified object content" + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "title": "Modified nested object content" + } + ] + }, + { + "type": "null" + } + ], + "description": "The modified content, if any." + }, + "transcript": { + "description": "The transcribed text from audio content. Only present when audio moderation is used and transcript inclusion is enabled on the channel.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "masked", + "unicode_cleaned", + "modified" + ], + "additionalProperties": false, + "description": "Potentially modified content." + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "evaluation": { + "type": "object", + "properties": { + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any policy." + }, + "flag_probability": { + "type": "number", + "description": "The probability that the content should be flagged." + }, + "severity_score": { + "type": "number", + "description": "The severity score of the content. A higher score indicates more severe content." + }, + "unicode_spoofed": { + "description": "Whether the content was flagged for Unicode spoofing.", + "type": "boolean" + }, + "shadow_flagged": { + "description": "Whether the content would have been flagged by analyze-only policies (flag: false).", + "type": "boolean" + } + }, + "required": [ + "flagged", + "flag_probability", + "severity_score" + ], + "additionalProperties": false, + "description": "The evaluation of the content after running the channel policies." + }, + "recommendation": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "The action to take based on the recommendation" + }, + "reason_codes": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string", + "enum": [ + "severity_reject", + "severity_review", + "author_block", + "dry_run", + "trusted_allow", + "untrusted_severity", + "rule_match", + "rule_default", + "rule_fallback", + "client_override", + "casebook_match" + ] + }, + { + "type": "string", + "pattern": "^rule:[\\s\\S]{0,}$" + } + ] + }, + "description": "Reason codes for the recommendation. Standard codes plus a `rule:` code identifying the rule that produced the action. Can be used to display a reason to the user." + }, + "matched_rules": { + "description": "Rules that matched during evaluation, if rules engine is active.", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "key", + "name" + ], + "additionalProperties": false + } + } + }, + "required": [ + "action", + "reason_codes" + ], + "additionalProperties": false, + "description": "The recommendation for the content based on the evaluation." + }, + "casebook": { + "anyOf": [ + { + "type": "object", + "properties": { + "verdict": { + "type": "string", + "enum": [ + "allow", + "reject" + ], + "description": "The ruling your past decisions point to for this content." + }, + "similarity": { + "type": "number", + "description": "How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided." + }, + "agreement": { + "type": "number", + "description": "How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned \u2014 below that the casebook reports a disagreement instead of picking a side \u2014 so it tells you how clean the consensus was, and is not a threshold to re-apply yourself." + }, + "confidence": { + "type": "number", + "description": "How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition." + }, + "case_count": { + "type": "number", + "description": "How many of your past cases backed this ruling." + }, + "topic": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The topic the closest matching case is filed under, or null when it has not been grouped into one yet." + } + }, + "required": [ + "verdict", + "similarity", + "agreement", + "confidence", + "case_count", + "topic" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "What your casebook \u2014 the record of your past moderation decisions \u2014 found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first." + }, + "policies": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier for the classifier output." + }, + "type": { + "type": "string", + "const": "classifier" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "flagged_fields": { + "description": "The keys of the flagged fields if submitting an object.", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "shadowFlagged": { + "type": "boolean" + } + }, + "required": [ + "id", + "probability", + "flagged" + ], + "additionalProperties": false + } + }, + "data": { + "description": "Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "id", + "type", + "probability", + "flagged" + ], + "additionalProperties": false, + "description": "Classifier policy.", + "title": "Classifier output" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "const": "entity_matcher" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "flagged_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "matches": { + "type": "array", + "items": { + "type": "object", + "properties": { + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "match": { + "type": "string" + }, + "span": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "integer" + } + }, + "reasons": { + "description": "Stable codes explaining why a URL was flagged (URL Risk only).", + "type": "array", + "items": { + "type": "string" + } + }, + "signals": { + "description": "Observable properties of a URL (URL Risk only). Absent for allow/block list matches.", + "type": "object", + "properties": { + "brand_impersonation": { + "anyOf": [ + { + "type": "object", + "properties": { + "brand": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "registered_domain_token", + "subdomain_token" + ] + } + }, + "required": [ + "brand", + "method" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "has_suspicious_characters": { + "type": "boolean" + }, + "is_link_shortener": { + "type": "boolean" + }, + "domain_age_days": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "has_email_setup": { + "type": [ + "boolean", + "null" + ] + }, + "redirect_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "final_url": { + "type": [ + "string", + "null" + ] + }, + "bot_protection": { + "type": [ + "boolean", + "null" + ] + }, + "is_reported": { + "type": "boolean" + } + }, + "required": [ + "brand_impersonation", + "has_suspicious_characters", + "is_link_shortener", + "domain_age_days", + "has_email_setup", + "redirect_count", + "final_url", + "bot_protection", + "is_reported" + ], + "additionalProperties": false + }, + "entity_type": { + "description": "Sub-type of the entity match \u2014 e.g. the NER key (email, phone, name, \u2026) for PII matches. Absent for URL Risk and wordlist matches where the type is already encoded in the parent label.", + "type": "string" + } + }, + "required": [ + "probability", + "match", + "span" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "type", + "probability", + "flagged", + "matches" + ], + "additionalProperties": false, + "description": "Entity matcher policy.", + "title": "Entity matcher output" + } + ], + "description": "Policy output schema.", + "type": "object" + }, + "description": "Results of all policies in the channel. Sorted by highest probability." + }, + "insights": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "sentiment" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "anyOf": [ + { + "type": "string", + "enum": [ + "positive", + "neutral", + "negative" + ] + }, + { + "type": "null" + } + ] + }, + "scores": { + "description": "Positive and negative scored independently: mixed content scores high on both. Present whenever `value` is set.", + "type": "object", + "properties": { + "positive": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "How positive the content is, 0 to 1." + }, + "negative": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "How negative the content is, 0 to 1." + } + }, + "required": [ + "positive", + "negative" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Sentiment insight", + "title": "Sentiment insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "language" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Language insight", + "title": "Language insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "curiosity" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "description": "Whether the content shows curiosity.", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Curiosity insight. Attempts to clarify or ask follow-up questions to better understand another person or idea.", + "title": "Curiosity insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "respect" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "description": "Whether the content shows respect.", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Respect insight. Shows deference or appreciation to others, or acknowledges the validity of another person.", + "title": "Respect insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "personal_story" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "description": "Whether the content shows personal story.", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Personal story insight. Includes a personal experience or story as a source of support for the statements made in the comment.", + "title": "Personal story insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "compassion" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "description": "Whether the content shows compassion.", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Compassion insight. Identifies with or shows concern, empathy, or support for the feelings/emotions of others.", + "title": "Compassion insight" + } + ], + "type": "object" + }, + "description": "Results of all insights enabled in the channel." + }, + "meta": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success", + "partial_success" + ] + }, + "timestamp": { + "type": "number" + }, + "channel_key": { + "type": "string", + "description": "The unique key of the channel where the content was handled. Either the channel provided by you or automatically routed." + }, + "usage": { + "type": "number" + }, + "processing_time": { + "type": "string" + } + }, + "required": [ + "status", + "timestamp", + "channel_key", + "usage" + ], + "additionalProperties": false, + "description": "Metadata about the moderation request" + }, + "errors": { + "description": "Policies that had errors", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "id", + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "content", + "author", + "evaluation", + "recommendation", + "casebook", + "policies", + "insights", + "meta" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "x-speakeasy-group": "content", + "x-speakeasy-name-override": "submit", + "x-speakeasy-usage-example": true, + "x-speakeasy-mcp": { + "title": "Submit content", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/projects": { + "get": { + "operationId": "listProjects", + "summary": "List projects", + "description": "List the projects in the organization. The list is paginated. Needs the `projects:read` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "Projects retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Project" + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List projects", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + }, + "post": { + "operationId": "createProject", + "summary": "Create a project", + "description": "Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 35, + "description": "The project's name." + }, + "domain": { + "description": "The website or app the project moderates content for. Used to write the context when none is given.", + "type": "string", + "maxLength": 255 + }, + "context": { + "description": "What the platform is and who uses it.", + "type": "string", + "maxLength": 2000 + }, + "brief": { + "description": "What you moderate, the problems you see and your guidelines.", + "type": "string", + "maxLength": 2000 + }, + "usedByMinors": { + "default": false, + "description": "Whether children use the platform.", + "type": "boolean" + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Project created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectWithKey" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create a project", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/projects/{id}": { + "get": { + "operationId": "getProject", + "summary": "Get a project", + "description": "Get a project by ID. Needs the `projects:read` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + } + ], + "responses": { + "200": { + "description": "Project retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get a project", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateProject", + "summary": "Update a project", + "description": "Update a project. Fields you leave out keep their value. Needs the `projects:write` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project to update." + }, + "required": true, + "description": "The ID of the project to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "The project's name.", + "type": "string", + "minLength": 1, + "maxLength": 75 + }, + "description": { + "description": "The project's description.", + "anyOf": [ + { + "type": "string", + "maxLength": 500 + }, + { + "type": "null" + } + ] + }, + "domain": { + "description": "The website or app the project moderates content for. Setting it on a project without context writes one.", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "context": { + "description": "What the platform is and who uses it.", + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ] + }, + "globalFlaggingMode": { + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates without flagging.", + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ] + }, + "enableRequestLogging": { + "description": "Whether moderated content is stored and shown in the dashboard.", + "type": "boolean" + }, + "casebookEnabled": { + "description": "Whether review queue decisions are recorded in the casebook.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Project updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update a project", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "deleteProject", + "summary": "Delete a project", + "description": "Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + } + ], + "responses": { + "200": { + "description": "Project deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the project was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the project." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete a project", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/projects/{id}/duplicate": { + "post": { + "operationId": "duplicateProject", + "summary": "Duplicate a project", + "description": "Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project to copy." + }, + "required": true, + "description": "The ID of the project to copy." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Name of the copy. Defaults to the original name with \"(copy)\".", + "type": "string", + "minLength": 1, + "maxLength": 75 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Project duplicated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectWithKey" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "projects", + "x-speakeasy-name-override": "duplicate", + "x-speakeasy-mcp": { + "title": "Duplicate a project", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/projects/{projectId}/channels": { + "get": { + "operationId": "listChannels", + "summary": "List channels", + "description": "List the channels in a project. The list is paginated. Needs the `channels:read` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + }, + { + "in": "query", + "name": "page", + "schema": { + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page. Maximum 100.", + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "Channels retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Channel" + }, + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List channels", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + }, + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "pageSize", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data", + "numPages": "$.pagination.totalPages" + } + } + }, + "post": { + "operationId": "createChannel", + "summary": "Create a channel", + "description": "Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string", + "description": "The ID of the project to add the channel to." + }, + "required": true, + "description": "The ID of the project to add the channel to." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "description": "The channel's name." + }, + "key": { + "description": "The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + }, + "description": { + "description": "The channel's description.", + "type": "string", + "maxLength": 500 + }, + "contentType": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Channel created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create a channel", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/channels/{id}": { + "get": { + "operationId": "getChannel", + "summary": "Get a channel", + "description": "Get a channel by ID. Needs the `channels:read` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel." + }, + "required": true, + "description": "The ID of the channel." + } + ], + "responses": { + "200": { + "description": "Channel retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "retrieve", + "x-speakeasy-mcp": { + "title": "Get a channel", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false + } + }, + "put": { + "operationId": "updateChannel", + "summary": "Update a channel", + "description": "Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel to update." + }, + "required": true, + "description": "The ID of the channel to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "The channel's name.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "key": { + "description": "The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + }, + "description": { + "description": "The channel's description.", + "anyOf": [ + { + "type": "string", + "maxLength": 500 + }, + { + "type": "null" + } + ] + }, + "contentType": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + }, + "flaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it." + }, + "contextEnabled": { + "type": "boolean", + "description": "Whether earlier messages in the conversation are read when moderating a message." + }, + "enableImageModeration": { + "type": "boolean", + "description": "Whether images are moderated." + }, + "enableVideoModeration": { + "type": "boolean", + "description": "Whether videos are moderated." + }, + "enableAudioModeration": { + "type": "boolean", + "description": "Whether audio is moderated." + }, + "enableVoiceModeration": { + "type": "boolean", + "description": "Whether real-time voice streams are moderated." + }, + "includeTranscriptInResponse": { + "type": "boolean", + "description": "Whether audio and video transcripts are returned in responses." + }, + "transcriptionQuality": { + "type": "string", + "enum": [ + "SPEED", + "BALANCED", + "ACCURACY" + ], + "description": "Trade-off between transcription speed and accuracy." + }, + "unicodeSpoofDetectionEnabled": { + "type": "boolean", + "description": "Whether look-alike Unicode characters are normalized before moderation." + }, + "frameCaptureInterval": { + "type": "number", + "minimum": 0.1, + "maximum": 60, + "description": "Seconds between frames captured from a video." + }, + "maxFramesPerVideo": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "description": "The most frames moderated per video." + }, + "spreadFrames": { + "type": "boolean", + "description": "Whether frames are spread evenly across the whole video." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Channel updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update a channel", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + }, + "delete": { + "operationId": "deleteChannel", + "summary": "Delete a channel", + "description": "Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel." + }, + "required": true, + "description": "The ID of the channel." + } + ], + "responses": { + "200": { + "description": "Channel deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the channel was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the channel." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete a channel", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/channels/{id}/duplicate": { + "post": { + "operationId": "duplicateChannel", + "summary": "Duplicate a channel", + "description": "Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel to copy." + }, + "required": true, + "description": "The ID of the channel to copy." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Name of the copy. Defaults to the original name with \"(copy)\".", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "key": { + "description": "Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Channel duplicated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "channels", + "x-speakeasy-name-override": "duplicate", + "x-speakeasy-mcp": { + "title": "Duplicate a channel", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/stream": { + "get": { + "tags": [ + "Voice" + ], + "summary": "Real-time voice moderation stream (WebSocket)", + "description": "Open a WebSocket to moderate live voice/call audio in real time. Speech is transcribed and each finalized utterance is moderated by your enabled text policies; you receive a verdict per utterance as it's spoken.\n\n**This is a WebSocket upgrade, not a regular HTTP call.** The request body below documents the frames you *send* over the socket; the `101` response documents the events you *receive*.\n\n- **Auth:** `Authorization: Bearer ` on the upgrade. A missing/invalid key closes `4401`; voice not enabled on the plan/channel closes `4403`.\n- **Subprotocol:** request `moderationapi.v1`.\n- **Flow:** send one `start` frame, then `media` frames as audio arrives, then `stop` (or disconnect). You receive `session.started`, `utterance.final` per utterance, optional `utterance.partial`/`warning`, and `session.ended`.\n- **Close codes:** `1000` normal \u00b7 `1011` server error \u00b7 `4400` bad request \u00b7 `4401` auth failed \u00b7 `4403` voice not enabled \u00b7 `4429` concurrency limit.\n\nSee the [Real-time voice guide](https://docs.moderationapi.com/content-moderation/real-time-voice) for the full walkthrough and code examples.", + "servers": [ + { + "url": "wss://voice.moderationapi.com/v1", + "description": "Voice streaming gateway" + } + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "required": true, + "description": "Bearer ", + "schema": { + "type": "string" + } + }, + { + "name": "Sec-WebSocket-Protocol", + "in": "header", + "required": true, + "description": "Requested subprotocol.", + "schema": { + "type": "string", + "enum": [ + "moderationapi.v1" + ] + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "description": "Frames sent by the client over the socket (not an HTTP body).", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/VoiceStartFrame" + }, + { + "$ref": "#/components/schemas/VoiceMediaFrame" + }, + { + "$ref": "#/components/schemas/VoiceStopFrame" + } + ], + "discriminator": { + "propertyName": "event" + } + } + } + } + }, + "responses": { + "101": { + "description": "Switching Protocols. The server then streams event frames over the socket; the key one is `utterance.final`.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/VoiceSessionStarted" + }, + { + "$ref": "#/components/schemas/VoiceUtteranceFinal" + }, + { + "$ref": "#/components/schemas/VoiceSessionEnded" + } + ], + "discriminator": { + "propertyName": "event" + } + } + } + } + } + }, + "x-webSocket": true, + "operationId": "streamVoice", + "x-speakeasy-ignore": true + } + } + }, + "components": { + "schemas": { + "PublicAuthor": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "last_incident": { + "description": "Timestamp of last incident", + "type": [ + "number", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "risk_evaluation": { + "anyOf": [ + { + "type": "object", + "properties": { + "risk_level": { + "description": "Calculated risk level based on more than 10 behavioral signals.", + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Risk assessment details, if available." + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "type": "number", + "description": "Total pieces of content" + }, + "flagged_content": { + "type": "number", + "description": "Number of flagged content pieces" + }, + "average_sentiment": { + "description": "Average sentiment score of content (-1 to 1). Requires a sentiment model in your project.", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "total_content", + "flagged_content" + ], + "additionalProperties": false + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "additionalProperties": false + }, + "Project": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the project." + }, + "name": { + "type": "string", + "description": "The project's name." + }, + "description": { + "description": "The project's description.", + "type": [ + "string", + "null" + ] + }, + "domain": { + "description": "The website or app the project moderates content for.", + "type": [ + "string", + "null" + ] + }, + "context": { + "description": "What the platform is and who uses it. AI moderation reads it to judge content in context.", + "type": [ + "string", + "null" + ] + }, + "globalFlaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup." + }, + "enableRequestLogging": { + "type": "boolean", + "description": "Whether moderated content is stored and shown in the dashboard." + }, + "casebookEnabled": { + "type": "boolean", + "description": "Whether decisions made in the review queue are recorded in the project's casebook." + }, + "createdAt": { + "description": "When the project was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the project was last changed.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "description", + "domain", + "context", + "globalFlaggingMode", + "enableRequestLogging", + "casebookEnabled", + "createdAt", + "updatedAt" + ], + "additionalProperties": false + }, + "ProjectWithKey": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the project." + }, + "name": { + "type": "string", + "description": "The project's name." + }, + "description": { + "description": "The project's description.", + "type": [ + "string", + "null" + ] + }, + "domain": { + "description": "The website or app the project moderates content for.", + "type": [ + "string", + "null" + ] + }, + "context": { + "description": "What the platform is and who uses it. AI moderation reads it to judge content in context.", + "type": [ + "string", + "null" + ] + }, + "globalFlaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup." + }, + "enableRequestLogging": { + "type": "boolean", + "description": "Whether moderated content is stored and shown in the dashboard." + }, + "casebookEnabled": { + "type": "boolean", + "description": "Whether decisions made in the review queue are recorded in the project's casebook." + }, + "createdAt": { + "description": "When the project was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the project was last changed.", + "type": "string" + }, + "secretKey": { + "type": "string", + "description": "A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings." + } + }, + "required": [ + "id", + "name", + "description", + "domain", + "context", + "globalFlaggingMode", + "enableRequestLogging", + "casebookEnabled", + "createdAt", + "updatedAt", + "secretKey" + ], + "additionalProperties": false + }, + "Channel": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the channel." + }, + "projectId": { + "type": "string", + "description": "The ID of the project the channel is in." + }, + "key": { + "type": "string", + "description": "The key you pass as `channel` when you moderate content. Unique in the project." + }, + "name": { + "type": "string", + "description": "The channel's name." + }, + "description": { + "description": "The channel's description.", + "type": [ + "string", + "null" + ] + }, + "isDefault": { + "type": "boolean", + "description": "Whether requests that name no channel use this one. Each project has one default channel." + }, + "contentType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + }, + { + "type": "null" + } + ] + }, + "flaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it." + }, + "contextEnabled": { + "type": "boolean", + "description": "Whether earlier messages in the conversation are read when moderating a message." + }, + "enableImageModeration": { + "type": "boolean", + "description": "Whether images are moderated." + }, + "enableVideoModeration": { + "type": "boolean", + "description": "Whether videos are moderated." + }, + "enableAudioModeration": { + "type": "boolean", + "description": "Whether audio is moderated." + }, + "enableVoiceModeration": { + "type": "boolean", + "description": "Whether real-time voice streams are moderated." + }, + "includeTranscriptInResponse": { + "type": "boolean", + "description": "Whether audio and video transcripts are returned in responses." + }, + "transcriptionQuality": { + "type": "string", + "enum": [ + "SPEED", + "BALANCED", + "ACCURACY" + ], + "description": "Trade-off between transcription speed and accuracy." + }, + "unicodeSpoofDetectionEnabled": { + "type": "boolean", + "description": "Whether look-alike Unicode characters are normalized before moderation." + }, + "frameCaptureInterval": { + "type": "number", + "minimum": 0.1, + "maximum": 60, + "description": "Seconds between frames captured from a video." + }, + "maxFramesPerVideo": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "description": "The most frames moderated per video." + }, + "spreadFrames": { + "type": "boolean", + "description": "Whether frames are spread evenly across the whole video." + }, + "createdAt": { + "description": "When the channel was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the channel was last changed.", + "type": "string" + } + }, + "required": [ + "id", + "projectId", + "key", + "name", + "description", + "isDefault", + "contentType", + "flaggingMode", + "contextEnabled", + "enableImageModeration", + "enableVideoModeration", + "enableAudioModeration", + "enableVoiceModeration", + "includeTranscriptInResponse", + "transcriptionQuality", + "unicodeSpoofDetectionEnabled", + "frameCaptureInterval", + "maxFramesPerVideo", + "spreadFrames", + "createdAt", + "updatedAt" + ], + "additionalProperties": false + }, + "AuthorBlockedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.blocked", + "description": "The event type.", + "example": "author.blocked" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.blocked", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_block_123", + "key": "block", + "name": "Block author", + "value": null, + "created_at": "2026-05-08T12:38:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "blocked", + "trust_level": { + "level": -1, + "manual": false + }, + "block": { + "until": null, + "reason": "Repeated spam violations" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "PublicActionPerformedAuthor": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Moderation action ID" + }, + "key": { + "description": "Customer-defined key identifying this action", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Display name of the action", + "type": [ + "string", + "null" + ] + }, + "value": { + "description": "The value passed to the action when it ran", + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the action was performed" + }, + "queue": { + "description": "The queue the item belongs to, if any", + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "author": { + "description": "The author the action was performed on", + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "id", + "key", + "name", + "value", + "created_at", + "author" + ], + "additionalProperties": false + }, + "AuthorUnblockedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.unblocked", + "description": "The event type.", + "example": "author.unblocked" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.unblocked", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_unblock_789", + "key": "auto_unblock", + "name": "Auto unblock", + "value": null, + "created_at": "2026-05-09T12:39:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 0, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "AuthorSuspendedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.suspended", + "description": "The event type.", + "example": "author.suspended" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.suspended", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_suspend_456", + "key": "suspend_24h", + "name": "Suspend (24h)", + "value": "24h", + "created_at": "2026-05-08T12:39:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "suspended", + "trust_level": { + "level": 0, + "manual": false + }, + "block": { + "until": 1746878400000, + "reason": "Cooling-off period" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "AuthorUpdatedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.updated", + "description": "The event type.", + "example": "author.updated" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.updated", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + }, + "AuthorTrustLevelChangedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.trust_level_changed", + "description": "The event type.", + "example": "author.trust_level_changed" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.trust_level_changed", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 3, + "manual": true + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + }, + "AuthorActionEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.action", + "description": "The event type.", + "example": "author.action" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.action", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_warn_111", + "key": "send_warning", + "name": "Send warning email", + "value": "violation_notice", + "created_at": "2026-05-08T12:42:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "QueueItemCompletedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.resolved", + "description": "The event type.", + "example": "queue_item.resolved" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicQueueItemEvent" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.resolved", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "item": { + "id": "item_xyz789", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } + ], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "blocked", + "trust_level": { + "level": -1, + "manual": false + }, + "block": { + "until": null, + "reason": "Repeated spam violations" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + }, + "queue": { + "id": "que_abc123" + } + } + } + } + }, + "PublicQueueItemEvent": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/PublicQueueItem" + }, + "author": { + "$ref": "#/components/schemas/PublicAuthor" + }, + "queue": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + }, + "required": [ + "item" + ], + "additionalProperties": false + }, + "PublicQueueItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Content ID from your system" + }, + "flagged": { + "description": "Whether the content was flagged by moderation", + "type": [ + "boolean", + "null" + ] + }, + "labels": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label name" + }, + "score": { + "type": "number", + "description": "Confidence score between 0 and 1" + }, + "manual": { + "description": "True if the label was applied manually by a moderator", + "type": "boolean" + }, + "flagged": { + "description": "Whether this label crossed its flagging threshold", + "type": "boolean" + }, + "shadow_flagged": { + "description": "Whether this label crossed its threshold under a shadowed policy \u2014 reported for visibility, never counted toward a flagging decision", + "type": "boolean" + }, + "matches": { + "type": "array", + "items": { + "type": "object", + "properties": { + "match": { + "type": "string", + "description": "The matched substring" + }, + "probability": { + "type": "number", + "description": "Match confidence between 0 and 1" + }, + "span": { + "type": "array", + "prefixItems": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "items": false, + "minItems": 2, + "maxItems": 2, + "description": "[start, end] character offsets in the source text" + }, + "mask": { + "type": [ + "string", + "null" + ] + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + }, + "signals": { + "type": "object", + "properties": { + "brand_impersonation": { + "anyOf": [ + { + "type": "object", + "properties": { + "brand": { + "type": "string" + }, + "method": { + "type": "string" + } + }, + "required": [ + "brand", + "method" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "has_suspicious_characters": { + "type": "boolean" + }, + "is_link_shortener": { + "type": "boolean" + }, + "domain_age_days": { + "type": [ + "number", + "null" + ] + }, + "has_email_setup": { + "type": [ + "boolean", + "null" + ] + }, + "redirect_count": { + "type": [ + "number", + "null" + ] + }, + "final_url": { + "type": [ + "string", + "null" + ] + }, + "bot_protection": { + "type": [ + "boolean", + "null" + ] + }, + "is_reported": { + "type": "boolean" + } + }, + "required": [ + "brand_impersonation", + "has_suspicious_characters", + "is_link_shortener", + "domain_age_days", + "has_email_setup", + "redirect_count", + "final_url", + "bot_protection", + "is_reported" + ], + "additionalProperties": false + }, + "entity_type": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "skeleton": { + "type": "string" + } + }, + "required": [ + "match", + "probability", + "span" + ], + "additionalProperties": false + } + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + } + }, + { + "type": "null" + } + ], + "description": "Moderation labels applied to the content" + }, + "flagged_fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "For object content, the field keys (e.g. \"bio\") that triggered a flag. Empty when no fields were flagged or the content is not an object." + }, + "language": { + "description": "Detected ISO language code, if available", + "type": [ + "string", + "null" + ] + }, + "content": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string", + "description": "The key of the content node" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "description": "Values in the object. Can be mixed content types." + } + }, + "required": [ + "type", + "data" + ], + "additionalProperties": false, + "description": "Object", + "title": "Object" + } + ], + "description": "The original content payload", + "type": "object" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the content was submitted" + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Arbitrary key/value metadata. Top-level keys are strings." + }, + { + "type": "null" + } + ], + "description": "Customer-supplied metadata attached to the content (same shape as the moderation API `metadata` input)." + }, + "client_action": { + "anyOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "Your recommendation for the content: allow, review, or reject." + }, + "behavior": { + "description": "How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright.", + "type": "string", + "enum": [ + "override", + "escalate" + ] + }, + "source": { + "description": "Where your recommendation came from, e.g. \"banned-ip\".", + "type": "string", + "maxLength": 100 + }, + "reason": { + "description": "A human-readable explanation for your recommendation.", + "type": "string", + "maxLength": 500 + } + }, + "required": [ + "action" + ], + "additionalProperties": false, + "description": "A recommendation from your own client-side flagging." + }, + { + "type": "null" + } + ], + "description": "The recommendation you submitted via the moderation API `clientAction` input, if any." + }, + "conversation_id": { + "description": "Conversation grouping ID, if any", + "type": [ + "string", + "null" + ] + }, + "author_id": { + "description": "External author ID (the customer's identifier, not Moderation API's internal id)", + "type": [ + "string", + "null" + ] + }, + "channel_key": { + "description": "The channel the content was submitted to, identified by your customer-defined channel key.", + "type": [ + "string", + "null" + ] + }, + "meta_type": { + "anyOf": [ + { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + }, + { + "type": "null" + } + ], + "description": "High-level content type (e.g. message, post, comment). Defaults to the channel's configured content type but can be overridden per request via the moderation API `type` field." + } + }, + "required": [ + "id", + "flagged", + "labels", + "flagged_fields", + "language", + "content", + "timestamp", + "metadata", + "client_action", + "conversation_id", + "author_id", + "channel_key", + "meta_type" + ], + "additionalProperties": false + }, + "QueueItemActionEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.action", + "description": "The event type.", + "example": "queue_item.action" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.action", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_99999", + "key": "shadow_ban", + "name": "Shadow ban", + "value": "24h", + "created_at": "2026-05-08T12:36:00.000Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz791", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } + ], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "PublicActionPerformed": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Moderation action ID" + }, + "key": { + "description": "Customer-defined key identifying this action", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Display name of the action", + "type": [ + "string", + "null" + ] + }, + "value": { + "description": "The value passed to the action when it ran", + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the action was performed" + }, + "queue": { + "description": "The queue the item belongs to, if any", + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "item": { + "description": "The content item the action was performed on, if any", + "$ref": "#/components/schemas/PublicQueueItem" + }, + "author": { + "description": "The author the action was performed on, if any", + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "id", + "key", + "name", + "value", + "created_at" + ], + "additionalProperties": false + }, + "QueueItemRejectedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.rejected", + "description": "The event type.", + "example": "queue_item.rejected" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.rejected", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_67890", + "key": "reject", + "name": "Reject", + "value": "spam", + "created_at": "2026-05-08T12:34:56.789Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz789", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } + ], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "QueueItemAllowedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.allowed", + "description": "The event type.", + "example": "queue_item.allowed" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.allowed", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_11111", + "key": "allow", + "name": "Allow", + "value": null, + "created_at": "2026-05-08T12:35:10.123Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz790", + "flagged": false, + "labels": [], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "WebhookEvent": { + "title": "WebhookEvent", + "description": "Discriminated union of every v2 webhook event. Switch on `type` to narrow to a specific event shape.", + "oneOf": [ + { + "$ref": "#/components/schemas/AuthorBlockedEvent" + }, + { + "$ref": "#/components/schemas/AuthorUnblockedEvent" + }, + { + "$ref": "#/components/schemas/AuthorSuspendedEvent" + }, + { + "$ref": "#/components/schemas/AuthorUpdatedEvent" + }, + { + "$ref": "#/components/schemas/AuthorTrustLevelChangedEvent" + }, + { + "$ref": "#/components/schemas/AuthorActionEvent" + }, + { + "$ref": "#/components/schemas/QueueItemCompletedEvent" + }, + { + "$ref": "#/components/schemas/QueueItemActionEvent" + }, + { + "$ref": "#/components/schemas/QueueItemRejectedEvent" + }, + { + "$ref": "#/components/schemas/QueueItemAllowedEvent" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "author.blocked": "#/components/schemas/AuthorBlockedEvent", + "author.unblocked": "#/components/schemas/AuthorUnblockedEvent", + "author.suspended": "#/components/schemas/AuthorSuspendedEvent", + "author.updated": "#/components/schemas/AuthorUpdatedEvent", + "author.trust_level_changed": "#/components/schemas/AuthorTrustLevelChangedEvent", + "author.action": "#/components/schemas/AuthorActionEvent", + "queue_item.resolved": "#/components/schemas/QueueItemCompletedEvent", + "queue_item.action": "#/components/schemas/QueueItemActionEvent", + "queue_item.rejected": "#/components/schemas/QueueItemRejectedEvent", + "queue_item.allowed": "#/components/schemas/QueueItemAllowedEvent" + } + } + }, + "VoiceStartFrame": { + "type": "object", + "description": "First frame the client sends. Declares the conversation, audio format, and tracks.", + "required": [ + "event", + "mediaFormat", + "tracks" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "start" + ] + }, + "conversationId": { + "type": "string", + "description": "Your external conversation id. Omit to have one generated and returned in `session.started`." + }, + "channel": { + "type": "string", + "description": "Optional. Selects which channel's policy configuration applies." + }, + "mediaFormat": { + "type": "object", + "required": [ + "encoding", + "sampleRate" + ], + "properties": { + "encoding": { + "type": "string", + "description": "audio/x-mulaw (PCMU), audio/x-alaw (PCMA), audio/l16 (linear16), or a common container (wav/mp3/ogg/flac).", + "example": "audio/x-mulaw" + }, + "sampleRate": { + "type": "integer", + "minimum": 8000, + "maximum": 48000, + "example": 8000 + } + } + }, + "tracks": { + "type": "array", + "description": "One or both tracks. Stream only the track(s) you have.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "authorId": { + "type": "string", + "description": "Your identifier for the speaker on this track." + } + } + } + }, + "emitPartials": { + "type": "boolean", + "default": false, + "description": "Set true to also receive interim, non-final transcripts." + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "description": "Arbitrary JSON attached to the conversation. Stored as-is and not interpreted by moderation." + } + } + }, + "VoiceMediaFrame": { + "type": "object", + "description": "Audio chunk for one track.", + "required": [ + "event", + "media" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "media" + ] + }, + "media": { + "type": "object", + "required": [ + "track", + "payload" + ], + "properties": { + "track": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "payload": { + "type": "string", + "description": "Base64-encoded audio in the declared format." + } + } + } + } + }, + "VoiceStopFrame": { + "type": "object", + "description": "Ends the call gracefully (or just disconnect).", + "required": [ + "event" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "stop" + ] + } + } + }, + "VoiceSessionStarted": { + "type": "object", + "description": "Sent after the start frame is accepted.", + "required": [ + "v", + "event", + "sessionId", + "tracks" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "session.started" + ] + }, + "conversationId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "tracks": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "VoiceUtteranceFinal": { + "type": "object", + "description": "A finalized utterance with its moderation result. The evaluation/recommendation/policies match the standard moderation response.", + "required": [ + "v", + "event", + "contentId", + "track", + "text", + "recommendation" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "utterance.final" + ] + }, + "conversationId": { + "type": "string" + }, + "contentId": { + "type": "string" + }, + "track": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "authorId": { + "type": "string" + }, + "text": { + "type": "string" + }, + "startMs": { + "type": "integer" + }, + "endMs": { + "type": "integer" + }, + "sttConfidence": { + "type": "number" + }, + "evaluation": { + "type": "object", + "additionalProperties": true + }, + "recommendation": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "allow", + "review", + "reject" + ] + } + } + }, + "policies": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "VoiceSessionEnded": { + "type": "object", + "description": "Sent when the call ends, with summary stats.", + "required": [ + "v", + "event", + "stats" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "session.ended" + ] + }, + "conversationId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "stats": { + "type": "object", + "properties": { + "durationMs": { + "type": "integer" + }, + "utterances": { + "type": "integer" + }, + "actions": { + "type": "object", + "properties": { + "allow": { + "type": "integer" + }, + "review": { + "type": "integer" + }, + "reject": { + "type": "integer" + } + } + } + } + } + } + }, + "Pagination": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "description": "The current page, starting at 1." + }, + "pageSize": { + "type": "integer", + "description": "Number of items per page." + }, + "total": { + "type": "integer", + "description": "Total number of items." + }, + "totalPages": { + "type": "integer", + "description": "Total number of pages." + }, + "hasMore": { + "type": "boolean", + "description": "Whether there is a next page." + } + }, + "required": [ + "page", + "pageSize", + "total", + "totalPages", + "hasMore" + ], + "additionalProperties": false, + "description": "Where this page is in the full list." + }, + "ErrorIssue": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "What is wrong." + }, + "path": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "description": "Location of the invalid field in the request body." + }, + "code": { + "type": "string", + "description": "Validation rule that failed." + } + }, + "required": [ + "message" + ] + }, + "BadRequestError": { + "type": "object", + "description": "The request is malformed or a parameter is invalid.", + "properties": { + "type": { + "type": "string", + "const": "invalid_request_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "invalid_request", + "project_id_required", + "validation_failed" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `invalid_request`: A parameter is invalid. `message` says which one.\n- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project.\n- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`.", + "example": "invalid_request" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Invalid input data" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "AuthenticationError": { + "type": "object", + "description": "The API key is missing, invalid or revoked.", + "properties": { + "type": { + "type": "string", + "const": "authentication_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "unauthorized", + "missing_api_key", + "malformed_api_key", + "invalid_api_key" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `unauthorized`: Authentication failed.\n- `missing_api_key`: No API key in the `Authorization` header.\n- `malformed_api_key`: The `Authorization` header does not contain a valid key format.\n- `invalid_api_key`: The API key does not exist or was revoked.", + "example": "unauthorized" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Authorization not provided" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "PermissionDeniedError": { + "type": "object", + "description": "The API key cannot do this, or the plan limit for this resource is reached.", + "properties": { + "type": { + "type": "string", + "const": "permission_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "permission_denied", + "account_disabled", + "quota_exceeded", + "plan_feature_unavailable", + "plan_limit_exceeded", + "organization_key_required", + "missing_key_permission", + "project_not_reachable" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `permission_denied`: The API key cannot perform this request.\n- `account_disabled`: The organization account is disabled.\n- `quota_exceeded`: The organization has used all API requests on its plan.\n- `plan_feature_unavailable`: The current plan does not include this feature.\n- `plan_limit_exceeded`: The request goes over a limit of the current plan.\n- `organization_key_required`: This endpoint needs an organization API key, but a project key was used.\n- `missing_key_permission`: The organization key does not have the permission this endpoint needs.\n- `project_not_reachable`: The organization key is limited to other projects.", + "example": "permission_denied" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Insufficient access" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "NotFoundError": { + "type": "object", + "description": "The resource does not exist or the key cannot see it.", + "properties": { + "type": { + "type": "string", + "const": "not_found_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "resource_not_found", + "action_not_found", + "author_not_found", + "queue_not_found", + "wordlist_not_found", + "webhook_not_found", + "project_not_found", + "channel_not_found" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `resource_not_found`: The resource does not exist.\n- `action_not_found`: The action does not exist.\n- `author_not_found`: The author does not exist.\n- `queue_not_found`: The review queue does not exist.\n- `wordlist_not_found`: The wordlist does not exist.\n- `webhook_not_found`: The webhook does not exist.\n- `project_not_found`: The project does not exist.\n- `channel_not_found`: The channel does not exist.", + "example": "resource_not_found" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Not found" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "ConflictError": { + "type": "object", + "description": "The request conflicts with the current state of a resource.", + "properties": { + "type": { + "type": "string", + "const": "conflict_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "resource_conflict" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `resource_conflict`: The request conflicts with an existing resource.", + "example": "resource_conflict" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Action with this key already exists" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "UnprocessableEntityError": { + "type": "object", + "description": "The request is valid JSON but cannot be processed.", + "properties": { + "type": { + "type": "string", + "const": "invalid_request_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "unprocessable_content" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `unprocessable_content`: The request is valid but cannot be processed.", + "example": "unprocessable_content" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Unprocessable content" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "RateLimitError": { + "type": "object", + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "properties": { + "type": { + "type": "string", + "const": "rate_limit_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "rate_limit_exceeded" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `rate_limit_exceeded`: Too many requests. Wait for the `Retry-After` seconds.", + "example": "rate_limit_exceeded" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Rate limit exceeded" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + }, + "InternalServerError": { + "type": "object", + "description": "Something went wrong on our side. Retry with backoff.", + "properties": { + "type": { + "type": "string", + "const": "api_error", + "description": "Broad error category. Stable; safe to switch on." + }, + "code": { + "type": "string", + "enum": [ + "internal_error" + ], + "x-speakeasy-unknown-values": "allow", + "description": "Exactly what went wrong. Stable; safe to branch on. New codes may be added.\n\n- `internal_error`: Something went wrong on our side. Retry with backoff.", + "example": "internal_error" + }, + "message": { + "type": "string", + "description": "Human-readable explanation.", + "example": "Internal server error" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorIssue" + }, + "description": "Validation problems, when the request body is invalid." + }, + "request_id": { + "type": "string", + "description": "Identifies this request. Include it when you contact support.", + "example": "h8fkz6kkzoa446ffve37atys" + }, + "doc_url": { + "type": "string", + "format": "uri", + "description": "Documentation for this `code`." + } + }, + "required": [ + "type", + "code", + "message", + "request_id", + "doc_url" + ] + } + }, + "securitySchemes": { + "Authorization": { + "type": "http", + "scheme": "bearer", + "x-speakeasy-name-override": "secretKey" + } + } + }, + "webhooks": { + "author.blocked": { + "post": { + "operationId": "authorBlocked", + "summary": "Author was permanently blocked", + "description": "Fired when an author transitions to the `blocked` status. The `data.object` is the action_performed record that drove the transition, with the author and triggering action nested as inline resources.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorBlockedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.unblocked": { + "post": { + "operationId": "authorUnblocked", + "summary": "Author was unblocked", + "description": "Fired when an author transitions back to the `enabled` status. May fire automatically when a temporary suspension expires (the auto-unblock worker runs the `AUTHOR_UNBLOCK` action).", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorUnblockedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.suspended": { + "post": { + "operationId": "authorSuspended", + "summary": "Author was temporarily suspended", + "description": "Fired when an author is suspended for a finite period. The `block.until` field on the nested author indicates when the suspension expires.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorSuspendedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.updated": { + "post": { + "operationId": "authorUpdated", + "summary": "Author profile or metadata changed", + "description": "Fired when public author fields (name, email, profile picture, metadata, etc.) change. Status transitions have their own dedicated events and do **not** trigger this.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorUpdatedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.trust_level_changed": { + "post": { + "operationId": "authorTrustLevelChanged", + "summary": "Author trust level transitioned", + "description": "Fired when an author's resolved trust level (manual override, falling back to computed) transitions to a new value. Does not fire for no-op recomputes.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorTrustLevelChangedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.action": { + "post": { + "operationId": "authorAction", + "summary": "A custom action was performed on an author", + "description": "Fired when an `AUTHOR_CUSTOM` moderation action runs against an author. Same shape as the lifecycle events (`author.blocked`, `author.suspended`, `author.unblocked`).", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorActionEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.resolved": { + "post": { + "operationId": "queueItemResolved", + "summary": "A queue item was resolved", + "description": "Fired when a moderator marks a queue item as resolved (checked off the queue).", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemCompletedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.action": { + "post": { + "operationId": "queueItemAction", + "summary": "A custom action was performed on a queue item", + "description": "Fired when a **custom** moderation action runs against a queue item. The `data.object` is the action_performed record with the related action, item, author, and queue nested as inline resources. Built-in actions (reject, allow) have dedicated events \u2014 see `queue_item.rejected` and `queue_item.allowed` instead.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemActionEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.rejected": { + "post": { + "operationId": "queueItemRejected", + "summary": "A queue item was rejected", + "description": "Fired when the built-in **reject** action runs against a queue item. Same shape as `queue_item.action`. Customers who want every action firing should subscribe to both this and the other built-in/custom events; subscribing only to `queue_item.action` no longer catches built-in events.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemRejectedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.allowed": { + "post": { + "operationId": "queueItemAllowed", + "summary": "A queue item was allowed", + "description": "Fired when the built-in **allow** action runs against a queue item. Same shape as `queue_item.action`. Customers who want every action firing should subscribe to both this and the other built-in/custom events.", + "tags": [ + "Webhooks" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemAllowedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + } + }, + "x-speakeasy-webhooks": { + "security": { + "type": "signature", + "headerName": "modapi-signature", + "signatureTextEncoding": "hex", + "algorithm": "hmac-sha256" + } + } +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9784d2b..6bceb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## 2.1.0 (2026-10-22) + +Full Changelog: [v2.0.0...v2.1.0](https://github.com/moderation-api/sdk-python/compare/v2.0.0...v2.1.0) + +### API changes + +- Update to the latest API spec. + +## 2.0.0 (2026-10-22) + +A new major version of the Python SDK. Read the breaking changes before you upgrade. + +```bash +pip install --upgrade "moderation_api>=2,<3" +``` + +### Python-specific changes + +- Requires Python 3.10 or later (was 3.9). +- Use the client as a context manager: `with ModerationAPI() as client:`. Every method has an `_async` version, for example `await client.content.submit_async(...)`. +- Methods take keyword arguments in snake_case, for example `client.content.submit(content={...}, author_id="user-123")`. +- Verify webhooks with `moderation_api.webhook_signature.construct_event(payload, signature)`. +### What's new + +- **Covers the whole API**, including the management API (`projects`, `channels`), wordlists and the review queue. +- **Automatic pagination.** List methods return an iterator that fetches the next page for you. +- **Clear errors.** One error class per HTTP status (`BadRequestError`, `NotFoundError`, `RateLimitError`, ...). Every error has a specific `code` (for example `invalid_api_key`, `quota_exceeded` or `author_not_found`), a `request_id` and a `doc_url`. See [Errors](https://docs.moderationapi.com/api-reference/errors). +- **Retries** with exponential backoff on `429` and `5xx`, and timeouts per client or per request. +- **Webhook verification** that reads the secret from `MODAPI_WEBHOOK_SECRET`. + +### Breaking changes + +The SDK is now generated from our OpenAPI spec with a new generator. Most calls keep their names, but check these: + +- **List responses** are `{ data, pagination }` instead of a plain array or a resource-specific shape, and list methods take `page` and `pageSize`. +- **Errors** have a new body: `code` is the specific error code, not the HTTP category. The old `data` field is gone. +- **Renamed:** `account.list` is now `account.retrieve`, and `actions.execute.execute` is now `actions.execute`. +- **Removed:** `actions.execute.executeByID` (use `actions.execute` with `actionId` or `actionKey`), `auth.*`, and `content.stream` (see [Real-time voice](https://docs.moderationapi.com/content-moderation/real-time-voice)). +- **Organization keys** work only with `projects` and `channels`; project keys work with everything else. Use one client per key. See the README. + +The license is unchanged: Apache-2.0. + ## 1.42.0 (2026-09-14) Full Changelog: [v1.41.0...v1.42.0](https://github.com/moderation-api/sdk-python/compare/v1.41.0...v1.42.0) diff --git a/README.md b/README.md index 5b6f333..e70f46d 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ Create the organization client only where you manage projects and channels, for ### [Content](docs/sdks/contentsdk/README.md) -* [submit](docs/sdks/contentsdk/README.md#submit) +* [submit](docs/sdks/contentsdk/README.md#submit) - Submit content ### [Projects](docs/sdks/projects/README.md) diff --git a/docs/errors/badrequesterror.md b/docs/errors/badrequesterror.md index 4e5610a..a90fb4f 100644 --- a/docs/errors/badrequesterror.md +++ b/docs/errors/badrequesterror.md @@ -5,11 +5,11 @@ The request is malformed or a parameter is invalid. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | *Literal["invalid_request_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | -| `code` | [models.BadRequestErrorCode](../models/badrequesterrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `invalid_request`: A parameter is invalid. `message` says which one.
- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. | invalid_request | -| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Invalid input data | -| `issues` | List[[models.ErrorIssue](../models/errorissue.md)] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | -| `request_id` | *str* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | -| `doc_url` | *str* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Literal["invalid_request_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [models.BadRequestErrorCode](../models/badrequesterrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `invalid_request`: A parameter is invalid. `message` says which one.
- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project.
- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. | invalid_request | +| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Invalid input data | +| `issues` | List[[models.ErrorIssue](../models/errorissue.md)] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *str* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *str* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file diff --git a/docs/errors/permissiondeniederror.md b/docs/errors/permissiondeniederror.md index a814db3..81bb452 100644 --- a/docs/errors/permissiondeniederror.md +++ b/docs/errors/permissiondeniederror.md @@ -5,11 +5,11 @@ The API key cannot do this, or the plan limit for this resource is reached. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `type` | *Literal["permission_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | -| `code` | [models.PermissionDeniedErrorCode](../models/permissiondeniederrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `permission_denied`: The API key cannot perform this request.
- `account_disabled`: The organization account is disabled.
- `quota_exceeded`: The organization has used all API requests on its plan.
- `plan_feature_unavailable`: The current plan does not include this feature.
- `plan_limit_exceeded`: The request goes over a limit of the current plan.
- `project_key_required`: This endpoint needs a project API key, but an organization key was used.
- `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
- `missing_key_permission`: The organization key does not have the permission this endpoint needs.
- `project_not_reachable`: The organization key is limited to other projects. | permission_denied | -| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Insufficient access | -| `issues` | List[[models.ErrorIssue](../models/errorissue.md)] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | -| `request_id` | *str* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | -| `doc_url` | *str* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Literal["permission_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [models.PermissionDeniedErrorCode](../models/permissiondeniederrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `permission_denied`: The API key cannot perform this request.
- `account_disabled`: The organization account is disabled.
- `quota_exceeded`: The organization has used all API requests on its plan.
- `plan_feature_unavailable`: The current plan does not include this feature.
- `plan_limit_exceeded`: The request goes over a limit of the current plan.
- `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
- `missing_key_permission`: The organization key does not have the permission this endpoint needs.
- `project_not_reachable`: The organization key is limited to other projects. | permission_denied | +| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Insufficient access | +| `issues` | List[[models.ErrorIssue](../models/errorissue.md)] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *str* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *str* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file diff --git a/docs/models/addwordlistwordsrequest.md b/docs/models/addwordlistwordsrequest.md index 0f25b77..a790814 100644 --- a/docs/models/addwordlistwordsrequest.md +++ b/docs/models/addwordlistwordsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to add words to | -| `body` | [models.AddWordlistWordsRequestBody](../models/addwordlistwordsrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to add words to | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.AddWordlistWordsRequestBody](../models/addwordlistwordsrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/badrequesterrorcode.md b/docs/models/badrequesterrorcode.md index 2511d6e..6d6f2eb 100644 --- a/docs/models/badrequesterrorcode.md +++ b/docs/models/badrequesterrorcode.md @@ -3,6 +3,7 @@ Exactly what went wrong. Stable; safe to branch on. New codes may be added. - `invalid_request`: A parameter is invalid. `message` says which one. +- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project. - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. ## Example Usage @@ -20,4 +21,5 @@ value: BadRequestErrorCode = "invalid_request" This is an open enum. Unrecognized values will not fail type checks. - `"invalid_request"` +- `"project_id_required"` - `"validation_failed"` diff --git a/docs/models/createactionrequest.md b/docs/models/createactionrequest.md index c7e0d37..fe4debe 100644 --- a/docs/models/createactionrequest.md +++ b/docs/models/createactionrequest.md @@ -3,16 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | -| `name` | *str* | :heavy_check_mark: | The name of the action. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | -| `type` | [OptionalNullable[models.CreateActionTypeRequest]](../models/createactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | -| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | -| `queue_behaviour` | [Optional[models.CreateActionQueueBehaviourRequest]](../models/createactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | -| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | -| `position` | [Optional[models.CreateActionPositionRequest]](../models/createactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | -| `possible_values` | List[[models.CreateActionPossibleValueRequest](../models/createactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | -| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | -| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.CreateActionRequestBody](../models/createactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createactionrequestbody.md b/docs/models/createactionrequestbody.md new file mode 100644 index 0000000..3f1559f --- /dev/null +++ b/docs/models/createactionrequestbody.md @@ -0,0 +1,18 @@ +# CreateActionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | +| `name` | *str* | :heavy_check_mark: | The name of the action. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | +| `type` | [OptionalNullable[models.CreateActionTypeRequest]](../models/createactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [Optional[models.CreateActionQueueBehaviourRequest]](../models/createactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | +| `position` | [Optional[models.CreateActionPositionRequest]](../models/createactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | List[[models.CreateActionPossibleValueRequest](../models/createactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/createauthorrequest.md b/docs/models/createauthorrequest.md index eaffa5e..fe82824 100644 --- a/docs/models/createauthorrequest.md +++ b/docs/models/createauthorrequest.md @@ -3,15 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | -| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | -| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | -| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | -| `metadata` | [Optional[models.CreateAuthorMetadata]](../models/createauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | -| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | -| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | -| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `external_id` | *str* | :heavy_check_mark: | External ID of the user, typically the ID of the author in your database. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.CreateAuthorRequestBody](../models/createauthorrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createauthorrequestbody.md b/docs/models/createauthorrequestbody.md new file mode 100644 index 0000000..94ce6b2 --- /dev/null +++ b/docs/models/createauthorrequestbody.md @@ -0,0 +1,17 @@ +# CreateAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | +| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | +| `metadata` | [Optional[models.CreateAuthorMetadata]](../models/createauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | +| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | +| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | +| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `external_id` | *str* | :heavy_check_mark: | External ID of the user, typically the ID of the author in your database. | \ No newline at end of file diff --git a/docs/models/createwebhookrequest.md b/docs/models/createwebhookrequest.md index e9ef743..f27a707 100644 --- a/docs/models/createwebhookrequest.md +++ b/docs/models/createwebhookrequest.md @@ -3,9 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `name` | *str* | :heavy_check_mark: | The webhook's name, used to identify it in the dashboard | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | -| `url` | *str* | :heavy_check_mark: | The webhook's URL. We'll call this URL when an event occurs. | -| `event_types` | List[[models.CreateWebhookEventTypeRequest](../models/createwebhookeventtyperequest.md)] | :heavy_check_mark: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.CreateWebhookRequestBody](../models/createwebhookrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createwebhookrequestbody.md b/docs/models/createwebhookrequestbody.md new file mode 100644 index 0000000..9fc1c3c --- /dev/null +++ b/docs/models/createwebhookrequestbody.md @@ -0,0 +1,11 @@ +# CreateWebhookRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | The webhook's name, used to identify it in the dashboard | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | +| `url` | *str* | :heavy_check_mark: | The webhook's URL. We'll call this URL when an event occurs. | +| `event_types` | List[[models.CreateWebhookEventTypeRequest](../models/createwebhookeventtyperequest.md)] | :heavy_check_mark: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | \ No newline at end of file diff --git a/docs/models/deleteactionrequest.md b/docs/models/deleteactionrequest.md index a3584c5..d93ca0a 100644 --- a/docs/models/deleteactionrequest.md +++ b/docs/models/deleteactionrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to delete. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to delete. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/deleteauthorrequest.md b/docs/models/deleteauthorrequest.md index 14a1c85..b157a10 100644 --- a/docs/models/deleteauthorrequest.md +++ b/docs/models/deleteauthorrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/deletewebhookrequest.md b/docs/models/deletewebhookrequest.md index d3581f1..a696f83 100644 --- a/docs/models/deletewebhookrequest.md +++ b/docs/models/deletewebhookrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to delete. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to delete. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/executeactionrequest.md b/docs/models/executeactionrequest.md index 5feba6d..21db116 100644 --- a/docs/models/executeactionrequest.md +++ b/docs/models/executeactionrequest.md @@ -1,15 +1,9 @@ # ExecuteActionRequest -Input parameters - ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `action_key` | *str* | :heavy_check_mark: | ID or key of the action to execute | -| `content_ids` | List[*str*] | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | -| `author_ids` | List[*str*] | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | -| `value` | *Optional[str]* | :heavy_minus_sign: | Optional value to provide with the action | -| `queue_id` | *Optional[str]* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | -| `duration` | *Optional[float]* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.ExecuteActionRequestBody](../models/executeactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/executeactionrequestbody.md b/docs/models/executeactionrequestbody.md new file mode 100644 index 0000000..f95f87a --- /dev/null +++ b/docs/models/executeactionrequestbody.md @@ -0,0 +1,15 @@ +# ExecuteActionRequestBody + +Input parameters + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `action_key` | *str* | :heavy_check_mark: | ID or key of the action to execute | +| `content_ids` | List[*str*] | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | +| `author_ids` | List[*str*] | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | +| `value` | *Optional[str]* | :heavy_minus_sign: | Optional value to provide with the action | +| `queue_id` | *Optional[str]* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | +| `duration` | *Optional[float]* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | \ No newline at end of file diff --git a/docs/models/getaccountrequest.md b/docs/models/getaccountrequest.md new file mode 100644 index 0000000..f9607c0 --- /dev/null +++ b/docs/models/getaccountrequest.md @@ -0,0 +1,8 @@ +# GetAccountRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getactionrequest.md b/docs/models/getactionrequest.md index ff92c80..0a6a6df 100644 --- a/docs/models/getactionrequest.md +++ b/docs/models/getactionrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to get. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to get. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getauthorrequest.md b/docs/models/getauthorrequest.md index 79475c0..8bf053e 100644 --- a/docs/models/getauthorrequest.md +++ b/docs/models/getauthorrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getqueuerequest.md b/docs/models/getqueuerequest.md index bad6034..c23c1b9 100644 --- a/docs/models/getqueuerequest.md +++ b/docs/models/getqueuerequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *str* | :heavy_check_mark: | The queue ID | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getqueuestatsrequest.md b/docs/models/getqueuestatsrequest.md index 03b9f05..4e0fe04 100644 --- a/docs/models/getqueuestatsrequest.md +++ b/docs/models/getqueuestatsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `within_days` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `within_days` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getwebhookrequest.md b/docs/models/getwebhookrequest.md index 77553c0..3872a90 100644 --- a/docs/models/getwebhookrequest.md +++ b/docs/models/getwebhookrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to get. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to get. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getwebhooksecretrequest.md b/docs/models/getwebhooksecretrequest.md new file mode 100644 index 0000000..23cddfb --- /dev/null +++ b/docs/models/getwebhooksecretrequest.md @@ -0,0 +1,8 @@ +# GetWebhookSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getwordlistembeddingstatusrequest.md b/docs/models/getwordlistembeddingstatusrequest.md index 75064a2..98ffd59 100644 --- a/docs/models/getwordlistembeddingstatusrequest.md +++ b/docs/models/getwordlistembeddingstatusrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to check embedding status for | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to check embedding status for | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getwordlistrequest.md b/docs/models/getwordlistrequest.md index af605a0..227adc7 100644 --- a/docs/models/getwordlistrequest.md +++ b/docs/models/getwordlistrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to get | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to get | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listactionsrequest.md b/docs/models/listactionsrequest.md index 3a4eb16..21f188c 100644 --- a/docs/models/listactionsrequest.md +++ b/docs/models/listactionsrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `queue_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `queue_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listauthorsrequest.md b/docs/models/listauthorsrequest.md index af86db3..6fbf789 100644 --- a/docs/models/listauthorsrequest.md +++ b/docs/models/listauthorsrequest.md @@ -3,12 +3,13 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `sort_by` | [Optional[models.SortBy]](../models/sortby.md) | :heavy_minus_sign: | N/A | -| `sort_direction` | [Optional[models.ListAuthorsSortDirection]](../models/listauthorssortdirection.md) | :heavy_minus_sign: | Sort direction | -| `member_since_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `last_active_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `content_types` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `sort_by` | [Optional[models.SortBy]](../models/sortby.md) | :heavy_minus_sign: | N/A | +| `sort_direction` | [Optional[models.ListAuthorsSortDirection]](../models/listauthorssortdirection.md) | :heavy_minus_sign: | Sort direction | +| `member_since_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `last_active_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `content_types` | List[*str*] | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listqueueitemsrequest.md b/docs/models/listqueueitemsrequest.md index 60fa671..f00198f 100644 --- a/docs/models/listqueueitemsrequest.md +++ b/docs/models/listqueueitemsrequest.md @@ -3,17 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `sort_field` | [Optional[models.SortField]](../models/sortfield.md) | :heavy_minus_sign: | N/A | -| `sort_direction` | [Optional[models.ListQueueItemsSortDirection]](../models/listqueueitemssortdirection.md) | :heavy_minus_sign: | Sort direction | -| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `labels` | List[*str*] | :heavy_minus_sign: | N/A | -| `after_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `before_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `filtered_action_ids` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `sort_field` | [Optional[models.SortField]](../models/sortfield.md) | :heavy_minus_sign: | N/A | +| `sort_direction` | [Optional[models.ListQueueItemsSortDirection]](../models/listqueueitemssortdirection.md) | :heavy_minus_sign: | Sort direction | +| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | N/A | +| `after_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `before_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listwebhooksrequest.md b/docs/models/listwebhooksrequest.md index f72c4f1..7f580a8 100644 --- a/docs/models/listwebhooksrequest.md +++ b/docs/models/listwebhooksrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listwordlistsrequest.md b/docs/models/listwordlistsrequest.md index a63caee..f9a69e4 100644 --- a/docs/models/listwordlistsrequest.md +++ b/docs/models/listwordlistsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/permissiondeniederrorcode.md b/docs/models/permissiondeniederrorcode.md index 7136670..802416b 100644 --- a/docs/models/permissiondeniederrorcode.md +++ b/docs/models/permissiondeniederrorcode.md @@ -7,7 +7,6 @@ Exactly what went wrong. Stable; safe to branch on. New codes may be added. - `quota_exceeded`: The organization has used all API requests on its plan. - `plan_feature_unavailable`: The current plan does not include this feature. - `plan_limit_exceeded`: The request goes over a limit of the current plan. -- `project_key_required`: This endpoint needs a project API key, but an organization key was used. - `organization_key_required`: This endpoint needs an organization API key, but a project key was used. - `missing_key_permission`: The organization key does not have the permission this endpoint needs. - `project_not_reachable`: The organization key is limited to other projects. @@ -31,7 +30,6 @@ This is an open enum. Unrecognized values will not fail type checks. - `"quota_exceeded"` - `"plan_feature_unavailable"` - `"plan_limit_exceeded"` -- `"project_key_required"` - `"organization_key_required"` - `"missing_key_permission"` - `"project_not_reachable"` diff --git a/docs/models/removewordlistwordsrequest.md b/docs/models/removewordlistwordsrequest.md index 6d4cfe6..dbe27f0 100644 --- a/docs/models/removewordlistwordsrequest.md +++ b/docs/models/removewordlistwordsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to remove words from | -| `words` | List[*str*] | :heavy_check_mark: | Array of words to remove from the wordlist | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | List[*str*] | :heavy_check_mark: | Array of words to remove from the wordlist | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/resolvequeueitemrequest.md b/docs/models/resolvequeueitemrequest.md index 06db45e..1482340 100644 --- a/docs/models/resolvequeueitemrequest.md +++ b/docs/models/resolvequeueitemrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `item_id` | *str* | :heavy_check_mark: | The item ID to resolve | -| `body` | [models.ResolveQueueItemRequestBody](../models/resolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `item_id` | *str* | :heavy_check_mark: | The item ID to resolve | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.ResolveQueueItemRequestBody](../models/resolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/submitcontentrequest.md b/docs/models/submitcontentrequest.md index 20b0139..0b7d63d 100644 --- a/docs/models/submitcontentrequest.md +++ b/docs/models/submitcontentrequest.md @@ -3,16 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [models.ContentRequest](../models/contentrequest.md) | :heavy_check_mark: | The content sent for moderation | -| `timestamp` | *Optional[float]* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | -| `channel` | *Optional[str]* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | -| `content_id` | *Optional[str]* | :heavy_minus_sign: | The unique ID of the content in your database. | -| `meta_type` | [Optional[models.SubmitContentMetaType]](../models/submitcontentmetatype.md) | :heavy_minus_sign: | The meta type of content being moderated | -| `author_id` | *Optional[str]* | :heavy_minus_sign: | The author of the content. | -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | For example the ID of a chat room or a post | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Any metadata you want to store with the content | -| `client_action` | [Optional[models.SubmitContentClientAction]](../models/submitcontentclientaction.md) | :heavy_minus_sign: | 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. | -| `do_not_store` | *Optional[bool]* | :heavy_minus_sign: | Do not store the content. The content won't enter the review queue | -| `policies` | List[[models.PolicyRequest](../models/policyrequest.md)] | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.SubmitContentRequestBody](../models/submitcontentrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/submitcontentrequestbody.md b/docs/models/submitcontentrequestbody.md new file mode 100644 index 0000000..d6f65e4 --- /dev/null +++ b/docs/models/submitcontentrequestbody.md @@ -0,0 +1,18 @@ +# SubmitContentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [models.ContentRequest](../models/contentrequest.md) | :heavy_check_mark: | The content sent for moderation | +| `timestamp` | *Optional[float]* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | +| `content_id` | *Optional[str]* | :heavy_minus_sign: | The unique ID of the content in your database. | +| `meta_type` | [Optional[models.SubmitContentMetaType]](../models/submitcontentmetatype.md) | :heavy_minus_sign: | The meta type of content being moderated | +| `author_id` | *Optional[str]* | :heavy_minus_sign: | The author of the content. | +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | For example the ID of a chat room or a post | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Any metadata you want to store with the content | +| `client_action` | [Optional[models.SubmitContentClientAction]](../models/submitcontentclientaction.md) | :heavy_minus_sign: | 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. | +| `do_not_store` | *Optional[bool]* | :heavy_minus_sign: | Do not store the content. The content won't enter the review queue | +| `policies` | List[[models.PolicyRequest](../models/policyrequest.md)] | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | \ No newline at end of file diff --git a/docs/models/unresolvequeueitemrequest.md b/docs/models/unresolvequeueitemrequest.md index 5d38e4d..b3a0e3b 100644 --- a/docs/models/unresolvequeueitemrequest.md +++ b/docs/models/unresolvequeueitemrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `item_id` | *str* | :heavy_check_mark: | The item ID to unresolve | -| `body` | [models.UnresolveQueueItemRequestBody](../models/unresolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `item_id` | *str* | :heavy_check_mark: | The item ID to unresolve | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.UnresolveQueueItemRequestBody](../models/unresolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateactionrequest.md b/docs/models/updateactionrequest.md index ffb7a86..690ab2a 100644 --- a/docs/models/updateactionrequest.md +++ b/docs/models/updateactionrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to update. | -| `body` | [models.UpdateActionRequestBody](../models/updateactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to update. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.UpdateActionRequestBody](../models/updateactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateauthorrequest.md b/docs/models/updateauthorrequest.md index 06fa54e..a3bf2c9 100644 --- a/docs/models/updateauthorrequest.md +++ b/docs/models/updateauthorrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `body` | [models.UpdateAuthorRequestBody](../models/updateauthorrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.UpdateAuthorRequestBody](../models/updateauthorrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatewebhookrequest.md b/docs/models/updatewebhookrequest.md index 6d184d2..bfdc84a 100644 --- a/docs/models/updatewebhookrequest.md +++ b/docs/models/updatewebhookrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to update. | -| `body` | [models.UpdateWebhookRequestBody](../models/updatewebhookrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to update. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.UpdateWebhookRequestBody](../models/updatewebhookrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatewordlistrequest.md b/docs/models/updatewordlistrequest.md index f27528d..41f281f 100644 --- a/docs/models/updatewordlistrequest.md +++ b/docs/models/updatewordlistrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to update | -| `body` | [models.UpdateWordlistRequestBody](../models/updatewordlistrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to update | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `body` | [models.UpdateWordlistRequestBody](../models/updatewordlistrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/account/README.md b/docs/sdks/account/README.md index aa86408..a39f4f8 100644 --- a/docs/sdks/account/README.md +++ b/docs/sdks/account/README.md @@ -31,9 +31,10 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/actions/README.md b/docs/sdks/actions/README.md index b79e070..baf82d7 100644 --- a/docs/sdks/actions/README.md +++ b/docs/sdks/actions/README.md @@ -38,12 +38,13 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `queue_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `queue_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -86,20 +87,21 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name of the action. | -| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | -| `type` | [OptionalNullable[models.CreateActionTypeRequest]](../../models/createactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | -| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | -| `queue_behaviour` | [Optional[models.CreateActionQueueBehaviourRequest]](../../models/createactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | -| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | -| `position` | [Optional[models.CreateActionPositionRequest]](../../models/createactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | -| `possible_values` | List[[models.CreateActionPossibleValueRequest](../../models/createactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | -| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | -| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the action. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | +| `type` | [OptionalNullable[models.CreateActionTypeRequest]](../../models/createactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [Optional[models.CreateActionQueueBehaviourRequest]](../../models/createactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | +| `position` | [Optional[models.CreateActionPositionRequest]](../../models/createactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | List[[models.CreateActionPossibleValueRequest](../../models/createactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -140,10 +142,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to get. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to get. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -184,21 +187,22 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to update. | -| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | -| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the action. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | -| `type` | [OptionalNullable[models.UpdateActionTypeRequest]](../../models/updateactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | -| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | -| `queue_behaviour` | [Optional[models.UpdateActionQueueBehaviourRequest]](../../models/updateactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | -| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | -| `position` | [Optional[models.UpdateActionPositionRequest]](../../models/updateactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | -| `possible_values` | List[[models.UpdateActionPossibleValueRequest](../../models/updateactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | -| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | -| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to update. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined key of the action. | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the action. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the action. | +| `type` | [OptionalNullable[models.UpdateActionTypeRequest]](../../models/updateactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [Optional[models.UpdateActionQueueBehaviourRequest]](../../models/updateactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | List[*str*] | :heavy_minus_sign: | The IDs of the queues the action is available in. | +| `position` | [Optional[models.UpdateActionPositionRequest]](../../models/updateactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | List[[models.UpdateActionPossibleValueRequest](../../models/updateactionpossiblevaluerequest.md)] | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *Optional[bool]* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *Optional[bool]* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -240,10 +244,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the action to delete. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the action to delete. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -286,15 +291,16 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `action_key` | *str* | :heavy_check_mark: | ID or key of the action to execute | -| `content_ids` | List[*str*] | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | -| `author_ids` | List[*str*] | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | -| `value` | *Optional[str]* | :heavy_minus_sign: | Optional value to provide with the action | -| `queue_id` | *Optional[str]* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | -| `duration` | *Optional[float]* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `action_key` | *str* | :heavy_check_mark: | ID or key of the action to execute | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `content_ids` | List[*str*] | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | +| `author_ids` | List[*str*] | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | +| `value` | *Optional[str]* | :heavy_minus_sign: | Optional value to provide with the action | +| `queue_id` | *Optional[str]* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | +| `duration` | *Optional[float]* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/authors/README.md b/docs/sdks/authors/README.md index 6b87903..881a732 100644 --- a/docs/sdks/authors/README.md +++ b/docs/sdks/authors/README.md @@ -86,19 +86,20 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `external_id` | *str* | :heavy_check_mark: | External ID of the user, typically the ID of the author in your database. | -| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | -| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | -| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | -| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | -| `metadata` | [Optional[models.CreateAuthorMetadata]](../../models/createauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | -| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | -| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | -| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `external_id` | *str* | :heavy_check_mark: | External ID of the user, typically the ID of the author in your database. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | +| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | +| `metadata` | [Optional[models.CreateAuthorMetadata]](../../models/createauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | +| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | +| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | +| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -140,10 +141,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -188,19 +190,20 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | -| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | -| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | -| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | -| `metadata` | [Optional[models.UpdateAuthorMetadata]](../../models/updateauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | -| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | -| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | -| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `profile_picture` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Author name or identifier | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Author email address | +| `company` | *OptionalNullable[str]* | :heavy_minus_sign: | The author's company or organization | +| `metadata` | [Optional[models.UpdateAuthorMetadata]](../../models/updateauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | +| `first_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp when author first appeared | +| `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp of last activity | +| `manual_trust_level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -243,10 +246,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/contentsdk/README.md b/docs/sdks/contentsdk/README.md index 3526843..b19f6c9 100644 --- a/docs/sdks/contentsdk/README.md +++ b/docs/sdks/contentsdk/README.md @@ -4,10 +4,12 @@ ### Available Operations -* [submit](#submit) +* [submit](#submit) - Submit content ## submit +Submit content + ### Example Usage @@ -37,6 +39,7 @@ with ModerationAPI( | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `content` | [models.ContentRequest](../../models/contentrequest.md) | :heavy_check_mark: | The content sent for moderation | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | | `timestamp` | *Optional[float]* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | | `channel` | *Optional[str]* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | | `content_id` | *Optional[str]* | :heavy_minus_sign: | The unique ID of the content in your database. | diff --git a/docs/sdks/items/README.md b/docs/sdks/items/README.md index b32d8e2..bf242aa 100644 --- a/docs/sdks/items/README.md +++ b/docs/sdks/items/README.md @@ -35,21 +35,22 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `sort_field` | [Optional[models.SortField]](../../models/sortfield.md) | :heavy_minus_sign: | N/A | -| `sort_direction` | [Optional[models.ListQueueItemsSortDirection]](../../models/listqueueitemssortdirection.md) | :heavy_minus_sign: | Sort direction | -| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `labels` | List[*str*] | :heavy_minus_sign: | N/A | -| `after_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `before_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `filtered_action_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `sort_field` | [Optional[models.SortField]](../../models/sortfield.md) | :heavy_minus_sign: | N/A | +| `sort_direction` | [Optional[models.ListQueueItemsSortDirection]](../../models/listqueueitemssortdirection.md) | :heavy_minus_sign: | Sort direction | +| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | N/A | +| `after_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `before_date` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -92,12 +93,13 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `item_id` | *str* | :heavy_check_mark: | The item ID to resolve | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional comment | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `item_id` | *str* | :heavy_check_mark: | The item ID to resolve | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional comment | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -139,12 +141,13 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `item_id` | *str* | :heavy_check_mark: | The item ID to unresolve | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional reason for unresolving the item | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `item_id` | *str* | :heavy_check_mark: | The item ID to unresolve | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional reason for unresolving the item | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/queuesdk/README.md b/docs/sdks/queuesdk/README.md index 2bdacfd..e129804 100644 --- a/docs/sdks/queuesdk/README.md +++ b/docs/sdks/queuesdk/README.md @@ -32,10 +32,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -78,11 +79,12 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The queue ID | -| `within_days` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID | +| `within_days` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 9998a49..6b82957 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -37,11 +37,12 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -83,13 +84,14 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The webhook's name, used to identify it in the dashboard | -| `url` | *str* | :heavy_check_mark: | The webhook's URL. We'll call this URL when an event occurs. | -| `event_types` | List[[models.CreateWebhookEventTypeRequest](../../models/createwebhookeventtyperequest.md)] | :heavy_check_mark: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The webhook's name, used to identify it in the dashboard | +| `url` | *str* | :heavy_check_mark: | The webhook's URL. We'll call this URL when an event occurs. | +| `event_types` | List[[models.CreateWebhookEventTypeRequest](../../models/createwebhookeventtyperequest.md)] | :heavy_check_mark: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -129,10 +131,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to get. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to get. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -172,14 +175,15 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to update. | -| `name` | *Optional[str]* | :heavy_minus_sign: | The webhook's name, used to identify it in the dashboard | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | -| `url` | *Optional[str]* | :heavy_minus_sign: | The webhook's URL. We'll call this URL when an event occurs. | -| `event_types` | List[[models.UpdateWebhookEventTypeRequest](../../models/updatewebhookeventtyperequest.md)] | :heavy_minus_sign: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to update. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `name` | *Optional[str]* | :heavy_minus_sign: | The webhook's name, used to identify it in the dashboard | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The webhook's description | +| `url` | *Optional[str]* | :heavy_minus_sign: | The webhook's URL. We'll call this URL when an event occurs. | +| `event_types` | List[[models.UpdateWebhookEventTypeRequest](../../models/updatewebhookeventtyperequest.md)] | :heavy_minus_sign: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -220,10 +224,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the webhook to delete. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the webhook to delete. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/webhooksecret/README.md b/docs/sdks/webhooksecret/README.md index 1c2a7bc..70c4307 100644 --- a/docs/sdks/webhooksecret/README.md +++ b/docs/sdks/webhooksecret/README.md @@ -31,9 +31,10 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/wordlist/README.md b/docs/sdks/wordlist/README.md index 5cf1560..370a982 100644 --- a/docs/sdks/wordlist/README.md +++ b/docs/sdks/wordlist/README.md @@ -36,11 +36,12 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -83,10 +84,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to get | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to get | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -129,15 +131,16 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to update | -| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the wordlist | -| `key` | *Optional[str]* | :heavy_minus_sign: | New key for the wordlist | -| `description` | *Optional[str]* | :heavy_minus_sign: | New description for the wordlist | -| `words` | List[*str*] | :heavy_minus_sign: | New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. | -| `strict` | *Optional[bool]* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to update | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the wordlist | +| `key` | *Optional[str]* | :heavy_minus_sign: | New key for the wordlist | +| `description` | *Optional[str]* | :heavy_minus_sign: | New description for the wordlist | +| `words` | List[*str*] | :heavy_minus_sign: | New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. | +| `strict` | *Optional[bool]* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -178,10 +181,11 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to check embedding status for | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to check embedding status for | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/words/README.md b/docs/sdks/words/README.md index 4fba2d8..422e61b 100644 --- a/docs/sdks/words/README.md +++ b/docs/sdks/words/README.md @@ -35,11 +35,12 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to add words to | -| `words` | List[*str*] | :heavy_check_mark: | Array of words to add to the wordlist. Duplicate words will be ignored. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to add words to | +| `words` | List[*str*] | :heavy_check_mark: | Array of words to add to the wordlist. Duplicate words will be ignored. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -84,11 +85,12 @@ with ModerationAPI( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the wordlist to remove words from | -| `words` | List[*str*] | :heavy_check_mark: | Array of words to remove from the wordlist | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | List[*str*] | :heavy_check_mark: | Array of words to remove from the wordlist | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pyproject.toml b/pyproject.toml index 9a82639..db1dec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "moderation_api" -version = "2.0.0" +version = "2.1.0" description = "The official Python library for the Moderation API" authors = [{ name = "Moderation API" },] readme = "README-PYPI.md" diff --git a/src/moderation_api/_version.py b/src/moderation_api/_version.py index cd591e8..5782a23 100644 --- a/src/moderation_api/_version.py +++ b/src/moderation_api/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "moderation_api" -__version__: str = "2.0.0" +__version__: str = "2.1.0" __openapi_doc_version__: str = "1.1.0" __gen_version__: str = "internal" -__user_agent__: str = "speakeasy-sdk/python 2.0.0 internal 1.1.0 moderation_api" +__user_agent__: str = "speakeasy-sdk/python 2.1.0 internal 1.1.0 moderation_api" try: if __package__ is not None: diff --git a/src/moderation_api/account.py b/src/moderation_api/account.py index 9388ce9..63326e9 100644 --- a/src/moderation_api/account.py +++ b/src/moderation_api/account.py @@ -13,6 +13,7 @@ class Account(BaseSDK): def retrieve( self, *, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -22,6 +23,7 @@ def retrieve( Get account details + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -36,12 +38,17 @@ def retrieve( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetAccountRequest( + project_id=project_id, + ) + req = self._build_request( method="GET", path="/account", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -105,6 +112,7 @@ def retrieve( async def retrieve_async( self, *, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -114,6 +122,7 @@ async def retrieve_async( Get account details + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -128,12 +137,17 @@ async def retrieve_async( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetAccountRequest( + project_id=project_id, + ) + req = self._build_request_async( method="GET", path="/account", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, diff --git a/src/moderation_api/actions.py b/src/moderation_api/actions.py index 50c21d4..fcdf8d6 100644 --- a/src/moderation_api/actions.py +++ b/src/moderation_api/actions.py @@ -17,6 +17,7 @@ def list( queue_id: Optional[str] = None, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -29,6 +30,7 @@ def list( :param queue_id: :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -48,6 +50,7 @@ def list( queue_id=queue_id, page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request( @@ -115,6 +118,7 @@ def next_func() -> Optional[models.ListActionsResponse]: queue_id=queue_id, page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -174,6 +178,7 @@ async def list_async( queue_id: Optional[str] = None, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -186,6 +191,7 @@ async def list_async( :param queue_id: :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -205,6 +211,7 @@ async def list_async( queue_id=queue_id, page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request_async( @@ -275,6 +282,7 @@ async def empty_result(): queue_id=queue_id, page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -332,6 +340,7 @@ def create( self, *, name: str, + project_id: Optional[str] = None, key: OptionalNullable[str] = UNSET, description: OptionalNullable[str] = UNSET, type_: OptionalNullable[models.CreateActionTypeRequest] = UNSET, @@ -359,6 +368,7 @@ def create( Create an action. :param name: The name of the action. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param key: User defined key of the action. :param description: The description of the action. :param type: The type of the action. @@ -385,21 +395,25 @@ def create( base_url = self._get_url(base_url, url_variables) request = models.CreateActionRequest( - key=key, - name=name, - description=description, - type=type_, - built_in=built_in, - queue_behaviour=queue_behaviour, - filter_in_queue_ids=utils.unmarshal( - filter_in_queue_ids, Optional[List[str]] - ), - position=position, - possible_values=utils.get_pydantic_model( - possible_values, Optional[List[models.CreateActionPossibleValueRequest]] + project_id=project_id, + body=models.CreateActionRequestBody( + key=key, + name=name, + description=description, + type=type_, + built_in=built_in, + queue_behaviour=queue_behaviour, + filter_in_queue_ids=utils.unmarshal( + filter_in_queue_ids, Optional[List[str]] + ), + position=position, + possible_values=utils.get_pydantic_model( + possible_values, + Optional[List[models.CreateActionPossibleValueRequest]], + ), + value_required=value_required, + free_text=free_text, ), - value_required=value_required, - free_text=free_text, ) req = self._build_request( @@ -416,7 +430,7 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateActionRequest + request.body, False, False, "json", models.CreateActionRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -483,6 +497,7 @@ async def create_async( self, *, name: str, + project_id: Optional[str] = None, key: OptionalNullable[str] = UNSET, description: OptionalNullable[str] = UNSET, type_: OptionalNullable[models.CreateActionTypeRequest] = UNSET, @@ -510,6 +525,7 @@ async def create_async( Create an action. :param name: The name of the action. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param key: User defined key of the action. :param description: The description of the action. :param type: The type of the action. @@ -536,21 +552,25 @@ async def create_async( base_url = self._get_url(base_url, url_variables) request = models.CreateActionRequest( - key=key, - name=name, - description=description, - type=type_, - built_in=built_in, - queue_behaviour=queue_behaviour, - filter_in_queue_ids=utils.unmarshal( - filter_in_queue_ids, Optional[List[str]] - ), - position=position, - possible_values=utils.get_pydantic_model( - possible_values, Optional[List[models.CreateActionPossibleValueRequest]] + project_id=project_id, + body=models.CreateActionRequestBody( + key=key, + name=name, + description=description, + type=type_, + built_in=built_in, + queue_behaviour=queue_behaviour, + filter_in_queue_ids=utils.unmarshal( + filter_in_queue_ids, Optional[List[str]] + ), + position=position, + possible_values=utils.get_pydantic_model( + possible_values, + Optional[List[models.CreateActionPossibleValueRequest]], + ), + value_required=value_required, + free_text=free_text, ), - value_required=value_required, - free_text=free_text, ) req = self._build_request_async( @@ -567,7 +587,7 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateActionRequest + request.body, False, False, "json", models.CreateActionRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -634,6 +654,7 @@ def retrieve( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -644,6 +665,7 @@ def retrieve( Get an action by ID. :param id: The ID of the action to get. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -661,6 +683,7 @@ def retrieve( request = models.GetActionRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -741,6 +764,7 @@ async def retrieve_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -751,6 +775,7 @@ async def retrieve_async( Get an action by ID. :param id: The ID of the action to get. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -768,6 +793,7 @@ async def retrieve_async( request = models.GetActionRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -848,6 +874,7 @@ def update( self, *, id: str, + project_id: Optional[str] = None, key: OptionalNullable[str] = UNSET, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, @@ -876,6 +903,7 @@ def update( Update an action. :param id: The ID of the action to update. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param key: User defined key of the action. :param name: The name of the action. :param description: The description of the action. @@ -904,6 +932,7 @@ def update( request = models.UpdateActionRequest( id=id, + project_id=project_id, body=models.UpdateActionRequestBody( key=key, name=name, @@ -1008,6 +1037,7 @@ async def update_async( self, *, id: str, + project_id: Optional[str] = None, key: OptionalNullable[str] = UNSET, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, @@ -1036,6 +1066,7 @@ async def update_async( Update an action. :param id: The ID of the action to update. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param key: User defined key of the action. :param name: The name of the action. :param description: The description of the action. @@ -1064,6 +1095,7 @@ async def update_async( request = models.UpdateActionRequest( id=id, + project_id=project_id, body=models.UpdateActionRequestBody( key=key, name=name, @@ -1168,6 +1200,7 @@ def delete( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1178,6 +1211,7 @@ def delete( Delete an action and all of its webhooks. :param id: The ID of the action to delete. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1195,6 +1229,7 @@ def delete( request = models.DeleteActionRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -1275,6 +1310,7 @@ async def delete_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1285,6 +1321,7 @@ async def delete_async( Delete an action and all of its webhooks. :param id: The ID of the action to delete. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1302,6 +1339,7 @@ async def delete_async( request = models.DeleteActionRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -1382,6 +1420,7 @@ def execute( self, *, action_key: str, + project_id: Optional[str] = None, content_ids: Optional[Iterable[str]] = None, author_ids: Optional[Iterable[str]] = None, value: Optional[str] = None, @@ -1397,6 +1436,7 @@ def execute( Execute a moderation action on one or more content items. :param action_key: ID or key of the action to execute + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param content_ids: IDs of the content items to apply the action to. Provide this or authorIds. :param author_ids: IDs of the authors to apply the action to. Provide this or contentIds. :param value: Optional value to provide with the action @@ -1418,12 +1458,15 @@ def execute( base_url = self._get_url(base_url, url_variables) request = models.ExecuteActionRequest( - action_key=action_key, - content_ids=utils.unmarshal(content_ids, Optional[List[str]]), - author_ids=utils.unmarshal(author_ids, Optional[List[str]]), - value=value, - queue_id=queue_id, - duration=duration, + project_id=project_id, + body=models.ExecuteActionRequestBody( + action_key=action_key, + content_ids=utils.unmarshal(content_ids, Optional[List[str]]), + author_ids=utils.unmarshal(author_ids, Optional[List[str]]), + value=value, + queue_id=queue_id, + duration=duration, + ), ) req = self._build_request( @@ -1440,7 +1483,7 @@ def execute( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ExecuteActionRequest + request.body, False, False, "json", models.ExecuteActionRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -1507,6 +1550,7 @@ async def execute_async( self, *, action_key: str, + project_id: Optional[str] = None, content_ids: Optional[Iterable[str]] = None, author_ids: Optional[Iterable[str]] = None, value: Optional[str] = None, @@ -1522,6 +1566,7 @@ async def execute_async( Execute a moderation action on one or more content items. :param action_key: ID or key of the action to execute + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param content_ids: IDs of the content items to apply the action to. Provide this or authorIds. :param author_ids: IDs of the authors to apply the action to. Provide this or contentIds. :param value: Optional value to provide with the action @@ -1543,12 +1588,15 @@ async def execute_async( base_url = self._get_url(base_url, url_variables) request = models.ExecuteActionRequest( - action_key=action_key, - content_ids=utils.unmarshal(content_ids, Optional[List[str]]), - author_ids=utils.unmarshal(author_ids, Optional[List[str]]), - value=value, - queue_id=queue_id, - duration=duration, + project_id=project_id, + body=models.ExecuteActionRequestBody( + action_key=action_key, + content_ids=utils.unmarshal(content_ids, Optional[List[str]]), + author_ids=utils.unmarshal(author_ids, Optional[List[str]]), + value=value, + queue_id=queue_id, + duration=duration, + ), ) req = self._build_request_async( @@ -1565,7 +1613,7 @@ async def execute_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ExecuteActionRequest + request.body, False, False, "json", models.ExecuteActionRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, diff --git a/src/moderation_api/authors.py b/src/moderation_api/authors.py index 62122be..752a7c4 100644 --- a/src/moderation_api/authors.py +++ b/src/moderation_api/authors.py @@ -116,6 +116,7 @@ def next_func() -> Optional[models.ListAuthorsResponse]: member_since_date=request.member_since_date, last_active_date=request.last_active_date, content_types=request.content_types, + project_id=request.project_id, ), retries=retries, server_url=server_url, @@ -278,6 +279,7 @@ async def empty_result(): member_since_date=request.member_since_date, last_active_date=request.last_active_date, content_types=request.content_types, + project_id=request.project_id, ), retries=retries, server_url=server_url, @@ -336,6 +338,7 @@ def create( self, *, external_id: str, + project_id: Optional[str] = None, profile_picture: OptionalNullable[str] = UNSET, external_link: OptionalNullable[str] = UNSET, name: OptionalNullable[str] = UNSET, @@ -357,6 +360,7 @@ def create( Create a new author. Typically not needed as authors are created automatically when content is moderated. :param external_id: External ID of the user, typically the ID of the author in your database. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param profile_picture: URL of the author's profile picture :param external_link: URL of the author's external profile :param name: Author name or identifier @@ -382,18 +386,21 @@ def create( base_url = self._get_url(base_url, url_variables) request = models.CreateAuthorRequest( - profile_picture=profile_picture, - external_link=external_link, - name=name, - email=email, - company=company, - metadata=utils.get_pydantic_model( - metadata, Optional[models.CreateAuthorMetadata] + project_id=project_id, + body=models.CreateAuthorRequestBody( + profile_picture=profile_picture, + external_link=external_link, + name=name, + email=email, + company=company, + metadata=utils.get_pydantic_model( + metadata, Optional[models.CreateAuthorMetadata] + ), + first_seen=first_seen, + last_seen=last_seen, + manual_trust_level=manual_trust_level, + external_id=external_id, ), - first_seen=first_seen, - last_seen=last_seen, - manual_trust_level=manual_trust_level, - external_id=external_id, ) req = self._build_request( @@ -410,7 +417,7 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateAuthorRequest + request.body, False, False, "json", models.CreateAuthorRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -484,6 +491,7 @@ async def create_async( self, *, external_id: str, + project_id: Optional[str] = None, profile_picture: OptionalNullable[str] = UNSET, external_link: OptionalNullable[str] = UNSET, name: OptionalNullable[str] = UNSET, @@ -505,6 +513,7 @@ async def create_async( Create a new author. Typically not needed as authors are created automatically when content is moderated. :param external_id: External ID of the user, typically the ID of the author in your database. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param profile_picture: URL of the author's profile picture :param external_link: URL of the author's external profile :param name: Author name or identifier @@ -530,18 +539,21 @@ async def create_async( base_url = self._get_url(base_url, url_variables) request = models.CreateAuthorRequest( - profile_picture=profile_picture, - external_link=external_link, - name=name, - email=email, - company=company, - metadata=utils.get_pydantic_model( - metadata, Optional[models.CreateAuthorMetadata] + project_id=project_id, + body=models.CreateAuthorRequestBody( + profile_picture=profile_picture, + external_link=external_link, + name=name, + email=email, + company=company, + metadata=utils.get_pydantic_model( + metadata, Optional[models.CreateAuthorMetadata] + ), + first_seen=first_seen, + last_seen=last_seen, + manual_trust_level=manual_trust_level, + external_id=external_id, ), - first_seen=first_seen, - last_seen=last_seen, - manual_trust_level=manual_trust_level, - external_id=external_id, ) req = self._build_request_async( @@ -558,7 +570,7 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateAuthorRequest + request.body, False, False, "json", models.CreateAuthorRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -632,6 +644,7 @@ def retrieve( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -642,6 +655,7 @@ def retrieve( Get detailed information about a specific author including historical data and analysis :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -659,6 +673,7 @@ def retrieve( request = models.GetAuthorRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -749,6 +764,7 @@ async def retrieve_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -759,6 +775,7 @@ async def retrieve_async( Get detailed information about a specific author including historical data and analysis :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -776,6 +793,7 @@ async def retrieve_async( request = models.GetAuthorRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -866,6 +884,7 @@ def update( self, *, id: str, + project_id: Optional[str] = None, profile_picture: OptionalNullable[str] = UNSET, external_link: OptionalNullable[str] = UNSET, name: OptionalNullable[str] = UNSET, @@ -887,6 +906,7 @@ def update( Update the details of a specific author :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param profile_picture: URL of the author's profile picture :param external_link: URL of the author's external profile :param name: Author name or identifier @@ -913,6 +933,7 @@ def update( request = models.UpdateAuthorRequest( id=id, + project_id=project_id, body=models.UpdateAuthorRequestBody( profile_picture=profile_picture, external_link=external_link, @@ -1019,6 +1040,7 @@ async def update_async( self, *, id: str, + project_id: Optional[str] = None, profile_picture: OptionalNullable[str] = UNSET, external_link: OptionalNullable[str] = UNSET, name: OptionalNullable[str] = UNSET, @@ -1040,6 +1062,7 @@ async def update_async( Update the details of a specific author :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param profile_picture: URL of the author's profile picture :param external_link: URL of the author's external profile :param name: Author name or identifier @@ -1066,6 +1089,7 @@ async def update_async( request = models.UpdateAuthorRequest( id=id, + project_id=project_id, body=models.UpdateAuthorRequestBody( profile_picture=profile_picture, external_link=external_link, @@ -1172,6 +1196,7 @@ def delete( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1182,6 +1207,7 @@ def delete( Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1199,6 +1225,7 @@ def delete( request = models.DeleteAuthorRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -1289,6 +1316,7 @@ async def delete_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1299,6 +1327,7 @@ async def delete_async( Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. :param id: Either external ID or the ID assigned by moderation API. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1316,6 +1345,7 @@ async def delete_async( request = models.DeleteAuthorRequest( id=id, + project_id=project_id, ) req = self._build_request_async( diff --git a/src/moderation_api/content_sdk.py b/src/moderation_api/content_sdk.py index f57c914..f9f63f7 100644 --- a/src/moderation_api/content_sdk.py +++ b/src/moderation_api/content_sdk.py @@ -14,6 +14,7 @@ def submit( self, *, content: Union[models.ContentRequest, models.ContentRequestTypedDict], + project_id: Optional[str] = None, timestamp: Optional[float] = None, channel: Optional[str] = None, content_id: Optional[str] = None, @@ -38,8 +39,10 @@ def submit( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.SubmitContentResponse: - r""" + r"""Submit content + :param content: The content sent for moderation + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param timestamp: Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. :param channel: Provide a channel ID or key. Will use the project's default channel if not provided. :param content_id: The unique ID of the content in your database. @@ -66,20 +69,23 @@ def submit( base_url = self._get_url(base_url, url_variables) request = models.SubmitContentRequest( - content=utils.get_pydantic_model(content, models.ContentRequest), - timestamp=timestamp, - channel=channel, - content_id=content_id, - meta_type=meta_type, - author_id=author_id, - conversation_id=conversation_id, - metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), - client_action=utils.get_pydantic_model( - client_action, Optional[models.SubmitContentClientAction] - ), - do_not_store=do_not_store, - policies=utils.get_pydantic_model( - policies, Optional[List[models.PolicyRequest]] + project_id=project_id, + body=models.SubmitContentRequestBody( + content=utils.get_pydantic_model(content, models.ContentRequest), + timestamp=timestamp, + channel=channel, + content_id=content_id, + meta_type=meta_type, + author_id=author_id, + conversation_id=conversation_id, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), + client_action=utils.get_pydantic_model( + client_action, Optional[models.SubmitContentClientAction] + ), + do_not_store=do_not_store, + policies=utils.get_pydantic_model( + policies, Optional[List[models.PolicyRequest]] + ), ), ) @@ -97,7 +103,7 @@ def submit( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.SubmitContentRequest + request.body, False, False, "json", models.SubmitContentRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -171,6 +177,7 @@ async def submit_async( self, *, content: Union[models.ContentRequest, models.ContentRequestTypedDict], + project_id: Optional[str] = None, timestamp: Optional[float] = None, channel: Optional[str] = None, content_id: Optional[str] = None, @@ -195,8 +202,10 @@ async def submit_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> models.SubmitContentResponse: - r""" + r"""Submit content + :param content: The content sent for moderation + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param timestamp: Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. :param channel: Provide a channel ID or key. Will use the project's default channel if not provided. :param content_id: The unique ID of the content in your database. @@ -223,20 +232,23 @@ async def submit_async( base_url = self._get_url(base_url, url_variables) request = models.SubmitContentRequest( - content=utils.get_pydantic_model(content, models.ContentRequest), - timestamp=timestamp, - channel=channel, - content_id=content_id, - meta_type=meta_type, - author_id=author_id, - conversation_id=conversation_id, - metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), - client_action=utils.get_pydantic_model( - client_action, Optional[models.SubmitContentClientAction] - ), - do_not_store=do_not_store, - policies=utils.get_pydantic_model( - policies, Optional[List[models.PolicyRequest]] + project_id=project_id, + body=models.SubmitContentRequestBody( + content=utils.get_pydantic_model(content, models.ContentRequest), + timestamp=timestamp, + channel=channel, + content_id=content_id, + meta_type=meta_type, + author_id=author_id, + conversation_id=conversation_id, + metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), + client_action=utils.get_pydantic_model( + client_action, Optional[models.SubmitContentClientAction] + ), + do_not_store=do_not_store, + policies=utils.get_pydantic_model( + policies, Optional[List[models.PolicyRequest]] + ), ), ) @@ -254,7 +266,7 @@ async def submit_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.SubmitContentRequest + request.body, False, False, "json", models.SubmitContentRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, diff --git a/src/moderation_api/errors/badrequesterror.py b/src/moderation_api/errors/badrequesterror.py index 46a0a05..7534826 100644 --- a/src/moderation_api/errors/badrequesterror.py +++ b/src/moderation_api/errors/badrequesterror.py @@ -21,6 +21,7 @@ class BadRequestErrorData(BaseModel): r"""Exactly what went wrong. Stable; safe to branch on. New codes may be added. - `invalid_request`: A parameter is invalid. `message` says which one. + - `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project. - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. """ message: str diff --git a/src/moderation_api/errors/permissiondeniederror.py b/src/moderation_api/errors/permissiondeniederror.py index b929507..e95a793 100644 --- a/src/moderation_api/errors/permissiondeniederror.py +++ b/src/moderation_api/errors/permissiondeniederror.py @@ -25,7 +25,6 @@ class PermissionDeniedErrorData(BaseModel): - `quota_exceeded`: The organization has used all API requests on its plan. - `plan_feature_unavailable`: The current plan does not include this feature. - `plan_limit_exceeded`: The request goes over a limit of the current plan. - - `project_key_required`: This endpoint needs a project API key, but an organization key was used. - `organization_key_required`: This endpoint needs an organization API key, but a project key was used. - `missing_key_permission`: The organization key does not have the permission this endpoint needs. - `project_not_reachable`: The organization key is limited to other projects. diff --git a/src/moderation_api/items.py b/src/moderation_api/items.py index f32fa4c..4ec3080 100644 --- a/src/moderation_api/items.py +++ b/src/moderation_api/items.py @@ -26,6 +26,7 @@ def list( include_resolved: Optional[bool] = None, author_id: Optional[str] = None, filtered_action_ids: Optional[Iterable[str]] = None, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -47,6 +48,7 @@ def list( :param include_resolved: :param author_id: :param filtered_action_ids: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -77,6 +79,7 @@ def list( filtered_action_ids=utils.unmarshal( filtered_action_ids, Optional[List[str]] ), + project_id=project_id, ) req = self._build_request( @@ -153,6 +156,7 @@ def next_func() -> Optional[models.ListQueueItemsResponse]: include_resolved=include_resolved, author_id=author_id, filtered_action_ids=filtered_action_ids, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -221,6 +225,7 @@ async def list_async( include_resolved: Optional[bool] = None, author_id: Optional[str] = None, filtered_action_ids: Optional[Iterable[str]] = None, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -242,6 +247,7 @@ async def list_async( :param include_resolved: :param author_id: :param filtered_action_ids: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -272,6 +278,7 @@ async def list_async( filtered_action_ids=utils.unmarshal( filtered_action_ids, Optional[List[str]] ), + project_id=project_id, ) req = self._build_request_async( @@ -351,6 +358,7 @@ async def empty_result(): include_resolved=include_resolved, author_id=author_id, filtered_action_ids=filtered_action_ids, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -409,6 +417,7 @@ def resolve( *, id: str, item_id: str, + project_id: Optional[str] = None, comment: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -421,6 +430,7 @@ def resolve( :param id: The queue ID :param item_id: The item ID to resolve + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param comment: Optional comment :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -440,6 +450,7 @@ def resolve( request = models.ResolveQueueItemRequest( id=id, item_id=item_id, + project_id=project_id, body=models.ResolveQueueItemRequestBody( comment=comment, ), @@ -534,6 +545,7 @@ async def resolve_async( *, id: str, item_id: str, + project_id: Optional[str] = None, comment: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -546,6 +558,7 @@ async def resolve_async( :param id: The queue ID :param item_id: The item ID to resolve + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param comment: Optional comment :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -565,6 +578,7 @@ async def resolve_async( request = models.ResolveQueueItemRequest( id=id, item_id=item_id, + project_id=project_id, body=models.ResolveQueueItemRequestBody( comment=comment, ), @@ -659,6 +673,7 @@ def unresolve( *, id: str, item_id: str, + project_id: Optional[str] = None, comment: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -671,6 +686,7 @@ def unresolve( :param id: The queue ID :param item_id: The item ID to unresolve + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param comment: Optional reason for unresolving the item :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -690,6 +706,7 @@ def unresolve( request = models.UnresolveQueueItemRequest( id=id, item_id=item_id, + project_id=project_id, body=models.UnresolveQueueItemRequestBody( comment=comment, ), @@ -784,6 +801,7 @@ async def unresolve_async( *, id: str, item_id: str, + project_id: Optional[str] = None, comment: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -796,6 +814,7 @@ async def unresolve_async( :param id: The queue ID :param item_id: The item ID to unresolve + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param comment: Optional reason for unresolving the item :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -815,6 +834,7 @@ async def unresolve_async( request = models.UnresolveQueueItemRequest( id=id, item_id=item_id, + project_id=project_id, body=models.UnresolveQueueItemRequestBody( comment=comment, ), diff --git a/src/moderation_api/models/__init__.py b/src/moderation_api/models/__init__.py index 79cfcc1..308e486 100644 --- a/src/moderation_api/models/__init__.py +++ b/src/moderation_api/models/__init__.py @@ -33,6 +33,8 @@ CreateActionQueueBehaviourRequest, CreateActionQueueBehaviourResponse, CreateActionRequest, + CreateActionRequestBody, + CreateActionRequestBodyTypedDict, CreateActionRequestTypedDict, CreateActionResponse, CreateActionResponseTypedDict, @@ -43,6 +45,8 @@ CreateAuthorMetadata, CreateAuthorMetadataTypedDict, CreateAuthorRequest, + CreateAuthorRequestBody, + CreateAuthorRequestBodyTypedDict, CreateAuthorRequestTypedDict, ) from .createchannelop import ( @@ -58,6 +62,8 @@ CreateWebhookEventTypeResponse, CreateWebhookPayloadVersion, CreateWebhookRequest, + CreateWebhookRequestBody, + CreateWebhookRequestBodyTypedDict, CreateWebhookRequestTypedDict, CreateWebhookResponse, CreateWebhookResponseTypedDict, @@ -107,6 +113,8 @@ from .errorissue import ErrorIssue, ErrorIssueTypedDict, Path, PathTypedDict from .executeactionop import ( ExecuteActionRequest, + ExecuteActionRequestBody, + ExecuteActionRequestBodyTypedDict, ExecuteActionRequestTypedDict, ExecuteActionResponse, ExecuteActionResponseTypedDict, @@ -114,6 +122,8 @@ from .getaccountop import ( CurrentProject, CurrentProjectTypedDict, + GetAccountRequest, + GetAccountRequestTypedDict, GetAccountResponse, GetAccountResponseTypedDict, ) @@ -183,6 +193,8 @@ GetWebhookResponseTypedDict, ) from .getwebhooksecretop import ( + GetWebhookSecretRequest, + GetWebhookSecretRequestTypedDict, GetWebhookSecretResponse, GetWebhookSecretResponseTypedDict, ) @@ -480,6 +492,8 @@ SubmitContentObjectTypedDict, SubmitContentRecommendationAction, SubmitContentRequest, + SubmitContentRequestBody, + SubmitContentRequestBodyTypedDict, SubmitContentRequestTypedDict, SubmitContentResponse, SubmitContentResponseTypedDict, @@ -649,6 +663,8 @@ "CreateActionQueueBehaviourRequest", "CreateActionQueueBehaviourResponse", "CreateActionRequest", + "CreateActionRequestBody", + "CreateActionRequestBodyTypedDict", "CreateActionRequestTypedDict", "CreateActionResponse", "CreateActionResponseTypedDict", @@ -657,6 +673,8 @@ "CreateAuthorMetadata", "CreateAuthorMetadataTypedDict", "CreateAuthorRequest", + "CreateAuthorRequestBody", + "CreateAuthorRequestBodyTypedDict", "CreateAuthorRequestTypedDict", "CreateChannelContentType", "CreateChannelRequest", @@ -669,6 +687,8 @@ "CreateWebhookEventTypeResponse", "CreateWebhookPayloadVersion", "CreateWebhookRequest", + "CreateWebhookRequestBody", + "CreateWebhookRequestBodyTypedDict", "CreateWebhookRequestTypedDict", "CreateWebhookResponse", "CreateWebhookResponseTypedDict", @@ -731,6 +751,8 @@ "Evaluation", "EvaluationTypedDict", "ExecuteActionRequest", + "ExecuteActionRequestBody", + "ExecuteActionRequestBodyTypedDict", "ExecuteActionRequestTypedDict", "ExecuteActionResponse", "ExecuteActionResponseTypedDict", @@ -747,6 +769,8 @@ "FlaggingMode", "Gambling", "GamblingTypedDict", + "GetAccountRequest", + "GetAccountRequestTypedDict", "GetAccountResponse", "GetAccountResponseTypedDict", "GetActionPosition", @@ -783,6 +807,8 @@ "GetWebhookRequestTypedDict", "GetWebhookResponse", "GetWebhookResponseTypedDict", + "GetWebhookSecretRequest", + "GetWebhookSecretRequestTypedDict", "GetWebhookSecretResponse", "GetWebhookSecretResponseTypedDict", "GetWordlistEmbeddingStatusRequest", @@ -997,6 +1023,8 @@ "SubmitContentObjectTypedDict", "SubmitContentRecommendationAction", "SubmitContentRequest", + "SubmitContentRequestBody", + "SubmitContentRequestBodyTypedDict", "SubmitContentRequestTypedDict", "SubmitContentResponse", "SubmitContentResponseTypedDict", @@ -1124,6 +1152,8 @@ "CreateActionQueueBehaviourRequest": ".createactionop", "CreateActionQueueBehaviourResponse": ".createactionop", "CreateActionRequest": ".createactionop", + "CreateActionRequestBody": ".createactionop", + "CreateActionRequestBodyTypedDict": ".createactionop", "CreateActionRequestTypedDict": ".createactionop", "CreateActionResponse": ".createactionop", "CreateActionResponseTypedDict": ".createactionop", @@ -1132,6 +1162,8 @@ "CreateAuthorMetadata": ".createauthorop", "CreateAuthorMetadataTypedDict": ".createauthorop", "CreateAuthorRequest": ".createauthorop", + "CreateAuthorRequestBody": ".createauthorop", + "CreateAuthorRequestBodyTypedDict": ".createauthorop", "CreateAuthorRequestTypedDict": ".createauthorop", "CreateChannelContentType": ".createchannelop", "CreateChannelRequest": ".createchannelop", @@ -1144,6 +1176,8 @@ "CreateWebhookEventTypeResponse": ".createwebhookop", "CreateWebhookPayloadVersion": ".createwebhookop", "CreateWebhookRequest": ".createwebhookop", + "CreateWebhookRequestBody": ".createwebhookop", + "CreateWebhookRequestBodyTypedDict": ".createwebhookop", "CreateWebhookRequestTypedDict": ".createwebhookop", "CreateWebhookResponse": ".createwebhookop", "CreateWebhookResponseTypedDict": ".createwebhookop", @@ -1180,11 +1214,15 @@ "Path": ".errorissue", "PathTypedDict": ".errorissue", "ExecuteActionRequest": ".executeactionop", + "ExecuteActionRequestBody": ".executeactionop", + "ExecuteActionRequestBodyTypedDict": ".executeactionop", "ExecuteActionRequestTypedDict": ".executeactionop", "ExecuteActionResponse": ".executeactionop", "ExecuteActionResponseTypedDict": ".executeactionop", "CurrentProject": ".getaccountop", "CurrentProjectTypedDict": ".getaccountop", + "GetAccountRequest": ".getaccountop", + "GetAccountRequestTypedDict": ".getaccountop", "GetAccountResponse": ".getaccountop", "GetAccountResponseTypedDict": ".getaccountop", "GetActionPosition": ".getactionop", @@ -1247,6 +1285,8 @@ "GetWebhookRequestTypedDict": ".getwebhookop", "GetWebhookResponse": ".getwebhookop", "GetWebhookResponseTypedDict": ".getwebhookop", + "GetWebhookSecretRequest": ".getwebhooksecretop", + "GetWebhookSecretRequestTypedDict": ".getwebhooksecretop", "GetWebhookSecretResponse": ".getwebhooksecretop", "GetWebhookSecretResponseTypedDict": ".getwebhooksecretop", "GetWordlistEmbeddingStatusRequest": ".getwordlistembeddingstatusop", @@ -1520,6 +1560,8 @@ "SubmitContentObjectTypedDict": ".submitcontentop", "SubmitContentRecommendationAction": ".submitcontentop", "SubmitContentRequest": ".submitcontentop", + "SubmitContentRequestBody": ".submitcontentop", + "SubmitContentRequestBodyTypedDict": ".submitcontentop", "SubmitContentRequestTypedDict": ".submitcontentop", "SubmitContentResponse": ".submitcontentop", "SubmitContentResponseTypedDict": ".submitcontentop", diff --git a/src/moderation_api/models/addwordlistwordsop.py b/src/moderation_api/models/addwordlistwordsop.py index 698e516..d63e343 100644 --- a/src/moderation_api/models/addwordlistwordsop.py +++ b/src/moderation_api/models/addwordlistwordsop.py @@ -1,11 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic -from typing import List -from typing_extensions import Annotated, TypedDict +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class AddWordlistWordsRequestBodyTypedDict(TypedDict): @@ -22,6 +28,8 @@ class AddWordlistWordsRequestTypedDict(TypedDict): id: str r"""ID of the wordlist to add words to""" body: AddWordlistWordsRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class AddWordlistWordsRequest(BaseModel): @@ -35,6 +43,29 @@ class AddWordlistWordsRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class AddWordlistWordsResponseTypedDict(TypedDict): r"""Words successfully added to wordlist""" diff --git a/src/moderation_api/models/badrequesterror.py b/src/moderation_api/models/badrequesterror.py index 5149f03..ebaa94c 100644 --- a/src/moderation_api/models/badrequesterror.py +++ b/src/moderation_api/models/badrequesterror.py @@ -8,6 +8,7 @@ BadRequestErrorCode = Union[ Literal[ "invalid_request", + "project_id_required", "validation_failed", ], UnrecognizedStr, @@ -15,5 +16,6 @@ r"""Exactly what went wrong. Stable; safe to branch on. New codes may be added. - `invalid_request`: A parameter is invalid. `message` says which one. +- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project. - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. """ diff --git a/src/moderation_api/models/createactionop.py b/src/moderation_api/models/createactionop.py index 5a0ed27..c622ab3 100644 --- a/src/moderation_api/models/createactionop.py +++ b/src/moderation_api/models/createactionop.py @@ -9,6 +9,7 @@ UNSET_SENTINEL, UnrecognizedStr, ) +from moderation_api.utils import FieldMetadata, HeaderMetadata, RequestMetadata import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union @@ -55,7 +56,7 @@ class CreateActionPossibleValueRequest(BaseModel): r"""The value of the action.""" -class CreateActionRequestTypedDict(TypedDict): +class CreateActionRequestBodyTypedDict(TypedDict): name: str r"""The name of the action.""" key: NotRequired[Nullable[str]] @@ -80,7 +81,7 @@ class CreateActionRequestTypedDict(TypedDict): r"""Whether the action allows any text to be entered as a value or if it must be one of the possible values.""" -class CreateActionRequest(BaseModel): +class CreateActionRequestBody(BaseModel): name: str r"""The name of the action.""" @@ -163,6 +164,42 @@ def serialize_model(self, handler): return m +class CreateActionRequestTypedDict(TypedDict): + body: CreateActionRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class CreateActionRequest(BaseModel): + body: Annotated[ + CreateActionRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + CreateActionTypeResponse = Union[ Literal[ "AUTHOR_BLOCK", @@ -330,7 +367,7 @@ def serialize_model(self, handler): try: - CreateActionRequest.model_rebuild() + CreateActionRequestBody.model_rebuild() except NameError: pass try: diff --git a/src/moderation_api/models/createauthorop.py b/src/moderation_api/models/createauthorop.py index df2f2e9..ef93ed7 100644 --- a/src/moderation_api/models/createauthorop.py +++ b/src/moderation_api/models/createauthorop.py @@ -8,10 +8,11 @@ UNSET, UNSET_SENTINEL, ) +from moderation_api.utils import FieldMetadata, HeaderMetadata, RequestMetadata import pydantic from pydantic import ConfigDict, model_serializer from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict class CreateAuthorMetadataTypedDict(TypedDict): @@ -98,7 +99,7 @@ def serialize_model(self, handler): return m -class CreateAuthorRequestTypedDict(TypedDict): +class CreateAuthorRequestBodyTypedDict(TypedDict): external_id: str r"""External ID of the user, typically the ID of the author in your database.""" profile_picture: NotRequired[Nullable[str]] @@ -120,7 +121,7 @@ class CreateAuthorRequestTypedDict(TypedDict): manual_trust_level: NotRequired[Nullable[float]] -class CreateAuthorRequest(BaseModel): +class CreateAuthorRequestBody(BaseModel): external_id: str r"""External ID of the user, typically the ID of the author in your database.""" @@ -195,3 +196,39 @@ def serialize_model(self, handler): m[k] = val return m + + +class CreateAuthorRequestTypedDict(TypedDict): + body: CreateAuthorRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class CreateAuthorRequest(BaseModel): + body: Annotated[ + CreateAuthorRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/moderation_api/models/createwebhookop.py b/src/moderation_api/models/createwebhookop.py index 63b95fd..f8910db 100644 --- a/src/moderation_api/models/createwebhookop.py +++ b/src/moderation_api/models/createwebhookop.py @@ -9,9 +9,10 @@ UNSET_SENTINEL, UnrecognizedStr, ) +from moderation_api.utils import FieldMetadata, HeaderMetadata, RequestMetadata import pydantic from pydantic import model_serializer -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -30,7 +31,7 @@ ] -class CreateWebhookRequestTypedDict(TypedDict): +class CreateWebhookRequestBodyTypedDict(TypedDict): name: str r"""The webhook's name, used to identify it in the dashboard""" url: str @@ -41,7 +42,7 @@ class CreateWebhookRequestTypedDict(TypedDict): r"""The webhook's description""" -class CreateWebhookRequest(BaseModel): +class CreateWebhookRequestBody(BaseModel): name: str r"""The webhook's name, used to identify it in the dashboard""" @@ -82,6 +83,42 @@ def serialize_model(self, handler): return m +class CreateWebhookRequestTypedDict(TypedDict): + body: CreateWebhookRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class CreateWebhookRequest(BaseModel): + body: Annotated[ + CreateWebhookRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + CreateWebhookEventTypeResponse = Union[ Literal[ "QUEUE_ITEM_NEW", @@ -184,7 +221,7 @@ def serialize_model(self, handler): try: - CreateWebhookRequest.model_rebuild() + CreateWebhookRequestBody.model_rebuild() except NameError: pass try: diff --git a/src/moderation_api/models/deleteactionop.py b/src/moderation_api/models/deleteactionop.py index 11154e2..4d66a08 100644 --- a/src/moderation_api/models/deleteactionop.py +++ b/src/moderation_api/models/deleteactionop.py @@ -1,14 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteActionRequestTypedDict(TypedDict): id: str r"""The ID of the action to delete.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class DeleteActionRequest(BaseModel): @@ -17,6 +22,29 @@ class DeleteActionRequest(BaseModel): ] r"""The ID of the action to delete.""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class DeleteActionResponseTypedDict(TypedDict): r"""Action deleted successfully""" diff --git a/src/moderation_api/models/deleteauthorop.py b/src/moderation_api/models/deleteauthorop.py index f7b764d..801be30 100644 --- a/src/moderation_api/models/deleteauthorop.py +++ b/src/moderation_api/models/deleteauthorop.py @@ -1,14 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteAuthorRequestTypedDict(TypedDict): id: str r"""Either external ID or the ID assigned by moderation API.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class DeleteAuthorRequest(BaseModel): @@ -17,6 +22,29 @@ class DeleteAuthorRequest(BaseModel): ] r"""Either external ID or the ID assigned by moderation API.""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class DeleteAuthorResponseTypedDict(TypedDict): r"""Successful response""" diff --git a/src/moderation_api/models/deletewebhookop.py b/src/moderation_api/models/deletewebhookop.py index 4fe0be3..ee1073c 100644 --- a/src/moderation_api/models/deletewebhookop.py +++ b/src/moderation_api/models/deletewebhookop.py @@ -1,14 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteWebhookRequestTypedDict(TypedDict): id: str r"""The ID of the webhook to delete.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class DeleteWebhookRequest(BaseModel): @@ -17,6 +22,29 @@ class DeleteWebhookRequest(BaseModel): ] r"""The ID of the webhook to delete.""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class DeleteWebhookResponseTypedDict(TypedDict): r"""Webhook deleted successfully""" diff --git a/src/moderation_api/models/executeactionop.py b/src/moderation_api/models/executeactionop.py index 9ebd953..868b983 100644 --- a/src/moderation_api/models/executeactionop.py +++ b/src/moderation_api/models/executeactionop.py @@ -2,13 +2,14 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, RequestMetadata import pydantic from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict -class ExecuteActionRequestTypedDict(TypedDict): +class ExecuteActionRequestBodyTypedDict(TypedDict): r"""Input parameters""" action_key: str @@ -25,7 +26,7 @@ class ExecuteActionRequestTypedDict(TypedDict): r"""Optional duration in milliseconds for actions with timeouts""" -class ExecuteActionRequest(BaseModel): +class ExecuteActionRequestBody(BaseModel): r"""Input parameters""" action_key: Annotated[str, pydantic.Field(alias="actionKey")] @@ -67,6 +68,42 @@ def serialize_model(self, handler): return m +class ExecuteActionRequestTypedDict(TypedDict): + body: ExecuteActionRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class ExecuteActionRequest(BaseModel): + body: Annotated[ + ExecuteActionRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + class ExecuteActionResponseTypedDict(TypedDict): r"""Execution result""" @@ -82,6 +119,6 @@ class ExecuteActionResponse(BaseModel): try: - ExecuteActionRequest.model_rebuild() + ExecuteActionRequestBody.model_rebuild() except NameError: pass diff --git a/src/moderation_api/models/getaccountop.py b/src/moderation_api/models/getaccountop.py index 61b841a..921d3b1 100644 --- a/src/moderation_api/models/getaccountop.py +++ b/src/moderation_api/models/getaccountop.py @@ -2,9 +2,41 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata +import pydantic from pydantic import model_serializer from typing import Optional -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetAccountRequestTypedDict(TypedDict): + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class GetAccountRequest(BaseModel): + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m class CurrentProjectTypedDict(TypedDict): diff --git a/src/moderation_api/models/getactionop.py b/src/moderation_api/models/getactionop.py index 8c6804f..d89cd51 100644 --- a/src/moderation_api/models/getactionop.py +++ b/src/moderation_api/models/getactionop.py @@ -9,7 +9,7 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union @@ -19,6 +19,8 @@ class GetActionRequestTypedDict(TypedDict): id: str r"""The ID of the action to get.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetActionRequest(BaseModel): @@ -27,6 +29,29 @@ class GetActionRequest(BaseModel): ] r"""The ID of the action to get.""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + GetActionType = Union[ Literal[ diff --git a/src/moderation_api/models/getauthorop.py b/src/moderation_api/models/getauthorop.py index f336bb7..e3f0abf 100644 --- a/src/moderation_api/models/getauthorop.py +++ b/src/moderation_api/models/getauthorop.py @@ -1,14 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetAuthorRequestTypedDict(TypedDict): id: str r"""Either external ID or the ID assigned by moderation API.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetAuthorRequest(BaseModel): @@ -16,3 +21,26 @@ class GetAuthorRequest(BaseModel): str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] r"""Either external ID or the ID assigned by moderation API.""" + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/moderation_api/models/getqueueop.py b/src/moderation_api/models/getqueueop.py index bbc2a1d..a1461f0 100644 --- a/src/moderation_api/models/getqueueop.py +++ b/src/moderation_api/models/getqueueop.py @@ -9,7 +9,7 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union @@ -19,6 +19,8 @@ class GetQueueRequestTypedDict(TypedDict): id: str r"""The queue ID""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetQueueRequest(BaseModel): @@ -27,6 +29,29 @@ class GetQueueRequest(BaseModel): ] r"""The queue ID""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + IsFlagged = Union[ Literal[ diff --git a/src/moderation_api/models/getqueuestatsop.py b/src/moderation_api/models/getqueuestatsop.py index d332ae1..9c28e90 100644 --- a/src/moderation_api/models/getqueuestatsop.py +++ b/src/moderation_api/models/getqueuestatsop.py @@ -2,7 +2,12 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) import pydantic from pydantic import model_serializer from typing import List, Optional @@ -13,6 +18,8 @@ class GetQueueStatsRequestTypedDict(TypedDict): id: str r"""The queue ID""" within_days: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetQueueStatsRequest(BaseModel): @@ -27,9 +34,16 @@ class GetQueueStatsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = 30 + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["withinDays"]) + optional_fields = set(["withinDays", "projectId"]) serialized = handler(self) m = {} diff --git a/src/moderation_api/models/getwebhookop.py b/src/moderation_api/models/getwebhookop.py index 1698366..6ac685a 100644 --- a/src/moderation_api/models/getwebhookop.py +++ b/src/moderation_api/models/getwebhookop.py @@ -9,16 +9,18 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic from pydantic import model_serializer -from typing import List, Literal, Union +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict class GetWebhookRequestTypedDict(TypedDict): id: str r"""The ID of the webhook to get.""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetWebhookRequest(BaseModel): @@ -27,6 +29,29 @@ class GetWebhookRequest(BaseModel): ] r"""The ID of the webhook to get.""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + GetWebhookEventType = Union[ Literal[ diff --git a/src/moderation_api/models/getwebhooksecretop.py b/src/moderation_api/models/getwebhooksecretop.py index f53f76f..b2e0885 100644 --- a/src/moderation_api/models/getwebhooksecretop.py +++ b/src/moderation_api/models/getwebhooksecretop.py @@ -1,8 +1,42 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from typing_extensions import TypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWebhookSecretRequestTypedDict(TypedDict): + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class GetWebhookSecretRequest(BaseModel): + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m class GetWebhookSecretResponseTypedDict(TypedDict): diff --git a/src/moderation_api/models/getwordlistembeddingstatusop.py b/src/moderation_api/models/getwordlistembeddingstatusop.py index ba5bc47..63ca82b 100644 --- a/src/moderation_api/models/getwordlistembeddingstatusop.py +++ b/src/moderation_api/models/getwordlistembeddingstatusop.py @@ -1,15 +1,19 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic -from typing_extensions import Annotated, TypedDict +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWordlistEmbeddingStatusRequestTypedDict(TypedDict): id: str r"""ID of the wordlist to check embedding status for""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetWordlistEmbeddingStatusRequest(BaseModel): @@ -18,6 +22,29 @@ class GetWordlistEmbeddingStatusRequest(BaseModel): ] r"""ID of the wordlist to check embedding status for""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class GetWordlistEmbeddingStatusResponseTypedDict(TypedDict): r"""Embedding status details""" diff --git a/src/moderation_api/models/getwordlistop.py b/src/moderation_api/models/getwordlistop.py index 6c2f5f6..2af7f9e 100644 --- a/src/moderation_api/models/getwordlistop.py +++ b/src/moderation_api/models/getwordlistop.py @@ -2,16 +2,18 @@ from __future__ import annotations from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, PathParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic from pydantic import model_serializer -from typing import List -from typing_extensions import Annotated, TypedDict +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWordlistRequestTypedDict(TypedDict): id: str r"""ID of the wordlist to get""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class GetWordlistRequest(BaseModel): @@ -20,6 +22,29 @@ class GetWordlistRequest(BaseModel): ] r"""ID of the wordlist to get""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class GetWordlistResponseTypedDict(TypedDict): r"""Successful response""" diff --git a/src/moderation_api/models/listactionsop.py b/src/moderation_api/models/listactionsop.py index 8b72b39..f67b900 100644 --- a/src/moderation_api/models/listactionsop.py +++ b/src/moderation_api/models/listactionsop.py @@ -10,7 +10,7 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, QueryParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer from typing import Awaitable, Callable, List, Literal, Optional, Union @@ -21,6 +21,8 @@ class ListActionsRequestTypedDict(TypedDict): queue_id: NotRequired[str] page: NotRequired[int] page_size: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ListActionsRequest(BaseModel): @@ -41,9 +43,16 @@ class ListActionsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = 20 + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["queueId", "page", "pageSize"]) + optional_fields = set(["queueId", "page", "pageSize", "projectId"]) serialized = handler(self) m = {} diff --git a/src/moderation_api/models/listauthorsop.py b/src/moderation_api/models/listauthorsop.py index 39ce87a..9dd87b5 100644 --- a/src/moderation_api/models/listauthorsop.py +++ b/src/moderation_api/models/listauthorsop.py @@ -4,7 +4,7 @@ from .pagination import Pagination, PaginationTypedDict from .publicauthor import PublicAuthor, PublicAuthorTypedDict from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, QueryParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer from typing import Awaitable, Callable, List, Literal, Optional, Union @@ -39,6 +39,8 @@ class ListAuthorsRequestTypedDict(TypedDict): member_since_date: NotRequired[str] last_active_date: NotRequired[str] content_types: NotRequired[List[str]] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ListAuthorsRequest(BaseModel): @@ -84,6 +86,13 @@ class ListAuthorsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -95,6 +104,7 @@ def serialize_model(self, handler): "memberSinceDate", "lastActiveDate", "contentTypes", + "projectId", ] ) serialized = handler(self) diff --git a/src/moderation_api/models/listqueueitemsop.py b/src/moderation_api/models/listqueueitemsop.py index e069518..fee4c87 100644 --- a/src/moderation_api/models/listqueueitemsop.py +++ b/src/moderation_api/models/listqueueitemsop.py @@ -3,7 +3,12 @@ from __future__ import annotations from .pagination import Pagination, PaginationTypedDict from moderation_api.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr -from moderation_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) import pydantic from pydantic import model_serializer from typing import Awaitable, Callable, List, Literal, Optional, Union @@ -39,6 +44,8 @@ class ListQueueItemsRequestTypedDict(TypedDict): include_resolved: NotRequired[bool] author_id: NotRequired[str] filtered_action_ids: NotRequired[List[str]] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ListQueueItemsRequest(BaseModel): @@ -112,6 +119,13 @@ class ListQueueItemsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -127,6 +141,7 @@ def serialize_model(self, handler): "includeResolved", "authorId", "filteredActionIds", + "projectId", ] ) serialized = handler(self) diff --git a/src/moderation_api/models/listwebhooksop.py b/src/moderation_api/models/listwebhooksop.py index 23c3124..056efec 100644 --- a/src/moderation_api/models/listwebhooksop.py +++ b/src/moderation_api/models/listwebhooksop.py @@ -10,7 +10,7 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, QueryParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer from typing import Awaitable, Callable, List, Literal, Optional, Union @@ -20,6 +20,8 @@ class ListWebhooksRequestTypedDict(TypedDict): page: NotRequired[int] page_size: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ListWebhooksRequest(BaseModel): @@ -34,9 +36,16 @@ class ListWebhooksRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = 20 + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["page", "pageSize"]) + optional_fields = set(["page", "pageSize", "projectId"]) serialized = handler(self) m = {} diff --git a/src/moderation_api/models/listwordlistsop.py b/src/moderation_api/models/listwordlistsop.py index 60d2bea..8c89abb 100644 --- a/src/moderation_api/models/listwordlistsop.py +++ b/src/moderation_api/models/listwordlistsop.py @@ -3,7 +3,7 @@ from __future__ import annotations from .pagination import Pagination, PaginationTypedDict from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, QueryParamMetadata +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer from typing import Awaitable, Callable, List, Optional, Union @@ -13,6 +13,8 @@ class ListWordlistsRequestTypedDict(TypedDict): page: NotRequired[int] page_size: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ListWordlistsRequest(BaseModel): @@ -27,9 +29,16 @@ class ListWordlistsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = 20 + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["page", "pageSize"]) + optional_fields = set(["page", "pageSize", "projectId"]) serialized = handler(self) m = {} diff --git a/src/moderation_api/models/permissiondeniederror.py b/src/moderation_api/models/permissiondeniederror.py index 92f5fa3..be2e602 100644 --- a/src/moderation_api/models/permissiondeniederror.py +++ b/src/moderation_api/models/permissiondeniederror.py @@ -12,7 +12,6 @@ "quota_exceeded", "plan_feature_unavailable", "plan_limit_exceeded", - "project_key_required", "organization_key_required", "missing_key_permission", "project_not_reachable", @@ -26,7 +25,6 @@ - `quota_exceeded`: The organization has used all API requests on its plan. - `plan_feature_unavailable`: The current plan does not include this feature. - `plan_limit_exceeded`: The request goes over a limit of the current plan. -- `project_key_required`: This endpoint needs a project API key, but an organization key was used. - `organization_key_required`: This endpoint needs an organization API key, but a project key was used. - `missing_key_permission`: The organization key does not have the permission this endpoint needs. - `project_not_reachable`: The organization key is limited to other projects. diff --git a/src/moderation_api/models/removewordlistwordsop.py b/src/moderation_api/models/removewordlistwordsop.py index e984b27..9936fe8 100644 --- a/src/moderation_api/models/removewordlistwordsop.py +++ b/src/moderation_api/models/removewordlistwordsop.py @@ -1,11 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel -from moderation_api.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) import pydantic -from typing import List -from typing_extensions import Annotated, TypedDict +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RemoveWordlistWordsRequestTypedDict(TypedDict): @@ -13,6 +19,8 @@ class RemoveWordlistWordsRequestTypedDict(TypedDict): r"""ID of the wordlist to remove words from""" words: List[str] r"""Array of words to remove from the wordlist""" + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class RemoveWordlistWordsRequest(BaseModel): @@ -26,6 +34,29 @@ class RemoveWordlistWordsRequest(BaseModel): ] r"""Array of words to remove from the wordlist""" + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class RemoveWordlistWordsResponseTypedDict(TypedDict): r"""Words successfully removed from wordlist""" diff --git a/src/moderation_api/models/resolvequeueitemop.py b/src/moderation_api/models/resolvequeueitemop.py index 691d4f6..1e666b7 100644 --- a/src/moderation_api/models/resolvequeueitemop.py +++ b/src/moderation_api/models/resolvequeueitemop.py @@ -2,7 +2,12 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import model_serializer from typing import Optional @@ -41,6 +46,8 @@ class ResolveQueueItemRequestTypedDict(TypedDict): item_id: str r"""The item ID to resolve""" body: ResolveQueueItemRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class ResolveQueueItemRequest(BaseModel): @@ -61,6 +68,29 @@ class ResolveQueueItemRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class ResolveQueueItemResponseTypedDict(TypedDict): r"""Successful response""" diff --git a/src/moderation_api/models/submitcontentop.py b/src/moderation_api/models/submitcontentop.py index ee8a44f..35d7231 100644 --- a/src/moderation_api/models/submitcontentop.py +++ b/src/moderation_api/models/submitcontentop.py @@ -10,7 +10,12 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import validate_const +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + RequestMetadata, + validate_const, +) from moderation_api.utils.unions import parse_open_union import pydantic from pydantic import ConfigDict, Field, model_serializer @@ -1947,7 +1952,7 @@ def serialize_model(self, handler): ] -class SubmitContentRequestTypedDict(TypedDict): +class SubmitContentRequestBodyTypedDict(TypedDict): content: ContentRequestTypedDict r"""The content sent for moderation""" timestamp: NotRequired[float] @@ -1972,7 +1977,7 @@ class SubmitContentRequestTypedDict(TypedDict): r"""(Enterprise) override the channel policies for this moderation request only.""" -class SubmitContentRequest(BaseModel): +class SubmitContentRequestBody(BaseModel): content: ContentRequest r"""The content sent for moderation""" @@ -2042,6 +2047,42 @@ def serialize_model(self, handler): return m +class SubmitContentRequestTypedDict(TypedDict): + body: SubmitContentRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + +class SubmitContentRequest(BaseModel): + body: Annotated[ + SubmitContentRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + class AudioResponseTypedDict(TypedDict): r"""Audio""" @@ -3580,7 +3621,7 @@ def serialize_model(self, handler): except NameError: pass try: - SubmitContentRequest.model_rebuild() + SubmitContentRequestBody.model_rebuild() except NameError: pass try: diff --git a/src/moderation_api/models/unresolvequeueitemop.py b/src/moderation_api/models/unresolvequeueitemop.py index 820625d..40a8d5f 100644 --- a/src/moderation_api/models/unresolvequeueitemop.py +++ b/src/moderation_api/models/unresolvequeueitemop.py @@ -2,7 +2,12 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import model_serializer from typing import Optional @@ -41,6 +46,8 @@ class UnresolveQueueItemRequestTypedDict(TypedDict): item_id: str r"""The item ID to unresolve""" body: UnresolveQueueItemRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class UnresolveQueueItemRequest(BaseModel): @@ -61,6 +68,29 @@ class UnresolveQueueItemRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class UnresolveQueueItemResponseTypedDict(TypedDict): r"""Successful response""" diff --git a/src/moderation_api/models/updateactionop.py b/src/moderation_api/models/updateactionop.py index 624099a..fe787ed 100644 --- a/src/moderation_api/models/updateactionop.py +++ b/src/moderation_api/models/updateactionop.py @@ -9,7 +9,12 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union @@ -169,6 +174,8 @@ class UpdateActionRequestTypedDict(TypedDict): id: str r"""The ID of the action to update.""" body: UpdateActionRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class UpdateActionRequest(BaseModel): @@ -182,6 +189,29 @@ class UpdateActionRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + UpdateActionTypeResponse = Union[ Literal[ diff --git a/src/moderation_api/models/updateauthorop.py b/src/moderation_api/models/updateauthorop.py index ceb8fb4..60a12f4 100644 --- a/src/moderation_api/models/updateauthorop.py +++ b/src/moderation_api/models/updateauthorop.py @@ -8,7 +8,12 @@ UNSET, UNSET_SENTINEL, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import ConfigDict, model_serializer from typing import Any, Dict, Optional @@ -197,6 +202,8 @@ class UpdateAuthorRequestTypedDict(TypedDict): id: str r"""Either external ID or the ID assigned by moderation API.""" body: UpdateAuthorRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class UpdateAuthorRequest(BaseModel): @@ -209,3 +216,26 @@ class UpdateAuthorRequest(BaseModel): UpdateAuthorRequestBody, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/moderation_api/models/updatewebhookop.py b/src/moderation_api/models/updatewebhookop.py index c62d94d..19bb062 100644 --- a/src/moderation_api/models/updatewebhookop.py +++ b/src/moderation_api/models/updatewebhookop.py @@ -9,7 +9,12 @@ UNSET_SENTINEL, UnrecognizedStr, ) -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union @@ -88,6 +93,8 @@ class UpdateWebhookRequestTypedDict(TypedDict): id: str r"""The ID of the webhook to update.""" body: UpdateWebhookRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class UpdateWebhookRequest(BaseModel): @@ -101,6 +108,29 @@ class UpdateWebhookRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + UpdateWebhookEventTypeResponse = Union[ Literal[ diff --git a/src/moderation_api/models/updatewordlistop.py b/src/moderation_api/models/updatewordlistop.py index d562295..02201b1 100644 --- a/src/moderation_api/models/updatewordlistop.py +++ b/src/moderation_api/models/updatewordlistop.py @@ -2,7 +2,12 @@ from __future__ import annotations from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL -from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) import pydantic from pydantic import model_serializer from typing import List, Optional @@ -59,6 +64,8 @@ class UpdateWordlistRequestTypedDict(TypedDict): id: str r"""ID of the wordlist to update""" body: UpdateWordlistRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" class UpdateWordlistRequest(BaseModel): @@ -72,6 +79,29 @@ class UpdateWordlistRequest(BaseModel): FieldMetadata(request=RequestMetadata(media_type="application/json")), ] + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["projectId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + class UpdateWordlistResponseTypedDict(TypedDict): r"""Wordlist updated successfully""" diff --git a/src/moderation_api/queue_sdk.py b/src/moderation_api/queue_sdk.py index fe67b0b..a85d82b 100644 --- a/src/moderation_api/queue_sdk.py +++ b/src/moderation_api/queue_sdk.py @@ -28,6 +28,7 @@ def retrieve( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -38,6 +39,7 @@ def retrieve( Get a queue :param id: The queue ID + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -55,6 +57,7 @@ def retrieve( request = models.GetQueueRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -145,6 +148,7 @@ async def retrieve_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -155,6 +159,7 @@ async def retrieve_async( Get a queue :param id: The queue ID + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -172,6 +177,7 @@ async def retrieve_async( request = models.GetQueueRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -263,6 +269,7 @@ def get_stats( *, id: str, within_days: Optional[int] = 30, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -274,6 +281,7 @@ def get_stats( :param id: The queue ID :param within_days: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -292,6 +300,7 @@ def get_stats( request = models.GetQueueStatsRequest( id=id, within_days=within_days, + project_id=project_id, ) req = self._build_request( @@ -383,6 +392,7 @@ async def get_stats_async( *, id: str, within_days: Optional[int] = 30, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -394,6 +404,7 @@ async def get_stats_async( :param id: The queue ID :param within_days: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -412,6 +423,7 @@ async def get_stats_async( request = models.GetQueueStatsRequest( id=id, within_days=within_days, + project_id=project_id, ) req = self._build_request_async( diff --git a/src/moderation_api/webhooks.py b/src/moderation_api/webhooks.py index 3169fb6..8a13457 100644 --- a/src/moderation_api/webhooks.py +++ b/src/moderation_api/webhooks.py @@ -16,6 +16,7 @@ def list( *, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -27,6 +28,7 @@ def list( :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -45,6 +47,7 @@ def list( request = models.ListWebhooksRequest( page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request( @@ -111,6 +114,7 @@ def next_func() -> Optional[models.ListWebhooksResponse]: return self.list( page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -151,6 +155,7 @@ async def list_async( *, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -162,6 +167,7 @@ async def list_async( :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -180,6 +186,7 @@ async def list_async( request = models.ListWebhooksRequest( page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request_async( @@ -249,6 +256,7 @@ async def empty_result(): return self.list_async( page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -290,6 +298,7 @@ def create( name: str, url: str, event_types: Iterable[models.CreateWebhookEventTypeRequest], + project_id: Optional[str] = None, description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -303,6 +312,7 @@ def create( :param name: The webhook's name, used to identify it in the dashboard :param url: The webhook's URL. We'll call this URL when an event occurs. :param event_types: Event types this webhook subscribes to. One webhook URL receives all events you list here. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param description: The webhook's description :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -320,11 +330,14 @@ def create( base_url = self._get_url(base_url, url_variables) request = models.CreateWebhookRequest( - name=name, - description=description, - url=url, - event_types=utils.unmarshal( - event_types, List[models.CreateWebhookEventTypeRequest] + project_id=project_id, + body=models.CreateWebhookRequestBody( + name=name, + description=description, + url=url, + event_types=utils.unmarshal( + event_types, List[models.CreateWebhookEventTypeRequest] + ), ), ) @@ -342,7 +355,7 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateWebhookRequest + request.body, False, False, "json", models.CreateWebhookRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -408,6 +421,7 @@ async def create_async( name: str, url: str, event_types: Iterable[models.CreateWebhookEventTypeRequest], + project_id: Optional[str] = None, description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -421,6 +435,7 @@ async def create_async( :param name: The webhook's name, used to identify it in the dashboard :param url: The webhook's URL. We'll call this URL when an event occurs. :param event_types: Event types this webhook subscribes to. One webhook URL receives all events you list here. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param description: The webhook's description :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -438,11 +453,14 @@ async def create_async( base_url = self._get_url(base_url, url_variables) request = models.CreateWebhookRequest( - name=name, - description=description, - url=url, - event_types=utils.unmarshal( - event_types, List[models.CreateWebhookEventTypeRequest] + project_id=project_id, + body=models.CreateWebhookRequestBody( + name=name, + description=description, + url=url, + event_types=utils.unmarshal( + event_types, List[models.CreateWebhookEventTypeRequest] + ), ), ) @@ -460,7 +478,7 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.CreateWebhookRequest + request.body, False, False, "json", models.CreateWebhookRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -524,6 +542,7 @@ def retrieve( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -534,6 +553,7 @@ def retrieve( Get a webhook by ID. :param id: The ID of the webhook to get. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -551,6 +571,7 @@ def retrieve( request = models.GetWebhookRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -626,6 +647,7 @@ async def retrieve_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -636,6 +658,7 @@ async def retrieve_async( Get a webhook by ID. :param id: The ID of the webhook to get. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -653,6 +676,7 @@ async def retrieve_async( request = models.GetWebhookRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -728,6 +752,7 @@ def update( self, *, id: str, + project_id: Optional[str] = None, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, url: Optional[str] = None, @@ -742,6 +767,7 @@ def update( Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. :param id: The ID of the webhook to update. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param name: The webhook's name, used to identify it in the dashboard :param description: The webhook's description :param url: The webhook's URL. We'll call this URL when an event occurs. @@ -763,6 +789,7 @@ def update( request = models.UpdateWebhookRequest( id=id, + project_id=project_id, body=models.UpdateWebhookRequestBody( name=name, description=description, @@ -854,6 +881,7 @@ async def update_async( self, *, id: str, + project_id: Optional[str] = None, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, url: Optional[str] = None, @@ -868,6 +896,7 @@ async def update_async( Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. :param id: The ID of the webhook to update. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param name: The webhook's name, used to identify it in the dashboard :param description: The webhook's description :param url: The webhook's URL. We'll call this URL when an event occurs. @@ -889,6 +918,7 @@ async def update_async( request = models.UpdateWebhookRequest( id=id, + project_id=project_id, body=models.UpdateWebhookRequestBody( name=name, description=description, @@ -980,6 +1010,7 @@ def delete( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -990,6 +1021,7 @@ def delete( Delete a webhook. :param id: The ID of the webhook to delete. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1007,6 +1039,7 @@ def delete( request = models.DeleteWebhookRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -1082,6 +1115,7 @@ async def delete_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1092,6 +1126,7 @@ async def delete_async( Delete a webhook. :param id: The ID of the webhook to delete. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1109,6 +1144,7 @@ async def delete_async( request = models.DeleteWebhookRequest( id=id, + project_id=project_id, ) req = self._build_request_async( diff --git a/src/moderation_api/webhooksecret.py b/src/moderation_api/webhooksecret.py index 9c52eb0..4ed0bb0 100644 --- a/src/moderation_api/webhooksecret.py +++ b/src/moderation_api/webhooksecret.py @@ -13,6 +13,7 @@ class WebhookSecret(BaseSDK): def retrieve( self, *, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -22,6 +23,7 @@ def retrieve( Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -36,12 +38,17 @@ def retrieve( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetWebhookSecretRequest( + project_id=project_id, + ) + req = self._build_request( method="GET", path="/webhook-secret", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -105,6 +112,7 @@ def retrieve( async def retrieve_async( self, *, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -114,6 +122,7 @@ async def retrieve_async( Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -128,12 +137,17 @@ async def retrieve_async( base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.GetWebhookSecretRequest( + project_id=project_id, + ) + req = self._build_request_async( method="GET", path="/webhook-secret", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, diff --git a/src/moderation_api/wordlist.py b/src/moderation_api/wordlist.py index 4628b45..6cefbf9 100644 --- a/src/moderation_api/wordlist.py +++ b/src/moderation_api/wordlist.py @@ -30,6 +30,7 @@ def list( *, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -41,6 +42,7 @@ def list( :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -59,6 +61,7 @@ def list( request = models.ListWordlistsRequest( page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request( @@ -125,6 +128,7 @@ def next_func() -> Optional[models.ListWordlistsResponse]: return self.list( page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -183,6 +187,7 @@ async def list_async( *, page: Optional[int] = 1, page_size: Optional[int] = 20, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -194,6 +199,7 @@ async def list_async( :param page: :param page_size: + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -212,6 +218,7 @@ async def list_async( request = models.ListWordlistsRequest( page=page, page_size=page_size, + project_id=project_id, ) req = self._build_request_async( @@ -281,6 +288,7 @@ async def empty_result(): return self.list_async( page=next_page, page_size=page_size, + project_id=project_id, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -338,6 +346,7 @@ def retrieve( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -348,6 +357,7 @@ def retrieve( Get a specific wordlist by ID :param id: ID of the wordlist to get + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -365,6 +375,7 @@ def retrieve( request = models.GetWordlistRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -455,6 +466,7 @@ async def retrieve_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -465,6 +477,7 @@ async def retrieve_async( Get a specific wordlist by ID :param id: ID of the wordlist to get + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -482,6 +495,7 @@ async def retrieve_async( request = models.GetWordlistRequest( id=id, + project_id=project_id, ) req = self._build_request_async( @@ -572,6 +586,7 @@ def update( self, *, id: str, + project_id: Optional[str] = None, name: Optional[str] = None, key: Optional[str] = None, description: Optional[str] = None, @@ -587,6 +602,7 @@ def update( Update a wordlist :param id: ID of the wordlist to update + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param name: New name for the wordlist :param key: New key for the wordlist :param description: New description for the wordlist @@ -609,6 +625,7 @@ def update( request = models.UpdateWordlistRequest( id=id, + project_id=project_id, body=models.UpdateWordlistRequestBody( name=name, key=key, @@ -699,6 +716,7 @@ async def update_async( self, *, id: str, + project_id: Optional[str] = None, name: Optional[str] = None, key: Optional[str] = None, description: Optional[str] = None, @@ -714,6 +732,7 @@ async def update_async( Update a wordlist :param id: ID of the wordlist to update + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param name: New name for the wordlist :param key: New key for the wordlist :param description: New description for the wordlist @@ -736,6 +755,7 @@ async def update_async( request = models.UpdateWordlistRequest( id=id, + project_id=project_id, body=models.UpdateWordlistRequestBody( name=name, key=key, @@ -826,6 +846,7 @@ def get_embedding_status( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -836,6 +857,7 @@ def get_embedding_status( Get the current embedding progress status for a wordlist :param id: ID of the wordlist to check embedding status for + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -853,6 +875,7 @@ def get_embedding_status( request = models.GetWordlistEmbeddingStatusRequest( id=id, + project_id=project_id, ) req = self._build_request( @@ -945,6 +968,7 @@ async def get_embedding_status_async( self, *, id: str, + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -955,6 +979,7 @@ async def get_embedding_status_async( Get the current embedding progress status for a wordlist :param id: ID of the wordlist to check embedding status for + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -972,6 +997,7 @@ async def get_embedding_status_async( request = models.GetWordlistEmbeddingStatusRequest( id=id, + project_id=project_id, ) req = self._build_request_async( diff --git a/src/moderation_api/words.py b/src/moderation_api/words.py index cefa1a0..085378a 100644 --- a/src/moderation_api/words.py +++ b/src/moderation_api/words.py @@ -15,6 +15,7 @@ def add( *, id: str, words: Iterable[str], + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -26,6 +27,7 @@ def add( :param id: ID of the wordlist to add words to :param words: Array of words to add to the wordlist. Duplicate words will be ignored. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -43,6 +45,7 @@ def add( request = models.AddWordlistWordsRequest( id=id, + project_id=project_id, body=models.AddWordlistWordsRequestBody( words=utils.unmarshal(words, List[str]), ), @@ -130,6 +133,7 @@ async def add_async( *, id: str, words: Iterable[str], + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -141,6 +145,7 @@ async def add_async( :param id: ID of the wordlist to add words to :param words: Array of words to add to the wordlist. Duplicate words will be ignored. + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -158,6 +163,7 @@ async def add_async( request = models.AddWordlistWordsRequest( id=id, + project_id=project_id, body=models.AddWordlistWordsRequestBody( words=utils.unmarshal(words, List[str]), ), @@ -245,6 +251,7 @@ def remove( *, id: str, words: Iterable[str], + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -256,6 +263,7 @@ def remove( :param id: ID of the wordlist to remove words from :param words: Array of words to remove from the wordlist + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -274,6 +282,7 @@ def remove( request = models.RemoveWordlistWordsRequest( id=id, words=utils.unmarshal(words, List[str]), + project_id=project_id, ) req = self._build_request( @@ -355,6 +364,7 @@ async def remove_async( *, id: str, words: Iterable[str], + project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -366,6 +376,7 @@ async def remove_async( :param id: ID of the wordlist to remove words from :param words: Array of words to remove from the wordlist + :param project_id: The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -384,6 +395,7 @@ async def remove_async( request = models.RemoveWordlistWordsRequest( id=id, words=utils.unmarshal(words, List[str]), + project_id=project_id, ) req = self._build_request_async(