diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index eb9d9eb..2c76b2f 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: 38730339aa1da77855e86c169896f12f + docChecksum: ed2fd953cba3e99fb81365252925a0d4 docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 2.1.1 - configChecksum: 3d9a12333f71c39e9fb299bc45245b92 + releaseVersion: 2.2.0 + configChecksum: da63d9409ef6e27083aab8b1d6def56f repoURL: https://github.com/moderation-api/sdk-python installationURL: https://github.com/moderation-api/sdk-python.git published: true @@ -47,23 +47,23 @@ trackedFiles: docs/errors/authenticationerror.md: last_write_checksum: sha1:cdb9eaf19220813ba7f8e63c39807eec5fb8f95f docs/errors/badrequesterror.md: - last_write_checksum: sha1:16a33340e3ef30ac7277ff3083ebd9867fd9ce7b + last_write_checksum: sha1:75edb4b6b9a193e6c7055b9e7106191b38acabf5 docs/errors/conflicterror.md: last_write_checksum: sha1:f5e67eedc35f8a93c2ba9675a5bdf7ebd696e446 docs/errors/internalservererror.md: last_write_checksum: sha1:f17be7e390331a5523a66684f9681f907ce4f9b9 docs/errors/notfounderror.md: - last_write_checksum: sha1:f1b0b0c97c7796ee821c6312960fac56404600c4 + last_write_checksum: sha1:1f2be6ce5d1770b4076a83b5d9705b8da463c623 docs/errors/permissiondeniederror.md: last_write_checksum: sha1:20c2dec2f1672933d2f017f61faeff3bbf26e593 docs/errors/ratelimiterror.md: last_write_checksum: sha1:c3525f444f391db06263cef2cfe877ea8f015469 docs/models/actionrequest.md: last_write_checksum: sha1:eb97e24bc728f013d6a86346ad5edea0b5406373 - docs/models/actionstat.md: - last_write_checksum: sha1:dd4e71ad441cb258bb22a3823e1b334637635546 + docs/models/actionresponse.md: + last_write_checksum: sha1:13b574670e3d0acf7512bc794244241a83130bcf docs/models/addwordlistwordsrequest.md: - last_write_checksum: sha1:151b2ddef58b9281db21c8ef97c77531bcc239fb + last_write_checksum: sha1:7b265e94c71b165ab0123f198dbc28bc66645963 docs/models/addwordlistwordsrequestbody.md: last_write_checksum: sha1:2c2d0ee0bddfafe1779220ee07aee53179e3b6fe docs/models/addwordlistwordsresponse.md: @@ -78,28 +78,22 @@ trackedFiles: last_write_checksum: sha1:9f7d896d79666963d3d884e6b12ffad79ce32c0d docs/models/authenticationerrorcode.md: last_write_checksum: sha1:67fd46b3807d5cbdbf5785b53b24e38785f31ae4 - docs/models/author.md: - last_write_checksum: sha1:534fc4c86f2ef71bf154b995d07ab1a00a86fd1b docs/models/authorstatus.md: last_write_checksum: sha1:7d7a67666c6ec82daa47ba9726c4d92792314ce1 docs/models/badrequesterrorcode.md: - last_write_checksum: sha1:2da41def3827487b66d4ce2008312eedf98df9fc + last_write_checksum: sha1:c04f6b8cc50257203e9df45a36f95f86a8d6f270 docs/models/block.md: last_write_checksum: sha1:a59f8f13228667d39879853ad05332c707c0afc8 + docs/models/bucket.md: + last_write_checksum: sha1:df24d99e697de42164d0769adff95be2eda03e8c docs/models/cannabis.md: last_write_checksum: sha1:f2837d187a268df000bcd19928b2b2e75cdf187c docs/models/casebook.md: last_write_checksum: sha1:06f2d38ae97a4fd3e1ac632ce85bd3ebd7e47fe8 - docs/models/casebookagreement.md: - last_write_checksum: sha1:7880dea0021ba88be8c71f1ca4f338d64389d312 - docs/models/casebookanswer.md: - last_write_checksum: sha1:679b43586bfba9db51ad0452ec8e51a1fcc37c88 docs/models/channel.md: last_write_checksum: sha1:1eccfaf5e0fe2775c92f478c52009a55745ae2bb docs/models/channelcircumvention.md: last_write_checksum: sha1:dfe4dde2cd4ad0ad751259472da6f28fbd89fd28 - docs/models/checkstatus.md: - last_write_checksum: sha1:36c36e20ac95b903bc8198bebaf7cbab2818f968 docs/models/classifieroutput.md: last_write_checksum: sha1:b019db75a1906cd78f17d0053e6376bbbc94ee10 docs/models/codeabuse.md: @@ -133,7 +127,7 @@ trackedFiles: docs/models/createactionqueuebehaviourresponse.md: last_write_checksum: sha1:661904e9ebeff0db3f2fbb3db788c585ec3abb52 docs/models/createactionrequest.md: - last_write_checksum: sha1:26e01e3c84f4835a9d20cb4587cc491fbf2c189a + last_write_checksum: sha1:e5da0e8e4c4727b8b295428764c24d572b766a7a docs/models/createactionrequestbody.md: last_write_checksum: sha1:7379ce37b676bbd8cb605846560593ef698eecf4 docs/models/createactionresponse.md: @@ -145,7 +139,7 @@ trackedFiles: docs/models/createauthormetadata.md: last_write_checksum: sha1:ed6f2bb159071080f1ddde183b7e09a0033a693b docs/models/createauthorrequest.md: - last_write_checksum: sha1:cb9b5e36c24363526d703384ffbffb539a6c2cff + last_write_checksum: sha1:b4a9b35a8bc909862a043fd63db695fe14e8bf53 docs/models/createauthorrequestbody.md: last_write_checksum: sha1:4accf2383553031d511b646f7e6c265d24c28a3d docs/models/createchannelcontenttype.md: @@ -154,6 +148,18 @@ trackedFiles: last_write_checksum: sha1:379cd7d7d019aa16fa349d08fd340f9d761ef3d9 docs/models/createchannelrequestbody.md: last_write_checksum: sha1:a716f74f46bb226942ba825a5365762920dc0143 + docs/models/createfeedbackrequest.md: + last_write_checksum: sha1:472018baed782d188fdea62fa3c5c29d221364c7 + docs/models/createfeedbackrequestbody.md: + last_write_checksum: sha1:26baaa1b9611048e232eab23704ada295f73c0b9 + docs/models/createfeedbackresponse.md: + last_write_checksum: sha1:a468e61d1a3dfbc46c3a7034cf5134b10291d9e4 + docs/models/createfeedbacktype.md: + last_write_checksum: sha1:4bb163646751effcb16449890b5aa158174bcd95 + docs/models/createprojectapikeyrequest.md: + last_write_checksum: sha1:2bc60aee79bf33184c381d21d490e02ac382ff8d + docs/models/createprojectapikeyrequestbody.md: + last_write_checksum: sha1:ea1bbb2713f18910c7e84f660099f37253754cc0 docs/models/createprojectrequest.md: last_write_checksum: sha1:3002ce5c3ad3795024e372370dfb648e4d437c49 docs/models/createwebhookeventtyperequest.md: @@ -163,11 +169,17 @@ trackedFiles: docs/models/createwebhookpayloadversion.md: last_write_checksum: sha1:fc2b9c87fa4930fea544ebf72a0491d9ee5c2c77 docs/models/createwebhookrequest.md: - last_write_checksum: sha1:c81d03ae02e67bf4c844d2acf73daa8da3ca4ed8 + last_write_checksum: sha1:c968209d10a8f5906342a5e19ea96e50766df5ed docs/models/createwebhookrequestbody.md: last_write_checksum: sha1:0ada491dab35eb0baccb75dafa0628f034ad55e0 docs/models/createwebhookresponse.md: last_write_checksum: sha1:d3e4e95d3258e1a3e2c6f9b647eb035089a64022 + docs/models/createwordlistrequest.md: + last_write_checksum: sha1:4e99ee05eb6e3db284bc3e40f05cbe5a7435aac5 + docs/models/createwordlistrequestbody.md: + last_write_checksum: sha1:345001c2a00abfa29c461150fdff29739517252f + docs/models/createwordlistresponse.md: + last_write_checksum: sha1:4a3f603cdbc351936833c2ca0798d0fe92846f74 docs/models/crypto.md: last_write_checksum: sha1:db443484ad40bac81119ff67c24a0216b6e3c08d docs/models/curiosityinsight.md: @@ -175,7 +187,7 @@ trackedFiles: docs/models/currentproject.md: last_write_checksum: sha1:2fd22e845cf2a3fac9dc06eb116e9bfaba9a2fe1 docs/models/dailyreviewcount.md: - last_write_checksum: sha1:ea66f88370089f3db1268a31befa907ed03f9e21 + last_write_checksum: sha1:0b376b0e6de05d2e7366f00a1457f54dd9cf9b45 docs/models/dataaudiorequest.md: last_write_checksum: sha1:1608d0ba903dd972968ef75d224d294ef9dc07ea docs/models/dataimagerequest.md: @@ -185,11 +197,11 @@ trackedFiles: docs/models/datavideorequest.md: last_write_checksum: sha1:948cd457b3bc2ed3c352ae6d4331807883a349f9 docs/models/deleteactionrequest.md: - last_write_checksum: sha1:fbad846593f5c5cdbfecbbec1b6ea4a49de69a54 + last_write_checksum: sha1:c215bfd31f9d86eb358301f1a7d6a70222338857 docs/models/deleteactionresponse.md: last_write_checksum: sha1:d8128ce2a339c801bfa0c91ed1b1243cc974a3d1 docs/models/deleteauthorrequest.md: - last_write_checksum: sha1:a5728a965732ade72520ddab82c56050e20c5356 + last_write_checksum: sha1:219a9007c3ac0b7a037c4b05be6ecd792b9d6411 docs/models/deleteauthorresponse.md: last_write_checksum: sha1:470ec6b2dd0f1e3fa81c9b67bdf00524270de610 docs/models/deletechannelrequest.md: @@ -201,7 +213,7 @@ trackedFiles: docs/models/deleteprojectresponse.md: last_write_checksum: sha1:57597dca05a2fcd6f6b1ef129f7cd834cc5316ba docs/models/deletewebhookrequest.md: - last_write_checksum: sha1:9dbb85c90303baca11b0c01ae365ab3931d0778b + last_write_checksum: sha1:f72533a66e9b9c50ee17bcde04ac8db58bb129d0 docs/models/deletewebhookresponse.md: last_write_checksum: sha1:9c274b660824d02e9fc18bab98ef18fd9027add1 docs/models/drugs.md: @@ -227,7 +239,7 @@ trackedFiles: docs/models/evaluation.md: last_write_checksum: sha1:dc81ec6315567fca488efc6da9a16b4ca6899925 docs/models/executeactionrequest.md: - last_write_checksum: sha1:5d7370245564436d96d25779cdadaa17c1b8d83b + last_write_checksum: sha1:0abecf77c13cb692445ccdfcea1b5959da107f0f docs/models/executeactionrequestbody.md: last_write_checksum: sha1:0d3920ab521ccbdb6a396510bcc6e626ffd634b7 docs/models/executeactionresponse.md: @@ -236,18 +248,14 @@ trackedFiles: last_write_checksum: sha1:5fac6b4e17a881eba7ad0b594693f1db235283c0 docs/models/facedetection.md: last_write_checksum: sha1:4f04c10a8d8451004fb295916b8553f7ff59abab - docs/models/filter_.md: - last_write_checksum: sha1:8fcade253298593df1b69abb9152bde3a541803f - docs/models/filterlabel.md: - last_write_checksum: sha1:4facc20237eb19a90c6f4dc186fe78dc5a548f40 - docs/models/flaggedcontenttrend.md: - last_write_checksum: sha1:6f146aac7ca954fd2612722c5edecc8ad76808cb docs/models/flaggingmode.md: last_write_checksum: sha1:2b62179f3ffb684c32dbd22701c564701c6f608e + docs/models/flagratespike.md: + last_write_checksum: sha1:03373a764758080a44df47a1a21bf69461ecedc4 docs/models/gambling.md: last_write_checksum: sha1:343bbfe2f0a7f12e50f78e0c6da7eda073de026d docs/models/getaccountrequest.md: - last_write_checksum: sha1:67a196a0b7940e0262cca727ab5dc8c1de909271 + last_write_checksum: sha1:6fec30c934161c0e100e8465cec3f3f76f9cef1d docs/models/getaccountresponse.md: last_write_checksum: sha1:7f88c1b881320e8cf86763cd05088e75e549a22e docs/models/getactionposition.md: @@ -257,51 +265,97 @@ trackedFiles: docs/models/getactionqueuebehaviour.md: last_write_checksum: sha1:3f1e1988781d3f52fec875063ee677bfba485db2 docs/models/getactionrequest.md: - last_write_checksum: sha1:faf3a88059f30078a2fbb0f106d8f2a91905d9c6 + last_write_checksum: sha1:c4c9f8aa63612d05fde6dccaa207945fb09b6165 docs/models/getactionresponse.md: last_write_checksum: sha1:bad30829267fbc4ba772be0f905f4a6537ec164f docs/models/getactiontype.md: last_write_checksum: sha1:2c93577a65ac4a4e32889986e486b5efd0848646 + docs/models/getanalyticsauthorsauthor.md: + last_write_checksum: sha1:2f285a30d9ded5a5e4789817f117e8d8f703d656 + docs/models/getanalyticsauthorsqueryparamrange.md: + last_write_checksum: sha1:90a141f10614269d1065026773249becf5e2f080 + docs/models/getanalyticsauthorsrangeresponse.md: + last_write_checksum: sha1:7df97e58db7015cc932fce90cb9943ceefbeb187 + docs/models/getanalyticsauthorsrequest.md: + last_write_checksum: sha1:606eb2cd18dfea06bdaf74feb4a49856ad58829d + docs/models/getanalyticsauthorsresponse.md: + last_write_checksum: sha1:13f3c820b776c1c720f2ed9d75d2b1615270920e + docs/models/getanalyticsautomationqueryparamrange.md: + last_write_checksum: sha1:b1f88e898a36abe55c0afb013aa3a6fdfa50e37e + docs/models/getanalyticsautomationrangeresponse.md: + last_write_checksum: sha1:fa5d88c33c4b3f0fa083c6c33c7ac58cdd9a6f0c + docs/models/getanalyticsautomationrequest.md: + last_write_checksum: sha1:1a1229360de5cd8554a9f3abc98a7f1ec3e38ff4 + docs/models/getanalyticsautomationresponse.md: + last_write_checksum: sha1:3c5883951ed90082c4ab8ff9af0e65f4d36b6ad8 + docs/models/getanalyticschannelschannel.md: + last_write_checksum: sha1:8f63c3eb01515bab5ce555b4343c466f6a1e8b69 + docs/models/getanalyticschannelsqueryparamrange.md: + last_write_checksum: sha1:49a9a15a933a81f811b409e63f4179890a770bdc + docs/models/getanalyticschannelsrangeresponse.md: + last_write_checksum: sha1:322f9f318732f4e5be0a79c8c4d17e9cf0ebd27f + docs/models/getanalyticschannelsrequest.md: + last_write_checksum: sha1:9193bf19ef2eca15adac7d835da818b79b2ad8e5 + docs/models/getanalyticschannelsresponse.md: + last_write_checksum: sha1:2e29a81ad9e1b805de1976161202206c807650dc + docs/models/getanalyticspoliciespolicy.md: + last_write_checksum: sha1:1c228f4eb20145e796043f0f45451805788f51f4 + docs/models/getanalyticspoliciesqueryparamrange.md: + last_write_checksum: sha1:da0796e913e57edc3ebe13a7f500853deace995f + docs/models/getanalyticspoliciesrangeresponse.md: + last_write_checksum: sha1:59c625ac36465ef9d4fabc3ebf3fd4e534f5015a + docs/models/getanalyticspoliciesrequest.md: + last_write_checksum: sha1:0fcaf433cb96359b4bacd2dc38994fb1b51c688b + docs/models/getanalyticspoliciesresponse.md: + last_write_checksum: sha1:61f6261b71d73747454139eb1caa01869e488fe9 + docs/models/getanalyticssummaryqueryparamrange.md: + last_write_checksum: sha1:74e05ebcc5c88b2f69902bed4d531772a218423e + docs/models/getanalyticssummaryrangeresponse.md: + last_write_checksum: sha1:4e7976047d83d5bdcd4fd576da9933957acc94b1 + docs/models/getanalyticssummaryrequest.md: + last_write_checksum: sha1:3ad9e141aad142faef805382b7ff870cb67263e8 + docs/models/getanalyticssummaryresponse.md: + last_write_checksum: sha1:03d68e3346eea964371d1da8d2f1afa9c61de666 + docs/models/getanalyticsvolumesqueryparamrange.md: + last_write_checksum: sha1:d459acd17772d5de478b62a417eea003fb8a2502 + docs/models/getanalyticsvolumesrangeresponse.md: + last_write_checksum: sha1:edbd222530f9022a6d9f7dbcaabe8fe6ff1e82f2 + docs/models/getanalyticsvolumesrequest.md: + last_write_checksum: sha1:fa003956b3a43c638e4defec4a38eb70a34f2c1d + docs/models/getanalyticsvolumesresponse.md: + last_write_checksum: sha1:7da81fe65a9fbd98881697fa7ece10450c75c5de docs/models/getauthorrequest.md: - last_write_checksum: sha1:1f95a36d459b88f81511f18433ac1b58778955c6 + last_write_checksum: sha1:c384eac5bb2e8c8da0c335f80c5ac547b7c15d24 docs/models/getchannelrequest.md: last_write_checksum: sha1:6f995844a8ce5166bcb1994a0d2ebe2458e98fa9 docs/models/getprojectrequest.md: last_write_checksum: sha1:36ed032fdb5e6f8a3f9be1ed427a1a17d58d0e2f - docs/models/getqueuecontenttype.md: - last_write_checksum: sha1:4cbf028f26c123a95a021932502a165966549d9f - docs/models/getqueuequeue.md: - last_write_checksum: sha1:c8ef905a7df4b648a35c47552d5366b7f1bb5451 - docs/models/getqueuerecommendationaction.md: - last_write_checksum: sha1:bc6702b02de201c183034d644f701aa1afbd6901 docs/models/getqueuerequest.md: - last_write_checksum: sha1:1eda4e3dfdc20027253291f438aa1841d005e6b8 + last_write_checksum: sha1:c9e129059ae92b4647fbc394b85740966dbaaa36 docs/models/getqueueresponse.md: - last_write_checksum: sha1:92fbe19cabcc7751157bd1043491e26bed955085 + last_write_checksum: sha1:257b50d454619f9b9056a75fb401ad1a79d37f2f docs/models/getqueuestatsrequest.md: - last_write_checksum: sha1:98538d9432b43fbabefd4a278f7ad7bd8432f194 + last_write_checksum: sha1:b7bb2314ad31e1e8bb8665b301fbad508516ada2 docs/models/getqueuestatsresponse.md: - last_write_checksum: sha1:fcbe4d64e0d11aa962ba42bdad4fb15c09a08d48 - docs/models/getqueuetype.md: - last_write_checksum: sha1:3d139324f660493267bc2584e25f2954de263c4b + last_write_checksum: sha1:283deaeda4a250eee179db63659dc97a41c6475f docs/models/getwebhookeventtype.md: last_write_checksum: sha1:2c8b1d5bb03b136c6553b17e5bdd00b830e7a394 docs/models/getwebhookpayloadversion.md: last_write_checksum: sha1:60b692ba995e47aa4a6207788a11c118717b48b9 docs/models/getwebhookrequest.md: - last_write_checksum: sha1:e93633db06a13556c00c384f27805b2d5421ceca + last_write_checksum: sha1:d6499c34e7a20c6988e15c66409643c1e43999a7 docs/models/getwebhookresponse.md: last_write_checksum: sha1:aab2bc255c774bcb7e7c7f21fb349be95f021e98 docs/models/getwebhooksecretrequest.md: - last_write_checksum: sha1:ada90bc34a17c3529199b7f8b0b15c1120f8ed35 + last_write_checksum: sha1:aacb17fb70a7453d77cbacc7d7cc00abea95429d docs/models/getwebhooksecretresponse.md: last_write_checksum: sha1:2b522faf79d9aeb7a83d515b6f9a9caf7e5c3e7e docs/models/getwordlistembeddingstatusrequest.md: - last_write_checksum: sha1:07638073c137b10148987b07c7d7866ad70e3706 + last_write_checksum: sha1:26c37676d80ae5efbc549e0277dc2ec20eee574d docs/models/getwordlistembeddingstatusresponse.md: last_write_checksum: sha1:8a14bd9f775b10af8cc179aa5e7a072775c4e956 docs/models/getwordlistrequest.md: - last_write_checksum: sha1:684c0944558456fe2f2a2d13c4099d646c0f99fc + last_write_checksum: sha1:d4ed2aa5b6046c0635ba90dd884ace16439ea901 docs/models/getwordlistresponse.md: last_write_checksum: sha1:47a1730eb606700aba8d367e0f3613f741c9a31b docs/models/guideline.md: @@ -330,8 +384,8 @@ trackedFiles: last_write_checksum: sha1:b5caab43652173b483a5081e842c1391c4ad227e docs/models/internalservererrorcode.md: last_write_checksum: sha1:e10bd4ab0ff00c78ad783e9079edd382a2832cc3 - docs/models/isflagged.md: - last_write_checksum: sha1:5945535d190a3658b78ae9f24eedeb39c6fcc564 + docs/models/label.md: + last_write_checksum: sha1:85d21f174d74740d6100036e4bfa19f7930d208a docs/models/languageinsight.md: last_write_checksum: sha1:24e3ed1573936724d99cb0927df88a73297763f4 docs/models/listactionsdata.md: @@ -343,7 +397,7 @@ trackedFiles: docs/models/listactionsqueuebehaviour.md: last_write_checksum: sha1:64482ff4675f11131fce0dc1279544a67a94ee3a docs/models/listactionsrequest.md: - last_write_checksum: sha1:c458b34df82f4783d638c5c47e7e2a79d0a726db + last_write_checksum: sha1:5f69f511891432550d15d5b60f00b87dca3b8427 docs/models/listactionsresponse.md: last_write_checksum: sha1:58f2ed5f656ee6cf7cd83b0565dc21d1a23ac034 docs/models/listactionsresponsebody.md: @@ -351,13 +405,11 @@ trackedFiles: docs/models/listactionstype.md: last_write_checksum: sha1:0acfca31cf44c1d30a705feb78bafa018407152c docs/models/listauthorsrequest.md: - last_write_checksum: sha1:3763ad95bb74fdd85c3c5fbd617d01fc053368e3 + last_write_checksum: sha1:5019c3bea8779989a4e766dce2953e20d1f31d41 docs/models/listauthorsresponse.md: last_write_checksum: sha1:54190f4a9d6e175bcb07946f024079d9d75f73a1 docs/models/listauthorsresponsebody.md: last_write_checksum: sha1:e13bbad68a5b35808b3d816918b4f6376d51b925 - docs/models/listauthorssortdirection.md: - last_write_checksum: sha1:3782d7e8077d7823c2be30217f7184df75eb5499 docs/models/listchannelsrequest.md: last_write_checksum: sha1:3588e16e2514f0c0101fee1af2a19f8a777669e1 docs/models/listchannelsresponse.md: @@ -370,22 +422,18 @@ trackedFiles: last_write_checksum: sha1:da5ad1598b3d60e808ffd38508a531b26ba694ec docs/models/listprojectsresponsebody.md: last_write_checksum: sha1:a810cd219dae76dab77a95d485f8770245d0a21f - docs/models/listqueueitemsaction.md: - last_write_checksum: sha1:9abd259ba70374326c6017c1dd947f4b81548381 - docs/models/listqueueitemsdata.md: - last_write_checksum: sha1:2207fdc0a837fcf1d8c243051baddc03fcc48413 - docs/models/listqueueitemslabel.md: - last_write_checksum: sha1:0c4fcb2565877c1ba680c14f5931e031bb8d01e3 docs/models/listqueueitemsrequest.md: - last_write_checksum: sha1:356a48e77490eb1e9514e5d040ea6a5893d73005 + last_write_checksum: sha1:b3f5385c2b620270898bb003779545d3450acb63 docs/models/listqueueitemsresponse.md: last_write_checksum: sha1:e64d55d94911de55deceb1229745943edbd32f81 docs/models/listqueueitemsresponsebody.md: - last_write_checksum: sha1:1d4ae5766877b9d20e15ba39ed9efdbb286bcc7d - docs/models/listqueueitemssortdirection.md: - last_write_checksum: sha1:ca8cd8f662954c9a0a95befa5bb22993fdd0a8f5 - docs/models/listqueueitemsstatus.md: - last_write_checksum: sha1:c02460d6c404820ed84c868bf8b5e0b438671c53 + last_write_checksum: sha1:82add8481ee9473f2b0d17cabdd227b98c6a5f2c + docs/models/listqueuesrequest.md: + last_write_checksum: sha1:6a0bc86398888f90cff2008fcbb3b460e9118c27 + docs/models/listqueuesresponse.md: + last_write_checksum: sha1:afc7fca7ea5313b5842e891198f3aaa3bcaf2b31 + docs/models/listqueuesresponsebody.md: + last_write_checksum: sha1:dbcd5a1149952411627ec5fac125f964deb1813b docs/models/listwebhooksdata.md: last_write_checksum: sha1:429716b17fa368d72aacf324cce21a446ec03b43 docs/models/listwebhookseventtype.md: @@ -393,7 +441,7 @@ trackedFiles: docs/models/listwebhookspayloadversion.md: last_write_checksum: sha1:1e5703533be94f7611a849073310f8472c877b45 docs/models/listwebhooksrequest.md: - last_write_checksum: sha1:02d4e1a8fcc9707517094ef9f61a3d0f8b1c0d4e + last_write_checksum: sha1:d1f97b364eef69030b4ea73d36e24d9b90b78041 docs/models/listwebhooksresponse.md: last_write_checksum: sha1:0d455d264c8f505d8ece9be38a7eabf0296241cc docs/models/listwebhooksresponsebody.md: @@ -401,7 +449,7 @@ trackedFiles: docs/models/listwordlistsdata.md: last_write_checksum: sha1:c494cff76fdb516204f6e9e8e3b7c31648d36f12 docs/models/listwordlistsrequest.md: - last_write_checksum: sha1:96c18cb532e49cb86d0fea0feab40368f266c854 + last_write_checksum: sha1:e3c73911abada9a4a910582f2a9f5002764ca7b1 docs/models/listwordlistsresponse.md: last_write_checksum: sha1:42695dbad3b56ec850f5f607f68932de9ceaffac docs/models/listwordlistsresponsebody.md: @@ -410,14 +458,10 @@ trackedFiles: last_write_checksum: sha1:4f0be91d2004422b98e25125bb2c99d3b8dcbb0d docs/models/matchedrule.md: last_write_checksum: sha1:38b4b6b7b5a492a54f94b3c7aa28df84a5d2272b - docs/models/mediatype.md: - last_write_checksum: sha1:b01559d3bfd412e12037c883500e1b63e83584e7 docs/models/meta.md: last_write_checksum: sha1:16400e8b19a2b2e40958ca16043bb346fe91f802 docs/models/metadata.md: last_write_checksum: sha1:3c8b975ac90d4d1b22e32ce536262cb44b3a944d - docs/models/metadatafilter.md: - last_write_checksum: sha1:687f14cadd5f224288ea1092ad37ecf83a63347e docs/models/metastatus.md: last_write_checksum: sha1:ca093563fe510508ebda1b9e0bb7418c9760988c docs/models/method.md: @@ -427,7 +471,7 @@ trackedFiles: docs/models/modified.md: last_write_checksum: sha1:f9beaef1f80aa3d97168d9486d263117541f4eb8 docs/models/notfounderrorcode.md: - last_write_checksum: sha1:a27312bea3d9a56e398b702a77267fbf82522128 + last_write_checksum: sha1:e8187838ee52a07d893c05a5d3dc0a3bc9720108 docs/models/pagination.md: last_write_checksum: sha1:4b3da29ce00e5aa486e79a68fdd00b9741432a6c docs/models/path.md: @@ -442,14 +486,16 @@ trackedFiles: last_write_checksum: sha1:294d1f75f8af8eb9a2a971d1ce1b527a69e2474f docs/models/policyrequest.md: last_write_checksum: sha1:7e2a70b2e90bb3a3e861621208e4dc552b5ee176 - docs/models/policyresponse.md: - last_write_checksum: sha1:9d3a5ab4cff0968a140ab778127e35d24926286c docs/models/political.md: last_write_checksum: sha1:deb07e4e829c7c2994766f2f787272cf0fce34e3 + docs/models/previousperiod.md: + last_write_checksum: sha1:57e061ceaa87a583202ea89b258d7840eb845b10 docs/models/profanity.md: last_write_checksum: sha1:c7552728b6eef5b380a57e9a4c1c3216c5b74805 docs/models/project.md: last_write_checksum: sha1:9c90aec9e27e572b30379a6f44fc78d746dabf7e + docs/models/projectapikey.md: + last_write_checksum: sha1:0b451a661ae175160635a7127a08b16544121f13 docs/models/projectglobalflaggingmode.md: last_write_checksum: sha1:e849c01b3b79fd799d4f74664020a06b849d7c2b docs/models/projectwithkey.md: @@ -459,7 +505,45 @@ trackedFiles: docs/models/promotion.md: last_write_checksum: sha1:52b573d17f9566555dd3407a1ea04f1b7825fa15 docs/models/publicauthor.md: - last_write_checksum: sha1:d921dc5c5445bb99f1e8f616aaf400ef36ef604b + last_write_checksum: sha1:fddc00e4ac3be32ef49b47edd8b514f81b11779d + docs/models/publicauthorstatus.md: + last_write_checksum: sha1:fa5dd80cf2773e26de7833aedf356ab79a2059ea + docs/models/queue.md: + last_write_checksum: sha1:55d14bf277d370f30ebd0fca8e465c6cd63f21f8 + docs/models/queueitem.md: + last_write_checksum: sha1:2b379154f8a8ce0497a58f0e6dc8eb9dcb7e9c85 + docs/models/queueitemaudio.md: + last_write_checksum: sha1:d531cb71cc9e6685f094a6934e80bf4043ac0c15 + docs/models/queueitembrandimpersonation.md: + last_write_checksum: sha1:0d6a2bff665ce1fc4cc0a413b5707669a4da4758 + docs/models/queueitemcontent.md: + last_write_checksum: sha1:c79756ce4aafd2c0b75c881b43899839223b8caf + docs/models/queueitemcontentleaf.md: + last_write_checksum: sha1:4f88d787af3c4f6858dda4ecb5cbee95b506a7bd + docs/models/queueitemdataaudio.md: + last_write_checksum: sha1:70e6c57f2ecc0e96dfd201a1aa9f3dc2c51f2b19 + docs/models/queueitemdataimage.md: + last_write_checksum: sha1:f85fb0f7f4f62c2360a404f9a0006a7d53f1423d + docs/models/queueitemdatatext.md: + last_write_checksum: sha1:c47bd324f1f70bdd817f3ab742ccc16885c5eac9 + docs/models/queueitemdatavideo.md: + last_write_checksum: sha1:c8759b56aced210296fae9743d360245d9c690c1 + docs/models/queueitemimage.md: + last_write_checksum: sha1:617e8b6a06009bfca1ecea3695dedcdb8ab1dedc + docs/models/queueitemmatch.md: + last_write_checksum: sha1:03ccf3f88210f57058cdf2d867550ea2a9b65fc6 + docs/models/queueitemobject.md: + last_write_checksum: sha1:9d9ce7c4eb98d36423542f713c93b29a5ef88323 + docs/models/queueitemsignals.md: + last_write_checksum: sha1:5a005f19d06b6f9c5df733af3508bfe39ad474fc + docs/models/queueitemstatus.md: + last_write_checksum: sha1:0e5622d28baaeb05782fd6a0eb3b48775c370e73 + docs/models/queueitemtext.md: + last_write_checksum: sha1:375f721b973aaf473a9be1a9d079b6cbf5320cc0 + docs/models/queueitemvideo.md: + last_write_checksum: sha1:38aebc86e665d68df485c047c6bc92d19ee8d04c + docs/models/queuewithcounts.md: + last_write_checksum: sha1:da819e5a73bf02722cb3c76e278d3b97be56ff4b docs/models/ratelimiterrorcode.md: last_write_checksum: sha1:d3d0923b8a898b1d740ce6bfc04a262f8e7666d4 docs/models/reasoncode.md: @@ -467,25 +551,31 @@ trackedFiles: docs/models/reasoncodeenum.md: last_write_checksum: sha1:fba885e8add400d72b780c52abb91ffd8a5fe95f docs/models/recommendation.md: - last_write_checksum: sha1:b81db234abae913cb2f60001d2b2c0311a98a6b9 + last_write_checksum: sha1:351c193d6cbdcebed4ce87ac40e10299dad0f979 docs/models/religion.md: last_write_checksum: sha1:5759f26a6aa19140b1595347d3284cfd22fa7a27 docs/models/removewordlistwordsrequest.md: - last_write_checksum: sha1:ae339bbf9b8b3c3f9c72477f9106500bfb5b8400 + last_write_checksum: sha1:87aad649088d7808d7b267086c2ec5aa96dc5f2c docs/models/removewordlistwordsresponse.md: last_write_checksum: sha1:5efef48f1d38df8e532615c71c4f05de2b0e28f8 docs/models/resolvequeueitemrequest.md: - last_write_checksum: sha1:ac952995d1bdd7d90a43194bea9efb28e613b36f - docs/models/resolvequeueitemrequestbody.md: - last_write_checksum: sha1:d9aa0601044346030a10359a0e1c42108aa116c7 + last_write_checksum: sha1:ce5e4b9191848cac928a7e065d9389323916a892 docs/models/resolvequeueitemresponse.md: - last_write_checksum: sha1:556b1fe9662ce8aec24d6bb251a707a3f0a8cd22 + last_write_checksum: sha1:6be4465672552b7deda68e1b60d4b503b1a90007 + docs/models/resolvequeueitemsrequest.md: + last_write_checksum: sha1:1ba6d46c01600c16c455ac44b0ee7912ae441f31 + docs/models/resolvequeueitemsrequestbody.md: + last_write_checksum: sha1:d155b6e58e2a94d1239e4a3e3eb04eaa7b6c40eb + docs/models/resolvequeueitemsresponse.md: + last_write_checksum: sha1:90cc162d906a0f5f7f55f312fbf81adb1ecf16a1 docs/models/respectinsight.md: last_write_checksum: sha1:4b28f5bb242fad6e0b615fff2c6845196b98f4f4 docs/models/reviewstats.md: - last_write_checksum: sha1:31e64b9015e09f258b913c6b3771d19f2387a60b + last_write_checksum: sha1:01d94d91890046eaea3341f8d374dac44b03ca90 docs/models/riskevaluation.md: last_write_checksum: sha1:fd518fc81e32b686c95cbd4d16d47888d3b83f04 + docs/models/rule.md: + last_write_checksum: sha1:fda54e4212880512aeefc6f1d775cc4f2cb5aa75 docs/models/scores.md: last_write_checksum: sha1:c83b10da5cf13a45af72e7fbd45ce5b1a17bb482 docs/models/security.md: @@ -506,14 +596,18 @@ trackedFiles: last_write_checksum: sha1:6f00ff737cabd9e206a803817ffd66812d9ca382 docs/models/signalsresponse.md: last_write_checksum: sha1:328f5e9dbbfa3c89008ee8e529c0dc32988aa39f + docs/models/sort.md: + last_write_checksum: sha1:37123a81430b8f146ca6674ed624b198942a153e docs/models/sortby.md: - last_write_checksum: sha1:7502f304bf2afedf61d3fff2929cd1be44f0fba4 - docs/models/sortfield.md: - last_write_checksum: sha1:335359823a0169c262fbc1effe9a41872ae582e7 + last_write_checksum: sha1:565d7b37a09c9e022505f2666e9e41b40a1a33e8 + docs/models/sortdirection.md: + last_write_checksum: sha1:72c3ccec458abb770fa7c056d633eef524535b33 + docs/models/source.md: + last_write_checksum: sha1:b77ffb3544955955f0bb43aac5b9a1b0919bb1b8 docs/models/spam.md: last_write_checksum: sha1:0d895e3de8859c08e407860e45082d61a58ff734 - docs/models/status.md: - last_write_checksum: sha1:109a5dc9dd757318d08f390859a924ccc86654f0 + docs/models/submitcontentauthor.md: + last_write_checksum: sha1:7450d00ebbb9df15fe6bc496625b5a90e084be5d docs/models/submitcontentbehavior.md: last_write_checksum: sha1:4b27b4fa8c4cf72cdc494a75de289db823f521ad docs/models/submitcontentblock.md: @@ -530,14 +624,14 @@ trackedFiles: last_write_checksum: sha1:5a92d030516d14406f717f66be7340fb80a1cbbd docs/models/submitcontentobject.md: last_write_checksum: sha1:e69f7ded03211f298df2ffbd5fb185c31901ad49 - docs/models/submitcontentrecommendationaction.md: - last_write_checksum: sha1:06144cc93759541217b52422e5824aea219a3b79 + docs/models/submitcontentpolicyresponse.md: + last_write_checksum: sha1:bf14d74e9baa81d3ac7224321096267e97d7a75f docs/models/submitcontentrequest.md: - last_write_checksum: sha1:aba3be182385a7d35fbfc8f914adb951169f096a + last_write_checksum: sha1:8860c6a21d8f97574f194579b29d4edb775ecedd docs/models/submitcontentrequestbody.md: - last_write_checksum: sha1:4efef96df742c08c58a789ac10466bde0078deb2 + last_write_checksum: sha1:01adf09cb69e6c8bd137ddbc2f54fac25de70927 docs/models/submitcontentresponse.md: - last_write_checksum: sha1:5ee6a1d316786c81e73bef8dfbd3dc83ef0bd4e2 + last_write_checksum: sha1:442e8d07c3a40bb6189ee3c5b535e3b374010f3f docs/models/submitcontenttrustlevel.md: last_write_checksum: sha1:05eb0efa74f798971e34f40eecf67eb9bfe9e9c3 docs/models/textrequest.md: @@ -548,28 +642,28 @@ trackedFiles: last_write_checksum: sha1:7a7af15a688027b76b2d8afc59b58c2ccd072478 docs/models/tobacco.md: last_write_checksum: sha1:ad150ed49039de6563644441c9afbb2a00efc6e1 - docs/models/topaction.md: - last_write_checksum: sha1:88f8810aaa151cea4e4d3bbc62244c7c7d93c070 docs/models/topic.md: last_write_checksum: sha1:eefe5aa4e12093288213aa8cbec131a61cad6eb9 docs/models/topreviewer.md: - last_write_checksum: sha1:f9e07f2a9b03bb833b0a5d28fc52a88ae8fee9e9 + last_write_checksum: sha1:1a08d7a23876cfebabacb2a5545b4b059fbd2495 + docs/models/totals.md: + last_write_checksum: sha1:e355fcb69c6d6904c66d858fdecc4c6326aca869 docs/models/toxicity.md: last_write_checksum: sha1:57689c8564fa374c992a5785fa8d20154dbdad22 docs/models/transcriptionquality.md: last_write_checksum: sha1:47dff7ac460bd5095b55d9376c48b6c011346e57 docs/models/trends.md: - last_write_checksum: sha1:74f38d5e4d17a22345dac8bcb0a3f52f9c4027a0 + last_write_checksum: sha1:9a8f87757f57244dc70008c44a580a323dd80c1a docs/models/trustlevel.md: last_write_checksum: sha1:59c7fab1ac94b8a21cebb6f15e753672b4ac8f1f docs/models/unicodespoofing.md: last_write_checksum: sha1:f226ab0193558bada5d79ae06526d468409f932e docs/models/unresolvequeueitemrequest.md: - last_write_checksum: sha1:ffc8cff20a7c6e938c7336bfaaa3e160223e5135 - docs/models/unresolvequeueitemrequestbody.md: - last_write_checksum: sha1:c15925f824a99518690275583046a1a12bd8ac6f + last_write_checksum: sha1:5806a111bde03f05d3868c104526e91118ecaa94 docs/models/unresolvequeueitemresponse.md: - last_write_checksum: sha1:af305267a7668adac330d292a9e5b0eaeec431e3 + last_write_checksum: sha1:25712953fa620825ff2de945f02f73563e5d2389 + docs/models/unresolvequeueitemstatus.md: + last_write_checksum: sha1:234a3a598529bd2d443cdb61624d39cd898496d5 docs/models/updateactionpositionrequest.md: last_write_checksum: sha1:8e7aaf03c455f6bf0bee5ee8d21e0bdd013a31fa docs/models/updateactionpositionresponse.md: @@ -583,7 +677,7 @@ trackedFiles: docs/models/updateactionqueuebehaviourresponse.md: last_write_checksum: sha1:205931c65c91088e37bb6149a19dda68e5707747 docs/models/updateactionrequest.md: - last_write_checksum: sha1:a5cee74f1520eaaab8a5a67013ab375a1565c03f + last_write_checksum: sha1:57f3671fc3aba6734c3ea4aaa12fbe8b8e938921 docs/models/updateactionrequestbody.md: last_write_checksum: sha1:7e85045ea6a3b5572f4adacca145739c4162bb04 docs/models/updateactionresponse.md: @@ -595,7 +689,7 @@ trackedFiles: docs/models/updateauthormetadata.md: last_write_checksum: sha1:315bcc1ec596952c947cf2051dd69def9007069c docs/models/updateauthorrequest.md: - last_write_checksum: sha1:906a01d465821e9172a9e9498eb8af2e115e1830 + last_write_checksum: sha1:8bd29a2df2ca5471b989c370e487e4fc00a28f0b docs/models/updateauthorrequestbody.md: last_write_checksum: sha1:16944b8b257aff425b8eb79ef1e22d0832801e55 docs/models/updatechannelcontenttype.md: @@ -621,15 +715,15 @@ trackedFiles: docs/models/updatewebhookpayloadversion.md: last_write_checksum: sha1:3fb625590fd0e45de0ed945c6de287de6a411202 docs/models/updatewebhookrequest.md: - last_write_checksum: sha1:66f1f66f60a762e1dd08cc9f8a6fd4e975fc6164 + last_write_checksum: sha1:7976400f8705d5150e648087912e0f6e0d5610eb 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:99eeed30ea0922542fe10a34e141367fa934b47c + last_write_checksum: sha1:6eefdd58cc1a9e722d97d57f459118e427d9047d docs/models/updatewordlistrequestbody.md: - last_write_checksum: sha1:3f7ae7eee8f69e4f566d07bee25f7a4e9700b648 + last_write_checksum: sha1:909b6cb337970674a642cb84321741fb602b5a0b docs/models/updatewordlistresponse.md: last_write_checksum: sha1:9b0be88824c40c531fd9a28186deb81dd57a5714 docs/models/urlmasking.md: @@ -648,40 +742,46 @@ trackedFiles: last_write_checksum: sha1:3cf75dcd72f529b7330c56f232011269b2dc644b docs/models/violence.md: last_write_checksum: sha1:0eeff10131ccfab92ffcf4a9be115d012d8cb2f4 + docs/models/volume.md: + last_write_checksum: sha1:74d62abca43ea6a447e4e35c57b463e8cd347dee docs/models/weapons.md: last_write_checksum: sha1:7de86b3e6826e5e810a5048ff36db2ad4a6ad2bc - docs/models/withinunit.md: - last_write_checksum: sha1:ca17d9ca4c86ddfec9b1808b0c10228fd81ac2c3 docs/sdks/account/README.md: - last_write_checksum: sha1:2451b51ed183ab247d05c5044df4c7a9a8be3573 + last_write_checksum: sha1:c32364abb6cabbbee7f5bf82fe310cacd7413f8e docs/sdks/actions/README.md: - last_write_checksum: sha1:e00bb473366b6437b8e0ee78f162a2fc78e718d7 + last_write_checksum: sha1:07376377faa14d3c68ca073e3022836a766a1c29 + docs/sdks/analytics/README.md: + last_write_checksum: sha1:b9e0da42f3bf64aae7181769cd178a301b735833 + docs/sdks/apikeys/README.md: + last_write_checksum: sha1:7c2084b4693e79cbe12a987e1c524e7d6802fb0c docs/sdks/authors/README.md: - last_write_checksum: sha1:eed884a739b5df009fea277bc141689eb9db6b22 + last_write_checksum: sha1:b5fad9c672b593e40cb528ab2b433df39c46d381 docs/sdks/channels/README.md: last_write_checksum: sha1:01c0e51bc630e4f5cb937e39faf535e894547fd3 docs/sdks/contentsdk/README.md: - last_write_checksum: sha1:b50dd8d8a1872e957df3da4fa36d189d7bb126d4 + last_write_checksum: sha1:ae7567227195c2042169e7821e2dec64c311bebe + docs/sdks/feedback/README.md: + last_write_checksum: sha1:ccbebb9f1e1102d390b4dbf114a5a4f783ef0abd docs/sdks/items/README.md: - last_write_checksum: sha1:994cd5aa1e04b3646e24922f8b16a76e12e17942 + last_write_checksum: sha1:ed06203e06e4abd51a3bbcb84865b67a11a9fde8 docs/sdks/projects/README.md: last_write_checksum: sha1:a256679120b221c4cabb8026f7ccceaea7ca22c7 docs/sdks/queuesdk/README.md: - last_write_checksum: sha1:9b7055228c0acc9e38f2796ed188fe6f5343bcc4 + last_write_checksum: sha1:289290743fd370bb3851f7eb785c75d6b0bf65b5 docs/sdks/webhooks/README.md: - last_write_checksum: sha1:306d9f6587191c859ff953ce731eebc3ccece232 + last_write_checksum: sha1:010e87f943933a75a26a82152767953f8f489533 docs/sdks/webhooksecret/README.md: - last_write_checksum: sha1:891943f7d09a8b3cfd886342e1d2fe169ad1a670 + last_write_checksum: sha1:4d0b1dc7b8d78b321e15d45ec039a0786ae44c45 docs/sdks/wordlist/README.md: - last_write_checksum: sha1:47467527cf6316a4a5a09c7275f1abde64554b8d + last_write_checksum: sha1:785bdffde5f78c333a022a2fd3835c7a01481da7 docs/sdks/words/README.md: - last_write_checksum: sha1:3f411237e8fb54e99aafa7b6cdfb3fbcf9046286 + last_write_checksum: sha1:6c81772f1cc8e8a8e09289b29f2bd7b5f1eeba9e py.typed: last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pylintrc: last_write_checksum: sha1:cb40e5fd2885dcf20f7c572a590b2656efe282a0 pyproject.toml: - last_write_checksum: sha1:194d3d0511d59ba7a0fc47a58ed0253a3d74922d + last_write_checksum: sha1:d22ee36bb66dd2ff46a523fdf3a7ab3ec9d19fe0 scripts/prepare_readme.py: last_write_checksum: sha1:7b330dc0eb57c916a1158fd90c6227f8dc517c83 scripts/publish.sh: @@ -695,25 +795,29 @@ trackedFiles: src/moderation_api/_hooks/types.py: last_write_checksum: sha1:bb2a67c388c536a910bd205bd9582065c5d2de39 src/moderation_api/_version.py: - last_write_checksum: sha1:3846cc0f16d9c62f387bc8ee9b1f3f7911ad8e49 + last_write_checksum: sha1:b53e0176440b60608a08fc1969b89e3be0c31739 src/moderation_api/account.py: - last_write_checksum: sha1:b83155ed2e9ddea53715fef16adf03683ea99006 + last_write_checksum: sha1:184d7da98d57398f23b83a572d3105e361ba430f src/moderation_api/actions.py: - last_write_checksum: sha1:1286e7aad3a4ceefc7e4577739dd69aca56d1187 + last_write_checksum: sha1:857f21700842ddcf2db17d4636ea07911312c080 + src/moderation_api/analytics.py: + last_write_checksum: sha1:e943d3f3a63389f916542a9149ae9b199ac77aaa + src/moderation_api/apikeys.py: + last_write_checksum: sha1:c8a66456925ce3c5837af354536f49485fd71967 src/moderation_api/authors.py: - last_write_checksum: sha1:cf4951338154371c5b5cfd4c538b95f8782fb812 + last_write_checksum: sha1:069689daa8a72d5f5b19cb6abfe6ce4937e4eaa1 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:48fe6b376029b2cde3070cc39b062cb8e37cd536 + last_write_checksum: sha1:5aa0a894d0ee19d44a783a38b6778e3709c333ac 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:22b41329268d5e4f7101ca76891ee3c94895b077 + last_write_checksum: sha1:3154f9151b284c0b386cbce1deb07a344013d4f9 src/moderation_api/errors/conflicterror.py: last_write_checksum: sha1:752e430486a83a8cc9b48bbf13a507dacc9607dd src/moderation_api/errors/internalservererror.py: @@ -725,49 +829,57 @@ trackedFiles: src/moderation_api/errors/no_response_error.py: last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f src/moderation_api/errors/notfounderror.py: - last_write_checksum: sha1:8e16b46d89276693c817e89e107c72124c42fcd2 + last_write_checksum: sha1:c3450ef169e43b350bbeaabff5628e72ee89f52c src/moderation_api/errors/permissiondeniederror.py: last_write_checksum: sha1:ef715026496a1c44d5548a12e3838e80d95fd76b src/moderation_api/errors/ratelimiterror.py: last_write_checksum: sha1:b21ea5a561809730626bedac760606e2150706bf src/moderation_api/errors/responsevalidationerror.py: last_write_checksum: sha1:4b7e233bbe80ffc0e929120c19ac748eb857f92f + src/moderation_api/feedback.py: + last_write_checksum: sha1:9bc3a8ba17790c90fd9fdf28b668fad5b2ab3a25 src/moderation_api/httpclient.py: last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 src/moderation_api/items.py: - last_write_checksum: sha1:b4d7bab76c059007d3b3ef5adf3e2050ca94ebc8 + last_write_checksum: sha1:ea935d11d6bb0b939b051752b76a99101eae16d0 src/moderation_api/models/__init__.py: - last_write_checksum: sha1:3824295e85fd397dac661d261f1dfb3b2df193b0 + last_write_checksum: sha1:4f26f94e991f1a48603551e4c7627628febd5cbd src/moderation_api/models/addwordlistwordsop.py: - last_write_checksum: sha1:870752f7f9f29e5430b3beeecbd1bb7b158ab175 + last_write_checksum: sha1:45d3dd92a286fa5b17f4eb79b5ed12062d019f4d src/moderation_api/models/authenticationerror.py: last_write_checksum: sha1:63c299ddbc05b97c083d497836594c1619815fab src/moderation_api/models/badrequesterror.py: - last_write_checksum: sha1:ea326d388bb1339930b2141d857571b470c711e4 + last_write_checksum: sha1:c259e6e34c6c5d53f479ee4ae1125d49441d001a 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:75512203ad595c2880c67ca595cc5d275f518d28 + last_write_checksum: sha1:9340ac9faed8f02d991ce698b714bed24ce283e8 src/moderation_api/models/createauthorop.py: - last_write_checksum: sha1:4928b8e9fc27f72ba565c1e5266824efd05c080e + last_write_checksum: sha1:ea6d2517d34754fb72a008fcf2f6cd180f54975d src/moderation_api/models/createchannelop.py: last_write_checksum: sha1:19f3857bbc2c1d66f906465518a4ae26e34ea666 + src/moderation_api/models/createfeedbackop.py: + last_write_checksum: sha1:a42446c5fa58e02518d8b84dec23f02a03922efb + src/moderation_api/models/createprojectapikeyop.py: + last_write_checksum: sha1:ead74822c855d5d27185a89d0766c04f48235b4f src/moderation_api/models/createprojectop.py: last_write_checksum: sha1:dc16578de2a09db059dccfe18712b42d767f1a62 src/moderation_api/models/createwebhookop.py: - last_write_checksum: sha1:abe6642f63eba52524e5c1654dd65ee4d9fe761f + last_write_checksum: sha1:9b21670eafa242702f8a7cc543b1b9081e95fe1f + src/moderation_api/models/createwordlistop.py: + last_write_checksum: sha1:dafc36a83b0e7043b883e2d8dfd9304ecbef9a53 src/moderation_api/models/deleteactionop.py: - last_write_checksum: sha1:180aa4fa98d90dad14da78dbefb521f387bc0841 + last_write_checksum: sha1:6da8c2822a5dc5b44584961e6f2d286723eba68c src/moderation_api/models/deleteauthorop.py: - last_write_checksum: sha1:5d1b8c36891f1b7247fe77b5de1f6bab1de98d1a + last_write_checksum: sha1:5d692cc19ca5243b490003b2e76614bc593d30f0 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:9e829c2b8f89f5801902f0dd6a78e7e83ec4f8bd + last_write_checksum: sha1:97c6f00957de3ac31a7a50533faa3040771622d6 src/moderation_api/models/duplicatechannelop.py: last_write_checksum: sha1:ac62e5fe7064a3b241935390d57002ed98bcc1e1 src/moderation_api/models/duplicateprojectop.py: @@ -775,89 +887,113 @@ trackedFiles: src/moderation_api/models/errorissue.py: last_write_checksum: sha1:12ac40f4f3533dad0cb604a67f2f70e6b07254f0 src/moderation_api/models/executeactionop.py: - last_write_checksum: sha1:6dff012c5267ec742e7f5ea852245d41bc881d8f + last_write_checksum: sha1:a9333bbe8bb479afc965f2472ce055d02760cfeb src/moderation_api/models/getaccountop.py: - last_write_checksum: sha1:2307dcddd805f86cf3cfc37a7754fc31da185191 + last_write_checksum: sha1:d71cab397b15d4514f7c585fe89669cfc815a75b src/moderation_api/models/getactionop.py: - last_write_checksum: sha1:29badfdfa294cbfff429ce5f156cfed15084469b + last_write_checksum: sha1:450920cda7969d1955cfe355c23d3666b9248383 + src/moderation_api/models/getanalyticsauthorsop.py: + last_write_checksum: sha1:4703b8cc0c3d4601b1e880a8a629d6893ef5d380 + src/moderation_api/models/getanalyticsautomationop.py: + last_write_checksum: sha1:5e18100f0e7ebde7f4f98bf3fed633de15094740 + src/moderation_api/models/getanalyticschannelsop.py: + last_write_checksum: sha1:267a662ad5660b31db4631ce6c81b15895134049 + src/moderation_api/models/getanalyticspoliciesop.py: + last_write_checksum: sha1:1990b6de41bb94881a23105ef75296ae1f99b793 + src/moderation_api/models/getanalyticssummaryop.py: + last_write_checksum: sha1:e5b2534aba9d1b1debde157caf2760e8a9d3fdd5 + src/moderation_api/models/getanalyticsvolumesop.py: + last_write_checksum: sha1:71dfd7ea6d95c28979eca23b9840373687f51c91 src/moderation_api/models/getauthorop.py: - last_write_checksum: sha1:19551cefcdda8f89fa073ad4a7907d41cb154ded + last_write_checksum: sha1:dd7b2a70171289444cf99a7c99c177bc83c4b0ab 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:9dee8b4291f66c5528d25a379a15f139ee119c14 + last_write_checksum: sha1:4ea5487db5f4c716c2c0655814ef6aaf69f5d645 src/moderation_api/models/getqueuestatsop.py: - last_write_checksum: sha1:76e8d5d3b43288793e3a586d2e5053ec008a2bef + last_write_checksum: sha1:3967f7215ee93870b9533b64bcd7bf7c94c2ee4e src/moderation_api/models/getwebhookop.py: - last_write_checksum: sha1:3bd33c8c94a39d956340f3251ff69badd27e3102 + last_write_checksum: sha1:b95ed0cd15a4b280727db23139a11903161e92b5 src/moderation_api/models/getwebhooksecretop.py: - last_write_checksum: sha1:dc87f26e4c211a3a876f4e569d445b5ab91b6883 + last_write_checksum: sha1:fcc1daba7bf3cdc955e2c71d8b612ddef42a4514 src/moderation_api/models/getwordlistembeddingstatusop.py: - last_write_checksum: sha1:e0940ba3f64232c17cb7b5634099c21bf1309c1e + last_write_checksum: sha1:e7c9de3abd6a0a739d3a9059734fb3b138f03075 src/moderation_api/models/getwordlistop.py: - last_write_checksum: sha1:f2a2503cad43bcc383f16215d0751d1b571021b7 + last_write_checksum: sha1:ed3bc2252157b06bb9e5cbf219a43da89e50c21d src/moderation_api/models/internalservererror.py: last_write_checksum: sha1:aa2999b9b9209cf1a43bdf0d065ccf890f79007b src/moderation_api/models/listactionsop.py: - last_write_checksum: sha1:17a8344a068530cc0c46d0b726a7b62c73bcc6b7 + last_write_checksum: sha1:3798d5c43d638bc609537341135d09765327bf25 src/moderation_api/models/listauthorsop.py: - last_write_checksum: sha1:5b6e792705e6077f35db579fdbc2644636dabeff + last_write_checksum: sha1:1d0e462f51188ea7e5e672231cd2d3faa4cec266 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:874a4353f6732e5d4dc523975c000b6c2cc042ab + last_write_checksum: sha1:cc74c8240e44b2363dbd1f4ab68de65427d299a8 + src/moderation_api/models/listqueuesop.py: + last_write_checksum: sha1:6f7bc390cb6fb073f89251c87ef5f3f1414d7706 src/moderation_api/models/listwebhooksop.py: - last_write_checksum: sha1:5dd067d74745d7d832474830e75edc3e2fd3a16f + last_write_checksum: sha1:513b6d9b7b8c86d93452fe10f01c3df6e7bbb727 src/moderation_api/models/listwordlistsop.py: - last_write_checksum: sha1:4cb88caafa938d3b648f8a8833ae05eff67f0d8d + last_write_checksum: sha1:40dd2840356e753f6b855b6e5537e43ffc5f8bb3 src/moderation_api/models/notfounderror.py: - last_write_checksum: sha1:a44e99269c4be4942eb84a4d9fa364a9b17f90db + last_write_checksum: sha1:0a7a0e510b991103f8d79288f113fd07e374deb5 src/moderation_api/models/pagination.py: last_write_checksum: sha1:b39970391aa653cb9cf835c0fc185bad7117d86a src/moderation_api/models/permissiondeniederror.py: last_write_checksum: sha1:10b6b6a23e0c8c67612ca46253ba07fc5c27f0f5 src/moderation_api/models/project.py: last_write_checksum: sha1:8b63414b298ed52321834567de4da1f6becb40e9 + src/moderation_api/models/projectapikey.py: + last_write_checksum: sha1:ea093f509107ba03a06007a4b140831e27e74443 src/moderation_api/models/projectwithkey.py: last_write_checksum: sha1:6517b6324c0193f660d410d1a9d0b392e3ff6203 src/moderation_api/models/publicauthor.py: - last_write_checksum: sha1:70595f937559ff2ecd1eeca6f0839957cf92bac2 + last_write_checksum: sha1:17ed88d181f43ab7876082ed01b9d321a4a06951 + src/moderation_api/models/queue.py: + last_write_checksum: sha1:bc6130277305f518ab00caa5fa59f70249ea344d + src/moderation_api/models/queueitem.py: + last_write_checksum: sha1:2754d0a11bbf3966f987760232f03501b8c0a73b + src/moderation_api/models/queuewithcounts.py: + last_write_checksum: sha1:f0499600ece3ef0b74a2d4a73d20b665a32793b7 src/moderation_api/models/ratelimiterror.py: last_write_checksum: sha1:0e2a9611cd0b938fcdcab514d2f667fb6286bfe1 src/moderation_api/models/removewordlistwordsop.py: - last_write_checksum: sha1:d677c10b4b7ff4ba1c017b1acece737bf4266476 + last_write_checksum: sha1:7cb9e8a08223096df7ffece80ff363b0208a56fe src/moderation_api/models/resolvequeueitemop.py: - last_write_checksum: sha1:664e811f1c8599aaa192272e3ad262fc79a371bf + last_write_checksum: sha1:e5d5b47b99d1b32db9b1adffd09a7caa948dcea5 + src/moderation_api/models/resolvequeueitemsop.py: + last_write_checksum: sha1:10da89b43bc99f17c90f3873727079dee625d2d2 src/moderation_api/models/security.py: last_write_checksum: sha1:dc71db919301e2ed408358e7b2066a8cb30c581b src/moderation_api/models/submitcontentop.py: - last_write_checksum: sha1:748596299c2ae4a9ce0c11812adb73a502489e2d + last_write_checksum: sha1:c5ab5a0c1f431ef17bba685a3b70ce1a3434bb77 src/moderation_api/models/unresolvequeueitemop.py: - last_write_checksum: sha1:045ee159e02dad90f660dff7c733bd8f5f34aab3 + last_write_checksum: sha1:90f2dd46899295dc1849fb3a31039b76cebc0c2c src/moderation_api/models/updateactionop.py: - last_write_checksum: sha1:f43fb150a406c10f214416daa3c5af645f11411e + last_write_checksum: sha1:bfd702ef0dbf1544fdd8aaeadca0887aaa108200 src/moderation_api/models/updateauthorop.py: - last_write_checksum: sha1:e2867179b9158e38fc8433e32db233399c2b1824 + last_write_checksum: sha1:25e9912c1961b87d0bc3dcf54ee0867f20258bb4 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:52c4f9e3432d4fadf70d54d0ad82882a80323616 + last_write_checksum: sha1:48de08773e7f5d13d92bf33e77ae2648a68eb339 src/moderation_api/models/updatewordlistop.py: - last_write_checksum: sha1:6be4160c8a8ae9f64d2937e63075dd5d23c72aa5 + last_write_checksum: sha1:4099914edf5402aa17e81d993ef4d4fd89d310bc src/moderation_api/projects.py: - last_write_checksum: sha1:a4aece7aba0496936fd398d185c0de035fe4828f + last_write_checksum: sha1:b77f9726cc282d48d7a2adfa2803b68b8e26548c src/moderation_api/py.typed: last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 src/moderation_api/queue_sdk.py: - last_write_checksum: sha1:83aa4d12c49541e692cf28eb5c93feef283e5833 + last_write_checksum: sha1:feca1dbd8b00911ac6b83221a115e030d8f0a57c src/moderation_api/sdk.py: - last_write_checksum: sha1:580ff8ec9ef32cc4f9a4e488a4a4f319f3a0304c + last_write_checksum: sha1:3a1d4d29e2c54908fac0d6ebed40ae54790c1277 src/moderation_api/sdkconfiguration.py: last_write_checksum: sha1:80f7a8dc676b19a1c1a145d30be50f52e6a92672 src/moderation_api/types/__init__.py: @@ -905,13 +1041,13 @@ trackedFiles: src/moderation_api/utils/values.py: last_write_checksum: sha1:c0eaaf8779a4ba3ae068579a57182667efef0cb7 src/moderation_api/webhooks.py: - last_write_checksum: sha1:151dc8211b7dc7dec6e5a8c3e67baee3cbfe2ade + last_write_checksum: sha1:91e77617ae1f143a25c614bae8bb2d0832561f1d src/moderation_api/webhooksecret.py: - last_write_checksum: sha1:168033acf81ec6f9d7feff2a7956f9db9fc58ed2 + last_write_checksum: sha1:df2b346a770a6c777b2fbab21d4c189c2c196d2f src/moderation_api/wordlist.py: - last_write_checksum: sha1:ed4062ea524540feffe978990340a296b6c08b98 + last_write_checksum: sha1:d4a0f12a41e2c00d0dfc69366ae4a6334fcdb62e src/moderation_api/words.py: - last_write_checksum: sha1:d589167bc24d375b66088de2407faeb1a2209c5e + last_write_checksum: sha1:27f34da4c40657bedee24f2b1d885811b4db0b58 examples: listAuthors: speakeasy-default-list-authors: @@ -1021,7 +1157,7 @@ examples: id: "" responses: "200": - application/json: {"queue": {"id": "", "name": "", "description": "furiously certification tighten", "filter": {}, "unresolvedItemsCount": 1559.96, "resolvedItemsCount": 1949.18, "totalItemsCount": 1912.44}} + application/json: {"queue": {"id": "", "name": "", "description": "furiously certification tighten", "isDefault": true, "unresolvedItemsCount": 1559.96, "resolvedItemsCount": 1949.18, "totalItemsCount": 1912.44}} "400": application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://actual-thyme.biz/"} "401": @@ -1043,7 +1179,7 @@ examples: withinDays: 30 responses: "200": - application/json: {"reviewStats": {"averageTimeToReview": 3713.81, "totalReviewed": 9855.4, "totalPending": 2413.77}, "actionStats": [{"actionId": "", "actionName": "", "count": 4507.74, "percentageOfTotal": 3785.01}], "topReviewers": [], "trends": {"dailyReviewCounts": [{"date": "2024-07-26", "count": 794.3}], "flaggedContentTrends": []}} + application/json: {"reviewStats": {"totalReviewed": 9855.4, "totalPending": 2413.77}, "topReviewers": [], "trends": {"dailyReviewCounts": [{"date": "2024-07-26", "count": 794.3}]}} "400": application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://accomplished-councilman.com/"} "401": @@ -1067,7 +1203,7 @@ examples: sortDirection: "desc" responses: "200": - application/json: {"data": [{"id": "", "content": "", "labels": [{"label": "", "score": 3108.5, "flagged": false}], "flagged": false, "status": "resolved", "timestamp": 79.16}], "pagination": {"page": 42752, "pageSize": 933228, "total": 306038, "totalPages": 947297, "hasMore": true}} + application/json: {"data": [{"id": "", "contentId": "", "content": {"type": "object", "data": {"key": {"type": "image"}}}, "labels": [{"label": "", "score": 3108.5, "flagged": false}], "flagged": false, "severity": 6116.19, "status": "resolved", "timestamp": 79.16, "language": "", "conversationId": null, "authorId": null, "contentType": ""}], "pagination": {"page": 42752, "pageSize": 933228, "total": 306038, "totalPages": 947297, "hasMore": true}} "400": application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://back-status.info"} "401": @@ -1111,7 +1247,7 @@ examples: application/json: {} responses: "200": - application/json: {"success": false, "status": "", "unresolvedAt": ""} + application/json: {"success": false, "status": "resolved", "unresolvedAt": ""} "400": application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://passionate-partridge.net"} "401": @@ -1662,4 +1798,213 @@ examples: application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://insecure-premium.com/"} "429": application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://upset-hydrant.info/"} + getAnalyticsSummary: + speakeasy-default-get-analytics-summary: + parameters: + query: + range: "30d" + responses: + "200": + application/json: {"range": "90d", "channelId": "", "totals": {"requests": 433848, "flagged": 598421, "flagRate": 2935.14, "allowed": 77552, "rejected": 763138, "sentToReview": 929850, "handledAutomatically": 506554, "flaggedButAllowed": 534731, "distinctAuthors": 148120}, "previousPeriod": {"requests": 787873, "flagged": 594999, "flagRate": 879.43, "allowed": 931019, "rejected": 234100, "sentToReview": 107365, "handledAutomatically": 837316, "flaggedButAllowed": 749172}, "pendingReview": 702903, "flagRateSpike": {"multiple": 7020.68, "recentFlagRate": 7330.75, "baselineFlagRate": 8573.96, "recentFlagged": 850480, "recentRequests": 17927}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://far-flung-e-mail.info/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://dreary-skean.org/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://blond-mechanic.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impartial-violin.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://juvenile-label.name/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://evil-puppet.org"} + getAnalyticsPolicies: + speakeasy-default-get-analytics-policies: + parameters: + query: + range: "30d" + limit: 8 + responses: + "200": + application/json: {"range": "7d", "channelId": "", "policies": [{"label": "", "flagged": 753055, "previousFlagged": 438914}]} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://amused-freckle.com"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tedious-muscat.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://faraway-sundae.name"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://confused-provision.name"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://supportive-restaurant.biz/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://remorseful-reasoning.name"} + getAnalyticsAuthors: + speakeasy-default-get-analytics-authors: + parameters: + query: + range: "30d" + limit: 6 + responses: + "200": + application/json: {"range": "90d", "channelId": "", "authors": [{"authorId": "", "name": "", "flagged": 894899}]} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://helpful-warming.org/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://good-ceramics.biz/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://bulky-fen.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://glum-cod.com"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://pleasing-plugin.name"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://mammoth-quart.org"} + getAnalyticsChannels: + speakeasy-default-get-analytics-channels: + parameters: + query: + range: "30d" + responses: + "200": + application/json: {"range": "90d", "channels": [{"id": "", "name": "", "requests": 532881, "flagged": 590382, "flagRate": 3406.46}]} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://only-hutch.info/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://voluminous-deck.biz/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://trained-switch.com/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://joyous-march.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://pertinent-traditionalism.info"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sugary-rationale.net"} + getAnalyticsVolumes: + speakeasy-default-get-analytics-volumes: + parameters: + query: + range: "30d" + responses: + "200": + application/json: {"range": "7d", "channelId": "", "bucket": "day", "volumes": []} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://forceful-swim.org/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://exalted-season.com"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://partial-tomatillo.biz"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://ripe-humidity.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://outrageous-farm.biz"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://kooky-possession.biz"} + getAnalyticsAutomation: + speakeasy-default-get-analytics-automation: + parameters: + query: + range: "30d" + responses: + "200": + application/json: {"range": "90d", "channelId": "", "flagged": 724170, "handledByRules": 973248, "handledByCasebook": 407020, "sentToReview": 546279, "mergedDuplicates": 90369, "automationRate": 5715.74, "reviewsAllowed": 813539, "reviewsRejected": 795140, "reviewsResolvedWithoutDecision": 900070, "reviewsUnresolved": 324651, "casebookOverrulings": 565973, "rules": []} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sunny-wombat.info/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://pastel-transom.org/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://first-zebra.net"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://gummy-skyline.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://warlike-veto.com"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://prime-hyphenation.org/"} + createFeedback: + speakeasy-default-create-feedback: + requestBody: + application/json: {"title": "", "description": "commonly oddly whereas onto cooperative serene oh", "type": "feature_request", "source": "api"} + responses: + "200": + application/json: {"id": "", "status": "received"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wry-bakeware.org/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://powerless-testimonial.org"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://esteemed-language.info"} + listQueues: + speakeasy-default-list-queues: + parameters: + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [], "pagination": {"page": 287357, "pageSize": 75276, "total": 18025, "totalPages": 878443, "hasMore": false}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://scientific-certification.biz"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://intent-integer.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worldly-fog.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://immaculate-toothbrush.name/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://medium-outlaw.com"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://which-tapioca.name/"} + resolveQueueItems: + speakeasy-default-resolve-queue-items: + parameters: + path: + id: "" + requestBody: + application/json: {"itemIds": ["", "", ""]} + responses: + "200": + application/json: {"resolved": 415438, "notFoundIds": ["", ""]} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://blushing-pick.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://moral-daddy.biz"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://unlined-eternity.name/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://burdensome-festival.net/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://kooky-haversack.com"} + createWordlist: + speakeasy-default-create-wordlist: + requestBody: + application/json: {"name": ""} + responses: + "200": + application/json: {"id": "", "name": "", "words": ["", "", ""], "createdAt": "1721740495881", "organizationId": "", "userId": "", "strict": true} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://vivid-meander.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://shameless-excess.net"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://breakable-insolence.info"} + createProjectApiKey: + speakeasy-default-create-project-api-key: + parameters: + path: + id: "" + requestBody: + application/json: {"name": "API key"} + responses: + "200": + application/json: {"id": "", "name": "", "projectId": "", "createdAt": "1711588645112", "secretKey": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://rusty-responsibility.com"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://compassionate-chow.net"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://buzzing-convection.com/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impractical-bin.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://damaged-bandwidth.name"} examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 979bf98..ddcef65 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false python: - version: 2.1.1 + version: 2.2.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index 31ff464..cabb255 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -35,6 +35,10 @@ "name": "Webhooks", "description": "Endpoints that receive events, and the events they receive." }, + { + "name": "Analytics", + "description": "Moderation numbers for a project, as on the dashboard overview." + }, { "name": "Account", "description": "The account that owns the API key." @@ -50,19 +54,23 @@ { "name": "Voice", "description": "Real-time voice moderation over WebSocket." + }, + { + "name": "Feedback", + "description": "Send feature requests and product feedback to the Moderation API team." } ], "externalDocs": { "url": "https://docs.moderationapi.com" }, "paths": { - "/authors": { + "/analytics/summary": { "get": { - "operationId": "listAuthors", - "summary": "List authors", - "description": "List authors with their activity metrics and reputation. The list is paginated.", + "operationId": "getAnalyticsSummary", + "summary": "Get the analytics summary", + "description": "Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one.", "tags": [ - "Authors" + "Analytics" ], "security": [ { @@ -72,78 +80,25 @@ "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", + "name": "range", "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", "type": "string", "enum": [ - "trustLevel", - "violationCount", - "reportCount", - "memberSince", - "lastActive", - "contentCount", - "flaggedContentRatio", - "averageSentiment" + "24h", + "7d", + "30d", + "90d" ] } }, { "in": "query", - "name": "sortDirection", + "name": "channel", "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" - } + "description": "A channel ID or key. Only count content from this channel. Leave out to count all channels." } }, { @@ -153,7 +108,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -165,20 +120,205 @@ "schema": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PublicAuthor" + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channelId": { + "description": "The channel the numbers are for. Null when they are for all channels.", + "type": [ + "string", + "null" + ] + }, + "totals": { + "type": "object", + "properties": { + "requests": { + "type": "integer", + "minimum": 0, + "description": "Requests received. Every request counts, also repeats and edits of the same content." + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Requests that were flagged." + }, + "flagRate": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The share of requests that were flagged: flagged / requests. 0 when there were no requests." + }, + "allowed": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"allow\". Includes content that was not flagged." + }, + "rejected": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"reject\". All of them were flagged." + }, + "sentToReview": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue." + }, + "handledAutomatically": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that were settled without human review: rejected plus flaggedButAllowed." + }, + "flaggedButAllowed": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that were allowed without human review." + }, + "distinctAuthors": { + "type": "integer", + "minimum": 0, + "description": "Distinct authors that sent content in the window. Approximate." + } }, - "description": "The items on this page." + "required": [ + "requests", + "flagged", + "flagRate", + "allowed", + "rejected", + "sentToReview", + "handledAutomatically", + "flaggedButAllowed", + "distinctAuthors" + ], + "additionalProperties": false, + "description": "Request counts for the window. A flagged request has one recommendation: allow, reject or review." }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "previousPeriod": { + "type": "object", + "properties": { + "requests": { + "type": "integer", + "minimum": 0, + "description": "Requests received. Every request counts, also repeats and edits of the same content." + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Requests that were flagged." + }, + "flagRate": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The share of requests that were flagged: flagged / requests. 0 when there were no requests." + }, + "allowed": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"allow\". Includes content that was not flagged." + }, + "rejected": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"reject\". All of them were flagged." + }, + "sentToReview": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue." + }, + "handledAutomatically": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that were settled without human review: rejected plus flaggedButAllowed." + }, + "flaggedButAllowed": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that were allowed without human review." + } + }, + "required": [ + "requests", + "flagged", + "flagRate", + "allowed", + "rejected", + "sentToReview", + "handledAutomatically", + "flaggedButAllowed" + ], + "additionalProperties": false, + "description": "The same counts for the window of equal length just before this one. Compare with `totals` to see the trend." + }, + "pendingReview": { + "type": "integer", + "minimum": 0, + "description": "Items in the default review queue that nobody has reviewed yet, counted as the queue counts them (repeats count once). The queue looks back 30 days, so older items are not included. The range does not change it." + }, + "flagRateSpike": { + "anyOf": [ + { + "type": "object", + "properties": { + "multiple": { + "type": "number", + "description": "How many times higher the recent flag rate is than the baseline, for example 2.4." + }, + "recentFlagRate": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The flag rate in the last 2 days." + }, + "baselineFlagRate": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The flag rate in the 30 days before that." + }, + "recentFlagged": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests in the last 2 days." + }, + "recentRequests": { + "type": "integer", + "minimum": 0, + "description": "Requests in the last 2 days." + } + }, + "required": [ + "multiple", + "recentFlagRate", + "baselineFlagRate", + "recentFlagged", + "recentRequests" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Set when the flag rate of the last 2 days is at least 2 times the rate of the 30 days before, with at least 50 flagged requests. Null when there is no spike. Always for the full project: the range and channel do not change it." } }, "required": [ - "data", - "pagination" + "range", + "channelId", + "totals", + "previousPeriod", + "pendingReview", + "flagRateSpike" ], "additionalProperties": false } @@ -246,42 +386,25 @@ } } }, - "x-speakeasy-group": "authors", - "x-speakeasy-name-override": "list", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "summary", "x-speakeasy-mcp": { - "title": "List authors", + "title": "Get the analytics summary", "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.", + } + }, + "/analytics/policies": { + "get": { + "operationId": "getAnalyticsPolicies", + "summary": "Get the most flagged policies", + "description": "Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before.", "tags": [ - "Authors" + "Analytics" ], "security": [ { @@ -289,6 +412,40 @@ } ], "parameters": [ + { + "in": "query", + "name": "range", + "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ] + } + }, + { + "in": "query", + "name": "channel", + "schema": { + "type": "string", + "description": "A channel ID or key. Only count content from this channel. Leave out to count all channels." + } + }, + { + "in": "query", + "name": "limit", + "schema": { + "default": 8, + "description": "How many entries to return, largest first. 1 to 50.", + "type": "integer", + "minimum": 1, + "maximum": 50 + } + }, { "in": "header", "name": "Project-Id", @@ -296,151 +453,71 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channelId": { + "description": "The channel the numbers are for. Null when they are for all channels.", + "type": [ + "string", + "null" + ] + }, + "policies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The policy label, for example `toxicity`." + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests with this label in the window. Repeats count each time." + }, + "previousFlagged": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests with this label in the window of equal length before." + } + }, + "required": [ + "label", + "flagged", + "previousFlagged" + ], + "additionalProperties": false }, - { - "type": "null" - } - ] + "description": "The policy labels with the most flagged requests, largest first." + } }, - "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" + "required": [ + "range", + "channelId", + "policies" + ], + "additionalProperties": false } } } @@ -475,6 +552,16 @@ } } }, + "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": { @@ -496,25 +583,25 @@ } } }, - "x-speakeasy-group": "authors", - "x-speakeasy-name-override": "create", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "policies", "x-speakeasy-mcp": { - "title": "Create a new author", + "title": "Get the most flagged policies", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "readOnlyHint": true, "destructiveHint": false } } }, - "/authors/{id}": { + "/analytics/authors": { "get": { - "operationId": "getAuthor", - "summary": "Get author details", - "description": "Get detailed information about a specific author including historical data and analysis", + "operationId": "getAnalyticsAuthors", + "summary": "Get the most flagged authors", + "description": "Get the authors with the most flagged content in a time window, largest first.", "tags": [ - "Authors" + "Analytics" ], "security": [ { @@ -523,14 +610,38 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "range", "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", "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." + "enum": [ + "24h", + "7d", + "30d", + "90d" + ] + } + }, + { + "in": "query", + "name": "channel", + "schema": { + "type": "string", + "description": "A channel ID or key. Only count content from this channel. Leave out to count all channels." + } + }, + { + "in": "query", + "name": "limit", + "schema": { + "default": 6, + "description": "How many entries to return, largest first. 1 to 50.", + "type": "integer", + "minimum": 1, + "maximum": 50 + } }, { "in": "header", @@ -539,7 +650,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -549,7 +660,63 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicAuthor" + "type": "object", + "properties": { + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channelId": { + "description": "The channel the numbers are for. Null when they are for all channels.", + "type": [ + "string", + "null" + ] + }, + "authors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "authorId": { + "type": "string", + "description": "The author ID from your system. Use it with the authors endpoints." + }, + "name": { + "description": "The author name, if known.", + "type": [ + "string", + "null" + ] + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests from this author in the window." + } + }, + "required": [ + "authorId", + "name", + "flagged" + ], + "additionalProperties": false + }, + "description": "The authors with the most flagged requests, largest first. Requests without an author are not included." + } + }, + "required": [ + "range", + "channelId", + "authors" + ], + "additionalProperties": false } } } @@ -615,23 +782,25 @@ } } }, - "x-speakeasy-group": "authors", - "x-speakeasy-name-override": "retrieve", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "authors", "x-speakeasy-mcp": { - "title": "Get author details", + "title": "Get the most flagged authors", "scopes": [ "read" ], "readOnlyHint": true, "destructiveHint": false } - }, - "put": { - "operationId": "updateAuthor", - "summary": "Update author details", - "description": "Update the details of a specific author", + } + }, + "/analytics/channels": { + "get": { + "operationId": "getAnalyticsChannels", + "summary": "Get analytics per channel", + "description": "Get requests, flags and flag rate for each channel of the project in a time window.", "tags": [ - "Authors" + "Analytics" ], "security": [ { @@ -640,14 +809,19 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "range", "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", "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." + "enum": [ + "24h", + "7d", + "30d", + "90d" + ] + } }, { "in": "header", @@ -656,141 +830,75 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" + "type": "object", + "properties": { + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The channel ID." + }, + "name": { + "type": "string", + "description": "The channel name." + }, + "requests": { + "type": "integer", + "minimum": 0, + "description": "Requests received in this channel." + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Requests flagged in this channel." + }, + "flagRate": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The share of requests in this channel that were flagged: flagged / requests." + } + }, + "required": [ + "id", + "name", + "requests", + "flagged", + "flagRate" + ], + "additionalProperties": false + }, + "description": "Requests and flags per channel. Channels with no requests in the window are not included." + } + }, + "required": [ + "range", + "channels" + ], + "additionalProperties": false } } } @@ -856,23 +964,25 @@ } } }, - "x-speakeasy-group": "authors", - "x-speakeasy-name-override": "update", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "channels", "x-speakeasy-mcp": { - "title": "Update author details", + "title": "Get analytics per channel", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "readOnlyHint": true, "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.", + } + }, + "/analytics/volumes": { + "get": { + "operationId": "getAnalyticsVolumes", + "summary": "Get volumes over time", + "description": "Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first.", "tags": [ - "Authors" + "Analytics" ], "security": [ { @@ -881,14 +991,27 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "range", "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", "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." + "enum": [ + "24h", + "7d", + "30d", + "90d" + ] + } + }, + { + "in": "query", + "name": "channel", + "schema": { + "type": "string", + "description": "A channel ID or key. Only count content from this channel. Leave out to count all channels." + } }, { "in": "header", @@ -897,7 +1020,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -909,12 +1032,78 @@ "schema": { "type": "object", "properties": { - "success": { - "type": "boolean" + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channelId": { + "description": "The channel the numbers are for. Null when they are for all channels.", + "type": [ + "string", + "null" + ] + }, + "bucket": { + "type": "string", + "enum": [ + "hour", + "day" + ], + "description": "The size of each entry in `volumes`." + }, + "volumes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "string", + "description": "Start of the bucket, as an ISO 8601 timestamp in UTC." + }, + "requests": { + "type": "integer", + "minimum": 0, + "description": "Requests received in the bucket." + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Requests flagged in the bucket." + }, + "rejected": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"reject\" in the bucket." + }, + "sentToReview": { + "type": "integer", + "minimum": 0, + "description": "Requests with the recommendation \"review\" in the bucket." + } + }, + "required": [ + "start", + "requests", + "flagged", + "rejected", + "sentToReview" + ], + "additionalProperties": false + }, + "description": "Counts over time, oldest first. Buckets with no requests are included with zeros." } }, "required": [ - "success" + "range", + "channelId", + "bucket", + "volumes" ], "additionalProperties": false } @@ -982,25 +1171,25 @@ } } }, - "x-speakeasy-group": "authors", - "x-speakeasy-name-override": "delete", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "volumes", "x-speakeasy-mcp": { - "title": "Delete an author", + "title": "Get volumes over time", "scopes": [ - "destructive" + "read" ], - "readOnlyHint": false, - "destructiveHint": true + "readOnlyHint": true, + "destructiveHint": false } } }, - "/queue/{id}": { + "/analytics/automation": { "get": { - "operationId": "getQueue", - "summary": "Get a queue", - "description": "Get a queue", + "operationId": "getAnalyticsAutomation", + "summary": "Get the automation breakdown", + "description": "Get how flagged content was handled in a time window: settled by rules or the casebook, or sent to human review, and what the reviewers decided.", "tags": [ - "Review queues" + "Analytics" ], "security": [ { @@ -1009,14 +1198,27 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "range", "schema": { + "default": "30d", + "description": "The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.", "type": "string", - "description": "The queue ID" - }, - "required": true, - "description": "The queue ID" + "enum": [ + "24h", + "7d", + "30d", + "90d" + ] + } + }, + { + "in": "query", + "name": "channel", + "schema": { + "type": "string", + "description": "A channel ID or key. Only count content from this channel. Leave out to count all channels." + } }, { "in": "header", @@ -1025,7 +1227,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -1037,288 +1239,125 @@ "schema": { "type": "object", "properties": { - "queue": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" + "range": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "90d" + ], + "description": "The time window of the numbers." + }, + "channelId": { + "description": "The channel the numbers are for. Null when they are for all channels.", + "type": [ + "string", + "null" + ] + }, + "flagged": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary." + }, + "handledByRules": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that a rule allowed or rejected without human review." + }, + "handledByCasebook": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that the casebook settled without human review." + }, + "sentToReview": { + "type": "integer", + "minimum": 0, + "description": "Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue." + }, + "mergedDuplicates": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later." + }, + "automationRate": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The share of flagged requests that did not need their own human review: (flagged - sentToReview) / flagged." }, - "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" - } - } + { + "type": "null" + } + ] + }, + "reviewsAllowed": { + "type": "integer", + "minimum": 0, + "description": "Review queue items from this window that a moderator allowed." + }, + "reviewsRejected": { + "type": "integer", + "minimum": 0, + "description": "Review queue items from this window that a moderator rejected." + }, + "reviewsResolvedWithoutDecision": { + "type": "integer", + "minimum": 0, + "description": "Review queue items from this window that a moderator marked as done without allow or reject." + }, + "reviewsUnresolved": { + "type": "integer", + "minimum": 0, + "description": "Review queue items from this window that are still open." + }, + "casebookOverrulings": { + "type": "integer", + "minimum": 0, + "description": "Requests where the casebook decision was different from the decision based on severity." + }, + "rules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The rule name. \"Other rules\" holds all rules after the largest ones." }, - "additionalProperties": false - }, - "unresolvedItemsCount": { - "type": "number" - }, - "resolvedItemsCount": { - "type": "number" + "count": { + "type": "integer", + "minimum": 0, + "description": "Flagged requests that this rule settled." + } }, - "totalItemsCount": { - "type": "number" - } + "required": [ + "name", + "count" + ], + "additionalProperties": false }, - "required": [ - "id", - "name", - "description", - "filter", - "unresolvedItemsCount", - "resolvedItemsCount", - "totalItemsCount" - ], - "additionalProperties": false + "description": "The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules." } }, "required": [ - "queue" + "range", + "channelId", + "flagged", + "handledByRules", + "handledByCasebook", + "sentToReview", + "mergedDuplicates", + "automationRate", + "reviewsAllowed", + "reviewsRejected", + "reviewsResolvedWithoutDecision", + "reviewsUnresolved", + "casebookOverrulings", + "rules" ], "additionalProperties": false } @@ -1386,10 +1425,10 @@ } } }, - "x-speakeasy-group": "queue", - "x-speakeasy-name-override": "retrieve", + "x-speakeasy-group": "analytics", + "x-speakeasy-name-override": "automation", "x-speakeasy-mcp": { - "title": "Get a queue", + "title": "Get the automation breakdown", "scopes": [ "read" ], @@ -1398,13 +1437,13 @@ } } }, - "/queue/{id}/stats": { + "/authors": { "get": { - "operationId": "getQueueStats", - "summary": "Get queue statistics", - "description": "Get detailed statistics about a moderation queue including review times, action counts, and trends", + "operationId": "listAuthors", + "summary": "List authors", + "description": "List the authors of the project, with their status, trust level and content metrics. The list is paginated. By default, the authors that were active most recently come first.", "tags": [ - "Review queues" + "Authors" ], "security": [ { @@ -1413,24 +1452,68 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "page", "schema": { - "type": "string", - "description": "The queue ID" - }, - "required": true, - "description": "The queue ID" + "default": 1, + "description": "Page number, starting at 1.", + "type": "integer", + "minimum": 1, + "maximum": 100000 + } }, { "in": "query", - "name": "withinDays", + "name": "pageSize", "schema": { - "default": 30, - "description": "Number of days to analyze statistics for", + "default": 20, + "description": "Number of items per page. Maximum 100.", "type": "integer", "minimum": 1, - "maximum": 365 + "maximum": 100 + } + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "trustLevel", + "violationCount", + "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" } }, { @@ -1440,7 +1523,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -1452,182 +1535,20 @@ "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": { + "data": { "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 + "$ref": "#/components/schemas/PublicAuthor" }, - "description": "List of top reviewers and their statistics" + "description": "The items on this page." }, - "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 + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "reviewStats", - "actionStats", - "topReviewers", - "trends" + "data", + "pagination" ], "additionalProperties": false } @@ -1695,25 +1616,42 @@ } } }, - "x-speakeasy-group": "queue", - "x-speakeasy-name-override": "getStats", + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "list", "x-speakeasy-mcp": { - "title": "Get queue statistics", + "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" + } } - } - }, - "/queue/{id}/items": { - "get": { - "operationId": "listQueueItems", - "summary": "Get queue items", - "description": "Get paginated list of items in a moderation queue with filtering options", + }, + "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": [ - "Review queues" + "Authors" ], "security": [ { @@ -1722,267 +1660,157 @@ ], "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, + "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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": { - "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 + "$ref": "#/components/schemas/PublicAuthor" } } } @@ -2017,16 +1845,6 @@ } } }, - "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": { @@ -2048,44 +1866,25 @@ } } }, - "x-speakeasy-group": "queue.items", - "x-speakeasy-name-override": "list", + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "create", "x-speakeasy-mcp": { - "title": "Get queue items", + "title": "Create a new author", "scopes": [ - "read" + "write" ], - "readOnlyHint": true, + "readOnlyHint": false, "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", + "/authors/{id}": { + "get": { + "operationId": "getAuthor", + "summary": "Get author details", + "description": "Get detailed information about a specific author including historical data and analysis", "tags": [ - "Review queues" + "Authors" ], "security": [ { @@ -2098,20 +1897,10 @@ "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" + "description": "Either external ID or the ID assigned by moderation API." }, "required": true, - "description": "The item ID to resolve" + "description": "Either external ID or the ID assigned by moderation API." }, { "in": "header", @@ -2120,54 +1909,17 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + "$ref": "#/components/schemas/PublicAuthor" } } } @@ -2202,6 +1954,16 @@ } } }, + "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": { @@ -2223,25 +1985,23 @@ } } }, - "x-speakeasy-group": "queue.items", - "x-speakeasy-name-override": "resolve", + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "retrieve", "x-speakeasy-mcp": { - "title": "Resolve a queue item", + "title": "Get author details", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "readOnlyHint": true, "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", + }, + "put": { + "operationId": "updateAuthor", + "summary": "Update author details", + "description": "Update the details of a specific author", "tags": [ - "Review queues" + "Authors" ], "security": [ { @@ -2254,20 +2014,10 @@ "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" + "description": "Either external ID or the ID assigned by moderation API." }, "required": true, - "description": "The item ID to unresolve" + "description": "Either external ID or the ID assigned by moderation API." }, { "in": "header", @@ -2276,7 +2026,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -2287,14 +2037,119 @@ "schema": { "type": "object", "properties": { - "comment": { - "description": "Optional reason for unresolving the item", - "type": "string" + "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": { - "comment": "Reopened after an appeal." + "manual_trust_level": 2, + "metadata": { + "identity_verified": true + } } } } @@ -2305,26 +2160,7 @@ "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 + "$ref": "#/components/schemas/PublicAuthor" } } } @@ -2359,6 +2195,16 @@ } } }, + "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": { @@ -2380,25 +2226,23 @@ } } }, - "x-speakeasy-group": "queue.items", - "x-speakeasy-name-override": "unresolve", - "x-speakeasy-mcp": { - "title": "Unresolve a queue item", + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update author details", "scopes": [ - "write" + "destructive" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": true } - } - }, - "/actions": { - "get": { - "operationId": "listActions", - "summary": "List moderation actions", - "description": "List the moderation actions of the project. The list is paginated.", + }, + "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": [ - "Actions" + "Authors" ], "security": [ { @@ -2407,33 +2251,14 @@ ], "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", + "in": "path", + "name": "id", "schema": { - "default": 20, - "description": "Number of items per page. Maximum 100.", - "type": "integer", - "minimum": 1, - "maximum": 100 - } + "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", @@ -2442,7 +2267,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -2454,148 +2279,12 @@ "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" + "success": { + "type": "boolean" } }, "required": [ - "data", - "pagination" + "success" ], "additionalProperties": false } @@ -2663,42 +2352,25 @@ } } }, - "x-speakeasy-group": "actions", - "x-speakeasy-name-override": "list", + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "delete", "x-speakeasy-mcp": { - "title": "List moderation actions", + "title": "Delete an author", "scopes": [ - "read" - ], - "readOnlyHint": true, - "destructiveHint": false - }, - "x-speakeasy-pagination": { - "type": "offsetLimit", - "inputs": [ - { - "name": "page", - "in": "parameters", - "type": "page" - }, - { - "name": "pageSize", - "in": "parameters", - "type": "limit" - } + "destructive" ], - "outputs": { - "results": "$.data", - "numPages": "$.pagination.totalPages" - } + "readOnlyHint": false, + "destructiveHint": true } - }, + } + }, + "/feedback": { "post": { - "operationId": "createAction", - "summary": "Create an action", - "description": "Create an action.", + "operationId": "createFeedback", + "summary": "Send feedback", + "description": "Sends a feature request, bug report or other feedback to the Moderation API team. The team reads every request and can reply by email. Limited to 5 requests per minute per organization.", "tags": [ - "Actions" + "Feedback" ], "security": [ { @@ -2713,7 +2385,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -2724,127 +2396,57 @@ "schema": { "type": "object", "properties": { - "key": { - "description": "User defined key of the action.", - "type": [ - "string", - "null" - ] - }, - "name": { + "title": { "type": "string", - "description": "The name of the action." + "minLength": 3, + "maxLength": 120, + "description": "A short summary of the request." }, "description": { - "description": "The description of the action.", - "type": [ - "string", - "null" - ] + "type": "string", + "minLength": 10, + "maxLength": 5000, + "description": "What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs." }, "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.", + "default": "feature_request", + "description": "The kind of feedback.", "type": "string", "enum": [ - "REMOVE", - "ADD", - "NO_CHANGE" + "feature_request", + "bug", + "other" ] }, - "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).", + "source": { + "default": "api", + "description": "Where the feedback was written: MCP server, agent skill, CLI or API.", "type": "string", "enum": [ - "ALL_QUEUES", - "SOME_QUEUES", - "HIDDEN" + "mcp", + "skill", + "cli", + "api" ] - }, - "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" + "title", + "description" ] }, "example": { - "name": "Suspend for 24 hours", - "key": "suspend-24h", - "type": "AUTHOR_BLOCK_TEMP", - "queueBehaviour": "REMOVE" + "title": "Filter queue items by author trust level", + "description": "We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.", + "type": "feature_request", + "source": "mcp" } } } }, "responses": { "200": { - "description": "Action created successfully", + "description": "Feedback received", "content": { "application/json": { "schema": { @@ -2852,129 +2454,17 @@ "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" - ] + "description": "ID of the feedback." }, - "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).", + "status": { "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" + "const": "received", + "description": "The team received the feedback." } }, "required": [ "id", - "createdAt", - "name", - "builtIn", - "queueBehaviour", - "filterInQueueIds", - "position", - "possibleValues", - "valueRequired", - "freeText" + "status" ], "additionalProperties": false } @@ -3001,16 +2491,6 @@ } } }, - "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": { @@ -3022,10 +2502,10 @@ } } }, - "x-speakeasy-group": "actions", + "x-speakeasy-group": "feedback", "x-speakeasy-name-override": "create", "x-speakeasy-mcp": { - "title": "Create an action", + "title": "Send feedback", "scopes": [ "write" ], @@ -3034,13 +2514,13 @@ } } }, - "/actions/{id}": { + "/queue": { "get": { - "operationId": "getAction", - "summary": "Get an action", - "description": "Get an action by ID.", + "operationId": "listQueues", + "summary": "List queues", + "description": "List the review queues of the project. The default queue comes first. The list is paginated. To get the item counts of a queue, use `GET /queue/{id}`.", "tags": [ - "Actions" + "Review queues" ], "security": [ { @@ -3049,14 +2529,26 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "page", "schema": { - "type": "string", - "description": "The ID of the action to get." - }, - "required": true, - "description": "The ID of the action to get." + "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", @@ -3065,143 +2557,32 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Action retrieved successfully", + "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The ID of the action." + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Queue" + }, + "description": "The items on this page." }, - "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" + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "id", - "createdAt", - "name", - "builtIn", - "queueBehaviour", - "filterInQueueIds", - "position", - "possibleValues", - "valueRequired", - "freeText" + "data", + "pagination" ], "additionalProperties": false } @@ -3228,6 +2609,16 @@ } } }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, "404": { "description": "Not found", "content": { @@ -3247,25 +2638,56 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "actions", - "x-speakeasy-name-override": "retrieve", + "x-speakeasy-group": "queue", + "x-speakeasy-name-override": "list", "x-speakeasy-mcp": { - "title": "Get an action", + "title": "List queues", "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" + } } - }, - "put": { - "operationId": "updateAction", - "summary": "Update an action", - "description": "Update an action.", + } + }, + "/queue/{id}": { + "get": { + "operationId": "getQueue", + "summary": "Get a queue", + "description": "Get a review queue with its item counts. The counts use the filters and the date window of the queue, the same as the dashboard.", "tags": [ - "Actions" + "Review queues" ], "security": [ { @@ -3278,10 +2700,10 @@ "name": "id", "schema": { "type": "string", - "description": "The ID of the action to update." + "description": "The queue ID." }, "required": true, - "description": "The ID of the action to update." + "description": "The queue ID." }, { "in": "header", @@ -3290,259 +2712,24 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" - } + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "queue": { + "$ref": "#/components/schemas/QueueWithCounts" + } }, "required": [ - "id", - "createdAt", - "name", - "builtIn", - "queueBehaviour", - "filterInQueueIds", - "position", - "possibleValues", - "valueRequired", - "freeText" + "queue" ], "additionalProperties": false } @@ -3569,22 +2756,22 @@ } } }, - "404": { - "description": "Not found", + "403": { + "description": "Insufficient access", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/PermissionDeniedError" } } } }, - "409": { - "description": "Action with this key already exists", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConflictError" + "$ref": "#/components/schemas/NotFoundError" } } } @@ -3598,25 +2785,37 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "actions", - "x-speakeasy-name-override": "update", + "x-speakeasy-group": "queue", + "x-speakeasy-name-override": "retrieve", "x-speakeasy-mcp": { - "title": "Update an action", + "title": "Get a queue", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "readOnlyHint": true, "destructiveHint": false } - }, - "delete": { - "operationId": "deleteAction", - "summary": "Delete an action", - "description": "Delete an action and all of its webhooks.", + } + }, + "/queue/{id}/stats": { + "get": { + "operationId": "getQueueStats", + "summary": "Get queue statistics", + "description": "Get review statistics of a queue for a period: resolved and pending items, the top reviewers and the resolved items per day.", "tags": [ - "Actions" + "Review queues" ], "security": [ { @@ -3629,10 +2828,21 @@ "name": "id", "schema": { "type": "string", - "description": "The ID of the action to delete." + "description": "The queue ID." }, "required": true, - "description": "The ID of the action to delete." + "description": "The queue ID." + }, + { + "in": "query", + "name": "withinDays", + "schema": { + "default": 30, + "description": "Length of the period in days, up to now.", + "type": "integer", + "minimum": 1, + "maximum": 365 + } }, { "in": "header", @@ -3641,30 +2851,105 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Action deleted successfully", + "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { - "deleted": { - "type": "boolean", - "description": "Whether the action was deleted." + "reviewStats": { + "type": "object", + "properties": { + "totalReviewed": { + "type": "integer", + "description": "Number of items resolved in this queue in the period." + }, + "totalPending": { + "type": "integer", + "description": "Number of items submitted in the period that wait for review now." + } + }, + "required": [ + "totalReviewed", + "totalPending" + ], + "additionalProperties": false }, - "id": { - "type": "string", - "description": "The ID of the action." + "topReviewers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "description": "The user ID of the reviewer. `null` for items resolved with an API key.", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "The name of the reviewer.", + "type": [ + "string", + "null" + ] + }, + "reviewCount": { + "type": "integer", + "description": "Number of items the reviewer resolved in the period." + } + }, + "required": [ + "userId", + "name", + "reviewCount" + ], + "additionalProperties": false + }, + "description": "Reviewers with the most resolved items, most first. Up to 10." + }, + "trends": { + "type": "object", + "properties": { + "dailyReviewCounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date in YYYY-MM-DD format (UTC)." + }, + "count": { + "type": "integer", + "description": "Number of items resolved." + } + }, + "required": [ + "date", + "count" + ], + "additionalProperties": false + }, + "description": "Resolved items per day. Days with no reviews are left out." + } + }, + "required": [ + "dailyReviewCounts" + ], + "additionalProperties": false } }, "required": [ - "deleted", - "id" + "reviewStats", + "topReviewers", + "trends" ], "additionalProperties": false } @@ -3691,290 +2976,209 @@ } } }, - "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", + "403": { + "description": "Insufficient access", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BadRequestError" + "$ref": "#/components/schemas/PermissionDeniedError" } } } }, - "401": { - "description": "Authorization not provided", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuthenticationError" + "$ref": "#/components/schemas/NotFoundError" } } } }, - "404": { - "description": "Not found", + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/RateLimitError" } } } }, - "429": { - "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "500": { + "description": "Internal server error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RateLimitError" + "$ref": "#/components/schemas/InternalServerError" } } } } }, - "x-speakeasy-group": "actions", - "x-speakeasy-name-override": "execute", + "x-speakeasy-group": "queue", + "x-speakeasy-name-override": "getStats", "x-speakeasy-mcp": { - "title": "Execute moderation action", + "title": "Get queue statistics", "scopes": [ - "destructive" + "read" ], - "readOnlyHint": false, - "destructiveHint": true + "readOnlyHint": true, + "destructiveHint": false } } }, - "/actions/{actionId}/execute": { - "post": { - "operationId": "executeActionById", - "summary": "Execute an action", - "description": "Execute an action on a set of content items in a queue.", + "/queue/{id}/items": { + "get": { + "operationId": "listQueueItems", + "summary": "List queue items", + "description": "List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item.", "tags": [ - "Actions" + "Review queues" ], "security": [ { "Authorization": [] } ], - "deprecated": true, "parameters": [ { "in": "path", - "name": "actionId", + "name": "id", "schema": { "type": "string", - "description": "The ID or key of the action to execute." + "description": "The queue ID." }, "required": true, - "description": "The ID or key of the action to execute." + "description": "The queue ID." }, { - "in": "header", - "name": "Project-Id", - "required": false, + "in": "query", + "name": "page", "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" - } - } + "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": "sort", + "schema": { + "type": "string", + "enum": [ + "FIFO", + "LIFO", + "RANDOM", + "SEVERITY_DESC" + ] + } + }, + { + "in": "query", + "name": "includeResolved", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "conversationIds", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "labels", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "authorId", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "filteredActionIds", + "schema": { + "type": "array", + "items": { + "type": "string" } } + }, + { + "in": "query", + "name": "afterDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "beforeDate", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" } - }, + ], "responses": { "200": { - "description": "Action executed successfully", + "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { - "success": { - "type": "boolean", - "description": "Action executed successfully." - }, - "actionId": { - "type": "string", - "description": "The ID of the action." - }, - "ids": { + "data": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/QueueItem" }, - "description": "The IDs of the content items." + "description": "The items on this page." + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "success", - "actionId", - "ids" + "data", + "pagination" ], "additionalProperties": false } @@ -4001,6 +3205,16 @@ } } }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, "404": { "description": "Not found", "content": { @@ -4020,18 +3234,56 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-ignore": true + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "list", + "x-speakeasy-mcp": { + "title": "List 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" + } + } } }, - "/webhooks": { - "get": { - "operationId": "listWebhooks", - "summary": "List webhooks", - "description": "List the webhooks of the project. The list is paginated.", + "/queue/{id}/items/{itemId}/resolve": { + "post": { + "operationId": "resolveQueueItem", + "summary": "Resolve a queue item", + "description": "Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`.", "tags": [ - "Webhooks" + "Review queues" ], "security": [ { @@ -4040,26 +3292,24 @@ ], "parameters": [ { - "in": "query", - "name": "page", + "in": "path", + "name": "id", "schema": { - "default": 1, - "description": "Page number, starting at 1.", - "type": "integer", - "minimum": 1, - "maximum": 100000 - } + "type": "string", + "description": "The queue ID." + }, + "required": true, + "description": "The queue ID." }, { - "in": "query", - "name": "pageSize", + "in": "path", + "name": "itemId", "schema": { - "default": 20, - "description": "Number of items per page. Maximum 100.", - "type": "integer", - "minimum": 1, - "maximum": 100 - } + "type": "string", + "description": "The item ID to resolve." + }, + "required": true, + "description": "The item ID to resolve." }, { "in": "header", @@ -4068,101 +3318,45 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Webhooks retrieved successfully", + "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 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." + "success": { + "type": "boolean" }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "resolvedAt": { + "type": "string", + "description": "When the item was resolved (ISO 8601)." } }, "required": [ - "data", - "pagination" + "success", + "resolvedAt" ], "additionalProperties": false } } } }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, "401": { "description": "Authorization not provided", "content": { @@ -4173,6 +3367,16 @@ } } }, + "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": { @@ -4182,44 +3386,37 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "webhooks", - "x-speakeasy-name-override": "list", + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "resolve", "x-speakeasy-mcp": { - "title": "List webhooks", + "title": "Resolve a queue item", "scopes": [ - "read" + "write" ], - "readOnlyHint": true, + "readOnlyHint": false, "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/resolve": { "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).", + "operationId": "resolveQueueItems", + "summary": "Resolve queue items", + "description": "Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`.", "tags": [ - "Webhooks" + "Review queues" ], "security": [ { @@ -4227,6 +3424,16 @@ } ], "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID." + }, + "required": true, + "description": "The queue ID." + }, { "in": "header", "name": "Project-Id", @@ -4234,7 +3441,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -4245,57 +3452,24 @@ "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": { + "itemIds": { "minItems": 1, + "maxItems": 100, "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" - ] + "type": "string" }, - "description": "Event types this webhook subscribes to. One webhook URL receives all events you list here." + "description": "The item IDs to resolve. Up to 100." } }, "required": [ - "name", - "url", - "eventTypes" + "itemIds" ] }, "example": { - "name": "Moderation events", - "url": "https://example.com/webhooks/moderation", - "eventTypes": [ - "QUEUE_ITEM_REJECTED", - "AUTHOR_BLOCKED" + "itemIds": [ + "clx8k2v0e000108l4a9bz3f7q", + "clx8k2v0e000208l4h2mc6d1r" ] } } @@ -4303,72 +3477,27 @@ }, "responses": { "200": { - "description": "Webhook created successfully", + "description": "Successful response", "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." + "resolved": { + "type": "integer", + "description": "Number of items resolved." }, - "eventTypes": { - "default": [], - "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "notFoundIds": { "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" + "type": "string" + }, + "description": "Item IDs that do not exist in the project." } }, "required": [ - "id", - "name", - "url", - "eventTypes", - "payloadVersion", - "createdAt" + "resolved", + "notFoundIds" ], "additionalProperties": false } @@ -4395,6 +3524,16 @@ } } }, + "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": { @@ -4404,12 +3543,22 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "webhooks", - "x-speakeasy-name-override": "create", + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "resolveMany", "x-speakeasy-mcp": { - "title": "Create a webhook", + "title": "Resolve queue items", "scopes": [ "write" ], @@ -4418,13 +3567,13 @@ } } }, - "/webhooks/{id}": { - "get": { - "operationId": "getWebhook", - "summary": "Get a webhook", - "description": "Get a webhook by ID.", + "/queue/{id}/items/{itemId}/unresolve": { + "post": { + "operationId": "unresolveQueueItem", + "summary": "Unresolve a queue item", + "description": "Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list.", "tags": [ - "Webhooks" + "Review queues" ], "security": [ { @@ -4437,10 +3586,20 @@ "name": "id", "schema": { "type": "string", - "description": "The ID of the webhook to get." + "description": "The queue ID." }, "required": true, - "description": "The ID of the webhook to get." + "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", @@ -4449,84 +3608,54 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Webhook retrieved successfully", + "description": "Successful response", "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" - ] - } + "success": { + "type": "boolean" }, - "payloadVersion": { + "status": { "type": "string", "enum": [ - "V1", - "V2" + "pending", + "resolved" ], - "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + "description": "`pending` waits for review. `resolved` is reviewed." }, - "createdAt": { - "description": "The date the webhook was created.", - "type": "string" + "unresolvedAt": { + "type": "string", + "description": "When the item was unresolved (ISO 8601)." } }, "required": [ - "id", - "name", - "url", - "eventTypes", - "payloadVersion", - "createdAt" + "success", + "status", + "unresolvedAt" ], "additionalProperties": false } } } }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, "401": { "description": "Authorization not provided", "content": { @@ -4537,12 +3666,12 @@ } } }, - "404": { - "description": "Not found", + "403": { + "description": "Insufficient access", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/PermissionDeniedError" } } } @@ -4556,25 +3685,37 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "webhooks", - "x-speakeasy-name-override": "retrieve", + "x-speakeasy-group": "queue.items", + "x-speakeasy-name-override": "unresolve", "x-speakeasy-mcp": { - "title": "Get a webhook", + "title": "Unresolve a queue item", "scopes": [ - "read" + "write" ], - "readOnlyHint": true, + "readOnlyHint": false, "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.", + } + }, + "/actions": { + "get": { + "operationId": "listActions", + "summary": "List moderation actions", + "description": "List the moderation actions of the project. The list is paginated.", "tags": [ - "Webhooks" + "Actions" ], "security": [ { @@ -4583,14 +3724,33 @@ ], "parameters": [ { - "in": "path", - "name": "id", + "in": "query", + "name": "queueId", "schema": { - "type": "string", - "description": "The ID of the webhook to update." - }, - "required": true, - "description": "The ID of the webhook to update." + "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", @@ -4599,128 +3759,160 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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", + "description": "Successful response", "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.", + "data": { "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." + "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." }, - "createdAt": { - "description": "The date the webhook was created.", - "type": "string" + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "id", - "name", - "url", - "eventTypes", - "payloadVersion", - "createdAt" + "data", + "pagination" ], "additionalProperties": false } @@ -4747,6 +3939,16 @@ } } }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PermissionDeniedError" + } + } + } + }, "404": { "description": "Not found", "content": { @@ -4766,25 +3968,54 @@ } } } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } } }, - "x-speakeasy-group": "webhooks", - "x-speakeasy-name-override": "update", + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "list", "x-speakeasy-mcp": { - "title": "Update a webhook", + "title": "List moderation actions", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "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" + } } }, - "delete": { - "operationId": "deleteWebhook", - "summary": "Delete a webhook", - "description": "Delete a webhook.", + "post": { + "operationId": "createAction", + "summary": "Create an action", + "description": "Create an action.", "tags": [ - "Webhooks" + "Actions" ], "security": [ { @@ -4792,16 +4023,6 @@ } ], "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", @@ -4809,86 +4030,334 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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." - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] }, - "required": [ - "deleted", - "id" - ], - "additionalProperties": false - } - } - } - }, - "401": { - "description": "Authorization not provided", + "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": { - "$ref": "#/components/schemas/AuthenticationError" + "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 } } } }, - "404": { - "description": "Not found", + "400": { + "description": "Invalid input data", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/BadRequestError" } } } }, - "429": { - "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "401": { + "description": "Authorization not provided", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RateLimitError" + "$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": "webhooks", - "x-speakeasy-name-override": "delete", + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "create", "x-speakeasy-mcp": { - "title": "Delete a webhook", + "title": "Create an action", "scopes": [ - "destructive" + "write" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": false } } }, - "/webhook-secret": { + "/actions/{id}": { "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.", + "operationId": "getAction", + "summary": "Get an action", + "description": "Get an action by ID.", "tags": [ - "Webhooks" + "Actions" ], "security": [ { @@ -4896,6 +4365,16 @@ } ], "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", @@ -4903,31 +4382,159 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Signing secret retrieved successfully", + "description": "Action retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { - "secret": { + "id": { "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." + "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": [ - "secret" + "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": { @@ -4938,6 +4545,16 @@ } } }, + "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": { @@ -4949,28 +4566,40 @@ } } }, - "x-speakeasy-group": "webhookSecret", + "x-speakeasy-group": "actions", "x-speakeasy-name-override": "retrieve", "x-speakeasy-mcp": { - "disabled": true + "title": "Get an action", + "scopes": [ + "read" + ], + "readOnlyHint": true, + "destructiveHint": false } - } - }, - "/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.", + }, + "put": { + "operationId": "updateAction", + "summary": "Update an action", + "description": "Update an action.", "tags": [ - "Content" + "Actions" ], "security": [ { "Authorization": [] } ], - "deprecated": true, "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", @@ -4978,7 +4607,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -4989,219 +4618,250 @@ "schema": { "type": "object", "properties": { - "contentId": { - "description": "The unique ID of the content in your database.", - "type": "string", - "minLength": 1, - "maxLength": 100 + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] }, - "channelKey": { - "description": "The key of the channel.", - "type": "string" + "name": { + "type": "string", + "description": "The name of the action." }, - "doNotStore": { - "description": "Do not store the content. The content won't enter the review queue", - "type": "boolean" + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] }, - "authorId": { - "description": "The author of the content.", - "type": "string" + "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" + } + ] }, - "contextId": { - "description": "For example the ID of a chat room or a post", - "type": "string" + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] }, - "metadata": { - "description": "Any metadata you want to store with the content", - "type": "object", - "propertyNames": { + "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" - }, - "additionalProperties": {} + } }, - "value": { + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", "type": "string", - "maxLength": 100000, - "description": "The text you'd like to analyze. We recommend to submit plain text or HTML" + "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": [ - "value" - ], - "description": "Input parameters for text moderation" + } } } } }, "responses": { "200": { - "description": "Successful response", + "description": "Action updated successfully", "content": { "application/json": { "schema": { - "allOf": [ - { - "type": "object", - "properties": { - "status": { + "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", - "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" + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] }, - "flagged": { - "type": "boolean", - "description": "Whether the content was flagged by any models" + { + "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." + } }, - "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 + "required": [ + "value" + ], + "additionalProperties": false + } }, - { - "type": "object", - "propertyNames": { - "type": "string" - }, - "additionalProperties": {} + "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 } } } @@ -5226,55 +4886,71 @@ } } }, - "403": { - "description": "Insufficient access", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" + "$ref": "#/components/schemas/NotFoundError" } } } }, - "429": { - "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "409": { + "description": "Action with this key already exists", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RateLimitError" + "$ref": "#/components/schemas/ConflictError" } } } }, - "500": { - "description": "Internal server error", + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InternalServerError" + "$ref": "#/components/schemas/RateLimitError" } } } } }, - "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.", + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "update", + "x-speakeasy-mcp": { + "title": "Update an action", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + }, + "delete": { + "operationId": "deleteAction", + "summary": "Delete an action", + "description": "Delete an action and all of its webhooks.", "tags": [ - "Content" + "Actions" ], "security": [ { "Authorization": [] } ], - "deprecated": true, "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", @@ -5282,237 +4958,38 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" + "responses": { + "200": { + "description": "Action deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the action was deleted." }, - "additionalProperties": {} + "id": { + "type": "string", + "description": "The ID of the action." + } }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the image you want to analyze." - } - }, - "required": [ - "url" - ], - "description": "Input parameters for image moderation" + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } } } - } - }, - "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", + }, + "400": { + "description": "Invalid input data", "content": { "application/json": { "schema": { @@ -5531,12 +5008,12 @@ } } }, - "403": { - "description": "Insufficient access", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" + "$ref": "#/components/schemas/NotFoundError" } } } @@ -5550,28 +5027,27 @@ } } } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } } }, - "x-speakeasy-ignore": true + "x-speakeasy-group": "actions", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete an action", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } } }, - "/account": { - "get": { - "operationId": "getAccount", - "summary": "Get account details", - "description": "Get account details", + "/actions/execute": { + "post": { + "operationId": "executeAction", + "summary": "Execute moderation action", + "description": "Execute a moderation action on one or more content items.", "tags": [ - "Account" + "Actions" ], "security": [ { @@ -5586,143 +5062,81 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" - } + "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" + ] } } } }, - "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", + "description": "Action executed successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { - "status": { - "type": "string", - "description": "Status of the authentication" - }, - "message": { - "type": "string", - "description": "Message of the authentication" + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" } }, "required": [ - "status", - "message" + "success" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Execution result" } } } @@ -5747,16 +5161,6 @@ } } }, - "403": { - "description": "Insufficient access", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" - } - } - } - }, "404": { "description": "Not found", "content": { @@ -5767,23 +5171,36 @@ } } }, - "500": { - "description": "Internal server error", + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InternalServerError" + "$ref": "#/components/schemas/RateLimitError" } } } } }, - "x-speakeasy-ignore": true - }, + "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": "createAuth", + "operationId": "executeActionById", + "summary": "Execute an action", + "description": "Execute an action on a set of content items in a queue.", "tags": [ - "Account" + "Actions" ], "security": [ { @@ -5792,6 +5209,16 @@ ], "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", @@ -5799,7 +5226,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -5809,36 +5236,62 @@ "application/json": { "schema": { "type": "object", - "properties": {} + "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": "Successful response", + "description": "Action executed successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { - "status": { - "type": "string", - "description": "Status of the authentication" + "success": { + "type": "boolean", + "description": "Action executed successfully." }, - "message": { + "actionId": { "type": "string", - "description": "Message of the authentication" + "description": "The ID of the action." }, - "project": { - "type": "string", - "description": "Name of the authenticated project" + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the content items." } }, "required": [ - "status", - "message", - "project" + "success", + "actionId", + "ids" ], "additionalProperties": false } @@ -5865,22 +5318,22 @@ } } }, - "403": { - "description": "Insufficient access", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" + "$ref": "#/components/schemas/NotFoundError" } } } }, - "500": { - "description": "Internal server error", + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InternalServerError" + "$ref": "#/components/schemas/RateLimitError" } } } @@ -5889,13 +5342,13 @@ "x-speakeasy-ignore": true } }, - "/wordlist": { + "/webhooks": { "get": { - "operationId": "listWordlists", - "summary": "List wordlists", - "description": "List the wordlists of the organization. The list is paginated.", + "operationId": "listWebhooks", + "summary": "List webhooks", + "description": "List the webhooks of the project. The list is paginated.", "tags": [ - "Wordlists" + "Webhooks" ], "security": [ { @@ -5932,13 +5385,13 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Successful response", + "description": "Webhooks retrieved successfully", "content": { "application/json": { "schema": { @@ -5951,43 +5404,64 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier of the wordlist" + "description": "The ID of the webhook." }, "name": { - "description": "Name of the wordlist", - "type": [ - "string", - "null" - ] + "type": "string", + "description": "The webhook's name." }, "description": { - "description": "Description of the wordlist", + "description": "The webhook's description.", "type": [ "string", "null" ] }, - "createdAt": { - "description": "When the wordlist was created", - "type": [ - "string", - "null" - ] + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." }, - "userId": { - "description": "User who created the wordlist", - "type": [ - "string", - "null" - ] + "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", - "description", - "createdAt", - "userId" + "url", + "eventTypes", + "payloadVersion", + "createdAt" ], "additionalProperties": false }, @@ -6006,16 +5480,6 @@ } } }, - "400": { - "description": "Invalid input data", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, "401": { "description": "Authorization not provided", "content": { @@ -6026,26 +5490,6 @@ } } }, - "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": { @@ -6055,22 +5499,12 @@ } } } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } } }, - "x-speakeasy-group": "wordlist", + "x-speakeasy-group": "webhooks", "x-speakeasy-name-override": "list", "x-speakeasy-mcp": { - "title": "List wordlists", + "title": "List webhooks", "scopes": [ "read" ], @@ -6096,15 +5530,13 @@ "numPages": "$.pagination.totalPages" } } - } - }, - "/wordlist/{id}": { - "get": { - "operationId": "getWordlist", - "summary": "Get wordlist", - "description": "Get a specific wordlist by ID", + }, + "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": [ - "Wordlists" + "Webhooks" ], "security": [ { @@ -6112,16 +5544,6 @@ } ], "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", @@ -6129,13 +5551,76 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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": "Successful response", + "description": "Webhook created successfully", "content": { "application/json": { "schema": { @@ -6143,58 +5628,64 @@ "properties": { "id": { "type": "string", - "description": "ID of the wordlist" + "description": "The ID of the webhook." }, "name": { - "anyOf": [ - { - "type": "string", - "description": "Name of the wordlist" - }, - { - "type": "null" - } + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" ] }, - "words": { + "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" - }, - "description": "Words in the wordlist" - }, - "createdAt": { - "description": "Creation date of the wordlist", - "type": "string" + "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" + ] + } }, - "organizationId": { + "payloadVersion": { "type": "string", - "description": "ID of the organization" + "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." }, - "userId": { - "anyOf": [ - { - "type": "string", - "description": "ID of the user" - }, - { - "type": "null" - } - ] - }, - "strict": { - "type": "boolean", - "description": "Strict mode" + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" } }, "required": [ "id", "name", - "words", - "createdAt", - "organizationId", - "userId", - "strict" + "url", + "eventTypes", + "payloadVersion", + "createdAt" ], "additionalProperties": false } @@ -6221,26 +5712,6 @@ } } }, - "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": { @@ -6250,35 +5721,27 @@ } } } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } } }, - "x-speakeasy-group": "wordlist", - "x-speakeasy-name-override": "retrieve", + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "create", "x-speakeasy-mcp": { - "title": "Get wordlist", + "title": "Create a webhook", "scopes": [ - "read" + "write" ], - "readOnlyHint": true, + "readOnlyHint": false, "destructiveHint": false } - }, - "put": { - "operationId": "updateWordlist", - "summary": "Update wordlist", - "description": "Update a wordlist", + } + }, + "/webhooks/{id}": { + "get": { + "operationId": "getWebhook", + "summary": "Get a webhook", + "description": "Get a webhook by ID.", "tags": [ - "Wordlists" + "Webhooks" ], "security": [ { @@ -6291,10 +5754,10 @@ "name": "id", "schema": { "type": "string", - "description": "ID of the wordlist to update" + "description": "The ID of the webhook to get." }, "required": true, - "description": "ID of the wordlist to update" + "description": "The ID of the webhook to get." }, { "in": "header", @@ -6303,48 +5766,13 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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", + "description": "Webhook retrieved successfully", "content": { "application/json": { "schema": { @@ -6352,74 +5780,70 @@ "properties": { "id": { "type": "string", - "description": "ID of the wordlist" + "description": "The ID of the webhook." }, "name": { - "anyOf": [ - { - "type": "string", - "description": "Name of the wordlist" - }, - { - "type": "null" - } + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" ] }, - "words": { + "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" - }, - "description": "Words in the wordlist" - }, - "createdAt": { - "description": "Creation date of the wordlist", - "type": "string" + "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" + ] + } }, - "organizationId": { + "payloadVersion": { "type": "string", - "description": "ID of the organization" - }, - "userId": { - "anyOf": [ - { - "type": "string", - "description": "ID of the user" - }, - { - "type": "null" - } - ] + "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." }, - "strict": { - "type": "boolean", - "description": "Strict mode" + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" } }, "required": [ "id", "name", - "words", - "createdAt", - "organizationId", - "userId", - "strict" + "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": { @@ -6451,25 +5875,23 @@ } } }, - "x-speakeasy-group": "wordlist", - "x-speakeasy-name-override": "update", + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "retrieve", "x-speakeasy-mcp": { - "title": "Update wordlist", + "title": "Get a webhook", "scopes": [ - "write" + "read" ], - "readOnlyHint": false, + "readOnlyHint": true, "destructiveHint": false } - } - }, - "/wordlist/{id}/embedding-status": { - "get": { - "operationId": "getWordlistEmbeddingStatus", - "summary": "Get embedding status", - "description": "Get the current embedding progress status for a wordlist", + }, + "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": [ - "Wordlists" + "Webhooks" ], "security": [ { @@ -6482,10 +5904,10 @@ "name": "id", "schema": { "type": "string", - "description": "ID of the wordlist to check embedding status for" + "description": "The ID of the webhook to update." }, "required": true, - "description": "ID of the wordlist to check embedding status for" + "description": "The ID of the webhook to update." }, { "in": "header", @@ -6494,38 +5916,130 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" + "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, - "description": "Embedding status details" + "additionalProperties": false } } } @@ -6550,16 +6064,6 @@ } } }, - "403": { - "description": "Insufficient access", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" - } - } - } - }, "404": { "description": "Not found", "content": { @@ -6579,37 +6083,25 @@ } } } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } } }, - "x-speakeasy-group": "wordlist", - "x-speakeasy-name-override": "getEmbeddingStatus", + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "update", "x-speakeasy-mcp": { - "title": "Get embedding status", + "title": "Update a webhook", "scopes": [ - "read" + "destructive" ], - "readOnlyHint": true, - "destructiveHint": false + "readOnlyHint": false, + "destructiveHint": true } - } - }, - "/wordlist/{id}/words": { - "post": { - "operationId": "addWordlistWords", - "summary": "Add words to wordlist", - "description": "Add words to an existing wordlist", + }, + "delete": { + "operationId": "deleteWebhook", + "summary": "Delete a webhook", + "description": "Delete a webhook.", "tags": [ - "Wordlists" + "Webhooks" ], "security": [ { @@ -6622,10 +6114,10 @@ "name": "id", "schema": { "type": "string", - "description": "ID of the wordlist to add words to" + "description": "The ID of the webhook to delete." }, "required": true, - "description": "ID of the wordlist to add words to" + "description": "The ID of the webhook to delete." }, { "in": "header", @@ -6634,82 +6126,36 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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", + "description": "Webhook deleted successfully", "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" + "deleted": { + "type": "boolean", + "description": "Whether the webhook was deleted." }, - "addedWords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of words that were added" + "id": { + "type": "string", + "description": "The ID of the webhook." } }, "required": [ - "addedCount", - "totalCount", - "addedWords" + "deleted", + "id" ], "additionalProperties": false } } } }, - "400": { - "description": "Invalid input data", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, "401": { "description": "Authorization not provided", "content": { @@ -6741,53 +6187,32 @@ } } }, - "x-speakeasy-group": "wordlist.words", - "x-speakeasy-name-override": "add", + "x-speakeasy-group": "webhooks", + "x-speakeasy-name-override": "delete", "x-speakeasy-mcp": { - "title": "Add words to wordlist", + "title": "Delete a webhook", "scopes": [ - "write" + "destructive" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": true } - }, - "delete": { - "operationId": "removeWordlistWords", - "summary": "Remove words from wordlist", - "description": "Remove words from an existing wordlist", - "tags": [ - "Wordlists" - ], - "security": [ - { + } + }, + "/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": "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", @@ -6795,54 +6220,31 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], "responses": { "200": { - "description": "Words successfully removed from wordlist", + "description": "Signing secret retrieved successfully", "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" + "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": [ - "removedCount", - "totalCount", - "removedWords" + "secret" ], "additionalProperties": false } } } }, - "400": { - "description": "Invalid input data", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, "401": { "description": "Authorization not provided", "content": { @@ -6853,16 +6255,6 @@ } } }, - "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": { @@ -6874,22 +6266,18 @@ } } }, - "x-speakeasy-group": "wordlist.words", - "x-speakeasy-name-override": "remove", + "x-speakeasy-group": "webhookSecret", + "x-speakeasy-name-override": "retrieve", "x-speakeasy-mcp": { - "title": "Remove words from wordlist", - "scopes": [ - "destructive" - ], - "readOnlyHint": false, - "destructiveHint": true + "disabled": true } } }, - "/moderate": { + "/moderate/text": { "post": { - "operationId": "submitContent", - "summary": "Submit content", + "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" ], @@ -6898,6 +6286,7 @@ "Authorization": [] } ], + "deprecated": true, "parameters": [ { "in": "header", @@ -6906,7 +6295,7 @@ "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.", + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", "x-speakeasy-name-override": "projectId" } ], @@ -6917,376 +6306,2474 @@ "schema": { "type": "object", "properties": { - "content": { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "text" - }, - "text": { - "type": "string", - "maxLength": 100000, - "description": "The content text" - } + "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": "Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted.", + "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" }, - "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 - } + "contentId": { + "description": "The ID of the content.", + "type": "string" }, - "required": [ - "type" - ], - "description": "Image", - "title": "Image" - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "video" + "request": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "The timestamp of the request" + }, + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" + } }, - "url": { - "type": "string", - "format": "uri", - "description": "A public URL of the video content" - } + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false, + "description": "Information about the request" }, - "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" - } + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any models" }, - "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" + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" }, - { - "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" + "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 }, - "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 + { + "type": "null" } - }, - "required": [ - "type" ], - "description": "Image", - "title": "Image" + "description": "Block or suspension details, if applicable. Null if the author is enabled." }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "video" - }, - "url": { - "type": "string", - "format": "uri", - "description": "A public URL of the video content" - } - }, - "required": [ - "type", - "url" + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" ], - "description": "Video", - "title": "Video" + "description": "Current author status" }, - { + "trust_level": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "audio" + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the audio content" + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" } }, "required": [ - "type", - "url" + "level", + "manual" ], - "description": "Audio", - "title": "Audio" + "additionalProperties": false } + }, + "required": [ + "id", + "block", + "status", + "trust_level" ], - "title": "Content leaf", - "type": "object" + "additionalProperties": false }, - "description": "Values in the object. Can be mixed content types." - } + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." }, - "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" - ] + "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." + } }, - "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": [ + "status", + "request", + "flagged", + "author", + "content_moderated", + "unicode_spoofing", + "data_found", + "original", + "content" + ], + "additionalProperties": false }, - "required": [ - "action" - ] + { + "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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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", + "description": "Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted.", "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" + "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" }, - { - "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" + "contentId": { + "description": "The ID of the content.", + "type": "string" }, - { + "request": { "type": "object", "properties": { - "flag": { - "type": "boolean" - }, - "threshold": { + "timestamp": { "type": "number", - "minimum": 0, - "maximum": 1 + "description": "The timestamp of the request" }, - "id": { - "type": "string", - "const": "hate" + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" } }, "required": [ - "flag", - "id" + "timestamp", + "quota_usage" ], - "title": "Hate" + "additionalProperties": false, + "description": "Information about the request" }, - { - "type": "object", - "properties": { - "flag": { - "type": "boolean" - }, - "threshold": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "id": { + "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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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" + } + } + }, + "post": { + "operationId": "createWordlist", + "summary": "Create wordlist", + "description": "Create a wordlist in the organization. You can add words now or later. Each word is embedded in the background for similarity matching. Use the embedding status endpoint to follow the progress. To use the wordlist in moderation, add it to a policy.", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, + "maxLength": 100, + "description": "Name of the wordlist" + }, + "key": { + "description": "Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added.", + "type": "string" + }, + "description": { + "description": "Description of the wordlist", + "type": "string" + }, + "words": { + "description": "Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Wordlist created 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" + } + } + } + }, + "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": "create", + "x-speakeasy-mcp": { + "title": "Create wordlist", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. Fields that you do not send stay the same. If you send words, they replace all existing words, and the embeddings are updated in the background.", + "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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.", + "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": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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": "Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted.", + "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" } @@ -9776,10 +11263,10 @@ "x-speakeasy-mcp": { "title": "Update a project", "scopes": [ - "write" + "destructive" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": true } }, "delete": { @@ -9993,7 +11480,125 @@ "x-speakeasy-group": "projects", "x-speakeasy-name-override": "duplicate", "x-speakeasy-mcp": { - "title": "Duplicate a project", + "title": "Duplicate a project", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/projects/{id}/api-keys": { + "post": { + "operationId": "createProjectApiKey", + "summary": "Create a project API key", + "description": "Create a new secret API key for a project and return it. Give each app or computer its own key, so you can revoke one without breaking the others. The project's existing keys keep working. 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." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "default": "API key", + "description": "A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer.", + "type": "string", + "minLength": 1, + "maxLength": 50 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "API key created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectApiKey" + } + } + } + }, + "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.apiKeys", + "x-speakeasy-name-override": "create", + "x-speakeasy-mcp": { + "title": "Create a project API key", "scopes": [ "write" ], @@ -10586,10 +12191,10 @@ "x-speakeasy-mcp": { "title": "Update a channel", "scopes": [ - "write" + "destructive" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": true } }, "delete": { @@ -10784,386 +12389,935 @@ "$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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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." }, - "403": { - "description": "Insufficient access", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionDeniedError" - } + "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." }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } + "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 }, - "429": { - "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitError" - } + "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." } }, - "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" + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" ], - "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" + "additionalProperties": false + }, + "Queue": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The queue ID." + }, + "name": { + "type": "string", + "description": "The queue name." + }, + "description": { + "description": "The queue description.", + "type": [ + "string", + "null" + ] + }, + "isDefault": { + "type": "boolean", + "description": "Whether this is the default queue of the project." } + }, + "required": [ + "id", + "name", + "description", + "isDefault" ], - "parameters": [ - { - "name": "Authorization", - "in": "header", - "required": true, - "description": "Bearer ", - "schema": { - "type": "string" - } + "additionalProperties": false + }, + "QueueWithCounts": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The queue ID." }, - { - "name": "Sec-WebSocket-Protocol", - "in": "header", - "required": true, - "description": "Requested subprotocol.", - "schema": { - "type": "string", - "enum": [ - "moderationapi.v1" - ] - } + "name": { + "type": "string", + "description": "The queue name." }, - { - "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" + "description": { + "description": "The queue description.", + "type": [ + "string", + "null" + ] + }, + "isDefault": { + "type": "boolean", + "description": "Whether this is the default queue of the project." + }, + "unresolvedItemsCount": { + "type": "integer", + "description": "Number of items that wait for review." + }, + "resolvedItemsCount": { + "type": "integer", + "description": "Number of items that are resolved." + }, + "totalItemsCount": { + "type": "integer", + "description": "Number of items in the queue, resolved and unresolved." } + }, + "required": [ + "id", + "name", + "description", + "isDefault", + "unresolvedItemsCount", + "resolvedItemsCount", + "totalItemsCount" ], - "requestBody": { - "description": "Frames sent by the client over the socket (not an HTTP body).", + "additionalProperties": false + }, + "QueueItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The item ID. Use it to resolve or unresolve the item in this queue." + }, + "contentId": { + "type": "string", + "description": "Your content ID, as you sent it to `POST /moderate`." + }, "content": { - "application/json": { - "schema": { + "anyOf": [ + { "oneOf": [ { - "$ref": "#/components/schemas/VoiceStartFrame" + "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" }, { - "$ref": "#/components/schemas/VoiceMediaFrame" + "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" }, { - "$ref": "#/components/schemas/VoiceStopFrame" + "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" } ], - "discriminator": { - "propertyName": "event" - } + "type": "object" + }, + { + "type": "null" } - } - } - }, - "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" + ], + "description": "The submitted content." + }, + "labels": { + "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" + } }, - { - "$ref": "#/components/schemas/VoiceSessionEnded" - } - ], - "discriminator": { - "propertyName": "event" + "required": [ + "match", + "probability", + "span" + ], + "additionalProperties": false } - } - } - } - } - }, - "x-webSocket": true, - "operationId": "streamVoice", - "x-speakeasy-ignore": true - } - } - }, - "components": { - "schemas": { - "PublicAuthor": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Author ID in Moderation API" + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + }, + "description": "The moderation labels of the content." }, - "external_id": { - "description": "The author's ID from your system", + "flagged": { + "type": "boolean", + "description": "Whether moderation flagged the content." + }, + "severity": { + "description": "Severity score from 0 to 1, if available.", "type": [ - "string", + "number", "null" ] }, - "profile_picture": { - "description": "URL of the author's profile picture", - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] + "status": { + "type": "string", + "enum": [ + "pending", + "resolved" + ], + "description": "`pending` waits for review. `resolved` is reviewed." }, - "external_link": { - "description": "URL of the author's external profile", - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] + "timestamp": { + "type": "number", + "description": "When the content was submitted, as Unix time in milliseconds." }, - "name": { - "description": "Author name or identifier", + "language": { + "description": "Detected ISO language code.", "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" - } + "conversationId": { + "description": "Conversation ID, if any.", + "type": [ + "string", + "null" ] }, - "company": { - "description": "The author's company or organization", + "authorId": { + "description": "Your author ID, if any.", "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", + "contentType": { + "description": "Content type, for example `message` or `profile`.", "type": [ - "number", + "string", "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", + "contentId", + "content", + "labels", + "flagged", + "severity", "status", - "trust_level", - "block", - "risk_evaluation", - "metrics", - "metadata" + "timestamp", + "language", + "conversationId", + "authorId", + "contentType" ], "additionalProperties": false }, @@ -11314,6 +13468,39 @@ ], "additionalProperties": false }, + "ProjectApiKey": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the API key." + }, + "name": { + "type": "string", + "description": "The key's name." + }, + "projectId": { + "type": "string", + "description": "The ID of the project the key belongs to." + }, + "createdAt": { + "description": "When the key was created.", + "type": "string" + }, + "secretKey": { + "type": "string", + "description": "The new secret API key. Use it to moderate content in this project. It is also shown in the project's settings." + } + }, + "required": [ + "id", + "name", + "projectId", + "createdAt", + "secretKey" + ], + "additionalProperties": false + }, "Channel": { "type": "object", "properties": { @@ -13555,10 +15742,11 @@ "enum": [ "invalid_request", "project_id_required", + "project_name_ambiguous", "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`.", + "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 key reaches more than one project. `message` lists the projects it reaches.\n- `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead.\n- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`.", "example": "invalid_request" }, "message": { @@ -13716,13 +15904,14 @@ "action_not_found", "author_not_found", "queue_not_found", + "queue_item_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.", + "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- `queue_item_not_found`: The queue item does not exist in the project.\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": { diff --git a/CHANGELOG.md b/CHANGELOG.md index a5479e3..b265fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,141 @@ # Changelog +## 2.2.0 (2026-10-26) + +Full Changelog: [v2.1.1...v2.2.0](https://github.com/moderation-api/sdk-python/compare/v2.1.1...v2.2.0) + +### âš  Breaking changes + +- `GET /authors`: removed the enum value `reportCount` from the `query` request parameter `sortBy` +- `GET /queue/{id}`: the response property `queue/description` became nullable for the status `200` +- `GET /queue/{id}`: removed the required property `queue/filter` from the response with the `200` status +- `GET /queue/{id}/items`: added `subschema #1, subschema #2` to the `data/items/content` response property `anyOf` list for the response status `200` +- `GET /queue/{id}/items`: the response property `data/items/authorId` became nullable for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/contentType` became nullable for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/conversationId` became nullable for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/language` became nullable for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/labels/items/flagged` became optional for the status `200` +- `GET /queue/{id}/items`: the `data/items/content` response's property `type` changed from `string` to `any` for status `200` +- `POST /queue/{id}/items/{itemId}/resolve`: removed the request body +- `POST /queue/{id}/items/{itemId}/unresolve`: removed the request body +- `GET /queue/{id}/stats`: the response property `topReviewers/items/name` became nullable for the status `200` +- `GET /queue/{id}/stats`: the response property `topReviewers/items/userId` became nullable for the status `200` +- `GET /queue/{id}/stats`: removed the required property `actionStats` from the response with the `200` status +- `GET /queue/{id}/stats`: removed the required property `reviewStats/averageTimeToReview` from the response with the `200` status +- `GET /queue/{id}/stats`: removed the required property `topReviewers/items/averageTimePerReview` from the response with the `200` status +- `GET /queue/{id}/stats`: removed the required property `topReviewers/items/topActions` from the response with the `200` status +- `GET /queue/{id}/stats`: removed the required property `trends/flaggedContentTrends` from the response with the `200` status + +### API changes + +- `GET /actions`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /actions`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /actions`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /actions/execute`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /actions/execute`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /actions/{actionId}/execute`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /actions/{actionId}/execute`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `DELETE /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /actions/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /actions/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /actions/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /actions/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /auth`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /auth`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /auth`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /authors`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /authors`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /authors`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /authors/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /authors/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /authors/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /authors/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `DELETE /channels/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /channels/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /channels/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /channels/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /channels/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /channels/{id}/duplicate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /channels/{id}/duplicate`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /moderate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /moderate/image`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /moderate/text`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /projects`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /projects/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /projects/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /projects/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /projects/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /projects/{id}/duplicate`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /projects/{id}/duplicate`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /projects/{projectId}/channels`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /projects/{projectId}/channels`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /projects/{projectId}/channels`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /queue/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /queue/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /queue/{id}/items`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /queue/{id}/items`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /queue/{id}/items/{itemId}/resolve`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /queue/{id}/items/{itemId}/unresolve`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /queue/{id}/stats`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /queue/{id}/stats`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /webhooks`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /webhooks/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /webhooks/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /webhooks/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /webhooks/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /wordlist`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /wordlist`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /wordlist/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /wordlist/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `PUT /wordlist/{id}`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `PUT /wordlist/{id}`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /wordlist/{id}/embedding-status`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `GET /wordlist/{id}/embedding-status`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `DELETE /wordlist/{id}/words`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `DELETE /wordlist/{id}/words`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `POST /wordlist/{id}/words`: added the new `project_name_ambiguous` enum value to the `code` response property for the response status `400` +- `POST /wordlist/{id}/words`: added the new `queue_item_not_found` enum value to the `code` response property for the response status `404` +- `GET /authors`: deleted the `query` request parameter `contentTypes` +- `GET /queue/{id}/items`: deleted the `query` request parameter `sortDirection` +- `GET /queue/{id}/items`: deleted the `query` request parameter `sortField` +- a breaking change was detected but the version is still `1.1.0` +- `GET /analytics/authors`: endpoint added +- `GET /analytics/automation`: endpoint added +- `GET /analytics/channels`: endpoint added +- `GET /analytics/policies`: endpoint added +- `GET /analytics/summary`: endpoint added +- `GET /analytics/volumes`: endpoint added +- `POST /feedback`: endpoint added +- `POST /projects/{id}/api-keys`: endpoint added +- `GET /queue`: endpoint added +- `GET /queue/{id}`: the `queue/resolvedItemsCount` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}`: the `queue/totalItemsCount` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}`: the `queue/unresolvedItemsCount` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}`: added the required property `queue/isDefault` to the response with the `200` status +- `GET /queue/{id}/items`: added the new optional `query` request parameter `sort` +- `GET /queue/{id}/items`: added the optional property `data/items/labels/items/manual` to the response with the `200` status +- `GET /queue/{id}/items`: added the optional property `data/items/labels/items/matches` to the response with the `200` status +- `GET /queue/{id}/items`: added the optional property `data/items/labels/items/shadow_flagged` to the response with the `200` status +- `GET /queue/{id}/items`: removed the optional property `data/items/actions` from the response with the `200` status +- `GET /queue/{id}/items`: the response property `data/items/authorId` became required for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/contentType` became required for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/conversationId` became required for the status `200` +- `GET /queue/{id}/items`: the response property `data/items/language` became required for the status `200` +- `GET /queue/{id}/items`: added the required property `data/items/contentId` to the response with the `200` status +- `GET /queue/{id}/items`: added the required property `data/items/severity` to the response with the `200` status +- `POST /queue/{id}/items/resolve`: endpoint added +- `POST /queue/{id}/items/{itemId}/resolve`: removed the optional property `comment` from the response with the `200` status +- `POST /queue/{id}/items/{itemId}/unresolve`: the `status` response property for the response status `200` was restricted to a list of enum values +- `GET /queue/{id}/stats`: removed the optional property `topReviewers/items/accuracyScore` from the response with the `200` status +- `GET /queue/{id}/stats`: the `reviewStats/totalPending` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}/stats`: the `reviewStats/totalReviewed` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}/stats`: the `topReviewers/items/reviewCount` response's property `type` was narrowed from `number` to `integer` for status `200` +- `GET /queue/{id}/stats`: the `trends/dailyReviewCounts/items/count` response's property `type` was narrowed from `number` to `integer` for status `200` +- `POST /wordlist`: endpoint added + ## 2.1.1 (2026-10-22) Full Changelog: [v2.1.0...v2.1.1](https://github.com/moderation-api/sdk-python/compare/v2.1.0...v2.1.1) diff --git a/README.md b/README.md index f3652aa..fa4341c 100644 --- a/README.md +++ b/README.md @@ -294,12 +294,10 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.authors.list(request={}) + res = ma_client.analytics.summary(range="30d") - while res is not None: - # Handle items - - res = res.next() + # Handle response + print(res) ``` @@ -309,9 +307,9 @@ with ModerationAPI( Moderation API has two kinds of API keys: - A **project key** works with one project: content, authors, review queues, actions, wordlists, webhooks and the account. Most integrations need only this key. -- An **organization key** works with the [management API](https://docs.moderationapi.com/api-reference/management-api): projects and channels. The management API is available on Enterprise plans. +- An **organization key** works with the [management API](https://docs.moderationapi.com/api-reference/management-api): projects and channels. It can also use any project's endpoints: name the project with `projectId`. -Each key works only with its own endpoints. With the wrong key the API returns `403` with the code `project_key_required` or `organization_key_required`. If you use both, create one client for each key: +A project key can't call the management API: the API returns `403` with the code `organization_key_required`. If you use both kinds of key, create one client for each: ```python import os @@ -353,6 +351,15 @@ Create the organization client only where you manage projects and channels, for * [delete](docs/sdks/actions/README.md#delete) - Delete an action * [execute](docs/sdks/actions/README.md#execute) - Execute moderation action +### [Analytics](docs/sdks/analytics/README.md) + +* [summary](docs/sdks/analytics/README.md#summary) - Get the analytics summary +* [policies](docs/sdks/analytics/README.md#policies) - Get the most flagged policies +* [authors](docs/sdks/analytics/README.md#authors) - Get the most flagged authors +* [channels](docs/sdks/analytics/README.md#channels) - Get analytics per channel +* [volumes](docs/sdks/analytics/README.md#volumes) - Get volumes over time +* [automation](docs/sdks/analytics/README.md#automation) - Get the automation breakdown + ### [Authors](docs/sdks/authors/README.md) * [list](docs/sdks/authors/README.md#list) - List authors @@ -374,6 +381,10 @@ Create the organization client only where you manage projects and channels, for * [submit](docs/sdks/contentsdk/README.md#submit) - Submit content +### [Feedback](docs/sdks/feedback/README.md) + +* [create](docs/sdks/feedback/README.md#create) - Send feedback + ### [Projects](docs/sdks/projects/README.md) * [list](docs/sdks/projects/README.md#list) - List projects @@ -383,15 +394,21 @@ Create the organization client only where you manage projects and channels, for * [delete](docs/sdks/projects/README.md#delete) - Delete a project * [duplicate](docs/sdks/projects/README.md#duplicate) - Duplicate a project +#### [Projects.ApiKeys](docs/sdks/apikeys/README.md) + +* [create](docs/sdks/apikeys/README.md#create) - Create a project API key + ### [Queue](docs/sdks/queuesdk/README.md) +* [list](docs/sdks/queuesdk/README.md#list) - List queues * [retrieve](docs/sdks/queuesdk/README.md#retrieve) - Get a queue * [get_stats](docs/sdks/queuesdk/README.md#get_stats) - Get queue statistics #### [Queue.Items](docs/sdks/items/README.md) -* [list](docs/sdks/items/README.md#list) - Get queue items +* [list](docs/sdks/items/README.md#list) - List queue items * [resolve](docs/sdks/items/README.md#resolve) - Resolve a queue item +* [resolve_many](docs/sdks/items/README.md#resolve_many) - Resolve queue items * [unresolve](docs/sdks/items/README.md#unresolve) - Unresolve a queue item ### [Webhooks](docs/sdks/webhooks/README.md) @@ -409,6 +426,7 @@ Create the organization client only where you manage projects and channels, for ### [Wordlist](docs/sdks/wordlist/README.md) * [list](docs/sdks/wordlist/README.md#list) - List wordlists +* [create](docs/sdks/wordlist/README.md#create) - Create wordlist * [retrieve](docs/sdks/wordlist/README.md#retrieve) - Get wordlist * [update](docs/sdks/wordlist/README.md#update) - Update wordlist * [get_embedding_status](docs/sdks/wordlist/README.md#get_embedding_status) - Get embedding status @@ -464,13 +482,11 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.authors.list(request={}, + res = ma_client.analytics.summary(range="30d", RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - while res is not None: - # Handle items - - res = res.next() + # Handle response + print(res) ``` @@ -486,12 +502,10 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.authors.list(request={}) - - while res is not None: - # Handle items + res = ma_client.analytics.summary(range="30d") - res = res.next() + # Handle response + print(res) ``` @@ -523,12 +537,10 @@ with ModerationAPI( res = None try: - res = ma_client.authors.list(request={}) - - while res is not None: - # Handle items + res = ma_client.analytics.summary(range="30d") - res = res.next() + # Handle response + print(res) except errors.ModerationAPIError as e: @@ -553,8 +565,9 @@ with ModerationAPI( * [`ModerationAPIError`](./src/moderation_api/errors/moderationapierror.py): The base class for HTTP error responses. * [`AuthenticationError`](./src/moderation_api/errors/authenticationerror.py): The API key is missing, invalid or revoked. Status code `401`. * [`RateLimitError`](./src/moderation_api/errors/ratelimiterror.py): Too many requests. Retry after the number of seconds in the `Retry-After` header. Status code `429`. + * [`BadRequestError`](./src/moderation_api/errors/badrequesterror.py): The request is malformed or a parameter is invalid. Status code `400`. * -
Less common errors (10) +
Less common errors (9)
@@ -565,11 +578,10 @@ with ModerationAPI( **Inherit from [`ModerationAPIError`](./src/moderation_api/errors/moderationapierror.py)**: -* [`BadRequestError`](./src/moderation_api/errors/badrequesterror.py): The request is malformed or a parameter is invalid. Status code `400`. Applicable to 32 of 42 methods.* -* [`NotFoundError`](./src/moderation_api/errors/notfounderror.py): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 31 of 42 methods.* -* [`PermissionDeniedError`](./src/moderation_api/errors/permissiondeniederror.py): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 27 of 42 methods.* -* [`InternalServerError`](./src/moderation_api/errors/internalservererror.py): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 15 of 42 methods.* -* [`ConflictError`](./src/moderation_api/errors/conflicterror.py): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 42 methods.* +* [`NotFoundError`](./src/moderation_api/errors/notfounderror.py): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 39 of 53 methods.* +* [`PermissionDeniedError`](./src/moderation_api/errors/permissiondeniederror.py): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 36 of 53 methods.* +* [`InternalServerError`](./src/moderation_api/errors/internalservererror.py): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 23 of 53 methods.* +* [`ConflictError`](./src/moderation_api/errors/conflicterror.py): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 53 methods.* * [`ResponseValidationError`](./src/moderation_api/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
@@ -593,12 +605,10 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.authors.list(request={}) + res = ma_client.analytics.summary(range="30d") - while res is not None: - # Handle items - - res = res.next() + # Handle response + print(res) ``` diff --git a/docs/errors/badrequesterror.md b/docs/errors/badrequesterror.md index a90fb4f..3d56af1 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.
- `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 +| 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 key reaches more than one project. `message` lists the projects it reaches.
- `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead.
- `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/notfounderror.md b/docs/errors/notfounderror.md index 8ed4191..e3529dc 100644 --- a/docs/errors/notfounderror.md +++ b/docs/errors/notfounderror.md @@ -5,11 +5,11 @@ The resource does not exist or the key cannot see it. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | *Literal["not_found_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | -| `code` | [models.NotFoundErrorCode](../models/notfounderrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `resource_not_found`: The resource does not exist.
- `action_not_found`: The action does not exist.
- `author_not_found`: The author does not exist.
- `queue_not_found`: The review queue does not exist.
- `wordlist_not_found`: The wordlist does not exist.
- `webhook_not_found`: The webhook does not exist.
- `project_not_found`: The project does not exist.
- `channel_not_found`: The channel does not exist. | resource_not_found | -| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Not found | -| `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["not_found_error"]* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [models.NotFoundErrorCode](../models/notfounderrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `resource_not_found`: The resource does not exist.
- `action_not_found`: The action does not exist.
- `author_not_found`: The author does not exist.
- `queue_not_found`: The review queue does not exist.
- `queue_item_not_found`: The queue item does not exist in the project.
- `wordlist_not_found`: The wordlist does not exist.
- `webhook_not_found`: The webhook does not exist.
- `project_not_found`: The project does not exist.
- `channel_not_found`: The channel does not exist. | resource_not_found | +| `message` | *str* | :heavy_check_mark: | Human-readable explanation. | Not found | +| `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/submitcontentrecommendationaction.md b/docs/models/actionresponse.md similarity index 63% rename from docs/models/submitcontentrecommendationaction.md rename to docs/models/actionresponse.md index 3f3b530..9ecbdae 100644 --- a/docs/models/submitcontentrecommendationaction.md +++ b/docs/models/actionresponse.md @@ -1,14 +1,14 @@ -# SubmitContentRecommendationAction +# ActionResponse The action to take based on the recommendation ## Example Usage ```python -from moderation_api.models import SubmitContentRecommendationAction +from moderation_api.models import ActionResponse # Open enum: unrecognized values are captured as UnrecognizedStr -value: SubmitContentRecommendationAction = "review" +value: ActionResponse = "review" ``` diff --git a/docs/models/actionstat.md b/docs/models/actionstat.md deleted file mode 100644 index 0134a12..0000000 --- a/docs/models/actionstat.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActionStat - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `action_id` | *str* | :heavy_check_mark: | ID of the moderation action | -| `action_name` | *str* | :heavy_check_mark: | Name of the moderation action | -| `count` | *float* | :heavy_check_mark: | Number of times this action was taken | -| `percentage_of_total` | *float* | :heavy_check_mark: | Percentage this action represents of all actions | \ No newline at end of file diff --git a/docs/models/addwordlistwordsrequest.md b/docs/models/addwordlistwordsrequest.md index a790814..f11fa8a 100644 --- a/docs/models/addwordlistwordsrequest.md +++ b/docs/models/addwordlistwordsrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 6d6f2eb..2d0009d 100644 --- a/docs/models/badrequesterrorcode.md +++ b/docs/models/badrequesterrorcode.md @@ -3,7 +3,8 @@ 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. +- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the key reaches more than one project. `message` lists the projects it reaches. +- `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead. - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. ## Example Usage @@ -22,4 +23,5 @@ This is an open enum. Unrecognized values will not fail type checks. - `"invalid_request"` - `"project_id_required"` +- `"project_name_ambiguous"` - `"validation_failed"` diff --git a/docs/models/checkstatus.md b/docs/models/bucket.md similarity index 57% rename from docs/models/checkstatus.md rename to docs/models/bucket.md index cd2ef4e..1ab6c3f 100644 --- a/docs/models/checkstatus.md +++ b/docs/models/bucket.md @@ -1,12 +1,14 @@ -# CheckStatus +# Bucket + +The size of each entry in `volumes`. ## Example Usage ```python -from moderation_api.models import CheckStatus +from moderation_api.models import Bucket # Open enum: unrecognized values are captured as UnrecognizedStr -value: CheckStatus = "all" +value: Bucket = "hour" ``` @@ -14,6 +16,5 @@ value: CheckStatus = "all" This is an open enum. Unrecognized values will not fail type checks. -- `"all"` -- `"checked"` -- `"unchecked"` +- `"hour"` +- `"day"` diff --git a/docs/models/casebookagreement.md b/docs/models/casebookagreement.md deleted file mode 100644 index 62828c3..0000000 --- a/docs/models/casebookagreement.md +++ /dev/null @@ -1,19 +0,0 @@ -# CasebookAgreement - -## Example Usage - -```python -from moderation_api.models import CasebookAgreement - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: CasebookAgreement = "ALL" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"ALL"` -- `"OVERRULED"` -- `"AGREED"` diff --git a/docs/models/casebookanswer.md b/docs/models/casebookanswer.md deleted file mode 100644 index 857b020..0000000 --- a/docs/models/casebookanswer.md +++ /dev/null @@ -1,20 +0,0 @@ -# CasebookAnswer - -## Example Usage - -```python -from moderation_api.models import CasebookAnswer - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: CasebookAnswer = "ALL" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"ALL"` -- `"ALLOWED"` -- `"REJECTED"` -- `"NO_ANSWER"` diff --git a/docs/models/createactionrequest.md b/docs/models/createactionrequest.md index fe4debe..03e997e 100644 --- a/docs/models/createactionrequest.md +++ b/docs/models/createactionrequest.md @@ -3,7 +3,7 @@ ## 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. | -| `body` | [models.CreateActionRequestBody](../models/createactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/createauthorrequest.md b/docs/models/createauthorrequest.md index fe82824..996ca48 100644 --- a/docs/models/createauthorrequest.md +++ b/docs/models/createauthorrequest.md @@ -3,7 +3,7 @@ ## 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. | -| `body` | [models.CreateAuthorRequestBody](../models/createauthorrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/createfeedbackrequest.md b/docs/models/createfeedbackrequest.md new file mode 100644 index 0000000..5f3fede --- /dev/null +++ b/docs/models/createfeedbackrequest.md @@ -0,0 +1,9 @@ +# CreateFeedbackRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [models.CreateFeedbackRequestBody](../models/createfeedbackrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createfeedbackrequestbody.md b/docs/models/createfeedbackrequestbody.md new file mode 100644 index 0000000..7da5c9e --- /dev/null +++ b/docs/models/createfeedbackrequestbody.md @@ -0,0 +1,11 @@ +# CreateFeedbackRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `title` | *str* | :heavy_check_mark: | A short summary of the request. | +| `description` | *str* | :heavy_check_mark: | What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs. | +| `type` | [Optional[models.CreateFeedbackType]](../models/createfeedbacktype.md) | :heavy_minus_sign: | The kind of feedback. | +| `source` | [Optional[models.Source]](../models/source.md) | :heavy_minus_sign: | Where the feedback was written: MCP server, agent skill, CLI or API. | \ No newline at end of file diff --git a/docs/models/createfeedbackresponse.md b/docs/models/createfeedbackresponse.md new file mode 100644 index 0000000..1079cb7 --- /dev/null +++ b/docs/models/createfeedbackresponse.md @@ -0,0 +1,11 @@ +# CreateFeedbackResponse + +Feedback received + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the feedback. | +| `status` | *Literal["received"]* | :heavy_check_mark: | The team received the feedback. | \ No newline at end of file diff --git a/docs/models/createfeedbacktype.md b/docs/models/createfeedbacktype.md new file mode 100644 index 0000000..19691e2 --- /dev/null +++ b/docs/models/createfeedbacktype.md @@ -0,0 +1,17 @@ +# CreateFeedbackType + +The kind of feedback. + +## Example Usage + +```python +from moderation_api.models import CreateFeedbackType +value: CreateFeedbackType = "feature_request" +``` + + +## Values + +- `"feature_request"` +- `"bug"` +- `"other"` diff --git a/docs/models/createprojectapikeyrequest.md b/docs/models/createprojectapikeyrequest.md new file mode 100644 index 0000000..f796310 --- /dev/null +++ b/docs/models/createprojectapikeyrequest.md @@ -0,0 +1,9 @@ +# CreateProjectAPIKeyRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the project. | +| `body` | [models.CreateProjectAPIKeyRequestBody](../models/createprojectapikeyrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createprojectapikeyrequestbody.md b/docs/models/createprojectapikeyrequestbody.md new file mode 100644 index 0000000..7682c5e --- /dev/null +++ b/docs/models/createprojectapikeyrequestbody.md @@ -0,0 +1,8 @@ +# CreateProjectAPIKeyRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *Optional[str]* | :heavy_minus_sign: | A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer. | \ No newline at end of file diff --git a/docs/models/createwebhookrequest.md b/docs/models/createwebhookrequest.md index f27a707..a03dac3 100644 --- a/docs/models/createwebhookrequest.md +++ b/docs/models/createwebhookrequest.md @@ -3,7 +3,7 @@ ## 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. | -| `body` | [models.CreateWebhookRequestBody](../models/createwebhookrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/createwordlistrequest.md b/docs/models/createwordlistrequest.md new file mode 100644 index 0000000..132ec6f --- /dev/null +++ b/docs/models/createwordlistrequest.md @@ -0,0 +1,9 @@ +# CreateWordlistRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [models.CreateWordlistRequestBody](../models/createwordlistrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createwordlistrequestbody.md b/docs/models/createwordlistrequestbody.md new file mode 100644 index 0000000..d78e7ed --- /dev/null +++ b/docs/models/createwordlistrequestbody.md @@ -0,0 +1,11 @@ +# CreateWordlistRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the wordlist | +| `key` | *Optional[str]* | :heavy_minus_sign: | Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the wordlist | +| `words` | List[*str*] | :heavy_minus_sign: | Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. | \ No newline at end of file diff --git a/docs/models/createwordlistresponse.md b/docs/models/createwordlistresponse.md new file mode 100644 index 0000000..693a2be --- /dev/null +++ b/docs/models/createwordlistresponse.md @@ -0,0 +1,16 @@ +# CreateWordlistResponse + +Wordlist created successfully + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the wordlist | +| `name` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `words` | List[*str*] | :heavy_check_mark: | Words in the wordlist | +| `created_at` | *str* | :heavy_check_mark: | Creation date of the wordlist | +| `organization_id` | *str* | :heavy_check_mark: | ID of the organization | +| `user_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `strict` | *bool* | :heavy_check_mark: | Strict mode | \ No newline at end of file diff --git a/docs/models/dailyreviewcount.md b/docs/models/dailyreviewcount.md index 3a366ba..8f79b89 100644 --- a/docs/models/dailyreviewcount.md +++ b/docs/models/dailyreviewcount.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `date_` | *str* | :heavy_check_mark: | Date in YYYY-MM-DD format | -| `count` | *float* | :heavy_check_mark: | Number of reviews on this date | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `date_` | *str* | :heavy_check_mark: | Date in YYYY-MM-DD format (UTC). | +| `count` | *int* | :heavy_check_mark: | Number of items resolved. | \ No newline at end of file diff --git a/docs/models/deleteactionrequest.md b/docs/models/deleteactionrequest.md index d93ca0a..1992e7b 100644 --- a/docs/models/deleteactionrequest.md +++ b/docs/models/deleteactionrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 b157a10..d093ee4 100644 --- a/docs/models/deleteauthorrequest.md +++ b/docs/models/deleteauthorrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 a696f83..5ad2622 100644 --- a/docs/models/deletewebhookrequest.md +++ b/docs/models/deletewebhookrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 21db116..cea445b 100644 --- a/docs/models/executeactionrequest.md +++ b/docs/models/executeactionrequest.md @@ -3,7 +3,7 @@ ## 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. | -| `body` | [models.ExecuteActionRequestBody](../models/executeactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/filter_.md b/docs/models/filter_.md deleted file mode 100644 index 053f209..0000000 --- a/docs/models/filter_.md +++ /dev/null @@ -1,32 +0,0 @@ -# Filter - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `is_flagged` | [Optional[models.IsFlagged]](../models/isflagged.md) | :heavy_minus_sign: | N/A | -| `casebook_answer` | [Optional[models.CasebookAnswer]](../models/casebookanswer.md) | :heavy_minus_sign: | N/A | -| `casebook_agreement` | [Optional[models.CasebookAgreement]](../models/casebookagreement.md) | :heavy_minus_sign: | N/A | -| `labels` | List[*str*] | :heavy_minus_sign: | N/A | -| `filter_labels` | List[[models.FilterLabel](../models/filterlabel.md)] | :heavy_minus_sign: | N/A | -| `metadata_filters` | List[[models.MetadataFilter](../models/metadatafilter.md)] | :heavy_minus_sign: | N/A | -| `filtered_channel_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `filtered_action_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `languages` | List[*str*] | :heavy_minus_sign: | N/A | -| `content_types` | List[[models.GetQueueContentType](../models/getqueuecontenttype.md)] | :heavy_minus_sign: | N/A | -| `media_types` | List[[models.MediaType](../models/mediatype.md)] | :heavy_minus_sign: | N/A | -| `author_trust_levels` | List[*int*] | :heavy_minus_sign: | N/A | -| `recommendation_actions` | List[[models.GetQueueRecommendationAction](../models/getqueuerecommendationaction.md)] | :heavy_minus_sign: | N/A | -| `min_severity` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `max_severity` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `after_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `before_date` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `within` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `within_unit` | [Optional[models.WithinUnit]](../models/withinunit.md) | :heavy_minus_sign: | N/A | -| `clear_date_window` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `check_status` | [OptionalNullable[models.CheckStatus]](../models/checkstatus.md) | :heavy_minus_sign: | N/A | -| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `content_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `conversation_ids` | List[*Nullable[str]*] | :heavy_minus_sign: | N/A | -| `search` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/filterlabel.md b/docs/models/filterlabel.md deleted file mode 100644 index 511fa35..0000000 --- a/docs/models/filterlabel.md +++ /dev/null @@ -1,11 +0,0 @@ -# FilterLabel - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `label` | *str* | :heavy_check_mark: | N/A | -| `type` | [models.GetQueueType](../models/getqueuetype.md) | :heavy_check_mark: | N/A | -| `min_threshold` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `max_threshold` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/flaggedcontenttrend.md b/docs/models/flaggedcontenttrend.md deleted file mode 100644 index 0daae98..0000000 --- a/docs/models/flaggedcontenttrend.md +++ /dev/null @@ -1,9 +0,0 @@ -# FlaggedContentTrend - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `label` | *str* | :heavy_check_mark: | Content flag/label | -| `trend` | *float* | :heavy_check_mark: | Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing | \ No newline at end of file diff --git a/docs/models/flagratespike.md b/docs/models/flagratespike.md new file mode 100644 index 0000000..bc6d7bf --- /dev/null +++ b/docs/models/flagratespike.md @@ -0,0 +1,12 @@ +# FlagRateSpike + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `multiple` | *float* | :heavy_check_mark: | How many times higher the recent flag rate is than the baseline, for example 2.4. | +| `recent_flag_rate` | *float* | :heavy_check_mark: | The flag rate in the last 2 days. | +| `baseline_flag_rate` | *float* | :heavy_check_mark: | The flag rate in the 30 days before that. | +| `recent_flagged` | *int* | :heavy_check_mark: | Flagged requests in the last 2 days. | +| `recent_requests` | *int* | :heavy_check_mark: | Requests in the last 2 days. | \ No newline at end of file diff --git a/docs/models/getaccountrequest.md b/docs/models/getaccountrequest.md index f9607c0..9d93122 100644 --- a/docs/models/getaccountrequest.md +++ b/docs/models/getaccountrequest.md @@ -3,6 +3,6 @@ ## 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 +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 0a6a6df..fe66dc3 100644 --- a/docs/models/getactionrequest.md +++ b/docs/models/getactionrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticsauthorsauthor.md b/docs/models/getanalyticsauthorsauthor.md new file mode 100644 index 0000000..ed62b14 --- /dev/null +++ b/docs/models/getanalyticsauthorsauthor.md @@ -0,0 +1,10 @@ +# GetAnalyticsAuthorsAuthor + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `author_id` | *str* | :heavy_check_mark: | The author ID from your system. Use it with the authors endpoints. | +| `name` | *Nullable[str]* | :heavy_check_mark: | The author name, if known. | +| `flagged` | *int* | :heavy_check_mark: | Flagged requests from this author in the window. | \ No newline at end of file diff --git a/docs/models/getanalyticsauthorsqueryparamrange.md b/docs/models/getanalyticsauthorsqueryparamrange.md new file mode 100644 index 0000000..82a8ac7 --- /dev/null +++ b/docs/models/getanalyticsauthorsqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsAuthorsQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsAuthorsQueryParamRange +value: GetAnalyticsAuthorsQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsauthorsrangeresponse.md b/docs/models/getanalyticsauthorsrangeresponse.md new file mode 100644 index 0000000..1b5c676 --- /dev/null +++ b/docs/models/getanalyticsauthorsrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsAuthorsRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsAuthorsRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsAuthorsRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsauthorsrequest.md b/docs/models/getanalyticsauthorsrequest.md new file mode 100644 index 0000000..c10efc3 --- /dev/null +++ b/docs/models/getanalyticsauthorsrequest.md @@ -0,0 +1,11 @@ +# GetAnalyticsAuthorsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsAuthorsQueryParamRange]](../models/getanalyticsauthorsqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticsauthorsresponse.md b/docs/models/getanalyticsauthorsresponse.md new file mode 100644 index 0000000..0e1a7ec --- /dev/null +++ b/docs/models/getanalyticsauthorsresponse.md @@ -0,0 +1,12 @@ +# GetAnalyticsAuthorsResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `range` | [models.GetAnalyticsAuthorsRangeResponse](../models/getanalyticsauthorsrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channel_id` | *Nullable[str]* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `authors` | List[[models.GetAnalyticsAuthorsAuthor](../models/getanalyticsauthorsauthor.md)] | :heavy_check_mark: | The authors with the most flagged requests, largest first. Requests without an author are not included. | \ No newline at end of file diff --git a/docs/models/getanalyticsautomationqueryparamrange.md b/docs/models/getanalyticsautomationqueryparamrange.md new file mode 100644 index 0000000..c71711d --- /dev/null +++ b/docs/models/getanalyticsautomationqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsAutomationQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsAutomationQueryParamRange +value: GetAnalyticsAutomationQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsautomationrangeresponse.md b/docs/models/getanalyticsautomationrangeresponse.md new file mode 100644 index 0000000..3a9c6f6 --- /dev/null +++ b/docs/models/getanalyticsautomationrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsAutomationRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsAutomationRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsAutomationRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsautomationrequest.md b/docs/models/getanalyticsautomationrequest.md new file mode 100644 index 0000000..cf4441a --- /dev/null +++ b/docs/models/getanalyticsautomationrequest.md @@ -0,0 +1,10 @@ +# GetAnalyticsAutomationRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsAutomationQueryParamRange]](../models/getanalyticsautomationqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticsautomationresponse.md b/docs/models/getanalyticsautomationresponse.md new file mode 100644 index 0000000..1c6c311 --- /dev/null +++ b/docs/models/getanalyticsautomationresponse.md @@ -0,0 +1,23 @@ +# GetAnalyticsAutomationResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [models.GetAnalyticsAutomationRangeResponse](../models/getanalyticsautomationrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channel_id` | *Nullable[str]* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `flagged` | *int* | :heavy_check_mark: | Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary. | +| `handled_by_rules` | *int* | :heavy_check_mark: | Flagged requests that a rule allowed or rejected without human review. | +| `handled_by_casebook` | *int* | :heavy_check_mark: | Flagged requests that the casebook settled without human review. | +| `sent_to_review` | *int* | :heavy_check_mark: | Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue. | +| `merged_duplicates` | *int* | :heavy_check_mark: | Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later. | +| `automation_rate` | *Nullable[float]* | :heavy_check_mark: | N/A | +| `reviews_allowed` | *int* | :heavy_check_mark: | Review queue items from this window that a moderator allowed. | +| `reviews_rejected` | *int* | :heavy_check_mark: | Review queue items from this window that a moderator rejected. | +| `reviews_resolved_without_decision` | *int* | :heavy_check_mark: | Review queue items from this window that a moderator marked as done without allow or reject. | +| `reviews_unresolved` | *int* | :heavy_check_mark: | Review queue items from this window that are still open. | +| `casebook_overrulings` | *int* | :heavy_check_mark: | Requests where the casebook decision was different from the decision based on severity. | +| `rules` | List[[models.Rule](../models/rule.md)] | :heavy_check_mark: | The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules. | \ No newline at end of file diff --git a/docs/models/getanalyticschannelschannel.md b/docs/models/getanalyticschannelschannel.md new file mode 100644 index 0000000..1df391c --- /dev/null +++ b/docs/models/getanalyticschannelschannel.md @@ -0,0 +1,12 @@ +# GetAnalyticsChannelsChannel + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The channel ID. | +| `name` | *str* | :heavy_check_mark: | The channel name. | +| `requests` | *int* | :heavy_check_mark: | Requests received in this channel. | +| `flagged` | *int* | :heavy_check_mark: | Requests flagged in this channel. | +| `flag_rate` | *float* | :heavy_check_mark: | The share of requests in this channel that were flagged: flagged / requests. | \ No newline at end of file diff --git a/docs/models/getanalyticschannelsqueryparamrange.md b/docs/models/getanalyticschannelsqueryparamrange.md new file mode 100644 index 0000000..a2093b0 --- /dev/null +++ b/docs/models/getanalyticschannelsqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsChannelsQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsChannelsQueryParamRange +value: GetAnalyticsChannelsQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticschannelsrangeresponse.md b/docs/models/getanalyticschannelsrangeresponse.md new file mode 100644 index 0000000..154fe88 --- /dev/null +++ b/docs/models/getanalyticschannelsrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsChannelsRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsChannelsRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsChannelsRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticschannelsrequest.md b/docs/models/getanalyticschannelsrequest.md new file mode 100644 index 0000000..8188a40 --- /dev/null +++ b/docs/models/getanalyticschannelsrequest.md @@ -0,0 +1,9 @@ +# GetAnalyticsChannelsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsChannelsQueryParamRange]](../models/getanalyticschannelsqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticschannelsresponse.md b/docs/models/getanalyticschannelsresponse.md new file mode 100644 index 0000000..573f0d0 --- /dev/null +++ b/docs/models/getanalyticschannelsresponse.md @@ -0,0 +1,11 @@ +# GetAnalyticsChannelsResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `range` | [models.GetAnalyticsChannelsRangeResponse](../models/getanalyticschannelsrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channels` | List[[models.GetAnalyticsChannelsChannel](../models/getanalyticschannelschannel.md)] | :heavy_check_mark: | Requests and flags per channel. Channels with no requests in the window are not included. | \ No newline at end of file diff --git a/docs/models/getanalyticspoliciespolicy.md b/docs/models/getanalyticspoliciespolicy.md new file mode 100644 index 0000000..4957dcd --- /dev/null +++ b/docs/models/getanalyticspoliciespolicy.md @@ -0,0 +1,10 @@ +# GetAnalyticsPoliciesPolicy + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `label` | *str* | :heavy_check_mark: | The policy label, for example `toxicity`. | +| `flagged` | *int* | :heavy_check_mark: | Flagged requests with this label in the window. Repeats count each time. | +| `previous_flagged` | *int* | :heavy_check_mark: | Flagged requests with this label in the window of equal length before. | \ No newline at end of file diff --git a/docs/models/getanalyticspoliciesqueryparamrange.md b/docs/models/getanalyticspoliciesqueryparamrange.md new file mode 100644 index 0000000..0c5bd55 --- /dev/null +++ b/docs/models/getanalyticspoliciesqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsPoliciesQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsPoliciesQueryParamRange +value: GetAnalyticsPoliciesQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticspoliciesrangeresponse.md b/docs/models/getanalyticspoliciesrangeresponse.md new file mode 100644 index 0000000..ee8b958 --- /dev/null +++ b/docs/models/getanalyticspoliciesrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsPoliciesRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsPoliciesRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsPoliciesRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticspoliciesrequest.md b/docs/models/getanalyticspoliciesrequest.md new file mode 100644 index 0000000..2429839 --- /dev/null +++ b/docs/models/getanalyticspoliciesrequest.md @@ -0,0 +1,11 @@ +# GetAnalyticsPoliciesRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsPoliciesQueryParamRange]](../models/getanalyticspoliciesqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticspoliciesresponse.md b/docs/models/getanalyticspoliciesresponse.md new file mode 100644 index 0000000..69b7456 --- /dev/null +++ b/docs/models/getanalyticspoliciesresponse.md @@ -0,0 +1,12 @@ +# GetAnalyticsPoliciesResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `range` | [models.GetAnalyticsPoliciesRangeResponse](../models/getanalyticspoliciesrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channel_id` | *Nullable[str]* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `policies` | List[[models.GetAnalyticsPoliciesPolicy](../models/getanalyticspoliciespolicy.md)] | :heavy_check_mark: | The policy labels with the most flagged requests, largest first. | \ No newline at end of file diff --git a/docs/models/getanalyticssummaryqueryparamrange.md b/docs/models/getanalyticssummaryqueryparamrange.md new file mode 100644 index 0000000..b6cc879 --- /dev/null +++ b/docs/models/getanalyticssummaryqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsSummaryQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsSummaryQueryParamRange +value: GetAnalyticsSummaryQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticssummaryrangeresponse.md b/docs/models/getanalyticssummaryrangeresponse.md new file mode 100644 index 0000000..eac632f --- /dev/null +++ b/docs/models/getanalyticssummaryrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsSummaryRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsSummaryRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsSummaryRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticssummaryrequest.md b/docs/models/getanalyticssummaryrequest.md new file mode 100644 index 0000000..03ff159 --- /dev/null +++ b/docs/models/getanalyticssummaryrequest.md @@ -0,0 +1,10 @@ +# GetAnalyticsSummaryRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsSummaryQueryParamRange]](../models/getanalyticssummaryqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticssummaryresponse.md b/docs/models/getanalyticssummaryresponse.md new file mode 100644 index 0000000..3fb6d48 --- /dev/null +++ b/docs/models/getanalyticssummaryresponse.md @@ -0,0 +1,15 @@ +# GetAnalyticsSummaryResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [models.GetAnalyticsSummaryRangeResponse](../models/getanalyticssummaryrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channel_id` | *Nullable[str]* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `totals` | [models.Totals](../models/totals.md) | :heavy_check_mark: | Request counts for the window. A flagged request has one recommendation: allow, reject or review. | +| `previous_period` | [models.PreviousPeriod](../models/previousperiod.md) | :heavy_check_mark: | The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. | +| `pending_review` | *int* | :heavy_check_mark: | Items in the default review queue that nobody has reviewed yet, counted as the queue counts them (repeats count once). The queue looks back 30 days, so older items are not included. The range does not change it. | +| `flag_rate_spike` | [Nullable[models.FlagRateSpike]](../models/flagratespike.md) | :heavy_check_mark: | Set when the flag rate of the last 2 days is at least 2 times the rate of the 30 days before, with at least 50 flagged requests. Null when there is no spike. Always for the full project: the range and channel do not change it. | \ No newline at end of file diff --git a/docs/models/getanalyticsvolumesqueryparamrange.md b/docs/models/getanalyticsvolumesqueryparamrange.md new file mode 100644 index 0000000..0dde9dd --- /dev/null +++ b/docs/models/getanalyticsvolumesqueryparamrange.md @@ -0,0 +1,18 @@ +# GetAnalyticsVolumesQueryParamRange + +The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsVolumesQueryParamRange +value: GetAnalyticsVolumesQueryParamRange = "24h" +``` + + +## Values + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsvolumesrangeresponse.md b/docs/models/getanalyticsvolumesrangeresponse.md new file mode 100644 index 0000000..15c10b4 --- /dev/null +++ b/docs/models/getanalyticsvolumesrangeresponse.md @@ -0,0 +1,22 @@ +# GetAnalyticsVolumesRangeResponse + +The time window of the numbers. + +## Example Usage + +```python +from moderation_api.models import GetAnalyticsVolumesRangeResponse + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: GetAnalyticsVolumesRangeResponse = "24h" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"24h"` +- `"7d"` +- `"30d"` +- `"90d"` diff --git a/docs/models/getanalyticsvolumesrequest.md b/docs/models/getanalyticsvolumesrequest.md new file mode 100644 index 0000000..06bea3f --- /dev/null +++ b/docs/models/getanalyticsvolumesrequest.md @@ -0,0 +1,10 @@ +# GetAnalyticsVolumesRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsVolumesQueryParamRange]](../models/getanalyticsvolumesqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getanalyticsvolumesresponse.md b/docs/models/getanalyticsvolumesresponse.md new file mode 100644 index 0000000..28f8964 --- /dev/null +++ b/docs/models/getanalyticsvolumesresponse.md @@ -0,0 +1,13 @@ +# GetAnalyticsVolumesResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `range` | [models.GetAnalyticsVolumesRangeResponse](../models/getanalyticsvolumesrangeresponse.md) | :heavy_check_mark: | The time window of the numbers. | +| `channel_id` | *Nullable[str]* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `bucket` | [models.Bucket](../models/bucket.md) | :heavy_check_mark: | The size of each entry in `volumes`. | +| `volumes` | List[[models.Volume](../models/volume.md)] | :heavy_check_mark: | Counts over time, oldest first. Buckets with no requests are included with zeros. | \ No newline at end of file diff --git a/docs/models/getauthorrequest.md b/docs/models/getauthorrequest.md index 8bf053e..ea7ea50 100644 --- a/docs/models/getauthorrequest.md +++ b/docs/models/getauthorrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getqueuecontenttype.md b/docs/models/getqueuecontenttype.md deleted file mode 100644 index 773d87e..0000000 --- a/docs/models/getqueuecontenttype.md +++ /dev/null @@ -1,25 +0,0 @@ -# GetQueueContentType - -## Example Usage - -```python -from moderation_api.models import GetQueueContentType - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: GetQueueContentType = "profile" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"profile"` -- `"message"` -- `"post"` -- `"comment"` -- `"event"` -- `"product"` -- `"review"` -- `"voice"` -- `"other"` diff --git a/docs/models/getqueuequeue.md b/docs/models/getqueuequeue.md deleted file mode 100644 index d4675d5..0000000 --- a/docs/models/getqueuequeue.md +++ /dev/null @@ -1,14 +0,0 @@ -# GetQueueQueue - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `description` | *str* | :heavy_check_mark: | N/A | -| `filter_` | [models.Filter](../models/filter_.md) | :heavy_check_mark: | N/A | -| `unresolved_items_count` | *float* | :heavy_check_mark: | N/A | -| `resolved_items_count` | *float* | :heavy_check_mark: | N/A | -| `total_items_count` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getqueuerecommendationaction.md b/docs/models/getqueuerecommendationaction.md deleted file mode 100644 index b352d84..0000000 --- a/docs/models/getqueuerecommendationaction.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetQueueRecommendationAction - -## Example Usage - -```python -from moderation_api.models import GetQueueRecommendationAction - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: GetQueueRecommendationAction = "review" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"review"` -- `"allow"` -- `"reject"` diff --git a/docs/models/getqueuerequest.md b/docs/models/getqueuerequest.md index c23c1b9..0abfb6e 100644 --- a/docs/models/getqueuerequest.md +++ b/docs/models/getqueuerequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getqueueresponse.md b/docs/models/getqueueresponse.md index 2efad7c..32f00b1 100644 --- a/docs/models/getqueueresponse.md +++ b/docs/models/getqueueresponse.md @@ -5,6 +5,6 @@ Successful response ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `queue` | [models.GetQueueQueue](../models/getqueuequeue.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `queue` | [models.QueueWithCounts](../models/queuewithcounts.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getqueuestatsrequest.md b/docs/models/getqueuestatsrequest.md index 4e0fe04..0c1d310 100644 --- a/docs/models/getqueuestatsrequest.md +++ b/docs/models/getqueuestatsrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getqueuestatsresponse.md b/docs/models/getqueuestatsresponse.md index 517dc54..ad8b12e 100644 --- a/docs/models/getqueuestatsresponse.md +++ b/docs/models/getqueuestatsresponse.md @@ -5,9 +5,8 @@ Successful response ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `review_stats` | [models.ReviewStats](../models/reviewstats.md) | :heavy_check_mark: | N/A | -| `action_stats` | List[[models.ActionStat](../models/actionstat.md)] | :heavy_check_mark: | N/A | -| `top_reviewers` | List[[models.TopReviewer](../models/topreviewer.md)] | :heavy_check_mark: | List of top reviewers and their statistics | -| `trends` | [models.Trends](../models/trends.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `review_stats` | [models.ReviewStats](../models/reviewstats.md) | :heavy_check_mark: | N/A | +| `top_reviewers` | List[[models.TopReviewer](../models/topreviewer.md)] | :heavy_check_mark: | Reviewers with the most resolved items, most first. Up to 10. | +| `trends` | [models.Trends](../models/trends.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getqueuetype.md b/docs/models/getqueuetype.md deleted file mode 100644 index 5acbb5b..0000000 --- a/docs/models/getqueuetype.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetQueueType - -## Example Usage - -```python -from moderation_api.models import GetQueueType - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: GetQueueType = "FLAGGED" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"FLAGGED"` -- `"NOT_FLAGGED"` -- `"THRESHOLDS"` -- `"MATCHED"` diff --git a/docs/models/getwebhookrequest.md b/docs/models/getwebhookrequest.md index 3872a90..36084e6 100644 --- a/docs/models/getwebhookrequest.md +++ b/docs/models/getwebhookrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/getwebhooksecretrequest.md b/docs/models/getwebhooksecretrequest.md index 23cddfb..a575b12 100644 --- a/docs/models/getwebhooksecretrequest.md +++ b/docs/models/getwebhooksecretrequest.md @@ -3,6 +3,6 @@ ## 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 +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 98ffd59..e824dcf 100644 --- a/docs/models/getwordlistembeddingstatusrequest.md +++ b/docs/models/getwordlistembeddingstatusrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 227adc7..3caf7cf 100644 --- a/docs/models/getwordlistrequest.md +++ b/docs/models/getwordlistrequest.md @@ -3,7 +3,7 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/isflagged.md b/docs/models/isflagged.md deleted file mode 100644 index 2eb8478..0000000 --- a/docs/models/isflagged.md +++ /dev/null @@ -1,20 +0,0 @@ -# IsFlagged - -## Example Usage - -```python -from moderation_api.models import IsFlagged - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: IsFlagged = "ALL" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"ALL"` -- `"FLAGGED"` -- `"NOT_FLAGGED"` -- `"SHADOW_FLAGGED"` diff --git a/docs/models/label.md b/docs/models/label.md new file mode 100644 index 0000000..33d1f1e --- /dev/null +++ b/docs/models/label.md @@ -0,0 +1,13 @@ +# Label + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `label` | *str* | :heavy_check_mark: | The label name | +| `score` | *float* | :heavy_check_mark: | Confidence score between 0 and 1 | +| `manual` | *Optional[bool]* | :heavy_minus_sign: | True if the label was applied manually by a moderator | +| `flagged` | *Optional[bool]* | :heavy_minus_sign: | Whether this label crossed its flagging threshold | +| `shadow_flagged` | *Optional[bool]* | :heavy_minus_sign: | Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision | +| `matches` | List[[models.QueueItemMatch](../models/queueitemmatch.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listactionsrequest.md b/docs/models/listactionsrequest.md index 21f188c..c76a91f 100644 --- a/docs/models/listactionsrequest.md +++ b/docs/models/listactionsrequest.md @@ -3,9 +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 | -| `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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 6fbf789..f554edc 100644 --- a/docs/models/listauthorsrequest.md +++ b/docs/models/listauthorsrequest.md @@ -3,13 +3,12 @@ ## 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 | -| `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 +| 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.SortDirection]](../models/sortdirection.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 | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listauthorssortdirection.md b/docs/models/listauthorssortdirection.md deleted file mode 100644 index 3cf8389..0000000 --- a/docs/models/listauthorssortdirection.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListAuthorsSortDirection - -Sort direction - -## Example Usage - -```python -from moderation_api.models import ListAuthorsSortDirection -value: ListAuthorsSortDirection = "asc" -``` - - -## Values - -- `"asc"` -- `"desc"` diff --git a/docs/models/listqueueitemsaction.md b/docs/models/listqueueitemsaction.md deleted file mode 100644 index 0775572..0000000 --- a/docs/models/listqueueitemsaction.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListQueueItemsAction - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Action ID | -| `name` | *str* | :heavy_check_mark: | Action name | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Action comment | -| `timestamp` | *float* | :heavy_check_mark: | Unix timestamp of when the action was taken | -| `reviewer` | *Optional[str]* | :heavy_minus_sign: | Moderator userID | \ No newline at end of file diff --git a/docs/models/listqueueitemsdata.md b/docs/models/listqueueitemsdata.md deleted file mode 100644 index 3830d22..0000000 --- a/docs/models/listqueueitemsdata.md +++ /dev/null @@ -1,18 +0,0 @@ -# ListQueueItemsData - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | Content ID | -| `content` | *str* | :heavy_check_mark: | The content to be moderated | -| `language` | *Optional[str]* | :heavy_minus_sign: | Content language | -| `labels` | List[[models.ListQueueItemsLabel](../models/listqueueitemslabel.md)] | :heavy_check_mark: | N/A | -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Conversation ID | -| `author_id` | *Optional[str]* | :heavy_minus_sign: | Author ID | -| `actions` | List[[models.ListQueueItemsAction](../models/listqueueitemsaction.md)] | :heavy_minus_sign: | Action IDs taken on this item | -| `flagged` | *bool* | :heavy_check_mark: | Whether the item is flagged by any label | -| `status` | [models.ListQueueItemsStatus](../models/listqueueitemsstatus.md) | :heavy_check_mark: | Status of the item | -| `timestamp` | *float* | :heavy_check_mark: | Unix timestamp of when the item was created | -| `content_type` | *Optional[str]* | :heavy_minus_sign: | Type of the content object | \ No newline at end of file diff --git a/docs/models/listqueueitemslabel.md b/docs/models/listqueueitemslabel.md deleted file mode 100644 index a486ff3..0000000 --- a/docs/models/listqueueitemslabel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ListQueueItemsLabel - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `label` | *str* | :heavy_check_mark: | Label name | -| `score` | *float* | :heavy_check_mark: | Confidence score of the label | -| `flagged` | *bool* | :heavy_check_mark: | Whether this label caused a flag | \ No newline at end of file diff --git a/docs/models/listqueueitemsrequest.md b/docs/models/listqueueitemsrequest.md index f00198f..d173e39 100644 --- a/docs/models/listqueueitemsrequest.md +++ b/docs/models/listqueueitemsrequest.md @@ -3,18 +3,17 @@ ## 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 | -| `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 +| 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` | [Optional[models.Sort]](../models/sort.md) | :heavy_minus_sign: | N/A | +| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | N/A | +| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | 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 | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listqueueitemsresponsebody.md b/docs/models/listqueueitemsresponsebody.md index 5a86db7..e9f69be 100644 --- a/docs/models/listqueueitemsresponsebody.md +++ b/docs/models/listqueueitemsresponsebody.md @@ -5,7 +5,7 @@ Successful response ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `data` | List[[models.ListQueueItemsData](../models/listqueueitemsdata.md)] | :heavy_check_mark: | The items on this page. | -| `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `data` | List[[models.QueueItem](../models/queueitem.md)] | :heavy_check_mark: | The items on this page. | +| `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/listqueueitemssortdirection.md b/docs/models/listqueueitemssortdirection.md deleted file mode 100644 index 06d2a9f..0000000 --- a/docs/models/listqueueitemssortdirection.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListQueueItemsSortDirection - -Sort direction - -## Example Usage - -```python -from moderation_api.models import ListQueueItemsSortDirection -value: ListQueueItemsSortDirection = "asc" -``` - - -## Values - -- `"asc"` -- `"desc"` diff --git a/docs/models/listqueuesrequest.md b/docs/models/listqueuesrequest.md new file mode 100644 index 0000000..6d69be4 --- /dev/null +++ b/docs/models/listqueuesrequest.md @@ -0,0 +1,10 @@ +# ListQueuesRequest + + +## Fields + +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/listqueuesresponse.md b/docs/models/listqueuesresponse.md new file mode 100644 index 0000000..433da60 --- /dev/null +++ b/docs/models/listqueuesresponse.md @@ -0,0 +1,8 @@ +# ListQueuesResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `result` | [models.ListQueuesResponseBody](../models/listqueuesresponsebody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listqueuesresponsebody.md b/docs/models/listqueuesresponsebody.md new file mode 100644 index 0000000..92810e7 --- /dev/null +++ b/docs/models/listqueuesresponsebody.md @@ -0,0 +1,11 @@ +# ListQueuesResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `data` | List[[models.Queue](../models/queue.md)] | :heavy_check_mark: | The items on this page. | +| `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/listwebhooksrequest.md b/docs/models/listwebhooksrequest.md index 7f580a8..157250c 100644 --- a/docs/models/listwebhooksrequest.md +++ b/docs/models/listwebhooksrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 f9a69e4..e32c7e5 100644 --- a/docs/models/listwordlistsrequest.md +++ b/docs/models/listwordlistsrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/mediatype.md b/docs/models/mediatype.md deleted file mode 100644 index 209778b..0000000 --- a/docs/models/mediatype.md +++ /dev/null @@ -1,21 +0,0 @@ -# MediaType - -## Example Usage - -```python -from moderation_api.models import MediaType - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: MediaType = "text" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"text"` -- `"image"` -- `"video"` -- `"object"` -- `"audio"` diff --git a/docs/models/notfounderrorcode.md b/docs/models/notfounderrorcode.md index 706a615..b68997e 100644 --- a/docs/models/notfounderrorcode.md +++ b/docs/models/notfounderrorcode.md @@ -6,6 +6,7 @@ Exactly what went wrong. Stable; safe to branch on. New codes may be added. - `action_not_found`: The action does not exist. - `author_not_found`: The author does not exist. - `queue_not_found`: The review queue does not exist. +- `queue_item_not_found`: The queue item does not exist in the project. - `wordlist_not_found`: The wordlist does not exist. - `webhook_not_found`: The webhook does not exist. - `project_not_found`: The project does not exist. @@ -29,6 +30,7 @@ This is an open enum. Unrecognized values will not fail type checks. - `"action_not_found"` - `"author_not_found"` - `"queue_not_found"` +- `"queue_item_not_found"` - `"wordlist_not_found"` - `"webhook_not_found"` - `"project_not_found"` diff --git a/docs/models/previousperiod.md b/docs/models/previousperiod.md new file mode 100644 index 0000000..84a66ab --- /dev/null +++ b/docs/models/previousperiod.md @@ -0,0 +1,17 @@ +# PreviousPeriod + +The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `requests` | *int* | :heavy_check_mark: | Requests received. Every request counts, also repeats and edits of the same content. | +| `flagged` | *int* | :heavy_check_mark: | Requests that were flagged. | +| `flag_rate` | *float* | :heavy_check_mark: | The share of requests that were flagged: flagged / requests. 0 when there were no requests. | +| `allowed` | *int* | :heavy_check_mark: | Requests with the recommendation "allow". Includes content that was not flagged. | +| `rejected` | *int* | :heavy_check_mark: | Requests with the recommendation "reject". All of them were flagged. | +| `sent_to_review` | *int* | :heavy_check_mark: | Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. | +| `handled_automatically` | *int* | :heavy_check_mark: | Flagged requests that were settled without human review: rejected plus flaggedButAllowed. | +| `flagged_but_allowed` | *int* | :heavy_check_mark: | Flagged requests that were allowed without human review. | \ No newline at end of file diff --git a/docs/models/projectapikey.md b/docs/models/projectapikey.md new file mode 100644 index 0000000..1daddab --- /dev/null +++ b/docs/models/projectapikey.md @@ -0,0 +1,12 @@ +# ProjectAPIKey + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the API key. | +| `name` | *str* | :heavy_check_mark: | The key's name. | +| `project_id` | *str* | :heavy_check_mark: | The ID of the project the key belongs to. | +| `created_at` | *str* | :heavy_check_mark: | When the key was created. | +| `secret_key` | *str* | :heavy_check_mark: | The new secret API key. Use it to moderate content in this project. It is also shown in the project's settings. | \ No newline at end of file diff --git a/docs/models/publicauthor.md b/docs/models/publicauthor.md index 11d6f64..d5cf676 100644 --- a/docs/models/publicauthor.md +++ b/docs/models/publicauthor.md @@ -15,7 +15,7 @@ | `first_seen` | *float* | :heavy_check_mark: | Timestamp when author first appeared | | `last_seen` | *float* | :heavy_check_mark: | Timestamp of last activity | | `last_incident` | *OptionalNullable[float]* | :heavy_minus_sign: | Timestamp of last incident | -| `status` | [models.Status](../models/status.md) | :heavy_check_mark: | Current author status | +| `status` | [models.PublicAuthorStatus](../models/publicauthorstatus.md) | :heavy_check_mark: | Current author status | | `trust_level` | [models.TrustLevel](../models/trustlevel.md) | :heavy_check_mark: | N/A | | `block` | [Nullable[models.Block]](../models/block.md) | :heavy_check_mark: | Block or suspension details, if applicable. Null if the author is enabled. | | `risk_evaluation` | [Nullable[models.RiskEvaluation]](../models/riskevaluation.md) | :heavy_check_mark: | Risk assessment details, if available. | diff --git a/docs/models/status.md b/docs/models/publicauthorstatus.md similarity index 68% rename from docs/models/status.md rename to docs/models/publicauthorstatus.md index eaf321c..69f3231 100644 --- a/docs/models/status.md +++ b/docs/models/publicauthorstatus.md @@ -1,14 +1,14 @@ -# Status +# PublicAuthorStatus Current author status ## Example Usage ```python -from moderation_api.models import Status +from moderation_api.models import PublicAuthorStatus # Open enum: unrecognized values are captured as UnrecognizedStr -value: Status = "enabled" +value: PublicAuthorStatus = "enabled" ``` diff --git a/docs/models/queue.md b/docs/models/queue.md new file mode 100644 index 0000000..afdfa27 --- /dev/null +++ b/docs/models/queue.md @@ -0,0 +1,11 @@ +# Queue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `name` | *str* | :heavy_check_mark: | The queue name. | +| `description` | *Nullable[str]* | :heavy_check_mark: | The queue description. | +| `is_default` | *bool* | :heavy_check_mark: | Whether this is the default queue of the project. | \ No newline at end of file diff --git a/docs/models/queueitem.md b/docs/models/queueitem.md new file mode 100644 index 0000000..efe0b62 --- /dev/null +++ b/docs/models/queueitem.md @@ -0,0 +1,19 @@ +# QueueItem + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The item ID. Use it to resolve or unresolve the item in this queue. | +| `content_id` | *str* | :heavy_check_mark: | Your content ID, as you sent it to `POST /moderate`. | +| `content` | [Nullable[models.QueueItemContent]](../models/queueitemcontent.md) | :heavy_check_mark: | The submitted content. | +| `labels` | List[[models.Label](../models/label.md)] | :heavy_check_mark: | The moderation labels of the content. | +| `flagged` | *bool* | :heavy_check_mark: | Whether moderation flagged the content. | +| `severity` | *Nullable[float]* | :heavy_check_mark: | Severity score from 0 to 1, if available. | +| `status` | [models.QueueItemStatus](../models/queueitemstatus.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | +| `timestamp` | *float* | :heavy_check_mark: | When the content was submitted, as Unix time in milliseconds. | +| `language` | *Nullable[str]* | :heavy_check_mark: | Detected ISO language code. | +| `conversation_id` | *Nullable[str]* | :heavy_check_mark: | Conversation ID, if any. | +| `author_id` | *Nullable[str]* | :heavy_check_mark: | Your author ID, if any. | +| `content_type` | *Nullable[str]* | :heavy_check_mark: | Content type, for example `message` or `profile`. | \ No newline at end of file diff --git a/docs/models/queueitemaudio.md b/docs/models/queueitemaudio.md new file mode 100644 index 0000000..0aeabd7 --- /dev/null +++ b/docs/models/queueitemaudio.md @@ -0,0 +1,11 @@ +# QueueItemAudio + +Audio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *Literal["audio"]* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/metadatafilter.md b/docs/models/queueitembrandimpersonation.md similarity index 59% rename from docs/models/metadatafilter.md rename to docs/models/queueitembrandimpersonation.md index fa1f938..6ac89ed 100644 --- a/docs/models/metadatafilter.md +++ b/docs/models/queueitembrandimpersonation.md @@ -1,9 +1,9 @@ -# MetadataFilter +# QueueItemBrandImpersonation ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `key` | *str* | :heavy_check_mark: | N/A | -| `value` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| `brand` | *str* | :heavy_check_mark: | N/A | +| `method` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/queueitemcontent.md b/docs/models/queueitemcontent.md new file mode 100644 index 0000000..df92e63 --- /dev/null +++ b/docs/models/queueitemcontent.md @@ -0,0 +1,35 @@ +# QueueItemContent + + +## Supported Types + +### `models.QueueItemText` + +```python +value: models.QueueItemText = /* values here */ +``` + +### `models.QueueItemImage` + +```python +value: models.QueueItemImage = /* values here */ +``` + +### `models.QueueItemVideo` + +```python +value: models.QueueItemVideo = /* values here */ +``` + +### `models.QueueItemAudio` + +```python +value: models.QueueItemAudio = /* values here */ +``` + +### `models.QueueItemObject` + +```python +value: models.QueueItemObject = /* values here */ +``` + diff --git a/docs/models/queueitemcontentleaf.md b/docs/models/queueitemcontentleaf.md new file mode 100644 index 0000000..f7d0cf4 --- /dev/null +++ b/docs/models/queueitemcontentleaf.md @@ -0,0 +1,29 @@ +# QueueItemContentLeaf + + +## Supported Types + +### `models.QueueItemDataText` + +```python +value: models.QueueItemDataText = /* values here */ +``` + +### `models.QueueItemDataImage` + +```python +value: models.QueueItemDataImage = /* values here */ +``` + +### `models.QueueItemDataVideo` + +```python +value: models.QueueItemDataVideo = /* values here */ +``` + +### `models.QueueItemDataAudio` + +```python +value: models.QueueItemDataAudio = /* values here */ +``` + diff --git a/docs/models/queueitemdataaudio.md b/docs/models/queueitemdataaudio.md new file mode 100644 index 0000000..e8eeba4 --- /dev/null +++ b/docs/models/queueitemdataaudio.md @@ -0,0 +1,11 @@ +# QueueItemDataAudio + +Audio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *Literal["audio"]* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/queueitemdataimage.md b/docs/models/queueitemdataimage.md new file mode 100644 index 0000000..d25f5f8 --- /dev/null +++ b/docs/models/queueitemdataimage.md @@ -0,0 +1,12 @@ +# QueueItemDataImage + +Image + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Literal["image"]* | :heavy_check_mark: | N/A | +| `url` | *Optional[str]* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *Optional[str]* | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/models/queueitemdatatext.md b/docs/models/queueitemdatatext.md new file mode 100644 index 0000000..d015414 --- /dev/null +++ b/docs/models/queueitemdatatext.md @@ -0,0 +1,11 @@ +# QueueItemDataText + +Text + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/queueitemdatavideo.md b/docs/models/queueitemdatavideo.md new file mode 100644 index 0000000..a109964 --- /dev/null +++ b/docs/models/queueitemdatavideo.md @@ -0,0 +1,11 @@ +# QueueItemDataVideo + +Video + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *Literal["video"]* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/queueitemimage.md b/docs/models/queueitemimage.md new file mode 100644 index 0000000..5a247ae --- /dev/null +++ b/docs/models/queueitemimage.md @@ -0,0 +1,12 @@ +# QueueItemImage + +Image + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *Literal["image"]* | :heavy_check_mark: | N/A | +| `url` | *Optional[str]* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *Optional[str]* | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/models/queueitemmatch.md b/docs/models/queueitemmatch.md new file mode 100644 index 0000000..80bc50d --- /dev/null +++ b/docs/models/queueitemmatch.md @@ -0,0 +1,16 @@ +# QueueItemMatch + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `match` | *str* | :heavy_check_mark: | The matched substring | +| `probability` | *float* | :heavy_check_mark: | Match confidence between 0 and 1 | +| `span` | List[*float*] | :heavy_check_mark: | [start, end] character offsets in the source text | +| `mask` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `reasons` | List[*str*] | :heavy_minus_sign: | N/A | +| `signals` | [Optional[models.QueueItemSignals]](../models/queueitemsignals.md) | :heavy_minus_sign: | N/A | +| `entity_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `scripts` | List[*str*] | :heavy_minus_sign: | N/A | +| `skeleton` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/queueitemobject.md b/docs/models/queueitemobject.md new file mode 100644 index 0000000..6ea82ee --- /dev/null +++ b/docs/models/queueitemobject.md @@ -0,0 +1,11 @@ +# QueueItemObject + +Object + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `type` | *Literal["object"]* | :heavy_check_mark: | N/A | +| `data` | Dict[str, [models.QueueItemContentLeaf](../models/queueitemcontentleaf.md)] | :heavy_check_mark: | Values in the object. Can be mixed content types. | \ No newline at end of file diff --git a/docs/models/queueitemsignals.md b/docs/models/queueitemsignals.md new file mode 100644 index 0000000..15b0db9 --- /dev/null +++ b/docs/models/queueitemsignals.md @@ -0,0 +1,16 @@ +# QueueItemSignals + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `brand_impersonation` | [Nullable[models.QueueItemBrandImpersonation]](../models/queueitembrandimpersonation.md) | :heavy_check_mark: | N/A | +| `has_suspicious_characters` | *bool* | :heavy_check_mark: | N/A | +| `is_link_shortener` | *bool* | :heavy_check_mark: | N/A | +| `domain_age_days` | *Nullable[float]* | :heavy_check_mark: | N/A | +| `has_email_setup` | *Nullable[bool]* | :heavy_check_mark: | N/A | +| `redirect_count` | *Nullable[float]* | :heavy_check_mark: | N/A | +| `final_url` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `bot_protection` | *Nullable[bool]* | :heavy_check_mark: | N/A | +| `is_reported` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listqueueitemsstatus.md b/docs/models/queueitemstatus.md similarity index 57% rename from docs/models/listqueueitemsstatus.md rename to docs/models/queueitemstatus.md index 7ff2e6a..ed84892 100644 --- a/docs/models/listqueueitemsstatus.md +++ b/docs/models/queueitemstatus.md @@ -1,14 +1,14 @@ -# ListQueueItemsStatus +# QueueItemStatus -Status of the item +`pending` waits for review. `resolved` is reviewed. ## Example Usage ```python -from moderation_api.models import ListQueueItemsStatus +from moderation_api.models import QueueItemStatus # Open enum: unrecognized values are captured as UnrecognizedStr -value: ListQueueItemsStatus = "pending" +value: QueueItemStatus = "pending" ``` diff --git a/docs/models/queueitemtext.md b/docs/models/queueitemtext.md new file mode 100644 index 0000000..e47bb6d --- /dev/null +++ b/docs/models/queueitemtext.md @@ -0,0 +1,11 @@ +# QueueItemText + +Text + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/queueitemvideo.md b/docs/models/queueitemvideo.md new file mode 100644 index 0000000..2d9e978 --- /dev/null +++ b/docs/models/queueitemvideo.md @@ -0,0 +1,11 @@ +# QueueItemVideo + +Video + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *Literal["video"]* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/queuewithcounts.md b/docs/models/queuewithcounts.md new file mode 100644 index 0000000..192b6dc --- /dev/null +++ b/docs/models/queuewithcounts.md @@ -0,0 +1,14 @@ +# QueueWithCounts + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `name` | *str* | :heavy_check_mark: | The queue name. | +| `description` | *Nullable[str]* | :heavy_check_mark: | The queue description. | +| `is_default` | *bool* | :heavy_check_mark: | Whether this is the default queue of the project. | +| `unresolved_items_count` | *int* | :heavy_check_mark: | Number of items that wait for review. | +| `resolved_items_count` | *int* | :heavy_check_mark: | Number of items that are resolved. | +| `total_items_count` | *int* | :heavy_check_mark: | Number of items in the queue, resolved and unresolved. | \ No newline at end of file diff --git a/docs/models/recommendation.md b/docs/models/recommendation.md index b732268..76dac16 100644 --- a/docs/models/recommendation.md +++ b/docs/models/recommendation.md @@ -7,6 +7,6 @@ The recommendation for the content based on the evaluation. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `action` | [models.SubmitContentRecommendationAction](../models/submitcontentrecommendationaction.md) | :heavy_check_mark: | The action to take based on the recommendation | +| `action` | [models.ActionResponse](../models/actionresponse.md) | :heavy_check_mark: | The action to take based on the recommendation | | `reason_codes` | List[[models.ReasonCode](../models/reasoncode.md)] | :heavy_check_mark: | 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` | List[[models.MatchedRule](../models/matchedrule.md)] | :heavy_minus_sign: | Rules that matched during evaluation, if rules engine is active. | \ No newline at end of file diff --git a/docs/models/removewordlistwordsrequest.md b/docs/models/removewordlistwordsrequest.md index dbe27f0..3371b2d 100644 --- a/docs/models/removewordlistwordsrequest.md +++ b/docs/models/removewordlistwordsrequest.md @@ -3,8 +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 | -| `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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 1482340..9f9e827 100644 --- a/docs/models/resolvequeueitemrequest.md +++ b/docs/models/resolvequeueitemrequest.md @@ -3,9 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/resolvequeueitemrequestbody.md b/docs/models/resolvequeueitemrequestbody.md deleted file mode 100644 index 6765922..0000000 --- a/docs/models/resolvequeueitemrequestbody.md +++ /dev/null @@ -1,8 +0,0 @@ -# ResolveQueueItemRequestBody - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional comment | \ No newline at end of file diff --git a/docs/models/resolvequeueitemresponse.md b/docs/models/resolvequeueitemresponse.md index 1a23f37..20b2406 100644 --- a/docs/models/resolvequeueitemresponse.md +++ b/docs/models/resolvequeueitemresponse.md @@ -5,8 +5,7 @@ Successful response ## Fields -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `success` | *bool* | :heavy_check_mark: | N/A | -| `resolved_at` | *str* | :heavy_check_mark: | Timestamp when the item was resolved | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional comment | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | N/A | +| `resolved_at` | *str* | :heavy_check_mark: | When the item was resolved (ISO 8601). | \ No newline at end of file diff --git a/docs/models/resolvequeueitemsrequest.md b/docs/models/resolvequeueitemsrequest.md new file mode 100644 index 0000000..a355159 --- /dev/null +++ b/docs/models/resolvequeueitemsrequest.md @@ -0,0 +1,10 @@ +# ResolveQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [models.ResolveQueueItemsRequestBody](../models/resolvequeueitemsrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/resolvequeueitemsrequestbody.md b/docs/models/resolvequeueitemsrequestbody.md new file mode 100644 index 0000000..06a891f --- /dev/null +++ b/docs/models/resolvequeueitemsrequestbody.md @@ -0,0 +1,8 @@ +# ResolveQueueItemsRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `item_ids` | List[*str*] | :heavy_check_mark: | The item IDs to resolve. Up to 100. | \ No newline at end of file diff --git a/docs/models/resolvequeueitemsresponse.md b/docs/models/resolvequeueitemsresponse.md new file mode 100644 index 0000000..5ff2cdf --- /dev/null +++ b/docs/models/resolvequeueitemsresponse.md @@ -0,0 +1,11 @@ +# ResolveQueueItemsResponse + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `resolved` | *int* | :heavy_check_mark: | Number of items resolved. | +| `not_found_ids` | List[*str*] | :heavy_check_mark: | Item IDs that do not exist in the project. | \ No newline at end of file diff --git a/docs/models/reviewstats.md b/docs/models/reviewstats.md index 67c754b..d1b0085 100644 --- a/docs/models/reviewstats.md +++ b/docs/models/reviewstats.md @@ -3,8 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `average_time_to_review` | *float* | :heavy_check_mark: | Average time in milliseconds to review an item | -| `total_reviewed` | *float* | :heavy_check_mark: | Total number of items reviewed | -| `total_pending` | *float* | :heavy_check_mark: | Total number of items pending review | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `total_reviewed` | *int* | :heavy_check_mark: | Number of items resolved in this queue in the period. | +| `total_pending` | *int* | :heavy_check_mark: | Number of items submitted in the period that wait for review now. | \ No newline at end of file diff --git a/docs/models/rule.md b/docs/models/rule.md new file mode 100644 index 0000000..3ed348b --- /dev/null +++ b/docs/models/rule.md @@ -0,0 +1,9 @@ +# Rule + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The rule name. "Other rules" holds all rules after the largest ones. | +| `count` | *int* | :heavy_check_mark: | Flagged requests that this rule settled. | \ No newline at end of file diff --git a/docs/models/sort.md b/docs/models/sort.md new file mode 100644 index 0000000..e858c56 --- /dev/null +++ b/docs/models/sort.md @@ -0,0 +1,16 @@ +# Sort + +## Example Usage + +```python +from moderation_api.models import Sort +value: Sort = "FIFO" +``` + + +## Values + +- `"FIFO"` +- `"LIFO"` +- `"RANDOM"` +- `"SEVERITY_DESC"` diff --git a/docs/models/sortby.md b/docs/models/sortby.md index c4a3a18..3626a82 100644 --- a/docs/models/sortby.md +++ b/docs/models/sortby.md @@ -12,7 +12,6 @@ value: SortBy = "trustLevel" - `"trustLevel"` - `"violationCount"` -- `"reportCount"` - `"memberSince"` - `"lastActive"` - `"contentCount"` diff --git a/docs/models/sortdirection.md b/docs/models/sortdirection.md new file mode 100644 index 0000000..2975d90 --- /dev/null +++ b/docs/models/sortdirection.md @@ -0,0 +1,16 @@ +# SortDirection + +Sort direction + +## Example Usage + +```python +from moderation_api.models import SortDirection +value: SortDirection = "asc" +``` + + +## Values + +- `"asc"` +- `"desc"` diff --git a/docs/models/sortfield.md b/docs/models/sortfield.md deleted file mode 100644 index 05a3712..0000000 --- a/docs/models/sortfield.md +++ /dev/null @@ -1,15 +0,0 @@ -# SortField - -## Example Usage - -```python -from moderation_api.models import SortField -value: SortField = "createdAt" -``` - - -## Values - -- `"createdAt"` -- `"severity"` -- `"reviewedAt"` diff --git a/docs/models/source.md b/docs/models/source.md new file mode 100644 index 0000000..5f42ac4 --- /dev/null +++ b/docs/models/source.md @@ -0,0 +1,18 @@ +# Source + +Where the feedback was written: MCP server, agent skill, CLI or API. + +## Example Usage + +```python +from moderation_api.models import Source +value: Source = "mcp" +``` + + +## Values + +- `"mcp"` +- `"skill"` +- `"cli"` +- `"api"` diff --git a/docs/models/author.md b/docs/models/submitcontentauthor.md similarity index 99% rename from docs/models/author.md rename to docs/models/submitcontentauthor.md index bacdb89..3801b8c 100644 --- a/docs/models/author.md +++ b/docs/models/submitcontentauthor.md @@ -1,4 +1,4 @@ -# Author +# SubmitContentAuthor ## Fields diff --git a/docs/models/policyresponse.md b/docs/models/submitcontentpolicyresponse.md similarity index 89% rename from docs/models/policyresponse.md rename to docs/models/submitcontentpolicyresponse.md index 47f2c37..fb6430c 100644 --- a/docs/models/policyresponse.md +++ b/docs/models/submitcontentpolicyresponse.md @@ -1,4 +1,4 @@ -# PolicyResponse +# SubmitContentPolicyResponse Policy output schema. diff --git a/docs/models/submitcontentrequest.md b/docs/models/submitcontentrequest.md index 0b7d63d..74389f0 100644 --- a/docs/models/submitcontentrequest.md +++ b/docs/models/submitcontentrequest.md @@ -3,7 +3,7 @@ ## 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. | -| `body` | [models.SubmitContentRequestBody](../models/submitcontentrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 index d6f65e4..9a98ed2 100644 --- a/docs/models/submitcontentrequestbody.md +++ b/docs/models/submitcontentrequestbody.md @@ -3,16 +3,16 @@ ## 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 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `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: | Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted. | +| `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/submitcontentresponse.md b/docs/models/submitcontentresponse.md index f3b68aa..d227c6c 100644 --- a/docs/models/submitcontentresponse.md +++ b/docs/models/submitcontentresponse.md @@ -8,11 +8,11 @@ Successful response | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `content` | [models.ContentResponse](../models/contentresponse.md) | :heavy_check_mark: | Potentially modified content. | -| `author` | [Nullable[models.Author]](../models/author.md) | :heavy_check_mark: | The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. | +| `author` | [Nullable[models.SubmitContentAuthor]](../models/submitcontentauthor.md) | :heavy_check_mark: | The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. | | `evaluation` | [models.Evaluation](../models/evaluation.md) | :heavy_check_mark: | The evaluation of the content after running the channel policies. | | `recommendation` | [models.Recommendation](../models/recommendation.md) | :heavy_check_mark: | The recommendation for the content based on the evaluation. | | `casebook` | [Nullable[models.Casebook]](../models/casebook.md) | :heavy_check_mark: | What your casebook — the record of your past moderation decisions — 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` | List[[models.PolicyResponse](../models/policyresponse.md)] | :heavy_check_mark: | Results of all policies in the channel. Sorted by highest probability. | +| `policies` | List[[models.SubmitContentPolicyResponse](../models/submitcontentpolicyresponse.md)] | :heavy_check_mark: | Results of all policies in the channel. Sorted by highest probability. | | `insights` | List[[models.Insight](../models/insight.md)] | :heavy_check_mark: | Results of all insights enabled in the channel. | | `meta` | [models.Meta](../models/meta.md) | :heavy_check_mark: | Metadata about the moderation request | | `errors` | List[[models.Error](../models/error.md)] | :heavy_minus_sign: | Policies that had errors | \ No newline at end of file diff --git a/docs/models/topaction.md b/docs/models/topaction.md deleted file mode 100644 index 77d1be2..0000000 --- a/docs/models/topaction.md +++ /dev/null @@ -1,10 +0,0 @@ -# TopAction - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `action_id` | *str* | :heavy_check_mark: | Most used action by this reviewer | -| `action_name` | *str* | :heavy_check_mark: | Name of the most used action | -| `count` | *float* | :heavy_check_mark: | Number of times this action was used | \ No newline at end of file diff --git a/docs/models/topreviewer.md b/docs/models/topreviewer.md index d2b695f..50b42c4 100644 --- a/docs/models/topreviewer.md +++ b/docs/models/topreviewer.md @@ -3,11 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | ID of the reviewer | -| `name` | *str* | :heavy_check_mark: | Name of the reviewer | -| `review_count` | *float* | :heavy_check_mark: | Number of items reviewed | -| `average_time_per_review` | *float* | :heavy_check_mark: | Average review time in milliseconds | -| `accuracy_score` | *Optional[float]* | :heavy_minus_sign: | Optional accuracy score based on review quality metrics | -| `top_actions` | List[[models.TopAction](../models/topaction.md)] | :heavy_check_mark: | Most common actions taken by this reviewer | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `user_id` | *Nullable[str]* | :heavy_check_mark: | The user ID of the reviewer. `null` for items resolved with an API key. | +| `name` | *Nullable[str]* | :heavy_check_mark: | The name of the reviewer. | +| `review_count` | *int* | :heavy_check_mark: | Number of items the reviewer resolved in the period. | \ No newline at end of file diff --git a/docs/models/totals.md b/docs/models/totals.md new file mode 100644 index 0000000..aabb7ab --- /dev/null +++ b/docs/models/totals.md @@ -0,0 +1,18 @@ +# Totals + +Request counts for the window. A flagged request has one recommendation: allow, reject or review. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `requests` | *int* | :heavy_check_mark: | Requests received. Every request counts, also repeats and edits of the same content. | +| `flagged` | *int* | :heavy_check_mark: | Requests that were flagged. | +| `flag_rate` | *float* | :heavy_check_mark: | The share of requests that were flagged: flagged / requests. 0 when there were no requests. | +| `allowed` | *int* | :heavy_check_mark: | Requests with the recommendation "allow". Includes content that was not flagged. | +| `rejected` | *int* | :heavy_check_mark: | Requests with the recommendation "reject". All of them were flagged. | +| `sent_to_review` | *int* | :heavy_check_mark: | Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. | +| `handled_automatically` | *int* | :heavy_check_mark: | Flagged requests that were settled without human review: rejected plus flaggedButAllowed. | +| `flagged_but_allowed` | *int* | :heavy_check_mark: | Flagged requests that were allowed without human review. | +| `distinct_authors` | *int* | :heavy_check_mark: | Distinct authors that sent content in the window. Approximate. | \ No newline at end of file diff --git a/docs/models/trends.md b/docs/models/trends.md index d9cf8da..894c0e5 100644 --- a/docs/models/trends.md +++ b/docs/models/trends.md @@ -3,7 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `daily_review_counts` | List[[models.DailyReviewCount](../models/dailyreviewcount.md)] | :heavy_check_mark: | N/A | -| `flagged_content_trends` | List[[models.FlaggedContentTrend](../models/flaggedcontenttrend.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `daily_review_counts` | List[[models.DailyReviewCount](../models/dailyreviewcount.md)] | :heavy_check_mark: | Resolved items per day. Days with no reviews are left out. | \ No newline at end of file diff --git a/docs/models/unresolvequeueitemrequest.md b/docs/models/unresolvequeueitemrequest.md index b3a0e3b..3718421 100644 --- a/docs/models/unresolvequeueitemrequest.md +++ b/docs/models/unresolvequeueitemrequest.md @@ -3,9 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/unresolvequeueitemrequestbody.md b/docs/models/unresolvequeueitemrequestbody.md deleted file mode 100644 index 5ef20d2..0000000 --- a/docs/models/unresolvequeueitemrequestbody.md +++ /dev/null @@ -1,8 +0,0 @@ -# UnresolveQueueItemRequestBody - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `comment` | *Optional[str]* | :heavy_minus_sign: | Optional reason for unresolving the item | \ No newline at end of file diff --git a/docs/models/unresolvequeueitemresponse.md b/docs/models/unresolvequeueitemresponse.md index 6f969f5..d86faa1 100644 --- a/docs/models/unresolvequeueitemresponse.md +++ b/docs/models/unresolvequeueitemresponse.md @@ -5,8 +5,8 @@ Successful response ## Fields -| Field | Type | Required | Description | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `success` | *bool* | :heavy_check_mark: | N/A | -| `status` | *str* | :heavy_check_mark: | New status of the item | -| `unresolved_at` | *str* | :heavy_check_mark: | Timestamp when the item was unresolved | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `success` | *bool* | :heavy_check_mark: | N/A | +| `status` | [models.UnresolveQueueItemStatus](../models/unresolvequeueitemstatus.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | +| `unresolved_at` | *str* | :heavy_check_mark: | When the item was unresolved (ISO 8601). | \ No newline at end of file diff --git a/docs/models/unresolvequeueitemstatus.md b/docs/models/unresolvequeueitemstatus.md new file mode 100644 index 0000000..119f18d --- /dev/null +++ b/docs/models/unresolvequeueitemstatus.md @@ -0,0 +1,20 @@ +# UnresolveQueueItemStatus + +`pending` waits for review. `resolved` is reviewed. + +## Example Usage + +```python +from moderation_api.models import UnresolveQueueItemStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: UnresolveQueueItemStatus = "pending" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"pending"` +- `"resolved"` diff --git a/docs/models/updateactionrequest.md b/docs/models/updateactionrequest.md index 690ab2a..5fb0c33 100644 --- a/docs/models/updateactionrequest.md +++ b/docs/models/updateactionrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 a3bf2c9..9b0d56e 100644 --- a/docs/models/updateauthorrequest.md +++ b/docs/models/updateauthorrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 bfdc84a..bb0cada 100644 --- a/docs/models/updatewebhookrequest.md +++ b/docs/models/updatewebhookrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 41f281f..00c51aa 100644 --- a/docs/models/updatewordlistrequest.md +++ b/docs/models/updatewordlistrequest.md @@ -3,8 +3,8 @@ ## Fields -| 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 +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/models/updatewordlistrequestbody.md b/docs/models/updatewordlistrequestbody.md index 42bb174..2d44dd0 100644 --- a/docs/models/updatewordlistrequestbody.md +++ b/docs/models/updatewordlistrequestbody.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `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. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `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. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. | +| `strict` | *Optional[bool]* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | \ No newline at end of file diff --git a/docs/models/volume.md b/docs/models/volume.md new file mode 100644 index 0000000..aca943a --- /dev/null +++ b/docs/models/volume.md @@ -0,0 +1,12 @@ +# Volume + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `start` | *str* | :heavy_check_mark: | Start of the bucket, as an ISO 8601 timestamp in UTC. | +| `requests` | *int* | :heavy_check_mark: | Requests received in the bucket. | +| `flagged` | *int* | :heavy_check_mark: | Requests flagged in the bucket. | +| `rejected` | *int* | :heavy_check_mark: | Requests with the recommendation "reject" in the bucket. | +| `sent_to_review` | *int* | :heavy_check_mark: | Requests with the recommendation "review" in the bucket. | \ No newline at end of file diff --git a/docs/models/withinunit.md b/docs/models/withinunit.md deleted file mode 100644 index 67ba327..0000000 --- a/docs/models/withinunit.md +++ /dev/null @@ -1,22 +0,0 @@ -# WithinUnit - -## Example Usage - -```python -from moderation_api.models import WithinUnit - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: WithinUnit = "MINUTES" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"MINUTES"` -- `"HOURS"` -- `"DAYS"` -- `"WEEKS"` -- `"MONTHS"` -- `"YEARS"` diff --git a/docs/sdks/account/README.md b/docs/sdks/account/README.md index a39f4f8..6fbdb15 100644 --- a/docs/sdks/account/README.md +++ b/docs/sdks/account/README.md @@ -31,10 +31,10 @@ with ModerationAPI( ### Parameters -| 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. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 baf82d7..d7ca661 100644 --- a/docs/sdks/actions/README.md +++ b/docs/sdks/actions/README.md @@ -38,13 +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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -87,21 +87,21 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -142,11 +142,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -187,22 +187,22 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -244,11 +244,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -291,16 +291,16 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/analytics/README.md b/docs/sdks/analytics/README.md new file mode 100644 index 0000000..76c58ad --- /dev/null +++ b/docs/sdks/analytics/README.md @@ -0,0 +1,301 @@ +# Analytics + +## Overview + +### Available Operations + +* [summary](#summary) - Get the analytics summary +* [policies](#policies) - Get the most flagged policies +* [authors](#authors) - Get the most flagged authors +* [channels](#channels) - Get analytics per channel +* [volumes](#volumes) - Get volumes over time +* [automation](#automation) - Get the automation breakdown + +## summary + +Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.summary(range="30d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsSummaryQueryParamRange]](../../models/getanalyticssummaryqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsSummaryResponse](../../models/getanalyticssummaryresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + +## policies + +Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.policies(range="30d", limit=8) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsPoliciesQueryParamRange]](../../models/getanalyticspoliciesqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsPoliciesResponse](../../models/getanalyticspoliciesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + +## authors + +Get the authors with the most flagged content in a time window, largest first. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.authors(range="30d", limit=6) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsAuthorsQueryParamRange]](../../models/getanalyticsauthorsqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsAuthorsResponse](../../models/getanalyticsauthorsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + +## channels + +Get requests, flags and flag rate for each channel of the project in a time window. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.channels(range="30d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsChannelsQueryParamRange]](../../models/getanalyticschannelsqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsChannelsResponse](../../models/getanalyticschannelsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + +## volumes + +Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.volumes(range="30d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsVolumesQueryParamRange]](../../models/getanalyticsvolumesqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsVolumesResponse](../../models/getanalyticsvolumesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + +## automation + +Get how flagged content was handled in a time window: settled by rules or the casebook, or sent to human review, and what the reviewers decided. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.analytics.automation(range="30d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [Optional[models.GetAnalyticsAutomationQueryParamRange]](../../models/getanalyticsautomationqueryparamrange.md) | :heavy_minus_sign: | The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. | +| `channel` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.GetAnalyticsAutomationResponse](../../models/getanalyticsautomationresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/apikeys/README.md b/docs/sdks/apikeys/README.md new file mode 100644 index 0000000..86b36a2 --- /dev/null +++ b/docs/sdks/apikeys/README.md @@ -0,0 +1,53 @@ +# Projects.ApiKeys + +## Overview + +### Available Operations + +* [create](#create) - Create a project API key + +## create + +Create a new secret API key for a project and return it. Give each app or computer its own key, so you can revoke one without breaking the others. The project's existing keys keep working. Needs the `projects:write` permission. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.projects.api_keys.create(id="", name="API key") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the project. | +| `name` | *Optional[str]* | :heavy_minus_sign: | A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ProjectAPIKey](../../models/projectapikey.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/authors/README.md b/docs/sdks/authors/README.md index 881a732..7e13e97 100644 --- a/docs/sdks/authors/README.md +++ b/docs/sdks/authors/README.md @@ -12,7 +12,7 @@ ## list -List authors with their activity metrics and reputation. The list is paginated. +List the authors of the project, with their status, trust level and content metrics. The list is paginated. By default, the authors that were active most recently come first. ### Example Usage @@ -86,20 +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. | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -141,11 +141,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -190,20 +190,20 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -246,11 +246,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 b19f6c9..1400bad 100644 --- a/docs/sdks/contentsdk/README.md +++ b/docs/sdks/contentsdk/README.md @@ -36,21 +36,21 @@ with ModerationAPI( ### Parameters -| 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. | -| `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. | -| `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 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. | +| `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: | Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted. | +| `policies` | List[[models.PolicyRequest](../../models/policyrequest.md)] | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | +| `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/feedback/README.md b/docs/sdks/feedback/README.md new file mode 100644 index 0000000..745db65 --- /dev/null +++ b/docs/sdks/feedback/README.md @@ -0,0 +1,54 @@ +# Feedback + +## Overview + +### Available Operations + +* [create](#create) - Send feedback + +## create + +Sends a feature request, bug report or other feedback to the Moderation API team. The team reads every request and can reply by email. Limited to 5 requests per minute per organization. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.feedback.create(title="Filter queue items by author trust level", description="We review queue items by hand. We want to see items from new authors first, so we need a filter for trust level on the queue items list.", type_="feature_request", source="mcp") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `title` | *str* | :heavy_check_mark: | A short summary of the request. | +| `description` | *str* | :heavy_check_mark: | What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `type` | [Optional[models.CreateFeedbackType]](../../models/createfeedbacktype.md) | :heavy_minus_sign: | The kind of feedback. | +| `source` | [Optional[models.Source]](../../models/source.md) | :heavy_minus_sign: | Where the feedback was written: MCP server, agent skill, CLI or API. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CreateFeedbackResponse](../../models/createfeedbackresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/items/README.md b/docs/sdks/items/README.md index bf242aa..b4c4b8e 100644 --- a/docs/sdks/items/README.md +++ b/docs/sdks/items/README.md @@ -4,13 +4,14 @@ ### Available Operations -* [list](#list) - Get queue items +* [list](#list) - List queue items * [resolve](#resolve) - Resolve a queue item +* [resolve_many](#resolve_many) - Resolve queue items * [unresolve](#unresolve) - Unresolve a queue item ## list -Get paginated list of items in a moderation queue with filtering options +List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. ### Example Usage @@ -24,7 +25,7 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.queue.items.list(id="", page=1, page_size=20, sort_direction="desc") + res = ma_client.queue.items.list(id="", page=1, page_size=20) while res is not None: # Handle items @@ -35,22 +36,21 @@ 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 | -| `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. | +| 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` | [Optional[models.Sort]](../../models/sort.md) | :heavy_minus_sign: | N/A | +| `include_resolved` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `conversation_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | N/A | +| `author_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | 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 | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -70,7 +70,7 @@ with ModerationAPI( ## resolve -Mark a queue item as resolved with a specific moderation action +Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. ### Example Usage @@ -84,7 +84,7 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.queue.items.resolve(id="", item_id="", comment="Reviewed: no violation.") + res = ma_client.queue.items.resolve(id="", item_id="") # Handle response print(res) @@ -93,13 +93,12 @@ 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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -116,9 +115,59 @@ with ModerationAPI( | errors.InternalServerError | 500 | application/json | | errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | +## resolve_many + +Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.queue.items.resolve_many(id="", item_ids=[ + "clx8k2v0e000108l4a9bz3f7q", + "clx8k2v0e000208l4h2mc6d1r", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `item_ids` | List[*str*] | :heavy_check_mark: | The item IDs to resolve. Up to 100. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.ResolveQueueItemsResponse](../../models/resolvequeueitemsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + ## unresolve -Mark a previously resolved queue item as unresolved/pending +Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. ### Example Usage @@ -132,7 +181,7 @@ with ModerationAPI( secret_key=os.getenv("MODAPI_SECRET_KEY", ""), ) as ma_client: - res = ma_client.queue.items.unresolve(id="", item_id="", comment="Reopened after an appeal.") + res = ma_client.queue.items.unresolve(id="", item_id="") # Handle response print(res) @@ -141,13 +190,12 @@ 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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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/queuesdk/README.md b/docs/sdks/queuesdk/README.md index e129804..72c3e08 100644 --- a/docs/sdks/queuesdk/README.md +++ b/docs/sdks/queuesdk/README.md @@ -4,12 +4,63 @@ ### Available Operations +* [list](#list) - List queues * [retrieve](#retrieve) - Get a queue * [get_stats](#get_stats) - Get queue statistics +## list + +List the review queues of the project. The default queue comes first. The list is paginated. To get the item counts of a queue, use `GET /queue/{id}`. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.queue.list(page=1, page_size=20) + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + +**[models.ListQueuesResponse](../../models/listqueuesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.PermissionDeniedError | 403 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + ## retrieve -Get a queue +Get a review queue with its item counts. The counts use the filters and the date window of the queue, the same as the dashboard. ### Example Usage @@ -32,11 +83,11 @@ with ModerationAPI( ### Parameters -| 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. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The queue ID. | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -56,7 +107,7 @@ with ModerationAPI( ## get_stats -Get detailed statistics about a moderation queue including review times, action counts, and trends +Get review statistics of a queue for a period: resolved and pending items, the top reviewers and the resolved items per day. ### Example Usage @@ -79,12 +130,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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 6b82957..6c8d8d2 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -37,12 +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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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,14 +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. | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -131,11 +131,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -175,15 +175,15 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -224,11 +224,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 70c4307..b242afb 100644 --- a/docs/sdks/webhooksecret/README.md +++ b/docs/sdks/webhooksecret/README.md @@ -31,10 +31,10 @@ with ModerationAPI( ### Parameters -| 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. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 370a982..304ed41 100644 --- a/docs/sdks/wordlist/README.md +++ b/docs/sdks/wordlist/README.md @@ -5,6 +5,7 @@ ### Available Operations * [list](#list) - List wordlists +* [create](#create) - Create wordlist * [retrieve](#retrieve) - Get wordlist * [update](#update) - Update wordlist * [get_embedding_status](#get_embedding_status) - Get embedding status @@ -36,12 +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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -59,6 +60,53 @@ with ModerationAPI( | errors.InternalServerError | 500 | application/json | | errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | +## create + +Create a wordlist in the organization. You can add words now or later. Each word is embedded in the background for similarity matching. Use the embedding status endpoint to follow the progress. To use the wordlist in moderation, add it to a policy. + +### Example Usage + + +```python +from moderation_api import ModerationAPI +import os + + +with ModerationAPI( + secret_key=os.getenv("MODAPI_SECRET_KEY", ""), +) as ma_client: + + res = ma_client.wordlist.create(name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the wordlist | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `key` | *Optional[str]* | :heavy_minus_sign: | Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the wordlist | +| `words` | List[*str*] | :heavy_minus_sign: | Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CreateWordlistResponse](../../models/createwordlistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.BadRequestError | 400 | application/json | +| errors.AuthenticationError | 401 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + ## retrieve Get a specific wordlist by ID @@ -84,11 +132,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -108,7 +156,7 @@ with ModerationAPI( ## update -Update a wordlist +Update a wordlist. Fields that you do not send stay the same. If you send words, they replace all existing words, and the embeddings are updated in the background. ### Example Usage @@ -131,16 +179,16 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. | +| `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 @@ -181,11 +229,11 @@ with ModerationAPI( ### Parameters -| 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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 422e61b..aadc6f9 100644 --- a/docs/sdks/words/README.md +++ b/docs/sdks/words/README.md @@ -35,12 +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. | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -85,12 +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 | -| `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. | +| 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 e9a9871..344d2e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "moderation_api" -version = "2.1.1" +version = "2.2.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 678d88a..ddddf70 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.1.1" +__version__: str = "2.2.0" __openapi_doc_version__: str = "1.1.0" __gen_version__: str = "internal" -__user_agent__: str = "speakeasy-sdk/python 2.1.1 internal 1.1.0 moderation_api" +__user_agent__: str = "speakeasy-sdk/python 2.2.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 63326e9..09ee5f9 100644 --- a/src/moderation_api/account.py +++ b/src/moderation_api/account.py @@ -23,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -122,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/actions.py b/src/moderation_api/actions.py index fcdf8d6..278bc07 100644 --- a/src/moderation_api/actions.py +++ b/src/moderation_api/actions.py @@ -30,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -191,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -368,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -525,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -665,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -775,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -903,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -1066,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -1211,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1321,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1436,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1566,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/analytics.py b/src/moderation_api/analytics.py new file mode 100644 index 0000000..2844276 --- /dev/null +++ b/src/moderation_api/analytics.py @@ -0,0 +1,1505 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from moderation_api import errors, models, utils +from moderation_api._hooks import HookContext +from moderation_api.types import OptionalNullable, UNSET +from moderation_api.utils import get_security_from_env +from moderation_api.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Analytics(BaseSDK): + def summary( + self, + *, + range: Optional[models.GetAnalyticsSummaryQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsSummaryResponse: + r"""Get the analytics summary + + Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsSummaryRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/summary", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsSummary", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsSummaryResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def summary_async( + self, + *, + range: Optional[models.GetAnalyticsSummaryQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsSummaryResponse: + r"""Get the analytics summary + + Get the totals of the project for a time window: requests, flags, flag rate, allowed, rejected and sent to review, with the window before for the trend. Also the review queue backlog and a flag-rate spike, if there is one. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsSummaryRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/summary", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsSummary", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsSummaryResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def policies( + self, + *, + range: Optional[models.GetAnalyticsPoliciesQueryParamRange] = "30d", + channel: Optional[str] = None, + limit: Optional[int] = 8, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsPoliciesResponse: + r"""Get the most flagged policies + + Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param limit: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsPoliciesRequest( + range=range, + channel=channel, + limit=limit, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/policies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsPolicies", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsPoliciesResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def policies_async( + self, + *, + range: Optional[models.GetAnalyticsPoliciesQueryParamRange] = "30d", + channel: Optional[str] = None, + limit: Optional[int] = 8, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsPoliciesResponse: + r"""Get the most flagged policies + + Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param limit: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsPoliciesRequest( + range=range, + channel=channel, + limit=limit, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/policies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsPolicies", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsPoliciesResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def authors( + self, + *, + range: Optional[models.GetAnalyticsAuthorsQueryParamRange] = "30d", + channel: Optional[str] = None, + limit: Optional[int] = 6, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsAuthorsResponse: + r"""Get the most flagged authors + + Get the authors with the most flagged content in a time window, largest first. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param limit: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsAuthorsRequest( + range=range, + channel=channel, + limit=limit, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/authors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsAuthors", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsAuthorsResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def authors_async( + self, + *, + range: Optional[models.GetAnalyticsAuthorsQueryParamRange] = "30d", + channel: Optional[str] = None, + limit: Optional[int] = 6, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsAuthorsResponse: + r"""Get the most flagged authors + + Get the authors with the most flagged content in a time window, largest first. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param limit: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsAuthorsRequest( + range=range, + channel=channel, + limit=limit, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/authors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsAuthors", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsAuthorsResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def channels( + self, + *, + range: Optional[models.GetAnalyticsChannelsQueryParamRange] = "30d", + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsChannelsResponse: + r"""Get analytics per channel + + Get requests, flags and flag rate for each channel of the project in a time window. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsChannelsRequest( + range=range, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/channels", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsChannels", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsChannelsResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def channels_async( + self, + *, + range: Optional[models.GetAnalyticsChannelsQueryParamRange] = "30d", + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsChannelsResponse: + r"""Get analytics per channel + + Get requests, flags and flag rate for each channel of the project in a time window. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsChannelsRequest( + range=range, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/channels", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsChannels", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsChannelsResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def volumes( + self, + *, + range: Optional[models.GetAnalyticsVolumesQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsVolumesResponse: + r"""Get volumes over time + + Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsVolumesRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/volumes", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsVolumes", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsVolumesResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def volumes_async( + self, + *, + range: Optional[models.GetAnalyticsVolumesQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsVolumesResponse: + r"""Get volumes over time + + Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsVolumesRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/volumes", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsVolumes", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.GetAnalyticsVolumesResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def automation( + self, + *, + range: Optional[models.GetAnalyticsAutomationQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsAutomationResponse: + r"""Get the automation breakdown + + Get how flagged content was handled in a time window: settled by rules or the casebook, or sent to human review, and what the reviewers decided. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsAutomationRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/analytics/automation", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsAutomation", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsAutomationResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def automation_async( + self, + *, + range: Optional[models.GetAnalyticsAutomationQueryParamRange] = "30d", + channel: Optional[str] = None, + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.GetAnalyticsAutomationResponse: + r"""Get the automation breakdown + + Get how flagged content was handled in a time window: settled by rules or the casebook, or sent to human review, and what the reviewers decided. + + :param range: The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets. + :param channel: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetAnalyticsAutomationRequest( + range=range, + channel=channel, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/analytics/automation", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAnalyticsAutomation", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Analytics"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.GetAnalyticsAutomationResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) diff --git a/src/moderation_api/apikeys.py b/src/moderation_api/apikeys.py new file mode 100644 index 0000000..43d23a1 --- /dev/null +++ b/src/moderation_api/apikeys.py @@ -0,0 +1,259 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from moderation_api import errors, models, utils +from moderation_api._hooks import HookContext +from moderation_api.types import OptionalNullable, UNSET +from moderation_api.utils import get_security_from_env +from moderation_api.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class APIKeys(BaseSDK): + def create( + self, + *, + id: str, + name: Optional[str] = "API key", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ProjectAPIKey: + r"""Create a project API key + + Create a new secret API key for a project and return it. Give each app or computer its own key, so you can revoke one without breaking the others. The project's existing keys keep working. Needs the `projects:write` permission. + + :param id: The ID of the project. + :param name: A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateProjectAPIKeyRequest( + id=id, + body=models.CreateProjectAPIKeyRequestBody( + name=name, + ), + ) + + req = self._build_request( + method="POST", + path="/projects/{id}/api-keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, + False, + False, + "json", + models.CreateProjectAPIKeyRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createProjectApiKey", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Projects"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ProjectAPIKey, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def create_async( + self, + *, + id: str, + name: Optional[str] = "API key", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ProjectAPIKey: + r"""Create a project API key + + Create a new secret API key for a project and return it. Give each app or computer its own key, so you can revoke one without breaking the others. The project's existing keys keep working. Needs the `projects:write` permission. + + :param id: The ID of the project. + :param name: A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateProjectAPIKeyRequest( + id=id, + body=models.CreateProjectAPIKeyRequestBody( + name=name, + ), + ) + + req = self._build_request_async( + method="POST", + path="/projects/{id}/api-keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, + False, + False, + "json", + models.CreateProjectAPIKeyRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createProjectApiKey", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Projects"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ProjectAPIKey, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) diff --git a/src/moderation_api/authors.py b/src/moderation_api/authors.py index 752a7c4..e2bf28b 100644 --- a/src/moderation_api/authors.py +++ b/src/moderation_api/authors.py @@ -24,7 +24,7 @@ def list( ) -> Optional[models.ListAuthorsResponse]: r"""List authors - List authors with their activity metrics and reputation. The list is paginated. + List the authors of the project, with their status, trust level and content metrics. The list is paginated. By default, the authors that were active most recently come first. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -115,7 +115,6 @@ def next_func() -> Optional[models.ListAuthorsResponse]: sort_direction=request.sort_direction, 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, @@ -184,7 +183,7 @@ async def list_async( ) -> Optional[models.ListAuthorsResponse]: r"""List authors - List authors with their activity metrics and reputation. The list is paginated. + List the authors of the project, with their status, trust level and content metrics. The list is paginated. By default, the authors that were active most recently come first. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -278,7 +277,6 @@ async def empty_result(): sort_direction=request.sort_direction, 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, @@ -360,7 +358,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -513,7 +511,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -655,7 +653,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -775,7 +773,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -906,7 +904,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1062,7 +1060,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1207,7 +1205,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1327,7 +1325,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/content_sdk.py b/src/moderation_api/content_sdk.py index f9f63f7..2e1a280 100644 --- a/src/moderation_api/content_sdk.py +++ b/src/moderation_api/content_sdk.py @@ -42,7 +42,7 @@ def submit( 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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -51,7 +51,7 @@ def submit( :param conversation_id: For example the ID of a chat room or a post :param metadata: Any metadata you want to store with the content :param client_action: 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. - :param do_not_store: Do not store the content. The content won't enter the review queue + :param do_not_store: Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted. :param policies: (Enterprise) override the channel policies for this moderation request only. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -205,7 +205,7 @@ async def submit_async( 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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -214,7 +214,7 @@ async def submit_async( :param conversation_id: For example the ID of a chat room or a post :param metadata: Any metadata you want to store with the content :param client_action: 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. - :param do_not_store: Do not store the content. The content won't enter the review queue + :param do_not_store: Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted. :param policies: (Enterprise) override the channel policies for this moderation request only. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/moderation_api/errors/badrequesterror.py b/src/moderation_api/errors/badrequesterror.py index 7534826..7332862 100644 --- a/src/moderation_api/errors/badrequesterror.py +++ b/src/moderation_api/errors/badrequesterror.py @@ -21,7 +21,8 @@ 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. + - `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the key reaches more than one project. `message` lists the projects it reaches. + - `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead. - `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/notfounderror.py b/src/moderation_api/errors/notfounderror.py index 9d916fa..6eba834 100644 --- a/src/moderation_api/errors/notfounderror.py +++ b/src/moderation_api/errors/notfounderror.py @@ -24,6 +24,7 @@ class NotFoundErrorData(BaseModel): - `action_not_found`: The action does not exist. - `author_not_found`: The author does not exist. - `queue_not_found`: The review queue does not exist. + - `queue_item_not_found`: The queue item does not exist in the project. - `wordlist_not_found`: The wordlist does not exist. - `webhook_not_found`: The webhook does not exist. - `project_not_found`: The project does not exist. diff --git a/src/moderation_api/feedback.py b/src/moderation_api/feedback.py new file mode 100644 index 0000000..4f61bd1 --- /dev/null +++ b/src/moderation_api/feedback.py @@ -0,0 +1,253 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from moderation_api import errors, models, utils +from moderation_api._hooks import HookContext +from moderation_api.types import OptionalNullable, UNSET +from moderation_api.utils import get_security_from_env +from moderation_api.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Feedback(BaseSDK): + def create( + self, + *, + title: str, + description: str, + project_id: Optional[str] = None, + type_: Optional[models.CreateFeedbackType] = "feature_request", + source: Optional[models.Source] = "api", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CreateFeedbackResponse: + r"""Send feedback + + Sends a feature request, bug report or other feedback to the Moderation API team. The team reads every request and can reply by email. Limited to 5 requests per minute per organization. + + :param title: A short summary of the request. + :param description: What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + :param type: The kind of feedback. + :param source: Where the feedback was written: MCP server, agent skill, CLI or API. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateFeedbackRequest( + project_id=project_id, + body=models.CreateFeedbackRequestBody( + title=title, + description=description, + type=type_, + source=source, + ), + ) + + req = self._build_request( + method="POST", + path="/feedback", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, False, False, "json", models.CreateFeedbackRequestBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createFeedback", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Feedback"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CreateFeedbackResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def create_async( + self, + *, + title: str, + description: str, + project_id: Optional[str] = None, + type_: Optional[models.CreateFeedbackType] = "feature_request", + source: Optional[models.Source] = "api", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CreateFeedbackResponse: + r"""Send feedback + + Sends a feature request, bug report or other feedback to the Moderation API team. The team reads every request and can reply by email. Limited to 5 requests per minute per organization. + + :param title: A short summary of the request. + :param description: What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + :param type: The kind of feedback. + :param source: Where the feedback was written: MCP server, agent skill, CLI or API. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateFeedbackRequest( + project_id=project_id, + body=models.CreateFeedbackRequestBody( + title=title, + description=description, + type=type_, + source=source, + ), + ) + + req = self._build_request_async( + method="POST", + path="/feedback", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, False, False, "json", models.CreateFeedbackRequestBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createFeedback", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Feedback"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CreateFeedbackResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) diff --git a/src/moderation_api/items.py b/src/moderation_api/items.py index 4ec3080..33abaa9 100644 --- a/src/moderation_api/items.py +++ b/src/moderation_api/items.py @@ -17,38 +17,36 @@ def list( id: str, page: Optional[int] = 1, page_size: Optional[int] = 20, - sort_field: Optional[models.SortField] = None, - sort_direction: Optional[models.ListQueueItemsSortDirection] = "desc", + sort: Optional[models.Sort] = None, + include_resolved: Optional[bool] = None, conversation_ids: Optional[Iterable[str]] = None, labels: Optional[Iterable[str]] = None, - after_date: Optional[str] = None, - before_date: Optional[str] = None, - include_resolved: Optional[bool] = None, author_id: Optional[str] = None, filtered_action_ids: Optional[Iterable[str]] = None, + after_date: Optional[str] = None, + before_date: Optional[str] = None, project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[models.ListQueueItemsResponse]: - r"""Get queue items + r"""List queue items - Get paginated list of items in a moderation queue with filtering options + List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. - :param id: The queue ID + :param id: The queue ID. :param page: :param page_size: - :param sort_field: - :param sort_direction: Sort direction + :param sort: + :param include_resolved: :param conversation_ids: :param labels: - :param after_date: - :param before_date: - :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 after_date: + :param before_date: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -68,17 +66,16 @@ def list( id=id, page=page, page_size=page_size, - sort_field=sort_field, - sort_direction=sort_direction, + sort=sort, + include_resolved=include_resolved, conversation_ids=utils.unmarshal(conversation_ids, Optional[List[str]]), labels=utils.unmarshal(labels, Optional[List[str]]), - after_date=after_date, - before_date=before_date, - include_resolved=include_resolved, author_id=author_id, filtered_action_ids=utils.unmarshal( filtered_action_ids, Optional[List[str]] ), + after_date=after_date, + before_date=before_date, project_id=project_id, ) @@ -147,15 +144,14 @@ def next_func() -> Optional[models.ListQueueItemsResponse]: id=id, page=next_page, page_size=page_size, - sort_field=sort_field, - sort_direction=sort_direction, + sort=sort, + include_resolved=include_resolved, conversation_ids=conversation_ids, labels=labels, - after_date=after_date, - before_date=before_date, - include_resolved=include_resolved, author_id=author_id, filtered_action_ids=filtered_action_ids, + after_date=after_date, + before_date=before_date, project_id=project_id, retries=retries, server_url=server_url, @@ -216,38 +212,36 @@ async def list_async( id: str, page: Optional[int] = 1, page_size: Optional[int] = 20, - sort_field: Optional[models.SortField] = None, - sort_direction: Optional[models.ListQueueItemsSortDirection] = "desc", + sort: Optional[models.Sort] = None, + include_resolved: Optional[bool] = None, conversation_ids: Optional[Iterable[str]] = None, labels: Optional[Iterable[str]] = None, - after_date: Optional[str] = None, - before_date: Optional[str] = None, - include_resolved: Optional[bool] = None, author_id: Optional[str] = None, filtered_action_ids: Optional[Iterable[str]] = None, + after_date: Optional[str] = None, + before_date: Optional[str] = None, project_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[models.ListQueueItemsResponse]: - r"""Get queue items + r"""List queue items - Get paginated list of items in a moderation queue with filtering options + List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. - :param id: The queue ID + :param id: The queue ID. :param page: :param page_size: - :param sort_field: - :param sort_direction: Sort direction + :param sort: + :param include_resolved: :param conversation_ids: :param labels: - :param after_date: - :param before_date: - :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 after_date: + :param before_date: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -267,17 +261,16 @@ async def list_async( id=id, page=page, page_size=page_size, - sort_field=sort_field, - sort_direction=sort_direction, + sort=sort, + include_resolved=include_resolved, conversation_ids=utils.unmarshal(conversation_ids, Optional[List[str]]), labels=utils.unmarshal(labels, Optional[List[str]]), - after_date=after_date, - before_date=before_date, - include_resolved=include_resolved, author_id=author_id, filtered_action_ids=utils.unmarshal( filtered_action_ids, Optional[List[str]] ), + after_date=after_date, + before_date=before_date, project_id=project_id, ) @@ -349,15 +342,14 @@ async def empty_result(): id=id, page=next_page, page_size=page_size, - sort_field=sort_field, - sort_direction=sort_direction, + sort=sort, + include_resolved=include_resolved, conversation_ids=conversation_ids, labels=labels, - after_date=after_date, - before_date=before_date, - include_resolved=include_resolved, author_id=author_id, filtered_action_ids=filtered_action_ids, + after_date=after_date, + before_date=before_date, project_id=project_id, retries=retries, server_url=server_url, @@ -418,7 +410,6 @@ 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, timeout_ms: Optional[int] = None, @@ -426,12 +417,11 @@ def resolve( ) -> models.ResolveQueueItemResponse: r"""Resolve a queue item - Mark a queue item as resolved with a specific moderation action + Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. - :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 id: The queue ID. + :param item_id: The item ID to resolve. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -451,9 +441,6 @@ def resolve( id=id, item_id=item_id, project_id=project_id, - body=models.ResolveQueueItemRequestBody( - comment=comment, - ), ) req = self._build_request( @@ -462,16 +449,13 @@ def resolve( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.body, False, False, "json", models.ResolveQueueItemRequestBody - ), allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -546,7 +530,6 @@ 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, timeout_ms: Optional[int] = None, @@ -554,12 +537,11 @@ async def resolve_async( ) -> models.ResolveQueueItemResponse: r"""Resolve a queue item - Mark a queue item as resolved with a specific moderation action + Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. - :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 id: The queue ID. + :param item_id: The item ID to resolve. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -579,9 +561,6 @@ async def resolve_async( id=id, item_id=item_id, project_id=project_id, - body=models.ResolveQueueItemRequestBody( - comment=comment, - ), ) req = self._build_request_async( @@ -590,6 +569,128 @@ async def resolve_async( base_url=base_url, url_variables=url_variables, request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="resolveQueueItem", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Review queues"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResolveQueueItemResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + def resolve_many( + self, + *, + id: str, + item_ids: Iterable[str], + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResolveQueueItemsResponse: + r"""Resolve queue items + + Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. + + :param id: The queue ID. + :param item_ids: The item IDs to resolve. Up to 100. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResolveQueueItemsRequest( + id=id, + project_id=project_id, + body=models.ResolveQueueItemsRequestBody( + item_ids=utils.unmarshal(item_ids, List[str]), + ), + ) + + req = self._build_request( + method="POST", + path="/queue/{id}/items/resolve", + base_url=base_url, + url_variables=url_variables, + request=request, request_body_required=True, request_has_path_params=True, request_has_query_params=True, @@ -598,7 +699,132 @@ async def resolve_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.body, False, False, "json", models.ResolveQueueItemRequestBody + request.body, False, False, "json", models.ResolveQueueItemsRequestBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="resolveQueueItems", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Review queues"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResolveQueueItemsResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def resolve_many_async( + self, + *, + id: str, + item_ids: Iterable[str], + project_id: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResolveQueueItemsResponse: + r"""Resolve queue items + + Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. + + :param id: The queue ID. + :param item_ids: The item IDs to resolve. Up to 100. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResolveQueueItemsRequest( + id=id, + project_id=project_id, + body=models.ResolveQueueItemsRequestBody( + item_ids=utils.unmarshal(item_ids, List[str]), + ), + ) + + req = self._build_request_async( + method="POST", + path="/queue/{id}/items/resolve", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, False, False, "json", models.ResolveQueueItemsRequestBody ), allow_empty_value=None, timeout_ms=timeout_ms, @@ -616,7 +842,7 @@ async def resolve_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="resolveQueueItem", + operation_id="resolveQueueItems", oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security @@ -631,7 +857,7 @@ async def resolve_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ResolveQueueItemResponse, http_res) + return unmarshal_json_response(models.ResolveQueueItemsResponse, http_res) if utils.match_response(http_res, "400", "application/json"): response_data = unmarshal_json_response( errors.BadRequestErrorData, http_res @@ -674,7 +900,6 @@ 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, timeout_ms: Optional[int] = None, @@ -682,12 +907,11 @@ def unresolve( ) -> models.UnresolveQueueItemResponse: r"""Unresolve a queue item - Mark a previously resolved queue item as unresolved/pending + Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. - :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 id: The queue ID. + :param item_id: The item ID to unresolve. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -707,9 +931,6 @@ def unresolve( id=id, item_id=item_id, project_id=project_id, - body=models.UnresolveQueueItemRequestBody( - comment=comment, - ), ) req = self._build_request( @@ -718,16 +939,13 @@ def unresolve( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.body, False, False, "json", models.UnresolveQueueItemRequestBody - ), allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -802,7 +1020,6 @@ 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, timeout_ms: Optional[int] = None, @@ -810,12 +1027,11 @@ async def unresolve_async( ) -> models.UnresolveQueueItemResponse: r"""Unresolve a queue item - Mark a previously resolved queue item as unresolved/pending + Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. - :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 id: The queue ID. + :param item_id: The item ID to unresolve. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -835,9 +1051,6 @@ async def unresolve_async( id=id, item_id=item_id, project_id=project_id, - body=models.UnresolveQueueItemRequestBody( - comment=comment, - ), ) req = self._build_request_async( @@ -846,16 +1059,13 @@ async def unresolve_async( base_url=base_url, url_variables=url_variables, request=request, - request_body_required=True, + request_body_required=False, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.body, False, False, "json", models.UnresolveQueueItemRequestBody - ), allow_empty_value=None, timeout_ms=timeout_ms, ) diff --git a/src/moderation_api/models/__init__.py b/src/moderation_api/models/__init__.py index 308e486..75cd8d2 100644 --- a/src/moderation_api/models/__init__.py +++ b/src/moderation_api/models/__init__.py @@ -56,6 +56,22 @@ CreateChannelRequestBodyTypedDict, CreateChannelRequestTypedDict, ) + from .createfeedbackop import ( + CreateFeedbackRequest, + CreateFeedbackRequestBody, + CreateFeedbackRequestBodyTypedDict, + CreateFeedbackRequestTypedDict, + CreateFeedbackResponse, + CreateFeedbackResponseTypedDict, + CreateFeedbackType, + Source, + ) + from .createprojectapikeyop import ( + CreateProjectAPIKeyRequest, + CreateProjectAPIKeyRequestBody, + CreateProjectAPIKeyRequestBodyTypedDict, + CreateProjectAPIKeyRequestTypedDict, + ) from .createprojectop import CreateProjectRequest, CreateProjectRequestTypedDict from .createwebhookop import ( CreateWebhookEventTypeRequest, @@ -68,6 +84,14 @@ CreateWebhookResponse, CreateWebhookResponseTypedDict, ) + from .createwordlistop import ( + CreateWordlistRequest, + CreateWordlistRequestBody, + CreateWordlistRequestBodyTypedDict, + CreateWordlistRequestTypedDict, + CreateWordlistResponse, + CreateWordlistResponseTypedDict, + ) from .deleteactionop import ( DeleteActionRequest, DeleteActionRequestTypedDict, @@ -138,47 +162,89 @@ GetActionResponseTypedDict, GetActionType, ) + from .getanalyticsauthorsop import ( + GetAnalyticsAuthorsAuthor, + GetAnalyticsAuthorsAuthorTypedDict, + GetAnalyticsAuthorsQueryParamRange, + GetAnalyticsAuthorsRangeResponse, + GetAnalyticsAuthorsRequest, + GetAnalyticsAuthorsRequestTypedDict, + GetAnalyticsAuthorsResponse, + GetAnalyticsAuthorsResponseTypedDict, + ) + from .getanalyticsautomationop import ( + GetAnalyticsAutomationQueryParamRange, + GetAnalyticsAutomationRangeResponse, + GetAnalyticsAutomationRequest, + GetAnalyticsAutomationRequestTypedDict, + GetAnalyticsAutomationResponse, + GetAnalyticsAutomationResponseTypedDict, + Rule, + RuleTypedDict, + ) + from .getanalyticschannelsop import ( + GetAnalyticsChannelsChannel, + GetAnalyticsChannelsChannelTypedDict, + GetAnalyticsChannelsQueryParamRange, + GetAnalyticsChannelsRangeResponse, + GetAnalyticsChannelsRequest, + GetAnalyticsChannelsRequestTypedDict, + GetAnalyticsChannelsResponse, + GetAnalyticsChannelsResponseTypedDict, + ) + from .getanalyticspoliciesop import ( + GetAnalyticsPoliciesPolicy, + GetAnalyticsPoliciesPolicyTypedDict, + GetAnalyticsPoliciesQueryParamRange, + GetAnalyticsPoliciesRangeResponse, + GetAnalyticsPoliciesRequest, + GetAnalyticsPoliciesRequestTypedDict, + GetAnalyticsPoliciesResponse, + GetAnalyticsPoliciesResponseTypedDict, + ) + from .getanalyticssummaryop import ( + FlagRateSpike, + FlagRateSpikeTypedDict, + GetAnalyticsSummaryQueryParamRange, + GetAnalyticsSummaryRangeResponse, + GetAnalyticsSummaryRequest, + GetAnalyticsSummaryRequestTypedDict, + GetAnalyticsSummaryResponse, + GetAnalyticsSummaryResponseTypedDict, + PreviousPeriod, + PreviousPeriodTypedDict, + Totals, + TotalsTypedDict, + ) + from .getanalyticsvolumesop import ( + Bucket, + GetAnalyticsVolumesQueryParamRange, + GetAnalyticsVolumesRangeResponse, + GetAnalyticsVolumesRequest, + GetAnalyticsVolumesRequestTypedDict, + GetAnalyticsVolumesResponse, + GetAnalyticsVolumesResponseTypedDict, + Volume, + VolumeTypedDict, + ) from .getauthorop import GetAuthorRequest, GetAuthorRequestTypedDict from .getchannelop import GetChannelRequest, GetChannelRequestTypedDict from .getprojectop import GetProjectRequest, GetProjectRequestTypedDict from .getqueueop import ( - CasebookAgreement, - CasebookAnswer, - CheckStatus, - Filter, - FilterLabel, - FilterLabelTypedDict, - FilterTypedDict, - GetQueueContentType, - GetQueueQueue, - GetQueueQueueTypedDict, - GetQueueRecommendationAction, GetQueueRequest, GetQueueRequestTypedDict, GetQueueResponse, GetQueueResponseTypedDict, - GetQueueType, - IsFlagged, - MediaType, - MetadataFilter, - MetadataFilterTypedDict, - WithinUnit, ) from .getqueuestatsop import ( - ActionStat, - ActionStatTypedDict, DailyReviewCount, DailyReviewCountTypedDict, - FlaggedContentTrend, - FlaggedContentTrendTypedDict, GetQueueStatsRequest, GetQueueStatsRequestTypedDict, GetQueueStatsResponse, GetQueueStatsResponseTypedDict, ReviewStats, ReviewStatsTypedDict, - TopAction, - TopActionTypedDict, TopReviewer, TopReviewerTypedDict, Trends, @@ -233,8 +299,8 @@ ListAuthorsResponseBody, ListAuthorsResponseBodyTypedDict, ListAuthorsResponseTypedDict, - ListAuthorsSortDirection, SortBy, + SortDirection, ) from .listchannelsop import ( ListChannelsRequest, @@ -253,21 +319,21 @@ ListProjectsResponseTypedDict, ) from .listqueueitemsop import ( - ListQueueItemsAction, - ListQueueItemsActionTypedDict, - ListQueueItemsData, - ListQueueItemsDataTypedDict, - ListQueueItemsLabel, - ListQueueItemsLabelTypedDict, ListQueueItemsRequest, ListQueueItemsRequestTypedDict, ListQueueItemsResponse, ListQueueItemsResponseBody, ListQueueItemsResponseBodyTypedDict, ListQueueItemsResponseTypedDict, - ListQueueItemsSortDirection, - ListQueueItemsStatus, - SortField, + Sort, + ) + from .listqueuesop import ( + ListQueuesRequest, + ListQueuesRequestTypedDict, + ListQueuesResponse, + ListQueuesResponseBody, + ListQueuesResponseBodyTypedDict, + ListQueuesResponseTypedDict, ) from .listwebhooksop import ( ListWebhooksData, @@ -295,6 +361,7 @@ from .pagination import Pagination, PaginationTypedDict from .permissiondeniederror import PermissionDeniedErrorCode from .project import Project, ProjectGlobalFlaggingMode, ProjectTypedDict + from .projectapikey import ProjectAPIKey, ProjectAPIKeyTypedDict from .projectwithkey import ( ProjectWithKey, ProjectWithKeyGlobalFlaggingMode, @@ -308,13 +375,52 @@ Metrics, MetricsTypedDict, PublicAuthor, + PublicAuthorStatus, PublicAuthorTypedDict, RiskEvaluation, RiskEvaluationTypedDict, - Status, TrustLevel, TrustLevelTypedDict, ) + from .queue import Queue, QueueTypedDict + from .queueitem import ( + Label, + LabelTypedDict, + QueueItem, + QueueItemAudio, + QueueItemAudioTypedDict, + QueueItemBrandImpersonation, + QueueItemBrandImpersonationTypedDict, + QueueItemContent, + QueueItemContentLeaf, + QueueItemContentLeafTypedDict, + QueueItemContentTypedDict, + QueueItemDataAudio, + QueueItemDataAudioTypedDict, + QueueItemDataImage, + QueueItemDataImageTypedDict, + QueueItemDataText, + QueueItemDataTextTypedDict, + QueueItemDataVideo, + QueueItemDataVideoTypedDict, + QueueItemImage, + QueueItemImageTypedDict, + QueueItemMatch, + QueueItemMatchTypedDict, + QueueItemObject, + QueueItemObjectTypedDict, + QueueItemSignals, + QueueItemSignalsTypedDict, + QueueItemStatus, + QueueItemText, + QueueItemTextTypedDict, + QueueItemTypedDict, + QueueItemVideo, + QueueItemVideoTypedDict, + UnknownQueueItemContent, + UnknownQueueItemContentLeaf, + ) + from .queuewithcounts import QueueWithCounts, QueueWithCountsTypedDict from .ratelimiterror import RateLimitErrorCode from .removewordlistwordsop import ( RemoveWordlistWordsRequest, @@ -324,15 +430,22 @@ ) from .resolvequeueitemop import ( ResolveQueueItemRequest, - ResolveQueueItemRequestBody, - ResolveQueueItemRequestBodyTypedDict, ResolveQueueItemRequestTypedDict, ResolveQueueItemResponse, ResolveQueueItemResponseTypedDict, ) + from .resolvequeueitemsop import ( + ResolveQueueItemsRequest, + ResolveQueueItemsRequestBody, + ResolveQueueItemsRequestBodyTypedDict, + ResolveQueueItemsRequestTypedDict, + ResolveQueueItemsResponse, + ResolveQueueItemsResponseTypedDict, + ) from .security import Security, SecurityTypedDict from .submitcontentop import ( ActionRequest, + ActionResponse, Adult, AdultTypedDict, Alcohol, @@ -341,9 +454,7 @@ AudioRequestTypedDict, AudioResponse, AudioResponseTypedDict, - Author, AuthorStatus, - AuthorTypedDict, Cannabis, CannabisTypedDict, Casebook, @@ -439,8 +550,6 @@ PersonalStoryInsightTypedDict, PolicyRequest, PolicyRequestTypedDict, - PolicyResponse, - PolicyResponseTypedDict, Political, PoliticalTypedDict, Profanity, @@ -476,6 +585,8 @@ SignalsResponseTypedDict, Spam, SpamTypedDict, + SubmitContentAuthor, + SubmitContentAuthorTypedDict, SubmitContentBehavior, SubmitContentBlock, SubmitContentBlockTypedDict, @@ -490,7 +601,8 @@ SubmitContentMetaType, SubmitContentObject, SubmitContentObjectTypedDict, - SubmitContentRecommendationAction, + SubmitContentPolicyResponse, + SubmitContentPolicyResponseTypedDict, SubmitContentRequest, SubmitContentRequestBody, SubmitContentRequestBodyTypedDict, @@ -519,7 +631,7 @@ UnicodeSpoofingTypedDict, UnknownContentLeafResponse, UnknownInsight, - UnknownPolicyResponse, + UnknownSubmitContentPolicyResponse, Value, Verdict, VideoRequest, @@ -533,11 +645,10 @@ ) from .unresolvequeueitemop import ( UnresolveQueueItemRequest, - UnresolveQueueItemRequestBody, - UnresolveQueueItemRequestBodyTypedDict, UnresolveQueueItemRequestTypedDict, UnresolveQueueItemResponse, UnresolveQueueItemResponseTypedDict, + UnresolveQueueItemStatus, ) from .updateactionop import ( UpdateActionPositionRequest, @@ -603,8 +714,7 @@ __all__ = [ "ActionRequest", - "ActionStat", - "ActionStatTypedDict", + "ActionResponse", "AddWordlistWordsRequest", "AddWordlistWordsRequestBody", "AddWordlistWordsRequestBodyTypedDict", @@ -620,23 +730,19 @@ "AudioResponse", "AudioResponseTypedDict", "AuthenticationErrorCode", - "Author", "AuthorStatus", - "AuthorTypedDict", "BadRequestErrorCode", "Block", "BlockTypedDict", + "Bucket", "Cannabis", "CannabisTypedDict", "Casebook", - "CasebookAgreement", - "CasebookAnswer", "CasebookTypedDict", "Channel", "ChannelCircumvention", "ChannelCircumventionTypedDict", "ChannelTypedDict", - "CheckStatus", "ClassifierOutput", "ClassifierOutputTypedDict", "CodeAbuse", @@ -681,6 +787,17 @@ "CreateChannelRequestBody", "CreateChannelRequestBodyTypedDict", "CreateChannelRequestTypedDict", + "CreateFeedbackRequest", + "CreateFeedbackRequestBody", + "CreateFeedbackRequestBodyTypedDict", + "CreateFeedbackRequestTypedDict", + "CreateFeedbackResponse", + "CreateFeedbackResponseTypedDict", + "CreateFeedbackType", + "CreateProjectAPIKeyRequest", + "CreateProjectAPIKeyRequestBody", + "CreateProjectAPIKeyRequestBodyTypedDict", + "CreateProjectAPIKeyRequestTypedDict", "CreateProjectRequest", "CreateProjectRequestTypedDict", "CreateWebhookEventTypeRequest", @@ -692,6 +809,12 @@ "CreateWebhookRequestTypedDict", "CreateWebhookResponse", "CreateWebhookResponseTypedDict", + "CreateWordlistRequest", + "CreateWordlistRequestBody", + "CreateWordlistRequestBodyTypedDict", + "CreateWordlistRequestTypedDict", + "CreateWordlistResponse", + "CreateWordlistResponseTypedDict", "Crypto", "CryptoTypedDict", "CuriosityInsight", @@ -760,12 +883,8 @@ "ExtremismTypedDict", "FaceDetection", "FaceDetectionTypedDict", - "Filter", - "FilterLabel", - "FilterLabelTypedDict", - "FilterTypedDict", - "FlaggedContentTrend", - "FlaggedContentTrendTypedDict", + "FlagRateSpike", + "FlagRateSpikeTypedDict", "FlaggingMode", "Gambling", "GamblingTypedDict", @@ -782,16 +901,54 @@ "GetActionResponse", "GetActionResponseTypedDict", "GetActionType", + "GetAnalyticsAuthorsAuthor", + "GetAnalyticsAuthorsAuthorTypedDict", + "GetAnalyticsAuthorsQueryParamRange", + "GetAnalyticsAuthorsRangeResponse", + "GetAnalyticsAuthorsRequest", + "GetAnalyticsAuthorsRequestTypedDict", + "GetAnalyticsAuthorsResponse", + "GetAnalyticsAuthorsResponseTypedDict", + "GetAnalyticsAutomationQueryParamRange", + "GetAnalyticsAutomationRangeResponse", + "GetAnalyticsAutomationRequest", + "GetAnalyticsAutomationRequestTypedDict", + "GetAnalyticsAutomationResponse", + "GetAnalyticsAutomationResponseTypedDict", + "GetAnalyticsChannelsChannel", + "GetAnalyticsChannelsChannelTypedDict", + "GetAnalyticsChannelsQueryParamRange", + "GetAnalyticsChannelsRangeResponse", + "GetAnalyticsChannelsRequest", + "GetAnalyticsChannelsRequestTypedDict", + "GetAnalyticsChannelsResponse", + "GetAnalyticsChannelsResponseTypedDict", + "GetAnalyticsPoliciesPolicy", + "GetAnalyticsPoliciesPolicyTypedDict", + "GetAnalyticsPoliciesQueryParamRange", + "GetAnalyticsPoliciesRangeResponse", + "GetAnalyticsPoliciesRequest", + "GetAnalyticsPoliciesRequestTypedDict", + "GetAnalyticsPoliciesResponse", + "GetAnalyticsPoliciesResponseTypedDict", + "GetAnalyticsSummaryQueryParamRange", + "GetAnalyticsSummaryRangeResponse", + "GetAnalyticsSummaryRequest", + "GetAnalyticsSummaryRequestTypedDict", + "GetAnalyticsSummaryResponse", + "GetAnalyticsSummaryResponseTypedDict", + "GetAnalyticsVolumesQueryParamRange", + "GetAnalyticsVolumesRangeResponse", + "GetAnalyticsVolumesRequest", + "GetAnalyticsVolumesRequestTypedDict", + "GetAnalyticsVolumesResponse", + "GetAnalyticsVolumesResponseTypedDict", "GetAuthorRequest", "GetAuthorRequestTypedDict", "GetChannelRequest", "GetChannelRequestTypedDict", "GetProjectRequest", "GetProjectRequestTypedDict", - "GetQueueContentType", - "GetQueueQueue", - "GetQueueQueueTypedDict", - "GetQueueRecommendationAction", "GetQueueRequest", "GetQueueRequestTypedDict", "GetQueueResponse", @@ -800,7 +957,6 @@ "GetQueueStatsRequestTypedDict", "GetQueueStatsResponse", "GetQueueStatsResponseTypedDict", - "GetQueueType", "GetWebhookEventType", "GetWebhookPayloadVersion", "GetWebhookRequest", @@ -844,7 +1000,8 @@ "Insight", "InsightTypedDict", "InternalServerErrorCode", - "IsFlagged", + "Label", + "LabelTypedDict", "LanguageInsight", "LanguageInsightTypedDict", "ListActionsData", @@ -866,7 +1023,6 @@ "ListAuthorsResponseBody", "ListAuthorsResponseBodyTypedDict", "ListAuthorsResponseTypedDict", - "ListAuthorsSortDirection", "ListChannelsRequest", "ListChannelsRequestTypedDict", "ListChannelsResponse", @@ -879,20 +1035,18 @@ "ListProjectsResponseBody", "ListProjectsResponseBodyTypedDict", "ListProjectsResponseTypedDict", - "ListQueueItemsAction", - "ListQueueItemsActionTypedDict", - "ListQueueItemsData", - "ListQueueItemsDataTypedDict", - "ListQueueItemsLabel", - "ListQueueItemsLabelTypedDict", "ListQueueItemsRequest", "ListQueueItemsRequestTypedDict", "ListQueueItemsResponse", "ListQueueItemsResponseBody", "ListQueueItemsResponseBodyTypedDict", "ListQueueItemsResponseTypedDict", - "ListQueueItemsSortDirection", - "ListQueueItemsStatus", + "ListQueuesRequest", + "ListQueuesRequestTypedDict", + "ListQueuesResponse", + "ListQueuesResponseBody", + "ListQueuesResponseBodyTypedDict", + "ListQueuesResponseTypedDict", "ListWebhooksData", "ListWebhooksDataTypedDict", "ListWebhooksEventType", @@ -915,13 +1069,10 @@ "LowQualityContentTypedDict", "MatchedRule", "MatchedRuleTypedDict", - "MediaType", "Meta", "MetaStatus", "MetaTypedDict", "Metadata", - "MetadataFilter", - "MetadataFilterTypedDict", "MetadataTypedDict", "Method", "Metrics", @@ -942,13 +1093,15 @@ "PersonalStoryInsightTypedDict", "PolicyRequest", "PolicyRequestTypedDict", - "PolicyResponse", - "PolicyResponseTypedDict", "Political", "PoliticalTypedDict", + "PreviousPeriod", + "PreviousPeriodTypedDict", "Profanity", "ProfanityTypedDict", "Project", + "ProjectAPIKey", + "ProjectAPIKeyTypedDict", "ProjectGlobalFlaggingMode", "ProjectTypedDict", "ProjectWithKey", @@ -957,7 +1110,43 @@ "Promotion", "PromotionTypedDict", "PublicAuthor", + "PublicAuthorStatus", "PublicAuthorTypedDict", + "Queue", + "QueueItem", + "QueueItemAudio", + "QueueItemAudioTypedDict", + "QueueItemBrandImpersonation", + "QueueItemBrandImpersonationTypedDict", + "QueueItemContent", + "QueueItemContentLeaf", + "QueueItemContentLeafTypedDict", + "QueueItemContentTypedDict", + "QueueItemDataAudio", + "QueueItemDataAudioTypedDict", + "QueueItemDataImage", + "QueueItemDataImageTypedDict", + "QueueItemDataText", + "QueueItemDataTextTypedDict", + "QueueItemDataVideo", + "QueueItemDataVideoTypedDict", + "QueueItemImage", + "QueueItemImageTypedDict", + "QueueItemMatch", + "QueueItemMatchTypedDict", + "QueueItemObject", + "QueueItemObjectTypedDict", + "QueueItemSignals", + "QueueItemSignalsTypedDict", + "QueueItemStatus", + "QueueItemText", + "QueueItemTextTypedDict", + "QueueItemTypedDict", + "QueueItemVideo", + "QueueItemVideoTypedDict", + "QueueTypedDict", + "QueueWithCounts", + "QueueWithCountsTypedDict", "RateLimitErrorCode", "ReasonCode", "ReasonCodeEnum", @@ -971,17 +1160,23 @@ "RemoveWordlistWordsResponse", "RemoveWordlistWordsResponseTypedDict", "ResolveQueueItemRequest", - "ResolveQueueItemRequestBody", - "ResolveQueueItemRequestBodyTypedDict", "ResolveQueueItemRequestTypedDict", "ResolveQueueItemResponse", "ResolveQueueItemResponseTypedDict", + "ResolveQueueItemsRequest", + "ResolveQueueItemsRequestBody", + "ResolveQueueItemsRequestBodyTypedDict", + "ResolveQueueItemsRequestTypedDict", + "ResolveQueueItemsResponse", + "ResolveQueueItemsResponseTypedDict", "RespectInsight", "RespectInsightTypedDict", "ReviewStats", "ReviewStatsTypedDict", "RiskEvaluation", "RiskEvaluationTypedDict", + "Rule", + "RuleTypedDict", "Scores", "ScoresTypedDict", "Security", @@ -1002,11 +1197,14 @@ "SignalsRequestTypedDict", "SignalsResponse", "SignalsResponseTypedDict", + "Sort", "SortBy", - "SortField", + "SortDirection", + "Source", "Spam", "SpamTypedDict", - "Status", + "SubmitContentAuthor", + "SubmitContentAuthorTypedDict", "SubmitContentBehavior", "SubmitContentBlock", "SubmitContentBlockTypedDict", @@ -1021,7 +1219,8 @@ "SubmitContentMetaType", "SubmitContentObject", "SubmitContentObjectTypedDict", - "SubmitContentRecommendationAction", + "SubmitContentPolicyResponse", + "SubmitContentPolicyResponseTypedDict", "SubmitContentRequest", "SubmitContentRequestBody", "SubmitContentRequestBodyTypedDict", @@ -1038,12 +1237,12 @@ "ThreatTypedDict", "Tobacco", "TobaccoTypedDict", - "TopAction", - "TopActionTypedDict", "TopReviewer", "TopReviewerTypedDict", "Topic", "TopicTypedDict", + "Totals", + "TotalsTypedDict", "Toxicity", "ToxicityTypedDict", "TranscriptionQuality", @@ -1059,13 +1258,14 @@ "UnicodeSpoofingTypedDict", "UnknownContentLeafResponse", "UnknownInsight", - "UnknownPolicyResponse", + "UnknownQueueItemContent", + "UnknownQueueItemContentLeaf", + "UnknownSubmitContentPolicyResponse", "UnresolveQueueItemRequest", - "UnresolveQueueItemRequestBody", - "UnresolveQueueItemRequestBodyTypedDict", "UnresolveQueueItemRequestTypedDict", "UnresolveQueueItemResponse", "UnresolveQueueItemResponseTypedDict", + "UnresolveQueueItemStatus", "UpdateActionPositionRequest", "UpdateActionPositionResponse", "UpdateActionPossibleValueRequest", @@ -1123,9 +1323,10 @@ "VideoResponseTypedDict", "Violence", "ViolenceTypedDict", + "Volume", + "VolumeTypedDict", "Weapons", "WeaponsTypedDict", - "WithinUnit", ] _dynamic_imports: dict[str, str] = { @@ -1170,6 +1371,18 @@ "CreateChannelRequestBody": ".createchannelop", "CreateChannelRequestBodyTypedDict": ".createchannelop", "CreateChannelRequestTypedDict": ".createchannelop", + "CreateFeedbackRequest": ".createfeedbackop", + "CreateFeedbackRequestBody": ".createfeedbackop", + "CreateFeedbackRequestBodyTypedDict": ".createfeedbackop", + "CreateFeedbackRequestTypedDict": ".createfeedbackop", + "CreateFeedbackResponse": ".createfeedbackop", + "CreateFeedbackResponseTypedDict": ".createfeedbackop", + "CreateFeedbackType": ".createfeedbackop", + "Source": ".createfeedbackop", + "CreateProjectAPIKeyRequest": ".createprojectapikeyop", + "CreateProjectAPIKeyRequestBody": ".createprojectapikeyop", + "CreateProjectAPIKeyRequestBodyTypedDict": ".createprojectapikeyop", + "CreateProjectAPIKeyRequestTypedDict": ".createprojectapikeyop", "CreateProjectRequest": ".createprojectop", "CreateProjectRequestTypedDict": ".createprojectop", "CreateWebhookEventTypeRequest": ".createwebhookop", @@ -1181,6 +1394,12 @@ "CreateWebhookRequestTypedDict": ".createwebhookop", "CreateWebhookResponse": ".createwebhookop", "CreateWebhookResponseTypedDict": ".createwebhookop", + "CreateWordlistRequest": ".createwordlistop", + "CreateWordlistRequestBody": ".createwordlistop", + "CreateWordlistRequestBodyTypedDict": ".createwordlistop", + "CreateWordlistRequestTypedDict": ".createwordlistop", + "CreateWordlistResponse": ".createwordlistop", + "CreateWordlistResponseTypedDict": ".createwordlistop", "DeleteActionRequest": ".deleteactionop", "DeleteActionRequestTypedDict": ".deleteactionop", "DeleteActionResponse": ".deleteactionop", @@ -1234,47 +1453,77 @@ "GetActionResponse": ".getactionop", "GetActionResponseTypedDict": ".getactionop", "GetActionType": ".getactionop", + "GetAnalyticsAuthorsAuthor": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsAuthorTypedDict": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsQueryParamRange": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsRangeResponse": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsRequest": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsRequestTypedDict": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsResponse": ".getanalyticsauthorsop", + "GetAnalyticsAuthorsResponseTypedDict": ".getanalyticsauthorsop", + "GetAnalyticsAutomationQueryParamRange": ".getanalyticsautomationop", + "GetAnalyticsAutomationRangeResponse": ".getanalyticsautomationop", + "GetAnalyticsAutomationRequest": ".getanalyticsautomationop", + "GetAnalyticsAutomationRequestTypedDict": ".getanalyticsautomationop", + "GetAnalyticsAutomationResponse": ".getanalyticsautomationop", + "GetAnalyticsAutomationResponseTypedDict": ".getanalyticsautomationop", + "Rule": ".getanalyticsautomationop", + "RuleTypedDict": ".getanalyticsautomationop", + "GetAnalyticsChannelsChannel": ".getanalyticschannelsop", + "GetAnalyticsChannelsChannelTypedDict": ".getanalyticschannelsop", + "GetAnalyticsChannelsQueryParamRange": ".getanalyticschannelsop", + "GetAnalyticsChannelsRangeResponse": ".getanalyticschannelsop", + "GetAnalyticsChannelsRequest": ".getanalyticschannelsop", + "GetAnalyticsChannelsRequestTypedDict": ".getanalyticschannelsop", + "GetAnalyticsChannelsResponse": ".getanalyticschannelsop", + "GetAnalyticsChannelsResponseTypedDict": ".getanalyticschannelsop", + "GetAnalyticsPoliciesPolicy": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesPolicyTypedDict": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesQueryParamRange": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesRangeResponse": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesRequest": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesRequestTypedDict": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesResponse": ".getanalyticspoliciesop", + "GetAnalyticsPoliciesResponseTypedDict": ".getanalyticspoliciesop", + "FlagRateSpike": ".getanalyticssummaryop", + "FlagRateSpikeTypedDict": ".getanalyticssummaryop", + "GetAnalyticsSummaryQueryParamRange": ".getanalyticssummaryop", + "GetAnalyticsSummaryRangeResponse": ".getanalyticssummaryop", + "GetAnalyticsSummaryRequest": ".getanalyticssummaryop", + "GetAnalyticsSummaryRequestTypedDict": ".getanalyticssummaryop", + "GetAnalyticsSummaryResponse": ".getanalyticssummaryop", + "GetAnalyticsSummaryResponseTypedDict": ".getanalyticssummaryop", + "PreviousPeriod": ".getanalyticssummaryop", + "PreviousPeriodTypedDict": ".getanalyticssummaryop", + "Totals": ".getanalyticssummaryop", + "TotalsTypedDict": ".getanalyticssummaryop", + "Bucket": ".getanalyticsvolumesop", + "GetAnalyticsVolumesQueryParamRange": ".getanalyticsvolumesop", + "GetAnalyticsVolumesRangeResponse": ".getanalyticsvolumesop", + "GetAnalyticsVolumesRequest": ".getanalyticsvolumesop", + "GetAnalyticsVolumesRequestTypedDict": ".getanalyticsvolumesop", + "GetAnalyticsVolumesResponse": ".getanalyticsvolumesop", + "GetAnalyticsVolumesResponseTypedDict": ".getanalyticsvolumesop", + "Volume": ".getanalyticsvolumesop", + "VolumeTypedDict": ".getanalyticsvolumesop", "GetAuthorRequest": ".getauthorop", "GetAuthorRequestTypedDict": ".getauthorop", "GetChannelRequest": ".getchannelop", "GetChannelRequestTypedDict": ".getchannelop", "GetProjectRequest": ".getprojectop", "GetProjectRequestTypedDict": ".getprojectop", - "CasebookAgreement": ".getqueueop", - "CasebookAnswer": ".getqueueop", - "CheckStatus": ".getqueueop", - "Filter": ".getqueueop", - "FilterLabel": ".getqueueop", - "FilterLabelTypedDict": ".getqueueop", - "FilterTypedDict": ".getqueueop", - "GetQueueContentType": ".getqueueop", - "GetQueueQueue": ".getqueueop", - "GetQueueQueueTypedDict": ".getqueueop", - "GetQueueRecommendationAction": ".getqueueop", "GetQueueRequest": ".getqueueop", "GetQueueRequestTypedDict": ".getqueueop", "GetQueueResponse": ".getqueueop", "GetQueueResponseTypedDict": ".getqueueop", - "GetQueueType": ".getqueueop", - "IsFlagged": ".getqueueop", - "MediaType": ".getqueueop", - "MetadataFilter": ".getqueueop", - "MetadataFilterTypedDict": ".getqueueop", - "WithinUnit": ".getqueueop", - "ActionStat": ".getqueuestatsop", - "ActionStatTypedDict": ".getqueuestatsop", "DailyReviewCount": ".getqueuestatsop", "DailyReviewCountTypedDict": ".getqueuestatsop", - "FlaggedContentTrend": ".getqueuestatsop", - "FlaggedContentTrendTypedDict": ".getqueuestatsop", "GetQueueStatsRequest": ".getqueuestatsop", "GetQueueStatsRequestTypedDict": ".getqueuestatsop", "GetQueueStatsResponse": ".getqueuestatsop", "GetQueueStatsResponseTypedDict": ".getqueuestatsop", "ReviewStats": ".getqueuestatsop", "ReviewStatsTypedDict": ".getqueuestatsop", - "TopAction": ".getqueuestatsop", - "TopActionTypedDict": ".getqueuestatsop", "TopReviewer": ".getqueuestatsop", "TopReviewerTypedDict": ".getqueuestatsop", "Trends": ".getqueuestatsop", @@ -1317,8 +1566,8 @@ "ListAuthorsResponseBody": ".listauthorsop", "ListAuthorsResponseBodyTypedDict": ".listauthorsop", "ListAuthorsResponseTypedDict": ".listauthorsop", - "ListAuthorsSortDirection": ".listauthorsop", "SortBy": ".listauthorsop", + "SortDirection": ".listauthorsop", "ListChannelsRequest": ".listchannelsop", "ListChannelsRequestTypedDict": ".listchannelsop", "ListChannelsResponse": ".listchannelsop", @@ -1331,21 +1580,19 @@ "ListProjectsResponseBody": ".listprojectsop", "ListProjectsResponseBodyTypedDict": ".listprojectsop", "ListProjectsResponseTypedDict": ".listprojectsop", - "ListQueueItemsAction": ".listqueueitemsop", - "ListQueueItemsActionTypedDict": ".listqueueitemsop", - "ListQueueItemsData": ".listqueueitemsop", - "ListQueueItemsDataTypedDict": ".listqueueitemsop", - "ListQueueItemsLabel": ".listqueueitemsop", - "ListQueueItemsLabelTypedDict": ".listqueueitemsop", "ListQueueItemsRequest": ".listqueueitemsop", "ListQueueItemsRequestTypedDict": ".listqueueitemsop", "ListQueueItemsResponse": ".listqueueitemsop", "ListQueueItemsResponseBody": ".listqueueitemsop", "ListQueueItemsResponseBodyTypedDict": ".listqueueitemsop", "ListQueueItemsResponseTypedDict": ".listqueueitemsop", - "ListQueueItemsSortDirection": ".listqueueitemsop", - "ListQueueItemsStatus": ".listqueueitemsop", - "SortField": ".listqueueitemsop", + "Sort": ".listqueueitemsop", + "ListQueuesRequest": ".listqueuesop", + "ListQueuesRequestTypedDict": ".listqueuesop", + "ListQueuesResponse": ".listqueuesop", + "ListQueuesResponseBody": ".listqueuesop", + "ListQueuesResponseBodyTypedDict": ".listqueuesop", + "ListQueuesResponseTypedDict": ".listqueuesop", "ListWebhooksData": ".listwebhooksop", "ListWebhooksDataTypedDict": ".listwebhooksop", "ListWebhooksEventType": ".listwebhooksop", @@ -1371,6 +1618,8 @@ "Project": ".project", "ProjectGlobalFlaggingMode": ".project", "ProjectTypedDict": ".project", + "ProjectAPIKey": ".projectapikey", + "ProjectAPIKeyTypedDict": ".projectapikey", "ProjectWithKey": ".projectwithkey", "ProjectWithKeyGlobalFlaggingMode": ".projectwithkey", "ProjectWithKeyTypedDict": ".projectwithkey", @@ -1381,26 +1630,70 @@ "Metrics": ".publicauthor", "MetricsTypedDict": ".publicauthor", "PublicAuthor": ".publicauthor", + "PublicAuthorStatus": ".publicauthor", "PublicAuthorTypedDict": ".publicauthor", "RiskEvaluation": ".publicauthor", "RiskEvaluationTypedDict": ".publicauthor", - "Status": ".publicauthor", "TrustLevel": ".publicauthor", "TrustLevelTypedDict": ".publicauthor", + "Queue": ".queue", + "QueueTypedDict": ".queue", + "Label": ".queueitem", + "LabelTypedDict": ".queueitem", + "QueueItem": ".queueitem", + "QueueItemAudio": ".queueitem", + "QueueItemAudioTypedDict": ".queueitem", + "QueueItemBrandImpersonation": ".queueitem", + "QueueItemBrandImpersonationTypedDict": ".queueitem", + "QueueItemContent": ".queueitem", + "QueueItemContentLeaf": ".queueitem", + "QueueItemContentLeafTypedDict": ".queueitem", + "QueueItemContentTypedDict": ".queueitem", + "QueueItemDataAudio": ".queueitem", + "QueueItemDataAudioTypedDict": ".queueitem", + "QueueItemDataImage": ".queueitem", + "QueueItemDataImageTypedDict": ".queueitem", + "QueueItemDataText": ".queueitem", + "QueueItemDataTextTypedDict": ".queueitem", + "QueueItemDataVideo": ".queueitem", + "QueueItemDataVideoTypedDict": ".queueitem", + "QueueItemImage": ".queueitem", + "QueueItemImageTypedDict": ".queueitem", + "QueueItemMatch": ".queueitem", + "QueueItemMatchTypedDict": ".queueitem", + "QueueItemObject": ".queueitem", + "QueueItemObjectTypedDict": ".queueitem", + "QueueItemSignals": ".queueitem", + "QueueItemSignalsTypedDict": ".queueitem", + "QueueItemStatus": ".queueitem", + "QueueItemText": ".queueitem", + "QueueItemTextTypedDict": ".queueitem", + "QueueItemTypedDict": ".queueitem", + "QueueItemVideo": ".queueitem", + "QueueItemVideoTypedDict": ".queueitem", + "UnknownQueueItemContent": ".queueitem", + "UnknownQueueItemContentLeaf": ".queueitem", + "QueueWithCounts": ".queuewithcounts", + "QueueWithCountsTypedDict": ".queuewithcounts", "RateLimitErrorCode": ".ratelimiterror", "RemoveWordlistWordsRequest": ".removewordlistwordsop", "RemoveWordlistWordsRequestTypedDict": ".removewordlistwordsop", "RemoveWordlistWordsResponse": ".removewordlistwordsop", "RemoveWordlistWordsResponseTypedDict": ".removewordlistwordsop", "ResolveQueueItemRequest": ".resolvequeueitemop", - "ResolveQueueItemRequestBody": ".resolvequeueitemop", - "ResolveQueueItemRequestBodyTypedDict": ".resolvequeueitemop", "ResolveQueueItemRequestTypedDict": ".resolvequeueitemop", "ResolveQueueItemResponse": ".resolvequeueitemop", "ResolveQueueItemResponseTypedDict": ".resolvequeueitemop", + "ResolveQueueItemsRequest": ".resolvequeueitemsop", + "ResolveQueueItemsRequestBody": ".resolvequeueitemsop", + "ResolveQueueItemsRequestBodyTypedDict": ".resolvequeueitemsop", + "ResolveQueueItemsRequestTypedDict": ".resolvequeueitemsop", + "ResolveQueueItemsResponse": ".resolvequeueitemsop", + "ResolveQueueItemsResponseTypedDict": ".resolvequeueitemsop", "Security": ".security", "SecurityTypedDict": ".security", "ActionRequest": ".submitcontentop", + "ActionResponse": ".submitcontentop", "Adult": ".submitcontentop", "AdultTypedDict": ".submitcontentop", "Alcohol": ".submitcontentop", @@ -1409,9 +1702,7 @@ "AudioRequestTypedDict": ".submitcontentop", "AudioResponse": ".submitcontentop", "AudioResponseTypedDict": ".submitcontentop", - "Author": ".submitcontentop", "AuthorStatus": ".submitcontentop", - "AuthorTypedDict": ".submitcontentop", "Cannabis": ".submitcontentop", "CannabisTypedDict": ".submitcontentop", "Casebook": ".submitcontentop", @@ -1507,8 +1798,6 @@ "PersonalStoryInsightTypedDict": ".submitcontentop", "PolicyRequest": ".submitcontentop", "PolicyRequestTypedDict": ".submitcontentop", - "PolicyResponse": ".submitcontentop", - "PolicyResponseTypedDict": ".submitcontentop", "Political": ".submitcontentop", "PoliticalTypedDict": ".submitcontentop", "Profanity": ".submitcontentop", @@ -1544,6 +1833,8 @@ "SignalsResponseTypedDict": ".submitcontentop", "Spam": ".submitcontentop", "SpamTypedDict": ".submitcontentop", + "SubmitContentAuthor": ".submitcontentop", + "SubmitContentAuthorTypedDict": ".submitcontentop", "SubmitContentBehavior": ".submitcontentop", "SubmitContentBlock": ".submitcontentop", "SubmitContentBlockTypedDict": ".submitcontentop", @@ -1558,7 +1849,8 @@ "SubmitContentMetaType": ".submitcontentop", "SubmitContentObject": ".submitcontentop", "SubmitContentObjectTypedDict": ".submitcontentop", - "SubmitContentRecommendationAction": ".submitcontentop", + "SubmitContentPolicyResponse": ".submitcontentop", + "SubmitContentPolicyResponseTypedDict": ".submitcontentop", "SubmitContentRequest": ".submitcontentop", "SubmitContentRequestBody": ".submitcontentop", "SubmitContentRequestBodyTypedDict": ".submitcontentop", @@ -1587,7 +1879,7 @@ "UnicodeSpoofingTypedDict": ".submitcontentop", "UnknownContentLeafResponse": ".submitcontentop", "UnknownInsight": ".submitcontentop", - "UnknownPolicyResponse": ".submitcontentop", + "UnknownSubmitContentPolicyResponse": ".submitcontentop", "Value": ".submitcontentop", "Verdict": ".submitcontentop", "VideoRequest": ".submitcontentop", @@ -1599,11 +1891,10 @@ "Weapons": ".submitcontentop", "WeaponsTypedDict": ".submitcontentop", "UnresolveQueueItemRequest": ".unresolvequeueitemop", - "UnresolveQueueItemRequestBody": ".unresolvequeueitemop", - "UnresolveQueueItemRequestBodyTypedDict": ".unresolvequeueitemop", "UnresolveQueueItemRequestTypedDict": ".unresolvequeueitemop", "UnresolveQueueItemResponse": ".unresolvequeueitemop", "UnresolveQueueItemResponseTypedDict": ".unresolvequeueitemop", + "UnresolveQueueItemStatus": ".unresolvequeueitemop", "UpdateActionPositionRequest": ".updateactionop", "UpdateActionPositionResponse": ".updateactionop", "UpdateActionPossibleValueRequest": ".updateactionop", diff --git a/src/moderation_api/models/addwordlistwordsop.py b/src/moderation_api/models/addwordlistwordsop.py index d63e343..c98f888 100644 --- a/src/moderation_api/models/addwordlistwordsop.py +++ b/src/moderation_api/models/addwordlistwordsop.py @@ -29,7 +29,7 @@ class AddWordlistWordsRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class AddWordlistWordsRequest(BaseModel): @@ -48,7 +48,7 @@ class AddWordlistWordsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/badrequesterror.py b/src/moderation_api/models/badrequesterror.py index ebaa94c..67f2d33 100644 --- a/src/moderation_api/models/badrequesterror.py +++ b/src/moderation_api/models/badrequesterror.py @@ -9,6 +9,7 @@ Literal[ "invalid_request", "project_id_required", + "project_name_ambiguous", "validation_failed", ], UnrecognizedStr, @@ -16,6 +17,7 @@ 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. +- `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the key reaches more than one project. `message` lists the projects it reaches. +- `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead. - `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 c622ab3..d806580 100644 --- a/src/moderation_api/models/createactionop.py +++ b/src/moderation_api/models/createactionop.py @@ -167,7 +167,7 @@ def serialize_model(self, handler): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class CreateActionRequest(BaseModel): @@ -181,7 +181,7 @@ class CreateActionRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/createauthorop.py b/src/moderation_api/models/createauthorop.py index ef93ed7..87f7cd6 100644 --- a/src/moderation_api/models/createauthorop.py +++ b/src/moderation_api/models/createauthorop.py @@ -201,7 +201,7 @@ def serialize_model(self, handler): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class CreateAuthorRequest(BaseModel): @@ -215,7 +215,7 @@ class CreateAuthorRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/createfeedbackop.py b/src/moderation_api/models/createfeedbackop.py new file mode 100644 index 0000000..91d6196 --- /dev/null +++ b/src/moderation_api/models/createfeedbackop.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + RequestMetadata, + validate_const, +) +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +CreateFeedbackType = Literal[ + "feature_request", + "bug", + "other", +] +r"""The kind of feedback.""" + + +Source = Literal[ + "mcp", + "skill", + "cli", + "api", +] +r"""Where the feedback was written: MCP server, agent skill, CLI or API.""" + + +class CreateFeedbackRequestBodyTypedDict(TypedDict): + title: str + r"""A short summary of the request.""" + description: str + r"""What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs.""" + type: NotRequired[CreateFeedbackType] + r"""The kind of feedback.""" + source: NotRequired[Source] + r"""Where the feedback was written: MCP server, agent skill, CLI or API.""" + + +class CreateFeedbackRequestBody(BaseModel): + title: str + r"""A short summary of the request.""" + + description: str + r"""What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs.""" + + type: Optional[CreateFeedbackType] = "feature_request" + r"""The kind of feedback.""" + + source: Optional[Source] = "api" + r"""Where the feedback was written: MCP server, agent skill, CLI or API.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "source"]) + 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 CreateFeedbackRequestTypedDict(TypedDict): + body: CreateFeedbackRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class CreateFeedbackRequest(BaseModel): + body: Annotated[ + CreateFeedbackRequestBody, + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 CreateFeedbackResponseTypedDict(TypedDict): + r"""Feedback received""" + + id: str + r"""ID of the feedback.""" + status: Literal["received"] + r"""The team received the feedback.""" + + +class CreateFeedbackResponse(BaseModel): + r"""Feedback received""" + + id: str + r"""ID of the feedback.""" + + status: Annotated[ + Annotated[Literal["received"], AfterValidator(validate_const("received"))], + pydantic.Field(alias="status"), + ] = "received" + r"""The team received the feedback.""" + + +try: + CreateFeedbackResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/createprojectapikeyop.py b/src/moderation_api/models/createprojectapikeyop.py new file mode 100644 index 0000000..7ef8a18 --- /dev/null +++ b/src/moderation_api/models/createprojectapikeyop.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateProjectAPIKeyRequestBodyTypedDict(TypedDict): + name: NotRequired[str] + r"""A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer.""" + + +class CreateProjectAPIKeyRequestBody(BaseModel): + name: Optional[str] = "API key" + r"""A name for the key, shown on the API keys page of the dashboard. Name it after where the key is used, for example the app or the computer.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name"]) + 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 CreateProjectAPIKeyRequestTypedDict(TypedDict): + id: str + r"""The ID of the project.""" + body: CreateProjectAPIKeyRequestBodyTypedDict + + +class CreateProjectAPIKeyRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the project.""" + + body: Annotated[ + CreateProjectAPIKeyRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/moderation_api/models/createwebhookop.py b/src/moderation_api/models/createwebhookop.py index f8910db..b168f52 100644 --- a/src/moderation_api/models/createwebhookop.py +++ b/src/moderation_api/models/createwebhookop.py @@ -86,7 +86,7 @@ def serialize_model(self, handler): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class CreateWebhookRequest(BaseModel): @@ -100,7 +100,7 @@ class CreateWebhookRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/createwordlistop.py b/src/moderation_api/models/createwordlistop.py new file mode 100644 index 0000000..f31ffb7 --- /dev/null +++ b/src/moderation_api/models/createwordlistop.py @@ -0,0 +1,146 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, 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 CreateWordlistRequestBodyTypedDict(TypedDict): + name: str + r"""Name of the wordlist""" + key: NotRequired[str] + r"""Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added.""" + description: NotRequired[str] + r"""Description of the wordlist""" + words: NotRequired[List[str]] + r"""Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.""" + + +class CreateWordlistRequestBody(BaseModel): + name: str + r"""Name of the wordlist""" + + key: Optional[str] = None + r"""Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added.""" + + description: Optional[str] = None + r"""Description of the wordlist""" + + words: Optional[List[str]] = None + r"""Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["key", "description", "words"]) + 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 CreateWordlistRequestTypedDict(TypedDict): + body: CreateWordlistRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class CreateWordlistRequest(BaseModel): + body: Annotated[ + CreateWordlistRequestBody, + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 CreateWordlistResponseTypedDict(TypedDict): + r"""Wordlist created successfully""" + + id: str + r"""ID of the wordlist""" + name: Nullable[str] + words: List[str] + r"""Words in the wordlist""" + created_at: str + r"""Creation date of the wordlist""" + organization_id: str + r"""ID of the organization""" + user_id: Nullable[str] + strict: bool + r"""Strict mode""" + + +class CreateWordlistResponse(BaseModel): + r"""Wordlist created successfully""" + + id: str + r"""ID of the wordlist""" + + name: Nullable[str] + + words: List[str] + r"""Words in the wordlist""" + + created_at: Annotated[str, pydantic.Field(alias="createdAt")] + r"""Creation date of the wordlist""" + + organization_id: Annotated[str, pydantic.Field(alias="organizationId")] + r"""ID of the organization""" + + user_id: Annotated[Nullable[str], pydantic.Field(alias="userId")] + + strict: bool + r"""Strict mode""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + CreateWordlistResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/deleteactionop.py b/src/moderation_api/models/deleteactionop.py index 4d66a08..487068d 100644 --- a/src/moderation_api/models/deleteactionop.py +++ b/src/moderation_api/models/deleteactionop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class DeleteActionRequest(BaseModel): @@ -27,7 +27,7 @@ class DeleteActionRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/deleteauthorop.py b/src/moderation_api/models/deleteauthorop.py index 801be30..b8e542e 100644 --- a/src/moderation_api/models/deleteauthorop.py +++ b/src/moderation_api/models/deleteauthorop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class DeleteAuthorRequest(BaseModel): @@ -27,7 +27,7 @@ class DeleteAuthorRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/deletewebhookop.py b/src/moderation_api/models/deletewebhookop.py index ee1073c..38c462b 100644 --- a/src/moderation_api/models/deletewebhookop.py +++ b/src/moderation_api/models/deletewebhookop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class DeleteWebhookRequest(BaseModel): @@ -27,7 +27,7 @@ class DeleteWebhookRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/executeactionop.py b/src/moderation_api/models/executeactionop.py index 868b983..feab8d3 100644 --- a/src/moderation_api/models/executeactionop.py +++ b/src/moderation_api/models/executeactionop.py @@ -71,7 +71,7 @@ def serialize_model(self, handler): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ExecuteActionRequest(BaseModel): @@ -85,7 +85,7 @@ class ExecuteActionRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getaccountop.py b/src/moderation_api/models/getaccountop.py index 921d3b1..6d04fc0 100644 --- a/src/moderation_api/models/getaccountop.py +++ b/src/moderation_api/models/getaccountop.py @@ -11,7 +11,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetAccountRequest(BaseModel): @@ -20,7 +20,7 @@ class GetAccountRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getactionop.py b/src/moderation_api/models/getactionop.py index d89cd51..c052cd5 100644 --- a/src/moderation_api/models/getactionop.py +++ b/src/moderation_api/models/getactionop.py @@ -20,7 +20,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetActionRequest(BaseModel): @@ -34,7 +34,7 @@ class GetActionRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getanalyticsauthorsop.py b/src/moderation_api/models/getanalyticsauthorsop.py new file mode 100644 index 0000000..0d4f799 --- /dev/null +++ b/src/moderation_api/models/getanalyticsauthorsop.py @@ -0,0 +1,162 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsAuthorsQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsAuthorsRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsAuthorsQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + channel: NotRequired[str] + limit: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsAuthorsRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsAuthorsQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + channel: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 6 + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "channel", "limit", "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 + + +GetAnalyticsAuthorsRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +class GetAnalyticsAuthorsAuthorTypedDict(TypedDict): + author_id: str + r"""The author ID from your system. Use it with the authors endpoints.""" + name: Nullable[str] + r"""The author name, if known.""" + flagged: int + r"""Flagged requests from this author in the window.""" + + +class GetAnalyticsAuthorsAuthor(BaseModel): + author_id: Annotated[str, pydantic.Field(alias="authorId")] + r"""The author ID from your system. Use it with the authors endpoints.""" + + name: Nullable[str] + r"""The author name, if known.""" + + flagged: int + r"""Flagged requests from this author in the window.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +class GetAnalyticsAuthorsResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsAuthorsRangeResponse + r"""The time window of the numbers.""" + channel_id: Nullable[str] + r"""The channel the numbers are for. Null when they are for all channels.""" + authors: List[GetAnalyticsAuthorsAuthorTypedDict] + r"""The authors with the most flagged requests, largest first. Requests without an author are not included.""" + + +class GetAnalyticsAuthorsResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsAuthorsRangeResponse + r"""The time window of the numbers.""" + + channel_id: Annotated[Nullable[str], pydantic.Field(alias="channelId")] + r"""The channel the numbers are for. Null when they are for all channels.""" + + authors: List[GetAnalyticsAuthorsAuthor] + r"""The authors with the most flagged requests, largest first. Requests without an author are not included.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + GetAnalyticsAuthorsAuthor.model_rebuild() +except NameError: + pass +try: + GetAnalyticsAuthorsResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getanalyticsautomationop.py b/src/moderation_api/models/getanalyticsautomationop.py new file mode 100644 index 0000000..81bf2dd --- /dev/null +++ b/src/moderation_api/models/getanalyticsautomationop.py @@ -0,0 +1,188 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsAutomationQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsAutomationRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsAutomationQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + channel: NotRequired[str] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsAutomationRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsAutomationQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + channel: Annotated[ + Optional[str], + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "channel", "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 + + +GetAnalyticsAutomationRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +class RuleTypedDict(TypedDict): + name: str + r"""The rule name. \"Other rules\" holds all rules after the largest ones.""" + count: int + r"""Flagged requests that this rule settled.""" + + +class Rule(BaseModel): + name: str + r"""The rule name. \"Other rules\" holds all rules after the largest ones.""" + + count: int + r"""Flagged requests that this rule settled.""" + + +class GetAnalyticsAutomationResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsAutomationRangeResponse + r"""The time window of the numbers.""" + channel_id: Nullable[str] + r"""The channel the numbers are for. Null when they are for all channels.""" + flagged: int + r"""Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary.""" + handled_by_rules: int + r"""Flagged requests that a rule allowed or rejected without human review.""" + handled_by_casebook: int + r"""Flagged requests that the casebook settled without human review.""" + sent_to_review: int + r"""Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue.""" + merged_duplicates: int + r"""Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later.""" + automation_rate: Nullable[float] + reviews_allowed: int + r"""Review queue items from this window that a moderator allowed.""" + reviews_rejected: int + r"""Review queue items from this window that a moderator rejected.""" + reviews_resolved_without_decision: int + r"""Review queue items from this window that a moderator marked as done without allow or reject.""" + reviews_unresolved: int + r"""Review queue items from this window that are still open.""" + casebook_overrulings: int + r"""Requests where the casebook decision was different from the decision based on severity.""" + rules: List[RuleTypedDict] + r"""The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules.""" + + +class GetAnalyticsAutomationResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsAutomationRangeResponse + r"""The time window of the numbers.""" + + channel_id: Annotated[Nullable[str], pydantic.Field(alias="channelId")] + r"""The channel the numbers are for. Null when they are for all channels.""" + + flagged: int + r"""Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary.""" + + handled_by_rules: Annotated[int, pydantic.Field(alias="handledByRules")] + r"""Flagged requests that a rule allowed or rejected without human review.""" + + handled_by_casebook: Annotated[int, pydantic.Field(alias="handledByCasebook")] + r"""Flagged requests that the casebook settled without human review.""" + + sent_to_review: Annotated[int, pydantic.Field(alias="sentToReview")] + r"""Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue.""" + + merged_duplicates: Annotated[int, pydantic.Field(alias="mergedDuplicates")] + r"""Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later.""" + + automation_rate: Annotated[Nullable[float], pydantic.Field(alias="automationRate")] + + reviews_allowed: Annotated[int, pydantic.Field(alias="reviewsAllowed")] + r"""Review queue items from this window that a moderator allowed.""" + + reviews_rejected: Annotated[int, pydantic.Field(alias="reviewsRejected")] + r"""Review queue items from this window that a moderator rejected.""" + + reviews_resolved_without_decision: Annotated[ + int, pydantic.Field(alias="reviewsResolvedWithoutDecision") + ] + r"""Review queue items from this window that a moderator marked as done without allow or reject.""" + + reviews_unresolved: Annotated[int, pydantic.Field(alias="reviewsUnresolved")] + r"""Review queue items from this window that are still open.""" + + casebook_overrulings: Annotated[int, pydantic.Field(alias="casebookOverrulings")] + r"""Requests where the casebook decision was different from the decision based on severity.""" + + rules: List[Rule] + r"""The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + GetAnalyticsAutomationResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getanalyticschannelsop.py b/src/moderation_api/models/getanalyticschannelsop.py new file mode 100644 index 0000000..8cac272 --- /dev/null +++ b/src/moderation_api/models/getanalyticschannelsop.py @@ -0,0 +1,123 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsChannelsQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsChannelsRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsChannelsQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsChannelsRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsChannelsQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "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 + + +GetAnalyticsChannelsRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +class GetAnalyticsChannelsChannelTypedDict(TypedDict): + id: str + r"""The channel ID.""" + name: str + r"""The channel name.""" + requests: int + r"""Requests received in this channel.""" + flagged: int + r"""Requests flagged in this channel.""" + flag_rate: float + r"""The share of requests in this channel that were flagged: flagged / requests.""" + + +class GetAnalyticsChannelsChannel(BaseModel): + id: str + r"""The channel ID.""" + + name: str + r"""The channel name.""" + + requests: int + r"""Requests received in this channel.""" + + flagged: int + r"""Requests flagged in this channel.""" + + flag_rate: Annotated[float, pydantic.Field(alias="flagRate")] + r"""The share of requests in this channel that were flagged: flagged / requests.""" + + +class GetAnalyticsChannelsResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsChannelsRangeResponse + r"""The time window of the numbers.""" + channels: List[GetAnalyticsChannelsChannelTypedDict] + r"""Requests and flags per channel. Channels with no requests in the window are not included.""" + + +class GetAnalyticsChannelsResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsChannelsRangeResponse + r"""The time window of the numbers.""" + + channels: List[GetAnalyticsChannelsChannel] + r"""Requests and flags per channel. Channels with no requests in the window are not included.""" + + +try: + GetAnalyticsChannelsChannel.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getanalyticspoliciesop.py b/src/moderation_api/models/getanalyticspoliciesop.py new file mode 100644 index 0000000..4d82c93 --- /dev/null +++ b/src/moderation_api/models/getanalyticspoliciesop.py @@ -0,0 +1,148 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsPoliciesQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsPoliciesRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsPoliciesQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + channel: NotRequired[str] + limit: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsPoliciesRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsPoliciesQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + channel: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 8 + + project_id: Annotated[ + Optional[str], + pydantic.Field(alias="Project-Id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "channel", "limit", "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 + + +GetAnalyticsPoliciesRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +class GetAnalyticsPoliciesPolicyTypedDict(TypedDict): + label: str + r"""The policy label, for example `toxicity`.""" + flagged: int + r"""Flagged requests with this label in the window. Repeats count each time.""" + previous_flagged: int + r"""Flagged requests with this label in the window of equal length before.""" + + +class GetAnalyticsPoliciesPolicy(BaseModel): + label: str + r"""The policy label, for example `toxicity`.""" + + flagged: int + r"""Flagged requests with this label in the window. Repeats count each time.""" + + previous_flagged: Annotated[int, pydantic.Field(alias="previousFlagged")] + r"""Flagged requests with this label in the window of equal length before.""" + + +class GetAnalyticsPoliciesResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsPoliciesRangeResponse + r"""The time window of the numbers.""" + channel_id: Nullable[str] + r"""The channel the numbers are for. Null when they are for all channels.""" + policies: List[GetAnalyticsPoliciesPolicyTypedDict] + r"""The policy labels with the most flagged requests, largest first.""" + + +class GetAnalyticsPoliciesResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsPoliciesRangeResponse + r"""The time window of the numbers.""" + + channel_id: Annotated[Nullable[str], pydantic.Field(alias="channelId")] + r"""The channel the numbers are for. Null when they are for all channels.""" + + policies: List[GetAnalyticsPoliciesPolicy] + r"""The policy labels with the most flagged requests, largest first.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + GetAnalyticsPoliciesPolicy.model_rebuild() +except NameError: + pass +try: + GetAnalyticsPoliciesResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getanalyticssummaryop.py b/src/moderation_api/models/getanalyticssummaryop.py new file mode 100644 index 0000000..b60c683 --- /dev/null +++ b/src/moderation_api/models/getanalyticssummaryop.py @@ -0,0 +1,280 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsSummaryQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsSummaryRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsSummaryQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + channel: NotRequired[str] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsSummaryRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsSummaryQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + channel: Annotated[ + Optional[str], + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "channel", "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 + + +GetAnalyticsSummaryRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +class TotalsTypedDict(TypedDict): + r"""Request counts for the window. A flagged request has one recommendation: allow, reject or review.""" + + requests: int + r"""Requests received. Every request counts, also repeats and edits of the same content.""" + flagged: int + r"""Requests that were flagged.""" + flag_rate: float + r"""The share of requests that were flagged: flagged / requests. 0 when there were no requests.""" + allowed: int + r"""Requests with the recommendation \"allow\". Includes content that was not flagged.""" + rejected: int + r"""Requests with the recommendation \"reject\". All of them were flagged.""" + sent_to_review: int + r"""Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue.""" + handled_automatically: int + r"""Flagged requests that were settled without human review: rejected plus flaggedButAllowed.""" + flagged_but_allowed: int + r"""Flagged requests that were allowed without human review.""" + distinct_authors: int + r"""Distinct authors that sent content in the window. Approximate.""" + + +class Totals(BaseModel): + r"""Request counts for the window. A flagged request has one recommendation: allow, reject or review.""" + + requests: int + r"""Requests received. Every request counts, also repeats and edits of the same content.""" + + flagged: int + r"""Requests that were flagged.""" + + flag_rate: Annotated[float, pydantic.Field(alias="flagRate")] + r"""The share of requests that were flagged: flagged / requests. 0 when there were no requests.""" + + allowed: int + r"""Requests with the recommendation \"allow\". Includes content that was not flagged.""" + + rejected: int + r"""Requests with the recommendation \"reject\". All of them were flagged.""" + + sent_to_review: Annotated[int, pydantic.Field(alias="sentToReview")] + r"""Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue.""" + + handled_automatically: Annotated[int, pydantic.Field(alias="handledAutomatically")] + r"""Flagged requests that were settled without human review: rejected plus flaggedButAllowed.""" + + flagged_but_allowed: Annotated[int, pydantic.Field(alias="flaggedButAllowed")] + r"""Flagged requests that were allowed without human review.""" + + distinct_authors: Annotated[int, pydantic.Field(alias="distinctAuthors")] + r"""Distinct authors that sent content in the window. Approximate.""" + + +class PreviousPeriodTypedDict(TypedDict): + r"""The same counts for the window of equal length just before this one. Compare with `totals` to see the trend.""" + + requests: int + r"""Requests received. Every request counts, also repeats and edits of the same content.""" + flagged: int + r"""Requests that were flagged.""" + flag_rate: float + r"""The share of requests that were flagged: flagged / requests. 0 when there were no requests.""" + allowed: int + r"""Requests with the recommendation \"allow\". Includes content that was not flagged.""" + rejected: int + r"""Requests with the recommendation \"reject\". All of them were flagged.""" + sent_to_review: int + r"""Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue.""" + handled_automatically: int + r"""Flagged requests that were settled without human review: rejected plus flaggedButAllowed.""" + flagged_but_allowed: int + r"""Flagged requests that were allowed without human review.""" + + +class PreviousPeriod(BaseModel): + r"""The same counts for the window of equal length just before this one. Compare with `totals` to see the trend.""" + + requests: int + r"""Requests received. Every request counts, also repeats and edits of the same content.""" + + flagged: int + r"""Requests that were flagged.""" + + flag_rate: Annotated[float, pydantic.Field(alias="flagRate")] + r"""The share of requests that were flagged: flagged / requests. 0 when there were no requests.""" + + allowed: int + r"""Requests with the recommendation \"allow\". Includes content that was not flagged.""" + + rejected: int + r"""Requests with the recommendation \"reject\". All of them were flagged.""" + + sent_to_review: Annotated[int, pydantic.Field(alias="sentToReview")] + r"""Requests with the recommendation \"review\". This counts requests, not the deduplicated items in the review queue.""" + + handled_automatically: Annotated[int, pydantic.Field(alias="handledAutomatically")] + r"""Flagged requests that were settled without human review: rejected plus flaggedButAllowed.""" + + flagged_but_allowed: Annotated[int, pydantic.Field(alias="flaggedButAllowed")] + r"""Flagged requests that were allowed without human review.""" + + +class FlagRateSpikeTypedDict(TypedDict): + multiple: float + r"""How many times higher the recent flag rate is than the baseline, for example 2.4.""" + recent_flag_rate: float + r"""The flag rate in the last 2 days.""" + baseline_flag_rate: float + r"""The flag rate in the 30 days before that.""" + recent_flagged: int + r"""Flagged requests in the last 2 days.""" + recent_requests: int + r"""Requests in the last 2 days.""" + + +class FlagRateSpike(BaseModel): + multiple: float + r"""How many times higher the recent flag rate is than the baseline, for example 2.4.""" + + recent_flag_rate: Annotated[float, pydantic.Field(alias="recentFlagRate")] + r"""The flag rate in the last 2 days.""" + + baseline_flag_rate: Annotated[float, pydantic.Field(alias="baselineFlagRate")] + r"""The flag rate in the 30 days before that.""" + + recent_flagged: Annotated[int, pydantic.Field(alias="recentFlagged")] + r"""Flagged requests in the last 2 days.""" + + recent_requests: Annotated[int, pydantic.Field(alias="recentRequests")] + r"""Requests in the last 2 days.""" + + +class GetAnalyticsSummaryResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsSummaryRangeResponse + r"""The time window of the numbers.""" + channel_id: Nullable[str] + r"""The channel the numbers are for. Null when they are for all channels.""" + totals: TotalsTypedDict + r"""Request counts for the window. A flagged request has one recommendation: allow, reject or review.""" + previous_period: PreviousPeriodTypedDict + r"""The same counts for the window of equal length just before this one. Compare with `totals` to see the trend.""" + pending_review: int + r"""Items in the default review queue that nobody has reviewed yet, counted as the queue counts them (repeats count once). The queue looks back 30 days, so older items are not included. The range does not change it.""" + flag_rate_spike: Nullable[FlagRateSpikeTypedDict] + r"""Set when the flag rate of the last 2 days is at least 2 times the rate of the 30 days before, with at least 50 flagged requests. Null when there is no spike. Always for the full project: the range and channel do not change it.""" + + +class GetAnalyticsSummaryResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsSummaryRangeResponse + r"""The time window of the numbers.""" + + channel_id: Annotated[Nullable[str], pydantic.Field(alias="channelId")] + r"""The channel the numbers are for. Null when they are for all channels.""" + + totals: Totals + r"""Request counts for the window. A flagged request has one recommendation: allow, reject or review.""" + + previous_period: Annotated[PreviousPeriod, pydantic.Field(alias="previousPeriod")] + r"""The same counts for the window of equal length just before this one. Compare with `totals` to see the trend.""" + + pending_review: Annotated[int, pydantic.Field(alias="pendingReview")] + r"""Items in the default review queue that nobody has reviewed yet, counted as the queue counts them (repeats count once). The queue looks back 30 days, so older items are not included. The range does not change it.""" + + flag_rate_spike: Annotated[ + Nullable[FlagRateSpike], pydantic.Field(alias="flagRateSpike") + ] + r"""Set when the flag rate of the last 2 days is at least 2 times the rate of the 30 days before, with at least 50 flagged requests. Null when there is no spike. Always for the full project: the range and channel do not change it.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + Totals.model_rebuild() +except NameError: + pass +try: + PreviousPeriod.model_rebuild() +except NameError: + pass +try: + FlagRateSpike.model_rebuild() +except NameError: + pass +try: + GetAnalyticsSummaryResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getanalyticsvolumesop.py b/src/moderation_api/models/getanalyticsvolumesop.py new file mode 100644 index 0000000..76aacb8 --- /dev/null +++ b/src/moderation_api/models/getanalyticsvolumesop.py @@ -0,0 +1,167 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +GetAnalyticsVolumesQueryParamRange = Literal[ + "24h", + "7d", + "30d", + "90d", +] +r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + +class GetAnalyticsVolumesRequestTypedDict(TypedDict): + range: NotRequired[GetAnalyticsVolumesQueryParamRange] + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + channel: NotRequired[str] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class GetAnalyticsVolumesRequest(BaseModel): + range: Annotated[ + Optional[GetAnalyticsVolumesQueryParamRange], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "30d" + r"""The time window. `24h` is the last 24 hours, in hourly buckets. `7d`, `30d` and `90d` are whole UTC days that end with today, in daily buckets.""" + + channel: Annotated[ + Optional[str], + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["range", "channel", "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 + + +GetAnalyticsVolumesRangeResponse = Union[ + Literal[ + "24h", + "7d", + "30d", + "90d", + ], + UnrecognizedStr, +] +r"""The time window of the numbers.""" + + +Bucket = Union[ + Literal[ + "hour", + "day", + ], + UnrecognizedStr, +] +r"""The size of each entry in `volumes`.""" + + +class VolumeTypedDict(TypedDict): + start: str + r"""Start of the bucket, as an ISO 8601 timestamp in UTC.""" + requests: int + r"""Requests received in the bucket.""" + flagged: int + r"""Requests flagged in the bucket.""" + rejected: int + r"""Requests with the recommendation \"reject\" in the bucket.""" + sent_to_review: int + r"""Requests with the recommendation \"review\" in the bucket.""" + + +class Volume(BaseModel): + start: str + r"""Start of the bucket, as an ISO 8601 timestamp in UTC.""" + + requests: int + r"""Requests received in the bucket.""" + + flagged: int + r"""Requests flagged in the bucket.""" + + rejected: int + r"""Requests with the recommendation \"reject\" in the bucket.""" + + sent_to_review: Annotated[int, pydantic.Field(alias="sentToReview")] + r"""Requests with the recommendation \"review\" in the bucket.""" + + +class GetAnalyticsVolumesResponseTypedDict(TypedDict): + r"""Successful response""" + + range: GetAnalyticsVolumesRangeResponse + r"""The time window of the numbers.""" + channel_id: Nullable[str] + r"""The channel the numbers are for. Null when they are for all channels.""" + bucket: Bucket + r"""The size of each entry in `volumes`.""" + volumes: List[VolumeTypedDict] + r"""Counts over time, oldest first. Buckets with no requests are included with zeros.""" + + +class GetAnalyticsVolumesResponse(BaseModel): + r"""Successful response""" + + range: GetAnalyticsVolumesRangeResponse + r"""The time window of the numbers.""" + + channel_id: Annotated[Nullable[str], pydantic.Field(alias="channelId")] + r"""The channel the numbers are for. Null when they are for all channels.""" + + bucket: Bucket + r"""The size of each entry in `volumes`.""" + + volumes: List[Volume] + r"""Counts over time, oldest first. Buckets with no requests are included with zeros.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + Volume.model_rebuild() +except NameError: + pass +try: + GetAnalyticsVolumesResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/getauthorop.py b/src/moderation_api/models/getauthorop.py index e3f0abf..6055831 100644 --- a/src/moderation_api/models/getauthorop.py +++ b/src/moderation_api/models/getauthorop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetAuthorRequest(BaseModel): @@ -27,7 +27,7 @@ class GetAuthorRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getqueueop.py b/src/moderation_api/models/getqueueop.py index a1461f0..508608a 100644 --- a/src/moderation_api/models/getqueueop.py +++ b/src/moderation_api/models/getqueueop.py @@ -1,40 +1,34 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, - UnrecognizedStr, -) +from .queuewithcounts import QueueWithCounts, QueueWithCountsTypedDict +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 List, Literal, Optional, Union +from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict class GetQueueRequestTypedDict(TypedDict): id: str - r"""The queue ID""" + 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetQueueRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The queue ID""" + 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -53,378 +47,13 @@ def serialize_model(self, handler): return m -IsFlagged = Union[ - Literal[ - "ALL", - "FLAGGED", - "NOT_FLAGGED", - "SHADOW_FLAGGED", - ], - UnrecognizedStr, -] - - -CasebookAnswer = Union[ - Literal[ - "ALL", - "ALLOWED", - "REJECTED", - "NO_ANSWER", - ], - UnrecognizedStr, -] - - -CasebookAgreement = Union[ - Literal[ - "ALL", - "OVERRULED", - "AGREED", - ], - UnrecognizedStr, -] - - -GetQueueType = Union[ - Literal[ - "FLAGGED", - "NOT_FLAGGED", - "THRESHOLDS", - "MATCHED", - ], - UnrecognizedStr, -] - - -class FilterLabelTypedDict(TypedDict): - label: str - type: GetQueueType - min_threshold: NotRequired[Nullable[float]] - max_threshold: NotRequired[Nullable[float]] - - -class FilterLabel(BaseModel): - label: str - - type: GetQueueType - - min_threshold: Annotated[ - OptionalNullable[float], pydantic.Field(alias="minThreshold") - ] = UNSET - - max_threshold: Annotated[ - OptionalNullable[float], pydantic.Field(alias="maxThreshold") - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["minThreshold", "maxThreshold"]) - nullable_fields = set(["minThreshold", "maxThreshold"]) - 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)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -class MetadataFilterTypedDict(TypedDict): - key: str - value: str - - -class MetadataFilter(BaseModel): - key: str - - value: str - - -GetQueueContentType = Union[ - Literal[ - "profile", - "message", - "post", - "comment", - "event", - "product", - "review", - "voice", - "other", - ], - UnrecognizedStr, -] - - -MediaType = Union[ - Literal[ - "text", - "image", - "video", - "object", - "audio", - ], - UnrecognizedStr, -] - - -GetQueueRecommendationAction = Union[ - Literal[ - "review", - "allow", - "reject", - ], - UnrecognizedStr, -] - - -WithinUnit = Union[ - Literal[ - "MINUTES", - "HOURS", - "DAYS", - "WEEKS", - "MONTHS", - "YEARS", - ], - UnrecognizedStr, -] - - -CheckStatus = Union[ - Literal[ - "all", - "checked", - "unchecked", - ], - UnrecognizedStr, -] - - -class FilterTypedDict(TypedDict): - is_flagged: NotRequired[IsFlagged] - casebook_answer: NotRequired[CasebookAnswer] - casebook_agreement: NotRequired[CasebookAgreement] - labels: NotRequired[List[str]] - filter_labels: NotRequired[List[FilterLabelTypedDict]] - metadata_filters: NotRequired[List[MetadataFilterTypedDict]] - filtered_channel_ids: NotRequired[List[str]] - filtered_action_ids: NotRequired[List[str]] - languages: NotRequired[List[str]] - content_types: NotRequired[List[GetQueueContentType]] - media_types: NotRequired[List[MediaType]] - author_trust_levels: NotRequired[List[int]] - recommendation_actions: NotRequired[List[GetQueueRecommendationAction]] - min_severity: NotRequired[int] - max_severity: NotRequired[int] - after_date: NotRequired[str] - before_date: NotRequired[str] - within: NotRequired[float] - within_unit: NotRequired[WithinUnit] - clear_date_window: NotRequired[bool] - check_status: NotRequired[Nullable[CheckStatus]] - author_id: NotRequired[str] - content_id: NotRequired[str] - conversation_ids: NotRequired[List[Nullable[str]]] - search: NotRequired[List[str]] - - -class Filter(BaseModel): - is_flagged: Annotated[Optional[IsFlagged], pydantic.Field(alias="isFlagged")] = None - - casebook_answer: Annotated[ - Optional[CasebookAnswer], pydantic.Field(alias="casebookAnswer") - ] = None - - casebook_agreement: Annotated[ - Optional[CasebookAgreement], pydantic.Field(alias="casebookAgreement") - ] = None - - labels: Optional[List[str]] = None - - filter_labels: Annotated[ - Optional[List[FilterLabel]], pydantic.Field(alias="filterLabels") - ] = None - - metadata_filters: Annotated[ - Optional[List[MetadataFilter]], pydantic.Field(alias="metadataFilters") - ] = None - - filtered_channel_ids: Annotated[ - Optional[List[str]], pydantic.Field(alias="filteredChannelIds") - ] = None - - filtered_action_ids: Annotated[ - Optional[List[str]], pydantic.Field(alias="filteredActionIds") - ] = None - - languages: Optional[List[str]] = None - - content_types: Annotated[ - Optional[List[GetQueueContentType]], pydantic.Field(alias="contentTypes") - ] = None - - media_types: Annotated[ - Optional[List[MediaType]], pydantic.Field(alias="mediaTypes") - ] = None - - author_trust_levels: Annotated[ - Optional[List[int]], pydantic.Field(alias="authorTrustLevels") - ] = None - - recommendation_actions: Annotated[ - Optional[List[GetQueueRecommendationAction]], - pydantic.Field(alias="recommendationActions"), - ] = None - - min_severity: Annotated[Optional[int], pydantic.Field(alias="minSeverity")] = None - - max_severity: Annotated[Optional[int], pydantic.Field(alias="maxSeverity")] = None - - after_date: Annotated[Optional[str], pydantic.Field(alias="afterDate")] = None - - before_date: Annotated[Optional[str], pydantic.Field(alias="beforeDate")] = None - - within: Optional[float] = None - - within_unit: Annotated[Optional[WithinUnit], pydantic.Field(alias="withinUnit")] = ( - None - ) - - clear_date_window: Annotated[ - Optional[bool], pydantic.Field(alias="clearDateWindow") - ] = None - - check_status: Annotated[ - OptionalNullable[CheckStatus], pydantic.Field(alias="checkStatus") - ] = UNSET - - author_id: Annotated[Optional[str], pydantic.Field(alias="authorID")] = None - - content_id: Annotated[Optional[str], pydantic.Field(alias="contentID")] = None - - conversation_ids: Annotated[ - Optional[List[Nullable[str]]], pydantic.Field(alias="conversationIds") - ] = None - - search: Optional[List[str]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "isFlagged", - "casebookAnswer", - "casebookAgreement", - "labels", - "filterLabels", - "metadataFilters", - "filteredChannelIds", - "filteredActionIds", - "languages", - "contentTypes", - "mediaTypes", - "authorTrustLevels", - "recommendationActions", - "minSeverity", - "maxSeverity", - "afterDate", - "beforeDate", - "within", - "withinUnit", - "clearDateWindow", - "checkStatus", - "authorID", - "contentID", - "conversationIds", - "search", - ] - ) - nullable_fields = set(["checkStatus"]) - 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)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m - - -class GetQueueQueueTypedDict(TypedDict): - id: str - name: str - description: str - filter_: FilterTypedDict - unresolved_items_count: float - resolved_items_count: float - total_items_count: float - - -class GetQueueQueue(BaseModel): - id: str - - name: str - - description: str - - filter_: Annotated[Filter, pydantic.Field(alias="filter")] - - unresolved_items_count: Annotated[ - float, pydantic.Field(alias="unresolvedItemsCount") - ] - - resolved_items_count: Annotated[float, pydantic.Field(alias="resolvedItemsCount")] - - total_items_count: Annotated[float, pydantic.Field(alias="totalItemsCount")] - - class GetQueueResponseTypedDict(TypedDict): r"""Successful response""" - queue: GetQueueQueueTypedDict + queue: QueueWithCountsTypedDict class GetQueueResponse(BaseModel): r"""Successful response""" - queue: GetQueueQueue - - -try: - FilterLabel.model_rebuild() -except NameError: - pass -try: - Filter.model_rebuild() -except NameError: - pass -try: - GetQueueQueue.model_rebuild() -except NameError: - pass + queue: QueueWithCounts diff --git a/src/moderation_api/models/getqueuestatsop.py b/src/moderation_api/models/getqueuestatsop.py index 9c28e90..e313a28 100644 --- a/src/moderation_api/models/getqueuestatsop.py +++ b/src/moderation_api/models/getqueuestatsop.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL from moderation_api.utils import ( FieldMetadata, HeaderMetadata, @@ -16,17 +16,17 @@ class GetQueueStatsRequestTypedDict(TypedDict): id: str - r"""The queue ID""" + 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetQueueStatsRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The queue ID""" + r"""The queue ID.""" within_days: Annotated[ Optional[int], @@ -39,7 +39,7 @@ class GetQueueStatsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -59,113 +59,41 @@ def serialize_model(self, handler): class ReviewStatsTypedDict(TypedDict): - average_time_to_review: float - r"""Average time in milliseconds to review an item""" - total_reviewed: float - r"""Total number of items reviewed""" - total_pending: float - r"""Total number of items pending review""" + total_reviewed: int + r"""Number of items resolved in this queue in the period.""" + total_pending: int + r"""Number of items submitted in the period that wait for review now.""" class ReviewStats(BaseModel): - average_time_to_review: Annotated[ - float, pydantic.Field(alias="averageTimeToReview") - ] - r"""Average time in milliseconds to review an item""" - - total_reviewed: Annotated[float, pydantic.Field(alias="totalReviewed")] - r"""Total number of items reviewed""" - - total_pending: Annotated[float, pydantic.Field(alias="totalPending")] - r"""Total number of items pending review""" - - -class ActionStatTypedDict(TypedDict): - action_id: str - r"""ID of the moderation action""" - action_name: str - r"""Name of the moderation action""" - count: float - r"""Number of times this action was taken""" - percentage_of_total: float - r"""Percentage this action represents of all actions""" - - -class ActionStat(BaseModel): - action_id: Annotated[str, pydantic.Field(alias="actionId")] - r"""ID of the moderation action""" - - action_name: Annotated[str, pydantic.Field(alias="actionName")] - r"""Name of the moderation action""" - - count: float - r"""Number of times this action was taken""" + total_reviewed: Annotated[int, pydantic.Field(alias="totalReviewed")] + r"""Number of items resolved in this queue in the period.""" - percentage_of_total: Annotated[float, pydantic.Field(alias="percentageOfTotal")] - r"""Percentage this action represents of all actions""" - - -class TopActionTypedDict(TypedDict): - action_id: str - r"""Most used action by this reviewer""" - action_name: str - r"""Name of the most used action""" - count: float - r"""Number of times this action was used""" - - -class TopAction(BaseModel): - action_id: Annotated[str, pydantic.Field(alias="actionId")] - r"""Most used action by this reviewer""" - - action_name: Annotated[str, pydantic.Field(alias="actionName")] - r"""Name of the most used action""" - - count: float - r"""Number of times this action was used""" + total_pending: Annotated[int, pydantic.Field(alias="totalPending")] + r"""Number of items submitted in the period that wait for review now.""" class TopReviewerTypedDict(TypedDict): - user_id: str - r"""ID of the reviewer""" - name: str - r"""Name of the reviewer""" - review_count: float - r"""Number of items reviewed""" - average_time_per_review: float - r"""Average review time in milliseconds""" - top_actions: List[TopActionTypedDict] - r"""Most common actions taken by this reviewer""" - accuracy_score: NotRequired[float] - r"""Optional accuracy score based on review quality metrics""" + user_id: Nullable[str] + r"""The user ID of the reviewer. `null` for items resolved with an API key.""" + name: Nullable[str] + r"""The name of the reviewer.""" + review_count: int + r"""Number of items the reviewer resolved in the period.""" class TopReviewer(BaseModel): - user_id: Annotated[str, pydantic.Field(alias="userId")] - r"""ID of the reviewer""" - - name: str - r"""Name of the reviewer""" - - review_count: Annotated[float, pydantic.Field(alias="reviewCount")] - r"""Number of items reviewed""" - - average_time_per_review: Annotated[ - float, pydantic.Field(alias="averageTimePerReview") - ] - r"""Average review time in milliseconds""" + user_id: Annotated[Nullable[str], pydantic.Field(alias="userId")] + r"""The user ID of the reviewer. `null` for items resolved with an API key.""" - top_actions: Annotated[List[TopAction], pydantic.Field(alias="topActions")] - r"""Most common actions taken by this reviewer""" + name: Nullable[str] + r"""The name of the reviewer.""" - accuracy_score: Annotated[ - Optional[float], pydantic.Field(alias="accuracyScore") - ] = None - r"""Optional accuracy score based on review quality metrics""" + review_count: Annotated[int, pydantic.Field(alias="reviewCount")] + r"""Number of items the reviewer resolved in the period.""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["accuracyScore"]) serialized = handler(self) m = {} @@ -174,64 +102,44 @@ def serialize_model(self, handler): 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 + m[k] = val return m class DailyReviewCountTypedDict(TypedDict): date_: str - r"""Date in YYYY-MM-DD format""" - count: float - r"""Number of reviews on this date""" + r"""Date in YYYY-MM-DD format (UTC).""" + count: int + r"""Number of items resolved.""" class DailyReviewCount(BaseModel): date_: Annotated[str, pydantic.Field(alias="date")] - r"""Date in YYYY-MM-DD format""" - - count: float - r"""Number of reviews on this date""" - - -class FlaggedContentTrendTypedDict(TypedDict): - label: str - r"""Content flag/label""" - trend: float - r"""Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing""" - - -class FlaggedContentTrend(BaseModel): - label: str - r"""Content flag/label""" + r"""Date in YYYY-MM-DD format (UTC).""" - trend: float - r"""Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing""" + count: int + r"""Number of items resolved.""" class TrendsTypedDict(TypedDict): daily_review_counts: List[DailyReviewCountTypedDict] - flagged_content_trends: List[FlaggedContentTrendTypedDict] + r"""Resolved items per day. Days with no reviews are left out.""" class Trends(BaseModel): daily_review_counts: Annotated[ List[DailyReviewCount], pydantic.Field(alias="dailyReviewCounts") ] - - flagged_content_trends: Annotated[ - List[FlaggedContentTrend], pydantic.Field(alias="flaggedContentTrends") - ] + r"""Resolved items per day. Days with no reviews are left out.""" class GetQueueStatsResponseTypedDict(TypedDict): r"""Successful response""" review_stats: ReviewStatsTypedDict - action_stats: List[ActionStatTypedDict] top_reviewers: List[TopReviewerTypedDict] - r"""List of top reviewers and their statistics""" + r"""Reviewers with the most resolved items, most first. Up to 10.""" trends: TrendsTypedDict @@ -240,10 +148,8 @@ class GetQueueStatsResponse(BaseModel): review_stats: Annotated[ReviewStats, pydantic.Field(alias="reviewStats")] - action_stats: Annotated[List[ActionStat], pydantic.Field(alias="actionStats")] - top_reviewers: Annotated[List[TopReviewer], pydantic.Field(alias="topReviewers")] - r"""List of top reviewers and their statistics""" + r"""Reviewers with the most resolved items, most first. Up to 10.""" trends: Trends @@ -252,14 +158,6 @@ class GetQueueStatsResponse(BaseModel): ReviewStats.model_rebuild() except NameError: pass -try: - ActionStat.model_rebuild() -except NameError: - pass -try: - TopAction.model_rebuild() -except NameError: - pass try: TopReviewer.model_rebuild() except NameError: diff --git a/src/moderation_api/models/getwebhookop.py b/src/moderation_api/models/getwebhookop.py index 6ac685a..69e0f50 100644 --- a/src/moderation_api/models/getwebhookop.py +++ b/src/moderation_api/models/getwebhookop.py @@ -20,7 +20,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetWebhookRequest(BaseModel): @@ -34,7 +34,7 @@ class GetWebhookRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getwebhooksecretop.py b/src/moderation_api/models/getwebhooksecretop.py index b2e0885..3a2396e 100644 --- a/src/moderation_api/models/getwebhooksecretop.py +++ b/src/moderation_api/models/getwebhooksecretop.py @@ -11,7 +11,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetWebhookSecretRequest(BaseModel): @@ -20,7 +20,7 @@ class GetWebhookSecretRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getwordlistembeddingstatusop.py b/src/moderation_api/models/getwordlistembeddingstatusop.py index 63ca82b..3f1af8d 100644 --- a/src/moderation_api/models/getwordlistembeddingstatusop.py +++ b/src/moderation_api/models/getwordlistembeddingstatusop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetWordlistEmbeddingStatusRequest(BaseModel): @@ -27,7 +27,7 @@ class GetWordlistEmbeddingStatusRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/getwordlistop.py b/src/moderation_api/models/getwordlistop.py index 2af7f9e..4fa89c1 100644 --- a/src/moderation_api/models/getwordlistop.py +++ b/src/moderation_api/models/getwordlistop.py @@ -13,7 +13,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class GetWordlistRequest(BaseModel): @@ -27,7 +27,7 @@ class GetWordlistRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/listactionsop.py b/src/moderation_api/models/listactionsop.py index f67b900..0abc3e0 100644 --- a/src/moderation_api/models/listactionsop.py +++ b/src/moderation_api/models/listactionsop.py @@ -22,7 +22,7 @@ class ListActionsRequestTypedDict(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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ListActionsRequest(BaseModel): @@ -48,7 +48,7 @@ class ListActionsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/listauthorsop.py b/src/moderation_api/models/listauthorsop.py index 9dd87b5..856b62d 100644 --- a/src/moderation_api/models/listauthorsop.py +++ b/src/moderation_api/models/listauthorsop.py @@ -14,7 +14,6 @@ SortBy = Literal[ "trustLevel", "violationCount", - "reportCount", "memberSince", "lastActive", "contentCount", @@ -23,7 +22,7 @@ ] -ListAuthorsSortDirection = Literal[ +SortDirection = Literal[ "asc", "desc", ] @@ -34,13 +33,12 @@ class ListAuthorsRequestTypedDict(TypedDict): page: NotRequired[int] page_size: NotRequired[int] sort_by: NotRequired[SortBy] - sort_direction: NotRequired[ListAuthorsSortDirection] + sort_direction: NotRequired[SortDirection] r"""Sort direction""" 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ListAuthorsRequest(BaseModel): @@ -62,7 +60,7 @@ class ListAuthorsRequest(BaseModel): ] = None sort_direction: Annotated[ - Optional[ListAuthorsSortDirection], + Optional[SortDirection], pydantic.Field(alias="sortDirection"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = "desc" @@ -80,18 +78,12 @@ class ListAuthorsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - content_types: Annotated[ - Optional[List[str]], - pydantic.Field(alias="contentTypes"), - 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -103,7 +95,6 @@ def serialize_model(self, handler): "sortDirection", "memberSinceDate", "lastActiveDate", - "contentTypes", "projectId", ] ) diff --git a/src/moderation_api/models/listqueueitemsop.py b/src/moderation_api/models/listqueueitemsop.py index fee4c87..2e64899 100644 --- a/src/moderation_api/models/listqueueitemsop.py +++ b/src/moderation_api/models/listqueueitemsop.py @@ -2,7 +2,8 @@ from __future__ import annotations from .pagination import Pagination, PaginationTypedDict -from moderation_api.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from .queueitem import QueueItem, QueueItemTypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL from moderation_api.utils import ( FieldMetadata, HeaderMetadata, @@ -15,44 +16,36 @@ from typing_extensions import Annotated, NotRequired, TypedDict -SortField = Literal[ - "createdAt", - "severity", - "reviewedAt", +Sort = Literal[ + "FIFO", + "LIFO", + "RANDOM", + "SEVERITY_DESC", ] -ListQueueItemsSortDirection = Literal[ - "asc", - "desc", -] -r"""Sort direction""" - - class ListQueueItemsRequestTypedDict(TypedDict): id: str - r"""The queue ID""" + r"""The queue ID.""" page: NotRequired[int] page_size: NotRequired[int] - sort_field: NotRequired[SortField] - sort_direction: NotRequired[ListQueueItemsSortDirection] - r"""Sort direction""" + sort: NotRequired[Sort] + include_resolved: NotRequired[bool] conversation_ids: NotRequired[List[str]] labels: NotRequired[List[str]] - after_date: NotRequired[str] - before_date: NotRequired[str] - include_resolved: NotRequired[bool] author_id: NotRequired[str] filtered_action_ids: NotRequired[List[str]] + after_date: NotRequired[str] + before_date: NotRequired[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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ListQueueItemsRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The queue ID""" + r"""The queue ID.""" page: Annotated[ Optional[int], @@ -65,18 +58,16 @@ class ListQueueItemsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = 20 - sort_field: Annotated[ - Optional[SortField], - pydantic.Field(alias="sortField"), + sort: Annotated[ + Optional[Sort], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - sort_direction: Annotated[ - Optional[ListQueueItemsSortDirection], - pydantic.Field(alias="sortDirection"), + include_resolved: Annotated[ + Optional[bool], + pydantic.Field(alias="includeResolved"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = "desc" - r"""Sort direction""" + ] = None conversation_ids: Annotated[ Optional[List[str]], @@ -89,33 +80,27 @@ class ListQueueItemsRequest(BaseModel): FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - after_date: Annotated[ - Optional[str], - pydantic.Field(alias="afterDate"), - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - - before_date: Annotated[ + author_id: Annotated[ Optional[str], - pydantic.Field(alias="beforeDate"), + pydantic.Field(alias="authorId"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - include_resolved: Annotated[ - Optional[bool], - pydantic.Field(alias="includeResolved"), + filtered_action_ids: Annotated[ + Optional[List[str]], + pydantic.Field(alias="filteredActionIds"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - author_id: Annotated[ + after_date: Annotated[ Optional[str], - pydantic.Field(alias="authorId"), + pydantic.Field(alias="afterDate"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None - filtered_action_ids: Annotated[ - Optional[List[str]], - pydantic.Field(alias="filteredActionIds"), + before_date: Annotated[ + Optional[str], + pydantic.Field(alias="beforeDate"), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None @@ -124,7 +109,7 @@ class ListQueueItemsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -132,15 +117,14 @@ def serialize_model(self, handler): [ "page", "pageSize", - "sortField", - "sortDirection", + "sort", + "includeResolved", "conversationIds", "labels", - "afterDate", - "beforeDate", - "includeResolved", "authorId", "filteredActionIds", + "afterDate", + "beforeDate", "projectId", ] ) @@ -158,164 +142,10 @@ def serialize_model(self, handler): return m -class ListQueueItemsLabelTypedDict(TypedDict): - label: str - r"""Label name""" - score: float - r"""Confidence score of the label""" - flagged: bool - r"""Whether this label caused a flag""" - - -class ListQueueItemsLabel(BaseModel): - label: str - r"""Label name""" - - score: float - r"""Confidence score of the label""" - - flagged: bool - r"""Whether this label caused a flag""" - - -class ListQueueItemsActionTypedDict(TypedDict): - id: str - r"""Action ID""" - name: str - r"""Action name""" - timestamp: float - r"""Unix timestamp of when the action was taken""" - comment: NotRequired[str] - r"""Action comment""" - reviewer: NotRequired[str] - r"""Moderator userID""" - - -class ListQueueItemsAction(BaseModel): - id: str - r"""Action ID""" - - name: str - r"""Action name""" - - timestamp: float - r"""Unix timestamp of when the action was taken""" - - comment: Optional[str] = None - r"""Action comment""" - - reviewer: Optional[str] = None - r"""Moderator userID""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["comment", "reviewer"]) - 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 - - -ListQueueItemsStatus = Union[ - Literal[ - "pending", - "resolved", - ], - UnrecognizedStr, -] -r"""Status of the item""" - - -class ListQueueItemsDataTypedDict(TypedDict): - id: str - r"""Content ID""" - content: str - r"""The content to be moderated""" - labels: List[ListQueueItemsLabelTypedDict] - flagged: bool - r"""Whether the item is flagged by any label""" - status: ListQueueItemsStatus - r"""Status of the item""" - timestamp: float - r"""Unix timestamp of when the item was created""" - language: NotRequired[str] - r"""Content language""" - conversation_id: NotRequired[str] - r"""Conversation ID""" - author_id: NotRequired[str] - r"""Author ID""" - actions: NotRequired[List[ListQueueItemsActionTypedDict]] - r"""Action IDs taken on this item""" - content_type: NotRequired[str] - r"""Type of the content object""" - - -class ListQueueItemsData(BaseModel): - id: str - r"""Content ID""" - - content: str - r"""The content to be moderated""" - - labels: List[ListQueueItemsLabel] - - flagged: bool - r"""Whether the item is flagged by any label""" - - status: ListQueueItemsStatus - r"""Status of the item""" - - timestamp: float - r"""Unix timestamp of when the item was created""" - - language: Optional[str] = None - r"""Content language""" - - conversation_id: Annotated[ - Optional[str], pydantic.Field(alias="conversationId") - ] = None - r"""Conversation ID""" - - author_id: Annotated[Optional[str], pydantic.Field(alias="authorId")] = None - r"""Author ID""" - - actions: Optional[List[ListQueueItemsAction]] = None - r"""Action IDs taken on this item""" - - content_type: Annotated[Optional[str], pydantic.Field(alias="contentType")] = None - r"""Type of the content object""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["language", "conversationId", "authorId", "actions", "contentType"] - ) - 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 ListQueueItemsResponseBodyTypedDict(TypedDict): r"""Successful response""" - data: List[ListQueueItemsDataTypedDict] + data: List[QueueItemTypedDict] r"""The items on this page.""" pagination: PaginationTypedDict r"""Where this page is in the full list.""" @@ -324,7 +154,7 @@ class ListQueueItemsResponseBodyTypedDict(TypedDict): class ListQueueItemsResponseBody(BaseModel): r"""Successful response""" - data: List[ListQueueItemsData] + data: List[QueueItem] r"""The items on this page.""" pagination: Pagination @@ -342,9 +172,3 @@ class ListQueueItemsResponse(BaseModel): ] result: ListQueueItemsResponseBody - - -try: - ListQueueItemsData.model_rebuild() -except NameError: - pass diff --git a/src/moderation_api/models/listqueuesop.py b/src/moderation_api/models/listqueuesop.py new file mode 100644 index 0000000..0561e6c --- /dev/null +++ b/src/moderation_api/models/listqueuesop.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pagination import Pagination, PaginationTypedDict +from .queue import Queue, QueueTypedDict +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Awaitable, Callable, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListQueuesRequestTypedDict(TypedDict): + page: NotRequired[int] + page_size: NotRequired[int] + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class ListQueuesRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page", "pageSize", "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 ListQueuesResponseBodyTypedDict(TypedDict): + r"""Successful response""" + + data: List[QueueTypedDict] + r"""The items on this page.""" + pagination: PaginationTypedDict + r"""Where this page is in the full list.""" + + +class ListQueuesResponseBody(BaseModel): + r"""Successful response""" + + data: List[Queue] + r"""The items on this page.""" + + pagination: Pagination + r"""Where this page is in the full list.""" + + +class ListQueuesResponseTypedDict(TypedDict): + result: ListQueuesResponseBodyTypedDict + + +class ListQueuesResponse(BaseModel): + next: Union[ + Callable[[], Optional[ListQueuesResponse]], + Callable[[], Awaitable[Optional[ListQueuesResponse]]], + ] + + result: ListQueuesResponseBody diff --git a/src/moderation_api/models/listwebhooksop.py b/src/moderation_api/models/listwebhooksop.py index 056efec..f2f24d6 100644 --- a/src/moderation_api/models/listwebhooksop.py +++ b/src/moderation_api/models/listwebhooksop.py @@ -21,7 +21,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ListWebhooksRequest(BaseModel): @@ -41,7 +41,7 @@ class ListWebhooksRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/listwordlistsop.py b/src/moderation_api/models/listwordlistsop.py index 8c89abb..4d07b6f 100644 --- a/src/moderation_api/models/listwordlistsop.py +++ b/src/moderation_api/models/listwordlistsop.py @@ -14,7 +14,7 @@ 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ListWordlistsRequest(BaseModel): @@ -34,7 +34,7 @@ class ListWordlistsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/notfounderror.py b/src/moderation_api/models/notfounderror.py index 91aa2a3..0df96a0 100644 --- a/src/moderation_api/models/notfounderror.py +++ b/src/moderation_api/models/notfounderror.py @@ -11,6 +11,7 @@ "action_not_found", "author_not_found", "queue_not_found", + "queue_item_not_found", "wordlist_not_found", "webhook_not_found", "project_not_found", @@ -24,6 +25,7 @@ - `action_not_found`: The action does not exist. - `author_not_found`: The author does not exist. - `queue_not_found`: The review queue does not exist. +- `queue_item_not_found`: The queue item does not exist in the project. - `wordlist_not_found`: The wordlist does not exist. - `webhook_not_found`: The webhook does not exist. - `project_not_found`: The project does not exist. diff --git a/src/moderation_api/models/projectapikey.py b/src/moderation_api/models/projectapikey.py new file mode 100644 index 0000000..cd2c71e --- /dev/null +++ b/src/moderation_api/models/projectapikey.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class ProjectAPIKeyTypedDict(TypedDict): + id: str + r"""The ID of the API key.""" + name: str + r"""The key's name.""" + project_id: str + r"""The ID of the project the key belongs to.""" + created_at: str + r"""When the key was created.""" + secret_key: str + r"""The new secret API key. Use it to moderate content in this project. It is also shown in the project's settings.""" + + +class ProjectAPIKey(BaseModel): + id: str + r"""The ID of the API key.""" + + name: str + r"""The key's name.""" + + project_id: Annotated[str, pydantic.Field(alias="projectId")] + r"""The ID of the project the key belongs to.""" + + created_at: Annotated[str, pydantic.Field(alias="createdAt")] + r"""When the key was created.""" + + secret_key: Annotated[str, pydantic.Field(alias="secretKey")] + r"""The new secret API key. Use it to moderate content in this project. It is also shown in the project's settings.""" + + +try: + ProjectAPIKey.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/publicauthor.py b/src/moderation_api/models/publicauthor.py index 457e955..0016381 100644 --- a/src/moderation_api/models/publicauthor.py +++ b/src/moderation_api/models/publicauthor.py @@ -15,7 +15,7 @@ from typing_extensions import NotRequired, TypedDict -Status = Union[ +PublicAuthorStatus = Union[ Literal[ "enabled", "suspended", @@ -252,7 +252,7 @@ class PublicAuthorTypedDict(TypedDict): r"""Timestamp when author first appeared""" last_seen: float r"""Timestamp of last activity""" - status: Status + status: PublicAuthorStatus r"""Current author status""" trust_level: TrustLevelTypedDict block: Nullable[BlockTypedDict] @@ -288,7 +288,7 @@ class PublicAuthor(BaseModel): last_seen: float r"""Timestamp of last activity""" - status: Status + status: PublicAuthorStatus r"""Current author status""" trust_level: TrustLevel diff --git a/src/moderation_api/models/queue.py b/src/moderation_api/models/queue.py new file mode 100644 index 0000000..22caf9a --- /dev/null +++ b/src/moderation_api/models/queue.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, TypedDict + + +class QueueTypedDict(TypedDict): + id: str + r"""The queue ID.""" + name: str + r"""The queue name.""" + description: Nullable[str] + r"""The queue description.""" + is_default: bool + r"""Whether this is the default queue of the project.""" + + +class Queue(BaseModel): + id: str + r"""The queue ID.""" + + name: str + r"""The queue name.""" + + description: Nullable[str] + r"""The queue description.""" + + is_default: Annotated[bool, pydantic.Field(alias="isDefault")] + r"""Whether this is the default queue of the project.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + Queue.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/queueitem.py b/src/moderation_api/models/queueitem.py new file mode 100644 index 0000000..beff052 --- /dev/null +++ b/src/moderation_api/models/queueitem.py @@ -0,0 +1,644 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from functools import partial +from moderation_api.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from moderation_api.utils import validate_const +from moderation_api.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class QueueItemDataAudioTypedDict(TypedDict): + r"""Audio""" + + url: str + r"""The URL of the audio content""" + type: Literal["audio"] + + +class QueueItemDataAudio(BaseModel): + r"""Audio""" + + url: str + r"""The URL of the audio content""" + + type: Annotated[ + Annotated[Literal["audio"], AfterValidator(validate_const("audio"))], + pydantic.Field(alias="type"), + ] = "audio" + + +class QueueItemDataVideoTypedDict(TypedDict): + r"""Video""" + + url: str + r"""A public URL of the video content""" + type: Literal["video"] + + +class QueueItemDataVideo(BaseModel): + r"""Video""" + + url: str + r"""A public URL of the video content""" + + type: Annotated[ + Annotated[Literal["video"], AfterValidator(validate_const("video"))], + pydantic.Field(alias="type"), + ] = "video" + + +class QueueItemDataImageTypedDict(TypedDict): + r"""Image""" + + type: Literal["image"] + url: NotRequired[str] + r"""A public URL of the image content. Either url or data must be provided.""" + data: NotRequired[str] + r"""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.""" + + +class QueueItemDataImage(BaseModel): + r"""Image""" + + type: Annotated[ + Annotated[Literal["image"], AfterValidator(validate_const("image"))], + pydantic.Field(alias="type"), + ] = "image" + + url: Optional[str] = None + r"""A public URL of the image content. Either url or data must be provided.""" + + data: Optional[str] = None + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["url", "data"]) + 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 QueueItemDataTextTypedDict(TypedDict): + r"""Text""" + + text: str + r"""The content text""" + type: Literal["text"] + + +class QueueItemDataText(BaseModel): + r"""Text""" + + text: str + r"""The content text""" + + type: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + +QueueItemContentLeafTypedDict = TypeAliasType( + "QueueItemContentLeafTypedDict", + Union[ + QueueItemDataTextTypedDict, + QueueItemDataVideoTypedDict, + QueueItemDataAudioTypedDict, + QueueItemDataImageTypedDict, + ], +) + + +class UnknownQueueItemContentLeaf(BaseModel): + r"""A QueueItemContentLeaf variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_QUEUE_ITEM_CONTENT_LEAF_VARIANTS: dict[str, Any] = { + "text": QueueItemDataText, + "image": QueueItemDataImage, + "video": QueueItemDataVideo, + "audio": QueueItemDataAudio, +} + + +QueueItemContentLeaf = Annotated[ + Union[ + QueueItemDataText, + QueueItemDataImage, + QueueItemDataVideo, + QueueItemDataAudio, + UnknownQueueItemContentLeaf, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_QUEUE_ITEM_CONTENT_LEAF_VARIANTS, + unknown_cls=UnknownQueueItemContentLeaf, + union_name="QueueItemContentLeaf", + ) + ), +] + + +class QueueItemObjectTypedDict(TypedDict): + r"""Object""" + + data: Dict[str, QueueItemContentLeafTypedDict] + r"""Values in the object. Can be mixed content types.""" + type: Literal["object"] + + +class QueueItemObject(BaseModel): + r"""Object""" + + data: Dict[str, QueueItemContentLeaf] + r"""Values in the object. Can be mixed content types.""" + + type: Annotated[ + Annotated[Literal["object"], AfterValidator(validate_const("object"))], + pydantic.Field(alias="type"), + ] = "object" + + +class QueueItemAudioTypedDict(TypedDict): + r"""Audio""" + + url: str + r"""The URL of the audio content""" + type: Literal["audio"] + + +class QueueItemAudio(BaseModel): + r"""Audio""" + + url: str + r"""The URL of the audio content""" + + type: Annotated[ + Annotated[Literal["audio"], AfterValidator(validate_const("audio"))], + pydantic.Field(alias="type"), + ] = "audio" + + +class QueueItemVideoTypedDict(TypedDict): + r"""Video""" + + url: str + r"""A public URL of the video content""" + type: Literal["video"] + + +class QueueItemVideo(BaseModel): + r"""Video""" + + url: str + r"""A public URL of the video content""" + + type: Annotated[ + Annotated[Literal["video"], AfterValidator(validate_const("video"))], + pydantic.Field(alias="type"), + ] = "video" + + +class QueueItemImageTypedDict(TypedDict): + r"""Image""" + + type: Literal["image"] + url: NotRequired[str] + r"""A public URL of the image content. Either url or data must be provided.""" + data: NotRequired[str] + r"""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.""" + + +class QueueItemImage(BaseModel): + r"""Image""" + + type: Annotated[ + Annotated[Literal["image"], AfterValidator(validate_const("image"))], + pydantic.Field(alias="type"), + ] = "image" + + url: Optional[str] = None + r"""A public URL of the image content. Either url or data must be provided.""" + + data: Optional[str] = None + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["url", "data"]) + 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 QueueItemTextTypedDict(TypedDict): + r"""Text""" + + text: str + r"""The content text""" + type: Literal["text"] + + +class QueueItemText(BaseModel): + r"""Text""" + + text: str + r"""The content text""" + + type: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + +QueueItemContentTypedDict = TypeAliasType( + "QueueItemContentTypedDict", + Union[ + QueueItemTextTypedDict, + QueueItemVideoTypedDict, + QueueItemAudioTypedDict, + QueueItemObjectTypedDict, + QueueItemImageTypedDict, + ], +) + + +class UnknownQueueItemContent(BaseModel): + r"""A QueueItemContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_QUEUE_ITEM_CONTENT_VARIANTS: dict[str, Any] = { + "text": QueueItemText, + "image": QueueItemImage, + "video": QueueItemVideo, + "audio": QueueItemAudio, + "object": QueueItemObject, +} + + +QueueItemContent = Annotated[ + Union[ + QueueItemText, + QueueItemImage, + QueueItemVideo, + QueueItemAudio, + QueueItemObject, + UnknownQueueItemContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_QUEUE_ITEM_CONTENT_VARIANTS, + unknown_cls=UnknownQueueItemContent, + union_name="QueueItemContent", + ) + ), +] + + +class QueueItemBrandImpersonationTypedDict(TypedDict): + brand: str + method: str + + +class QueueItemBrandImpersonation(BaseModel): + brand: str + + method: str + + +class QueueItemSignalsTypedDict(TypedDict): + brand_impersonation: Nullable[QueueItemBrandImpersonationTypedDict] + has_suspicious_characters: bool + is_link_shortener: bool + domain_age_days: Nullable[float] + has_email_setup: Nullable[bool] + redirect_count: Nullable[float] + final_url: Nullable[str] + bot_protection: Nullable[bool] + is_reported: bool + + +class QueueItemSignals(BaseModel): + brand_impersonation: Nullable[QueueItemBrandImpersonation] + + has_suspicious_characters: bool + + is_link_shortener: bool + + domain_age_days: Nullable[float] + + has_email_setup: Nullable[bool] + + redirect_count: Nullable[float] + + final_url: Nullable[str] + + bot_protection: Nullable[bool] + + is_reported: bool + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +class QueueItemMatchTypedDict(TypedDict): + match: str + r"""The matched substring""" + probability: float + r"""Match confidence between 0 and 1""" + span: List[float] + r"""[start, end] character offsets in the source text""" + mask: NotRequired[Nullable[str]] + reasons: NotRequired[List[str]] + signals: NotRequired[QueueItemSignalsTypedDict] + entity_type: NotRequired[str] + scripts: NotRequired[List[str]] + skeleton: NotRequired[str] + + +class QueueItemMatch(BaseModel): + match: str + r"""The matched substring""" + + probability: float + r"""Match confidence between 0 and 1""" + + span: List[float] + r"""[start, end] character offsets in the source text""" + + mask: OptionalNullable[str] = UNSET + + reasons: Optional[List[str]] = None + + signals: Optional[QueueItemSignals] = None + + entity_type: Optional[str] = None + + scripts: Optional[List[str]] = None + + skeleton: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["mask", "reasons", "signals", "entity_type", "scripts", "skeleton"] + ) + nullable_fields = set(["mask"]) + 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)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class LabelTypedDict(TypedDict): + label: str + r"""The label name""" + score: float + r"""Confidence score between 0 and 1""" + manual: NotRequired[bool] + r"""True if the label was applied manually by a moderator""" + flagged: NotRequired[bool] + r"""Whether this label crossed its flagging threshold""" + shadow_flagged: NotRequired[bool] + r"""Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision""" + matches: NotRequired[List[QueueItemMatchTypedDict]] + + +class Label(BaseModel): + label: str + r"""The label name""" + + score: float + r"""Confidence score between 0 and 1""" + + manual: Optional[bool] = None + r"""True if the label was applied manually by a moderator""" + + flagged: Optional[bool] = None + r"""Whether this label crossed its flagging threshold""" + + shadow_flagged: Optional[bool] = None + r"""Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision""" + + matches: Optional[List[QueueItemMatch]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["manual", "flagged", "shadow_flagged", "matches"]) + 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 + + +QueueItemStatus = Union[ + Literal[ + "pending", + "resolved", + ], + UnrecognizedStr, +] +r"""`pending` waits for review. `resolved` is reviewed.""" + + +class QueueItemTypedDict(TypedDict): + id: str + r"""The item ID. Use it to resolve or unresolve the item in this queue.""" + content_id: str + r"""Your content ID, as you sent it to `POST /moderate`.""" + content: Nullable[QueueItemContentTypedDict] + r"""The submitted content.""" + labels: List[LabelTypedDict] + r"""The moderation labels of the content.""" + flagged: bool + r"""Whether moderation flagged the content.""" + severity: Nullable[float] + r"""Severity score from 0 to 1, if available.""" + status: QueueItemStatus + r"""`pending` waits for review. `resolved` is reviewed.""" + timestamp: float + r"""When the content was submitted, as Unix time in milliseconds.""" + language: Nullable[str] + r"""Detected ISO language code.""" + conversation_id: Nullable[str] + r"""Conversation ID, if any.""" + author_id: Nullable[str] + r"""Your author ID, if any.""" + content_type: Nullable[str] + r"""Content type, for example `message` or `profile`.""" + + +class QueueItem(BaseModel): + id: str + r"""The item ID. Use it to resolve or unresolve the item in this queue.""" + + content_id: Annotated[str, pydantic.Field(alias="contentId")] + r"""Your content ID, as you sent it to `POST /moderate`.""" + + content: Nullable[QueueItemContent] + r"""The submitted content.""" + + labels: List[Label] + r"""The moderation labels of the content.""" + + flagged: bool + r"""Whether moderation flagged the content.""" + + severity: Nullable[float] + r"""Severity score from 0 to 1, if available.""" + + status: QueueItemStatus + r"""`pending` waits for review. `resolved` is reviewed.""" + + timestamp: float + r"""When the content was submitted, as Unix time in milliseconds.""" + + language: Nullable[str] + r"""Detected ISO language code.""" + + conversation_id: Annotated[Nullable[str], pydantic.Field(alias="conversationId")] + r"""Conversation ID, if any.""" + + author_id: Annotated[Nullable[str], pydantic.Field(alias="authorId")] + r"""Your author ID, if any.""" + + content_type: Annotated[Nullable[str], pydantic.Field(alias="contentType")] + r"""Content type, for example `message` or `profile`.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + QueueItemDataAudio.model_rebuild() +except NameError: + pass +try: + QueueItemDataVideo.model_rebuild() +except NameError: + pass +try: + QueueItemDataImage.model_rebuild() +except NameError: + pass +try: + QueueItemDataText.model_rebuild() +except NameError: + pass +try: + QueueItemObject.model_rebuild() +except NameError: + pass +try: + QueueItemAudio.model_rebuild() +except NameError: + pass +try: + QueueItemVideo.model_rebuild() +except NameError: + pass +try: + QueueItemImage.model_rebuild() +except NameError: + pass +try: + QueueItemText.model_rebuild() +except NameError: + pass +try: + QueueItem.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/queuewithcounts.py b/src/moderation_api/models/queuewithcounts.py new file mode 100644 index 0000000..939f588 --- /dev/null +++ b/src/moderation_api/models/queuewithcounts.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, Nullable, UNSET_SENTINEL +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, TypedDict + + +class QueueWithCountsTypedDict(TypedDict): + id: str + r"""The queue ID.""" + name: str + r"""The queue name.""" + description: Nullable[str] + r"""The queue description.""" + is_default: bool + r"""Whether this is the default queue of the project.""" + unresolved_items_count: int + r"""Number of items that wait for review.""" + resolved_items_count: int + r"""Number of items that are resolved.""" + total_items_count: int + r"""Number of items in the queue, resolved and unresolved.""" + + +class QueueWithCounts(BaseModel): + id: str + r"""The queue ID.""" + + name: str + r"""The queue name.""" + + description: Nullable[str] + r"""The queue description.""" + + is_default: Annotated[bool, pydantic.Field(alias="isDefault")] + r"""Whether this is the default queue of the project.""" + + unresolved_items_count: Annotated[int, pydantic.Field(alias="unresolvedItemsCount")] + r"""Number of items that wait for review.""" + + resolved_items_count: Annotated[int, pydantic.Field(alias="resolvedItemsCount")] + r"""Number of items that are resolved.""" + + total_items_count: Annotated[int, pydantic.Field(alias="totalItemsCount")] + r"""Number of items in the queue, resolved and unresolved.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + 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: + m[k] = val + + return m + + +try: + QueueWithCounts.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/removewordlistwordsop.py b/src/moderation_api/models/removewordlistwordsop.py index 9936fe8..853a985 100644 --- a/src/moderation_api/models/removewordlistwordsop.py +++ b/src/moderation_api/models/removewordlistwordsop.py @@ -20,7 +20,7 @@ class RemoveWordlistWordsRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class RemoveWordlistWordsRequest(BaseModel): @@ -39,7 +39,7 @@ class RemoveWordlistWordsRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/resolvequeueitemop.py b/src/moderation_api/models/resolvequeueitemop.py index 1e666b7..57c2c18 100644 --- a/src/moderation_api/models/resolvequeueitemop.py +++ b/src/moderation_api/models/resolvequeueitemop.py @@ -2,78 +2,41 @@ from __future__ import annotations from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) +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 ResolveQueueItemRequestBodyTypedDict(TypedDict): - comment: NotRequired[str] - r"""Optional comment""" - - -class ResolveQueueItemRequestBody(BaseModel): - comment: Optional[str] = None - r"""Optional comment""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["comment"]) - 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 ResolveQueueItemRequestTypedDict(TypedDict): id: str - r"""The queue ID""" + r"""The queue ID.""" item_id: str - r"""The item ID to resolve""" - body: ResolveQueueItemRequestBodyTypedDict + r"""The item ID to resolve.""" 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class ResolveQueueItemRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The queue ID""" + r"""The queue ID.""" item_id: Annotated[ str, pydantic.Field(alias="itemId"), FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] - r"""The item ID to resolve""" - - body: Annotated[ - ResolveQueueItemRequestBody, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + r"""The item ID to resolve.""" 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -97,9 +60,7 @@ class ResolveQueueItemResponseTypedDict(TypedDict): success: bool resolved_at: str - r"""Timestamp when the item was resolved""" - comment: NotRequired[str] - r"""Optional comment""" + r"""When the item was resolved (ISO 8601).""" class ResolveQueueItemResponse(BaseModel): @@ -108,26 +69,7 @@ class ResolveQueueItemResponse(BaseModel): success: bool resolved_at: Annotated[str, pydantic.Field(alias="resolvedAt")] - r"""Timestamp when the item was resolved""" - - comment: Optional[str] = None - r"""Optional comment""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["comment"]) - 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 + r"""When the item was resolved (ISO 8601).""" try: diff --git a/src/moderation_api/models/resolvequeueitemsop.py b/src/moderation_api/models/resolvequeueitemsop.py new file mode 100644 index 0000000..4c57a30 --- /dev/null +++ b/src/moderation_api/models/resolvequeueitemsop.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from moderation_api.types import BaseModel, UNSET_SENTINEL +from moderation_api.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResolveQueueItemsRequestBodyTypedDict(TypedDict): + item_ids: List[str] + r"""The item IDs to resolve. Up to 100.""" + + +class ResolveQueueItemsRequestBody(BaseModel): + item_ids: Annotated[List[str], pydantic.Field(alias="itemIds")] + r"""The item IDs to resolve. Up to 100.""" + + +class ResolveQueueItemsRequestTypedDict(TypedDict): + id: str + r"""The queue ID.""" + body: ResolveQueueItemsRequestBodyTypedDict + project_id: NotRequired[str] + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" + + +class ResolveQueueItemsRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The queue ID.""" + + body: Annotated[ + ResolveQueueItemsRequestBody, + 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, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 ResolveQueueItemsResponseTypedDict(TypedDict): + r"""Successful response""" + + resolved: int + r"""Number of items resolved.""" + not_found_ids: List[str] + r"""Item IDs that do not exist in the project.""" + + +class ResolveQueueItemsResponse(BaseModel): + r"""Successful response""" + + resolved: int + r"""Number of items resolved.""" + + not_found_ids: Annotated[List[str], pydantic.Field(alias="notFoundIds")] + r"""Item IDs that do not exist in the project.""" + + +try: + ResolveQueueItemsRequestBody.model_rebuild() +except NameError: + pass +try: + ResolveQueueItemsResponse.model_rebuild() +except NameError: + pass diff --git a/src/moderation_api/models/submitcontentop.py b/src/moderation_api/models/submitcontentop.py index 35d7231..f23b480 100644 --- a/src/moderation_api/models/submitcontentop.py +++ b/src/moderation_api/models/submitcontentop.py @@ -1972,7 +1972,7 @@ class SubmitContentRequestBodyTypedDict(TypedDict): client_action: NotRequired[SubmitContentClientActionTypedDict] r"""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: NotRequired[bool] - r"""Do not store the content. The content won't enter the review queue""" + r"""Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted.""" policies: NotRequired[List[PolicyRequestTypedDict]] r"""(Enterprise) override the channel policies for this moderation request only.""" @@ -2012,7 +2012,7 @@ class SubmitContentRequestBody(BaseModel): r"""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: Annotated[Optional[bool], pydantic.Field(alias="doNotStore")] = None - r"""Do not store the content. The content won't enter the review queue""" + r"""Process the content without saving it on our servers. The item is still created and appears in the review queue, analytics and author history with its moderation results, but its content is empty, so reviewers cannot see what was submitted.""" policies: Optional[List[PolicyRequest]] = None r"""(Enterprise) override the channel policies for this moderation request only.""" @@ -2050,7 +2050,7 @@ def serialize_model(self, handler): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class SubmitContentRequest(BaseModel): @@ -2064,7 +2064,7 @@ class SubmitContentRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -2369,7 +2369,7 @@ class SubmitContentTrustLevel(BaseModel): r"""True if the trust level was set manually by a moderator""" -class AuthorTypedDict(TypedDict): +class SubmitContentAuthorTypedDict(TypedDict): id: str r"""Author ID in Moderation API""" block: Nullable[SubmitContentBlockTypedDict] @@ -2381,7 +2381,7 @@ class AuthorTypedDict(TypedDict): r"""The author's ID from your system""" -class Author(BaseModel): +class SubmitContentAuthor(BaseModel): id: str r"""Author ID in Moderation API""" @@ -2472,7 +2472,7 @@ def serialize_model(self, handler): return m -SubmitContentRecommendationAction = Union[ +ActionResponse = Union[ Literal[ "review", "allow", @@ -2521,7 +2521,7 @@ class MatchedRule(BaseModel): class RecommendationTypedDict(TypedDict): r"""The recommendation for the content based on the evaluation.""" - action: SubmitContentRecommendationAction + action: ActionResponse r"""The action to take based on the recommendation""" reason_codes: List[ReasonCodeTypedDict] r"""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.""" @@ -2532,7 +2532,7 @@ class RecommendationTypedDict(TypedDict): class Recommendation(BaseModel): r"""The recommendation for the content based on the evaluation.""" - action: SubmitContentRecommendationAction + action: ActionResponse r"""The action to take based on the recommendation""" reason_codes: List[ReasonCode] @@ -2881,15 +2881,15 @@ def serialize_model(self, handler): return m -PolicyResponseTypedDict = TypeAliasType( - "PolicyResponseTypedDict", +SubmitContentPolicyResponseTypedDict = TypeAliasType( + "SubmitContentPolicyResponseTypedDict", Union[EntityMatcherOutputTypedDict, ClassifierOutputTypedDict], ) r"""Policy output schema.""" -class UnknownPolicyResponse(BaseModel): - r"""A PolicyResponse variant the SDK doesn't recognize. Preserves the raw payload.""" +class UnknownSubmitContentPolicyResponse(BaseModel): + r"""A SubmitContentPolicyResponse variant the SDK doesn't recognize. Preserves the raw payload.""" type: Literal["UNKNOWN"] = "UNKNOWN" raw: Any @@ -2898,21 +2898,21 @@ class UnknownPolicyResponse(BaseModel): model_config = ConfigDict(frozen=True) -_POLICY_RESPONSE_VARIANTS: dict[str, Any] = { +_SUBMIT_CONTENT_POLICY_RESPONSE_VARIANTS: dict[str, Any] = { "classifier": ClassifierOutput, "entity_matcher": EntityMatcherOutput, } -PolicyResponse = Annotated[ - Union[ClassifierOutput, EntityMatcherOutput, UnknownPolicyResponse], +SubmitContentPolicyResponse = Annotated[ + Union[ClassifierOutput, EntityMatcherOutput, UnknownSubmitContentPolicyResponse], BeforeValidator( partial( parse_open_union, disc_key="type", - variants=_POLICY_RESPONSE_VARIANTS, - unknown_cls=UnknownPolicyResponse, - union_name="PolicyResponse", + variants=_SUBMIT_CONTENT_POLICY_RESPONSE_VARIANTS, + unknown_cls=UnknownSubmitContentPolicyResponse, + union_name="SubmitContentPolicyResponse", ) ), ] @@ -3342,7 +3342,7 @@ class SubmitContentResponseTypedDict(TypedDict): content: ContentResponseTypedDict r"""Potentially modified content.""" - author: Nullable[AuthorTypedDict] + author: Nullable[SubmitContentAuthorTypedDict] r"""The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.""" evaluation: EvaluationTypedDict r"""The evaluation of the content after running the channel policies.""" @@ -3350,7 +3350,7 @@ class SubmitContentResponseTypedDict(TypedDict): r"""The recommendation for the content based on the evaluation.""" casebook: Nullable[CasebookTypedDict] r"""What your casebook — the record of your past moderation decisions — 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: List[PolicyResponseTypedDict] + policies: List[SubmitContentPolicyResponseTypedDict] r"""Results of all policies in the channel. Sorted by highest probability.""" insights: List[InsightTypedDict] r"""Results of all insights enabled in the channel.""" @@ -3366,7 +3366,7 @@ class SubmitContentResponse(BaseModel): content: ContentResponse r"""Potentially modified content.""" - author: Nullable[Author] + author: Nullable[SubmitContentAuthor] r"""The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.""" evaluation: Evaluation @@ -3378,7 +3378,7 @@ class SubmitContentResponse(BaseModel): casebook: Nullable[Casebook] r"""What your casebook — the record of your past moderation decisions — 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: List[PolicyResponse] + policies: List[SubmitContentPolicyResponse] r"""Results of all policies in the channel. Sorted by highest probability.""" insights: List[Insight] diff --git a/src/moderation_api/models/unresolvequeueitemop.py b/src/moderation_api/models/unresolvequeueitemop.py index 40a8d5f..c0ddc90 100644 --- a/src/moderation_api/models/unresolvequeueitemop.py +++ b/src/moderation_api/models/unresolvequeueitemop.py @@ -1,79 +1,42 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from moderation_api.types import BaseModel, UNSET_SENTINEL -from moderation_api.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) +from moderation_api.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from moderation_api.utils import FieldMetadata, HeaderMetadata, PathParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional +from typing import Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict -class UnresolveQueueItemRequestBodyTypedDict(TypedDict): - comment: NotRequired[str] - r"""Optional reason for unresolving the item""" - - -class UnresolveQueueItemRequestBody(BaseModel): - comment: Optional[str] = None - r"""Optional reason for unresolving the item""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["comment"]) - 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 UnresolveQueueItemRequestTypedDict(TypedDict): id: str - r"""The queue ID""" + r"""The queue ID.""" item_id: str - r"""The item ID to unresolve""" - body: UnresolveQueueItemRequestBodyTypedDict + r"""The item ID to unresolve.""" 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class UnresolveQueueItemRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] - r"""The queue ID""" + r"""The queue ID.""" item_id: Annotated[ str, pydantic.Field(alias="itemId"), FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] - r"""The item ID to unresolve""" - - body: Annotated[ - UnresolveQueueItemRequestBody, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] + r"""The item ID to unresolve.""" 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -92,14 +55,24 @@ def serialize_model(self, handler): return m +UnresolveQueueItemStatus = Union[ + Literal[ + "pending", + "resolved", + ], + UnrecognizedStr, +] +r"""`pending` waits for review. `resolved` is reviewed.""" + + class UnresolveQueueItemResponseTypedDict(TypedDict): r"""Successful response""" success: bool - status: str - r"""New status of the item""" + status: UnresolveQueueItemStatus + r"""`pending` waits for review. `resolved` is reviewed.""" unresolved_at: str - r"""Timestamp when the item was unresolved""" + r"""When the item was unresolved (ISO 8601).""" class UnresolveQueueItemResponse(BaseModel): @@ -107,11 +80,11 @@ class UnresolveQueueItemResponse(BaseModel): success: bool - status: str - r"""New status of the item""" + status: UnresolveQueueItemStatus + r"""`pending` waits for review. `resolved` is reviewed.""" unresolved_at: Annotated[str, pydantic.Field(alias="unresolvedAt")] - r"""Timestamp when the item was unresolved""" + r"""When the item was unresolved (ISO 8601).""" try: diff --git a/src/moderation_api/models/updateactionop.py b/src/moderation_api/models/updateactionop.py index fe787ed..86aca2b 100644 --- a/src/moderation_api/models/updateactionop.py +++ b/src/moderation_api/models/updateactionop.py @@ -175,7 +175,7 @@ class UpdateActionRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class UpdateActionRequest(BaseModel): @@ -194,7 +194,7 @@ class UpdateActionRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/updateauthorop.py b/src/moderation_api/models/updateauthorop.py index 60a12f4..a8098c6 100644 --- a/src/moderation_api/models/updateauthorop.py +++ b/src/moderation_api/models/updateauthorop.py @@ -203,7 +203,7 @@ class UpdateAuthorRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class UpdateAuthorRequest(BaseModel): @@ -222,7 +222,7 @@ class UpdateAuthorRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/updatewebhookop.py b/src/moderation_api/models/updatewebhookop.py index 19bb062..45dbd80 100644 --- a/src/moderation_api/models/updatewebhookop.py +++ b/src/moderation_api/models/updatewebhookop.py @@ -94,7 +94,7 @@ class UpdateWebhookRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class UpdateWebhookRequest(BaseModel): @@ -113,7 +113,7 @@ class UpdateWebhookRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/models/updatewordlistop.py b/src/moderation_api/models/updatewordlistop.py index 02201b1..44b6d9d 100644 --- a/src/moderation_api/models/updatewordlistop.py +++ b/src/moderation_api/models/updatewordlistop.py @@ -22,7 +22,7 @@ class UpdateWordlistRequestBodyTypedDict(TypedDict): description: NotRequired[str] r"""New description for the wordlist""" words: NotRequired[List[str]] - r"""New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored.""" + r"""New words for the wordlist. Replace the existing words with these new ones. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.""" strict: NotRequired[bool] r"""Deprecated. Now using threshold in project settings.""" @@ -38,7 +38,7 @@ class UpdateWordlistRequestBody(BaseModel): r"""New description for the wordlist""" words: Optional[List[str]] = None - r"""New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored.""" + r"""New words for the wordlist. Replace the existing words with these new ones. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words.""" strict: Optional[bool] = None r"""Deprecated. Now using threshold in project settings.""" @@ -65,7 +65,7 @@ class UpdateWordlistRequestTypedDict(TypedDict): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" class UpdateWordlistRequest(BaseModel): @@ -84,7 +84,7 @@ class UpdateWordlistRequest(BaseModel): 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.""" + r"""The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/moderation_api/projects.py b/src/moderation_api/projects.py index f962195..cda9067 100644 --- a/src/moderation_api/projects.py +++ b/src/moderation_api/projects.py @@ -1,9 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration from jsonpath import JSONPath from moderation_api import errors, models, utils from moderation_api._hooks import HookContext +from moderation_api.apikeys import APIKeys from moderation_api.types import OptionalNullable, UNSET from moderation_api.utils import get_security_from_env from moderation_api.utils.unmarshal_json_response import unmarshal_json_response @@ -11,6 +13,18 @@ class Projects(BaseSDK): + api_keys: APIKeys + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.api_keys = APIKeys(self.sdk_configuration, parent_ref=self.parent_ref) + def list( self, *, diff --git a/src/moderation_api/queue_sdk.py b/src/moderation_api/queue_sdk.py index a85d82b..2510da3 100644 --- a/src/moderation_api/queue_sdk.py +++ b/src/moderation_api/queue_sdk.py @@ -2,13 +2,14 @@ from .basesdk import BaseSDK from .sdkconfiguration import SDKConfiguration +from jsonpath import JSONPath from moderation_api import errors, models, utils from moderation_api._hooks import HookContext from moderation_api.items import Items from moderation_api.types import OptionalNullable, UNSET from moderation_api.utils import get_security_from_env from moderation_api.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union class QueueSDK(BaseSDK): @@ -24,6 +25,319 @@ def __init__( def _init_sdks(self): self.items = Items(self.sdk_configuration, parent_ref=self.parent_ref) + def list( + self, + *, + 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, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListQueuesResponse]: + r"""List queues + + List the review queues of the project. The default queue comes first. The list is paginated. To get the item counts of a queue, use `GET /queue/{id}`. + + :param page: + :param page_size: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListQueuesRequest( + page=page, + page_size=page_size, + project_id=project_id, + ) + + req = self._build_request( + method="GET", + path="/queue", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listQueues", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Review queues"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Optional[models.ListQueuesResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + page = request.page if isinstance(request.page, int) else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.totalPages").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit_ = request.page_size if isinstance(request.page_size, int) else 20 + if len(results[0]) < limit_: + return None + + return self.list( + page=next_page, + page_size=page_size, + project_id=project_id, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListQueuesResponse( + result=unmarshal_json_response(models.ListQueuesResponseBody, http_res), + next=next_func, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def list_async( + self, + *, + 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, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListQueuesResponse]: + r"""List queues + + List the review queues of the project. The default queue comes first. The list is paginated. To get the item counts of a queue, use `GET /queue/{id}`. + + :param page: + :param page_size: + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListQueuesRequest( + page=page, + page_size=page_size, + project_id=project_id, + ) + + req = self._build_request_async( + method="GET", + path="/queue", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listQueues", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Review queues"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + def next_func() -> Awaitable[Optional[models.ListQueuesResponse]]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + page = request.page if isinstance(request.page, int) else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.totalPages").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return empty_result() + + if not http_res.text: + return empty_result() + results = JSONPath("$.data").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit_ = request.page_size if isinstance(request.page_size, int) else 20 + if len(results[0]) < limit_: + return 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, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListQueuesResponse( + result=unmarshal_json_response(models.ListQueuesResponseBody, http_res), + next=next_func, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.PermissionDeniedErrorData, http_res + ) + raise errors.PermissionDeniedError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response(errors.NotFoundErrorData, http_res) + raise errors.NotFoundError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerErrorData, http_res + ) + raise errors.InternalServerError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + def retrieve( self, *, @@ -36,10 +350,10 @@ def retrieve( ) -> models.GetQueueResponse: r"""Get a queue - Get a queue + Get a review queue with its item counts. The counts use the filters and the date window of the queue, the same as the dashboard. - :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 id: The queue ID. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -156,10 +470,10 @@ async def retrieve_async( ) -> models.GetQueueResponse: r"""Get a queue - Get a queue + Get a review queue with its item counts. The counts use the filters and the date window of the queue, the same as the dashboard. - :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 id: The queue ID. + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -277,11 +591,11 @@ def get_stats( ) -> models.GetQueueStatsResponse: r"""Get queue statistics - Get detailed statistics about a moderation queue including review times, action counts, and trends + Get review statistics of a queue for a period: resolved and pending items, the top reviewers and the resolved items per day. - :param id: The queue ID + :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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -400,11 +714,11 @@ async def get_stats_async( ) -> models.GetQueueStatsResponse: r"""Get queue statistics - Get detailed statistics about a moderation queue including review times, action counts, and trends + Get review statistics of a queue for a period: resolved and pending items, the top reviewers and the resolved items per day. - :param id: The queue ID + :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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/sdk.py b/src/moderation_api/sdk.py index 14ccb74..0cf00f6 100644 --- a/src/moderation_api/sdk.py +++ b/src/moderation_api/sdk.py @@ -17,9 +17,11 @@ if TYPE_CHECKING: from moderation_api.account import Account from moderation_api.actions import Actions + from moderation_api.analytics import Analytics from moderation_api.authors import Authors from moderation_api.channels import Channels from moderation_api.content_sdk import ContentSDK + from moderation_api.feedback import Feedback from moderation_api.projects import Projects from moderation_api.queue_sdk import QueueSDK from moderation_api.webhooks import Webhooks @@ -32,7 +34,9 @@ class ModerationAPI(BaseSDK): https://docs.moderationapi.com """ + analytics: "Analytics" authors: "Authors" + feedback: "Feedback" queue: "QueueSDK" actions: "Actions" webhooks: "Webhooks" @@ -43,7 +47,9 @@ class ModerationAPI(BaseSDK): projects: "Projects" channels: "Channels" _sub_sdk_map = { + "analytics": ("moderation_api.analytics", "Analytics"), "authors": ("moderation_api.authors", "Authors"), + "feedback": ("moderation_api.feedback", "Feedback"), "queue": ("moderation_api.queue_sdk", "QueueSDK"), "actions": ("moderation_api.actions", "Actions"), "webhooks": ("moderation_api.webhooks", "Webhooks"), diff --git a/src/moderation_api/webhooks.py b/src/moderation_api/webhooks.py index 8a13457..afc1f63 100644 --- a/src/moderation_api/webhooks.py +++ b/src/moderation_api/webhooks.py @@ -28,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -167,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -312,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -435,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -553,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -658,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -767,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -896,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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. @@ -1021,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -1126,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/webhooksecret.py b/src/moderation_api/webhooksecret.py index 4ed0bb0..97a7237 100644 --- a/src/moderation_api/webhooksecret.py +++ b/src/moderation_api/webhooksecret.py @@ -23,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -122,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/wordlist.py b/src/moderation_api/wordlist.py index 6cefbf9..17e776b 100644 --- a/src/moderation_api/wordlist.py +++ b/src/moderation_api/wordlist.py @@ -42,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -199,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -342,6 +342,248 @@ async def empty_result(): raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + def create( + self, + *, + name: str, + project_id: Optional[str] = None, + key: Optional[str] = None, + description: Optional[str] = None, + words: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CreateWordlistResponse: + r"""Create wordlist + + Create a wordlist in the organization. You can add words now or later. Each word is embedded in the background for similarity matching. Use the embedding status endpoint to follow the progress. To use the wordlist in moderation, add it to a policy. + + :param name: Name of the wordlist + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + :param key: Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. + :param description: Description of the wordlist + :param words: Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateWordlistRequest( + project_id=project_id, + body=models.CreateWordlistRequestBody( + name=name, + key=key, + description=description, + words=utils.unmarshal(words, Optional[List[str]]), + ), + ) + + req = self._build_request( + method="POST", + path="/wordlist", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, False, False, "json", models.CreateWordlistRequestBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createWordlist", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Wordlists"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CreateWordlistResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + project_id: Optional[str] = None, + key: Optional[str] = None, + description: Optional[str] = None, + words: Optional[Iterable[str]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CreateWordlistResponse: + r"""Create wordlist + + Create a wordlist in the organization. You can add words now or later. Each word is embedded in the background for similarity matching. Use the embedding status endpoint to follow the progress. To use the wordlist in moderation, add it to a policy. + + :param name: Name of the wordlist + :param project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + :param key: Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. + :param description: Description of the wordlist + :param words: Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. + :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 + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateWordlistRequest( + project_id=project_id, + body=models.CreateWordlistRequestBody( + name=name, + key=key, + description=description, + words=utils.unmarshal(words, Optional[List[str]]), + ), + ) + + req = self._build_request_async( + method="POST", + path="/wordlist", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.body, False, False, "json", models.CreateWordlistRequestBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createWordlist", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Wordlists"], + extensions=None, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CreateWordlistResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestErrorData, http_res + ) + raise errors.BadRequestError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.AuthenticationErrorData, http_res + ) + raise errors.AuthenticationError(response_data, http_res) + if utils.match_response(http_res, "429", "application/json"): + response_data = unmarshal_json_response(errors.RateLimitErrorData, http_res) + raise errors.RateLimitError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.ModerationAPIDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.ModerationAPIDefaultError("Unexpected response received", http_res) + def retrieve( self, *, @@ -357,7 +599,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -477,7 +719,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -599,14 +841,14 @@ def update( ) -> models.UpdateWordlistResponse: r"""Update wordlist - Update a wordlist + Update a wordlist. Fields that you do not send stay the same. If you send words, they replace all existing words, and the embeddings are updated in the background. :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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 - :param words: New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. + :param words: New words for the wordlist. Replace the existing words with these new ones. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. :param strict: Deprecated. Now using threshold in project settings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -729,14 +971,14 @@ async def update_async( ) -> models.UpdateWordlistResponse: r"""Update wordlist - Update a wordlist + Update a wordlist. Fields that you do not send stay the same. If you send words, they replace all existing words, and the embeddings are updated in the background. :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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 - :param words: New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. + :param words: New words for the wordlist. Replace the existing words with these new ones. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. :param strict: Deprecated. Now using threshold in project settings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -857,7 +1099,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -979,7 +1221,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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 diff --git a/src/moderation_api/words.py b/src/moderation_api/words.py index 085378a..0a507c5 100644 --- a/src/moderation_api/words.py +++ b/src/moderation_api/words.py @@ -27,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -145,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -263,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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 @@ -376,7 +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 project_id: The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: 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