diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 557cdba..1a3d5e3 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2331670b-5789-4489-85ed-fb316d2d6d7e management: - docChecksum: 38730339aa1da77855e86c169896f12f + docChecksum: ed2fd953cba3e99fb81365252925a0d4 docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 5.1.1 - configChecksum: 6cbac05d92e51b9e4f0b80ec196fa8ef + releaseVersion: 5.2.0 + configChecksum: 4dbda5aa25bde9974dca06741a29c5d2 repoURL: https://github.com/moderation-api/sdk-typescript installationURL: https://github.com/moderation-api/sdk-typescript published: true @@ -54,7 +54,7 @@ trackedFiles: docs/models/authentication-error-code.md: last_write_checksum: sha1:ded523611ede5428ec082227fc531295a34bc352 docs/models/bad-request-error-code.md: - last_write_checksum: sha1:c42953467ceb19d3016430f022801e7534eb225e + last_write_checksum: sha1:f92f1bdff63c874995c87b2e2a7478698e28e3db docs/models/block.md: last_write_checksum: sha1:be375b2175db97656f912eb434592a8c292a26c2 docs/models/channel.md: @@ -68,13 +68,13 @@ trackedFiles: docs/models/errors/authentication-error.md: last_write_checksum: sha1:4cdad20cb9444299f43bc605a5c3c77c70710f37 docs/models/errors/bad-request-error.md: - last_write_checksum: sha1:9b330660c65d9df7df3cbe9f3fbe526586577382 + last_write_checksum: sha1:13b4e2910b848887815c2eb9bff3d8183abd504f docs/models/errors/conflict-error.md: last_write_checksum: sha1:dbce58e55529fb66d58147140881b8915ed6f5ad docs/models/errors/internal-server-error.md: last_write_checksum: sha1:1c3647d583d63ae0dc89113b126605222f35b714 docs/models/errors/not-found-error.md: - last_write_checksum: sha1:eb685f9ec1e5988222ce5e78c285bb7791b8c58f + last_write_checksum: sha1:035b1a927a2b857e6387cf0a9edae569b28ed250 docs/models/errors/permission-denied-error.md: last_write_checksum: sha1:4f8634c5835b32c836d054ddf8b323d216f18fad docs/models/errors/rate-limit-error.md: @@ -83,20 +83,22 @@ trackedFiles: last_write_checksum: sha1:6e87bc0075565dd8ba8768e18cb627b7899ec707 docs/models/internal-server-error-code.md: last_write_checksum: sha1:dae21e10d1084feea315eac34a7f01994237b46b + docs/models/label.md: + last_write_checksum: sha1:b437eaa8a6020647a02b71f83fc44bbe8cf36bd7 docs/models/metadata.md: last_write_checksum: sha1:fcf6676e02d01bb5039dd02a80919fb8831fc4bf docs/models/metrics.md: last_write_checksum: sha1:0dff9a6c4357acc69f216bb1264099978c4b5293 docs/models/not-found-error-code.md: - last_write_checksum: sha1:d32f5f2654150eec54ce5a6980d9fd68b5e8c1cc + last_write_checksum: sha1:ad8fe3bdd9669af1d73224988bc1edcdd4d9c0b3 docs/models/operations/action-request.md: last_write_checksum: sha1:346d74f9753d7017312f118a7599ce314a8e42ad - docs/models/operations/action-stat.md: - last_write_checksum: sha1:6e4fe93983334615f24ee6631eb63763b08e9f00 + docs/models/operations/action-response.md: + last_write_checksum: sha1:def6b750fede9e5a5de0ba35aa83dd8129ff38d2 docs/models/operations/add-wordlist-words-request-body.md: last_write_checksum: sha1:3fd7ca492410ff345db45fe8b9fe3bdc64953f28 docs/models/operations/add-wordlist-words-request.md: - last_write_checksum: sha1:c347e9285b0378e2f450e84447b107ecd04f547d + last_write_checksum: sha1:358d15a050a492bbd5be0c952c89cd0bcd0609b3 docs/models/operations/add-wordlist-words-response.md: last_write_checksum: sha1:cf1267a9dc5c51917004eeb674372308e5a82c6d docs/models/operations/adult.md: @@ -109,28 +111,24 @@ trackedFiles: last_write_checksum: sha1:e14a31b8fa9b8ec5b9e197fb64bab33e70ab019a docs/models/operations/author-status.md: last_write_checksum: sha1:a240bc22dc6e64b409101f9393d9c8f06b2bb590 - docs/models/operations/author.md: - last_write_checksum: sha1:ce6f2425788288d4c604e0692ecc1b1b09236268 docs/models/operations/behavior.md: last_write_checksum: sha1:2dc87fd2bca28e87b5e9e1b59dbdfea803edf944 docs/models/operations/block.md: last_write_checksum: sha1:65a37cde96d35aa3e9ef59e2c38fa72ae0868bcf docs/models/operations/brand-impersonation.md: last_write_checksum: sha1:29a1f98433b95f34ae3690a4bc1465386ce665c8 + docs/models/operations/bucket.md: + last_write_checksum: sha1:66ae5897b71b6ad531c85510f4ca9c447ddf394c docs/models/operations/cannabis.md: last_write_checksum: sha1:b7a8a05bc3452cd337ea708cf3fb24990e3cda6e - docs/models/operations/casebook-agreement.md: - last_write_checksum: sha1:07a5e41e9c50ccbd2dcac6e9763f5f7141ddaa39 - docs/models/operations/casebook-answer.md: - last_write_checksum: sha1:603d6259d9618ba39d8ea51426d7c2d531e56409 docs/models/operations/casebook.md: last_write_checksum: sha1:1219b1f467f90aceec35cd6f685f3c8f8ae51b28 docs/models/operations/channel-circumvention.md: last_write_checksum: sha1:8f2e2dc576c844d8894f203b82941f52d062e406 - docs/models/operations/check-status.md: - last_write_checksum: sha1:1a70bd1999c593a97b2e04eea8df62b670f124de + docs/models/operations/channel.md: + last_write_checksum: sha1:a34d4e754d58b0aea86c06b5d3f14e3312e8589d docs/models/operations/classifier-output.md: - last_write_checksum: sha1:621f1f0cf2f408bb3bac2492a41703874659d0d2 + last_write_checksum: sha1:fa841653042a94f84e2a00d19190f2ed4533e337 docs/models/operations/client-action.md: last_write_checksum: sha1:caed181f0db880df76e3c5221ab55c3ea0ec1ab8 docs/models/operations/code-abuse.md: @@ -162,7 +160,7 @@ trackedFiles: docs/models/operations/create-action-request-body.md: last_write_checksum: sha1:5618312af9e159916ed0faa89b6059325c6892b8 docs/models/operations/create-action-request.md: - last_write_checksum: sha1:665b1deb92d23202a149bcdc2fe5ffcc2f71208b + last_write_checksum: sha1:b103bcfe486a0663def7c29c20e83f67534ba875 docs/models/operations/create-action-response.md: last_write_checksum: sha1:bbb0d0ac31b00fd6decf12fb2249913e53b2d30d docs/models/operations/create-action-type-request.md: @@ -174,13 +172,25 @@ trackedFiles: docs/models/operations/create-author-request-body.md: last_write_checksum: sha1:7df7ceed9c42d185ed2b58990deb10019e98e673 docs/models/operations/create-author-request.md: - last_write_checksum: sha1:b68d1ac9f50761a4e14405484a5004a3505699f3 + last_write_checksum: sha1:beb89486ed96cde9e4972ff54e73a3540e16d32e docs/models/operations/create-channel-content-type.md: last_write_checksum: sha1:f72f71a57fad0c33b8cb4bdcdd06ae5697cde2ca docs/models/operations/create-channel-request-body.md: last_write_checksum: sha1:f68d1dd216b064dba8310102961563a6b313227a docs/models/operations/create-channel-request.md: last_write_checksum: sha1:695c0b721a29cb4e9ce1d20a3ac09097bbe0d136 + docs/models/operations/create-feedback-request-body.md: + last_write_checksum: sha1:156c9bed1243fe865d014d1d88babaa557b9e768 + docs/models/operations/create-feedback-request.md: + last_write_checksum: sha1:0ee279baee0ba2037b854155e0c398cb5b5cb329 + docs/models/operations/create-feedback-response.md: + last_write_checksum: sha1:157d9c9f65c3cc2604ad00a0b3a7f148f9e1bd16 + docs/models/operations/create-feedback-type.md: + last_write_checksum: sha1:808485d09b292505eb0bc6da465715a22503bdae + docs/models/operations/create-project-api-key-request-body.md: + last_write_checksum: sha1:360f94ec3b8d1016ea5e01d89a21aaff9d72e76d + docs/models/operations/create-project-api-key-request.md: + last_write_checksum: sha1:5beff99c3d2066e4a3c2827c0b862c84c99d1390 docs/models/operations/create-project-request.md: last_write_checksum: sha1:194ee488422f8f28672c606116cd8a9453809ec2 docs/models/operations/create-webhook-event-type-request.md: @@ -192,9 +202,15 @@ trackedFiles: docs/models/operations/create-webhook-request-body.md: last_write_checksum: sha1:669bd2cfe24389708e54b2f92aa65236807c384e docs/models/operations/create-webhook-request.md: - last_write_checksum: sha1:8390d5d666dc4560dcb5242b23daaf471a459cdf + last_write_checksum: sha1:929905728e0abf050feb4d3c4f1141c58676a93b docs/models/operations/create-webhook-response.md: last_write_checksum: sha1:6af3559e4f3da8f630519cd54d6d59e138b4b973 + docs/models/operations/create-wordlist-request-body.md: + last_write_checksum: sha1:5793f172e1f056de26c31fe8dd5feefd212d5914 + docs/models/operations/create-wordlist-request.md: + last_write_checksum: sha1:7e5cf5c9cb0c8171538486edbcdb0a3394125369 + docs/models/operations/create-wordlist-response.md: + last_write_checksum: sha1:b75a12d57c3435cf5c8efb8474f2342d316275d1 docs/models/operations/crypto.md: last_write_checksum: sha1:ee28188867d89b863d1ed003dc4d99d65f1c4955 docs/models/operations/curiosity-insight.md: @@ -202,7 +218,7 @@ trackedFiles: docs/models/operations/current-project.md: last_write_checksum: sha1:95eeb42c5c97fdc684635df874fa2e8c8006aa6a docs/models/operations/daily-review-count.md: - last_write_checksum: sha1:8415db9103c73c2a0b2a4b4156d99ff6544cc833 + last_write_checksum: sha1:62333b8f4245ea78756a401e7140e053a914d67c docs/models/operations/data-audio.md: last_write_checksum: sha1:56207e194dbf43b7ad4e2389d7c94a54ad275f40 docs/models/operations/data-image.md: @@ -212,11 +228,11 @@ trackedFiles: docs/models/operations/data-video.md: last_write_checksum: sha1:207610c44fe94cf119f3cfcdf4471bd26f69b807 docs/models/operations/delete-action-request.md: - last_write_checksum: sha1:f4193a4879d4d2388406d855cc25673307a22cfb + last_write_checksum: sha1:ae0e75a1b2e5f13a629ea940520cb28200a02f00 docs/models/operations/delete-action-response.md: last_write_checksum: sha1:21cd2fa0c991db8cec40b50f4f6888f71a205224 docs/models/operations/delete-author-request.md: - last_write_checksum: sha1:c69ddc97f3580f6e6aaa448d234239e5b37eab73 + last_write_checksum: sha1:307d943174678108b22fa552e0d5f3787138efad docs/models/operations/delete-author-response.md: last_write_checksum: sha1:c22d767de93db6b894e82418a4defe9e0872f909 docs/models/operations/delete-channel-request.md: @@ -228,7 +244,7 @@ trackedFiles: docs/models/operations/delete-project-response.md: last_write_checksum: sha1:443f2a7cf9042e2c1f0b51e708c5529c2920c44e docs/models/operations/delete-webhook-request.md: - last_write_checksum: sha1:74dc626c3e0cb958a817386dd8a63bcd7f83e8aa + last_write_checksum: sha1:fee7a3d1a2289bf9ab340685711b8ea0a3b20cc8 docs/models/operations/delete-webhook-response.md: last_write_checksum: sha1:3f8bc3d81daac532d4f63bb291139ab5c10c8f89 docs/models/operations/drugs.md: @@ -254,25 +270,21 @@ trackedFiles: docs/models/operations/execute-action-request-body.md: last_write_checksum: sha1:9d7b79817b40f70a62dc09087042d390e14101b3 docs/models/operations/execute-action-request.md: - last_write_checksum: sha1:a9b52afea20cb95aba9c5d993479cdfcd1e7c49a + last_write_checksum: sha1:bb82c15d20dffdd3ae7206224f27dcc8cc8a42d5 docs/models/operations/execute-action-response.md: last_write_checksum: sha1:12fce10184bdd16e84f51b1d373bc6723e2e6010 docs/models/operations/extremism.md: last_write_checksum: sha1:b91861f68b688a6d2031a3870b8dc22d3eec34b3 docs/models/operations/face-detection.md: last_write_checksum: sha1:503372c971e02a9701cf14ac30046ef1c00d9525 - docs/models/operations/filter-label.md: - last_write_checksum: sha1:b2b0830416ef64edd02ef82adef3741d223a1509 - docs/models/operations/filter.md: - last_write_checksum: sha1:ba8e3100b45b00957e4c2a45bd66fbbcc2d2489d - docs/models/operations/flagged-content-trend.md: - last_write_checksum: sha1:04606879b6df9928fbb911a3b021c8f92c93c6df + docs/models/operations/flag-rate-spike.md: + last_write_checksum: sha1:27279cdbbcbbf322119142fc0a9e107091093c97 docs/models/operations/flagging-mode.md: last_write_checksum: sha1:6f1c3627e482e2d3739526db111630e453f50ab2 docs/models/operations/gambling.md: last_write_checksum: sha1:5adc5517572e154a7f084fb5612f8e0c5561ca29 docs/models/operations/get-account-request.md: - last_write_checksum: sha1:24f9d3814ed5deab735ed981f9b2e123cba5414e + last_write_checksum: sha1:1ef1ca0d8bccb2e78ddf60ef5693e1a13f0a1a7e docs/models/operations/get-account-response.md: last_write_checksum: sha1:1a24bc7fe2224e7b7ba178683098868c4778639a docs/models/operations/get-action-position.md: @@ -282,49 +294,95 @@ trackedFiles: docs/models/operations/get-action-queue-behaviour.md: last_write_checksum: sha1:5d4317a80d04053d1e4fcf18134247cc4c9a8a74 docs/models/operations/get-action-request.md: - last_write_checksum: sha1:fea15cb2796dded792f1b43fc7aa631c4350dfbf + last_write_checksum: sha1:31de9c15b36d03ffc6c367c577c5cc8350840601 docs/models/operations/get-action-response.md: last_write_checksum: sha1:63ac4982855e7f06eeea646e25d87ba91d91b5ff docs/models/operations/get-action-type.md: last_write_checksum: sha1:d4716096df59c144490f7b4cc6d58a06f191962d + docs/models/operations/get-analytics-authors-author.md: + last_write_checksum: sha1:b3af56cbb1941eee4a93ab26d840719a0bc8b7f4 + docs/models/operations/get-analytics-authors-query-param-range.md: + last_write_checksum: sha1:2cd37c827e4fb04a7db718571b984863fe6a4ee0 + docs/models/operations/get-analytics-authors-range-response.md: + last_write_checksum: sha1:099da98b76875435d7419d4f25e71fa64a43b718 + docs/models/operations/get-analytics-authors-request.md: + last_write_checksum: sha1:8298f736309a763b6f1cbe8474a4551e7cff1faf + docs/models/operations/get-analytics-authors-response.md: + last_write_checksum: sha1:3ca3f4cd05a185c06bd8b2d31491a1a1ce1debe2 + docs/models/operations/get-analytics-automation-query-param-range.md: + last_write_checksum: sha1:5491e8db35c8b3033a221faeecfd003e6ab9d4bf + docs/models/operations/get-analytics-automation-range-response.md: + last_write_checksum: sha1:1befcc9249d8879196034f2b0c757d2f9482e8cd + docs/models/operations/get-analytics-automation-request.md: + last_write_checksum: sha1:5c954546882d4900cf24bee7dfb09a3385198eb9 + docs/models/operations/get-analytics-automation-response.md: + last_write_checksum: sha1:6935a504d7381944d5d9241a58cd9677e26b5b17 + docs/models/operations/get-analytics-channels-query-param-range.md: + last_write_checksum: sha1:b5fb6d05a744a72b0c7a780639a0c1d45571aeef + docs/models/operations/get-analytics-channels-range-response.md: + last_write_checksum: sha1:2623fefe816df3e71ee3fe31a023fb92ba4d28dc + docs/models/operations/get-analytics-channels-request.md: + last_write_checksum: sha1:ef04216cfcc5b30832fc65f44d22a29ad75e3d84 + docs/models/operations/get-analytics-channels-response.md: + last_write_checksum: sha1:a104b6fb858790e626ceff1243d2dc6b42afbf21 + docs/models/operations/get-analytics-policies-policy.md: + last_write_checksum: sha1:dd5e948d9dcee362474b2753d814f6f6a9d35e29 + docs/models/operations/get-analytics-policies-query-param-range.md: + last_write_checksum: sha1:54de5519ec73c2de0e0d945dd552f7385ab6d590 + docs/models/operations/get-analytics-policies-range-response.md: + last_write_checksum: sha1:7dd2b2adf294e6060c55e84400d319c2de1a016d + docs/models/operations/get-analytics-policies-request.md: + last_write_checksum: sha1:8783c2e817344e6edf9845f718d710ae43df3335 + docs/models/operations/get-analytics-policies-response.md: + last_write_checksum: sha1:c405374a36a3def8289071d866db2e83ee9ee0d6 + docs/models/operations/get-analytics-summary-query-param-range.md: + last_write_checksum: sha1:78b714cc36709be24a5081d73d932820ee455fe3 + docs/models/operations/get-analytics-summary-range-response.md: + last_write_checksum: sha1:e4ffe03847c4ab1b2081a5a35b5620310395abdc + docs/models/operations/get-analytics-summary-request.md: + last_write_checksum: sha1:70eb81b3edcc17f62a36a5f65f164a185b034a95 + docs/models/operations/get-analytics-summary-response.md: + last_write_checksum: sha1:7dfae97ddceed8ad5faa935f02e05b8c802be74f + docs/models/operations/get-analytics-volumes-query-param-range.md: + last_write_checksum: sha1:772a423576182b2bab3fe312078aeda8a72c255f + docs/models/operations/get-analytics-volumes-range-response.md: + last_write_checksum: sha1:79cec2ea8c1d7a206f1e27f580cf2eccdb1e517e + docs/models/operations/get-analytics-volumes-request.md: + last_write_checksum: sha1:74ec1e275e94a909302a7882d99473a5f1cf8335 + docs/models/operations/get-analytics-volumes-response.md: + last_write_checksum: sha1:ea641c4873e636293569654e1094cd12791c0120 docs/models/operations/get-author-request.md: - last_write_checksum: sha1:961a5a53eacb473e3450dadbc7a9d00d061b13a7 + last_write_checksum: sha1:c40893bc0ef54213fdc7d2f5edb12e81504244bd docs/models/operations/get-channel-request.md: last_write_checksum: sha1:707bf453a85565b21625b1e66753cd6e8f6dc8fc docs/models/operations/get-project-request.md: last_write_checksum: sha1:f607cb2dd9be62091e61653de0b602f125f542d2 - docs/models/operations/get-queue-content-type.md: - last_write_checksum: sha1:9029fa2b0816b9adf3cadf9d4697375f5456f7df - docs/models/operations/get-queue-recommendation-action.md: - last_write_checksum: sha1:bdf2011f8cdf34284d9748e7620b783b16c62070 docs/models/operations/get-queue-request.md: - last_write_checksum: sha1:3be9c63068a132fa53c1a421baac82290b33bba9 + last_write_checksum: sha1:93053c6e91c3d3caf8cb8117f87592de085453b5 docs/models/operations/get-queue-response.md: - last_write_checksum: sha1:fb935318459b57d7da6645a22b00782674a79cf2 + last_write_checksum: sha1:000b59d5c44103f42337b90374fe9399484b27b1 docs/models/operations/get-queue-stats-request.md: - last_write_checksum: sha1:e660366fb8873bbc016cbadccafa9f3e6abed1ef + last_write_checksum: sha1:4802b0dbb7e2b88195f7d46d019ddf287a2227c3 docs/models/operations/get-queue-stats-response.md: - last_write_checksum: sha1:a95741c07cf693575f6a90ba1981c694658f0a44 - docs/models/operations/get-queue-type.md: - last_write_checksum: sha1:aa739bcbdc63b081b0aa0549853f01c03521b7bf + last_write_checksum: sha1:74930ff0e4b0903b79f457716666b56607770672 docs/models/operations/get-webhook-event-type.md: last_write_checksum: sha1:e00fa62642feae64be5687aca8970a19bb3dc824 docs/models/operations/get-webhook-payload-version.md: last_write_checksum: sha1:d1b0b75f6b51b2bcdeb8553af6ac8741feae8332 docs/models/operations/get-webhook-request.md: - last_write_checksum: sha1:c9231ec12af924747548244c73f965923ee500f8 + last_write_checksum: sha1:2f7ce405bc690bca958bba3cd449e8ee78821d7d docs/models/operations/get-webhook-response.md: last_write_checksum: sha1:ff29e0e0ad67e8cc282c47067121995dfade58c9 docs/models/operations/get-webhook-secret-request.md: - last_write_checksum: sha1:5889e9f67aa651f6b8c3b422c15c49408aa9a060 + last_write_checksum: sha1:befdeaa619aa0a630c184f3bbc8bd9bd10d9e7d9 docs/models/operations/get-webhook-secret-response.md: last_write_checksum: sha1:3f86ae7f31c748d5615acb06659535a8b581764f docs/models/operations/get-wordlist-embedding-status-request.md: - last_write_checksum: sha1:878dc7b223480b885504702368a8a2439d265583 + last_write_checksum: sha1:5154eb407ce2b557b5c4871cdc054adada5f15f7 docs/models/operations/get-wordlist-embedding-status-response.md: last_write_checksum: sha1:9116183c49fbdb044bab989a17d6b6d763661d11 docs/models/operations/get-wordlist-request.md: - last_write_checksum: sha1:0a100e48ba26f9d6faf1853167daec6ba8ca13a4 + last_write_checksum: sha1:ae36359bc69dc2294b9acd124740017e01a7bc4c docs/models/operations/get-wordlist-response.md: last_write_checksum: sha1:6f0275935b0a9f159c34f8b047af58860649e5f7 docs/models/operations/global-flagging-mode.md: @@ -353,8 +411,8 @@ trackedFiles: last_write_checksum: sha1:ad13baa172ea88be9ffd13906da4504f38f79ce3 docs/models/operations/insight.md: last_write_checksum: sha1:5eaa59dcff3b2b40c7b8aef63d5a667014f2ec4b - docs/models/operations/is-flagged.md: - last_write_checksum: sha1:e5ec2d7ae3dd3fab9b100fca92b3b58731fac397 + docs/models/operations/label.md: + last_write_checksum: sha1:36f986300a16772220602a9d3a742e109f315799 docs/models/operations/language-insight.md: last_write_checksum: sha1:4326c8e0b9426d341f58d2a47fc047476cac90ba docs/models/operations/list-actions-data.md: @@ -366,7 +424,7 @@ trackedFiles: docs/models/operations/list-actions-queue-behaviour.md: last_write_checksum: sha1:d9a1752d254d17207c1b252fc51530a4ed724f6d docs/models/operations/list-actions-request.md: - last_write_checksum: sha1:b21e810e95530e94fd18ac6932479806b7b03227 + last_write_checksum: sha1:dc05051c44c6c6bcd4dc2b764340461735281dc7 docs/models/operations/list-actions-response-body.md: last_write_checksum: sha1:70db78b9dc061a12bb97c9c60fddc1e53dd638da docs/models/operations/list-actions-response.md: @@ -374,13 +432,11 @@ trackedFiles: docs/models/operations/list-actions-type.md: last_write_checksum: sha1:e3df5f195fd93649db3ce08ce2fd001dbb29f9ed docs/models/operations/list-authors-request.md: - last_write_checksum: sha1:f3b3ec693372fb2a77f5c8509cc70bf9932996a4 + last_write_checksum: sha1:18b6c7b10b44e3d19540d9d88db463b22f2a0fe9 docs/models/operations/list-authors-response-body.md: last_write_checksum: sha1:15ba61c20108439a81dde996e9f11b08819f80ae docs/models/operations/list-authors-response.md: last_write_checksum: sha1:28cc9212d73eaad43146ed58f3b5765cbffd07e5 - docs/models/operations/list-authors-sort-direction.md: - last_write_checksum: sha1:4d6344ff8be6579589485f58ab05566dde7b7b2a docs/models/operations/list-channels-request.md: last_write_checksum: sha1:0a59167b813f8b8882f8784c90c535497e435d86 docs/models/operations/list-channels-response-body.md: @@ -393,22 +449,18 @@ trackedFiles: last_write_checksum: sha1:9a968e3924bde2e3f77339217f330b05bf820498 docs/models/operations/list-projects-response.md: last_write_checksum: sha1:13025ce371d73d1df5054181f5eb01065e429bb9 - docs/models/operations/list-queue-items-action.md: - last_write_checksum: sha1:d0951890a7fb71cbdc838fb6c96e3408ae494bbb - docs/models/operations/list-queue-items-data.md: - last_write_checksum: sha1:f3b9353624333d2e68f336ac60ef11551132a469 - docs/models/operations/list-queue-items-label.md: - last_write_checksum: sha1:f03b855ca94682df4f46f351156e2be9923173a6 docs/models/operations/list-queue-items-request.md: - last_write_checksum: sha1:b6c6707a379a5635f912c4687a161ad0b8827192 + last_write_checksum: sha1:49b357bc020eecce6ae5dcb4b69fd8a39d1a36ac docs/models/operations/list-queue-items-response-body.md: - last_write_checksum: sha1:c5181c6e52d0cfc4a4f99386f2eaef1ffbead3d7 + last_write_checksum: sha1:86aa220b01a2d23d472a0dc80e289c90316b463e docs/models/operations/list-queue-items-response.md: - last_write_checksum: sha1:d31f79cbb8d3962a204a5cb3edd40e5f134e231e - docs/models/operations/list-queue-items-sort-direction.md: - last_write_checksum: sha1:ecd787e8c193175dcf07fcaa826c054516448011 - docs/models/operations/list-queue-items-status.md: - last_write_checksum: sha1:0717214f5884cb9025553a6edf50c6dc38c0b12a + last_write_checksum: sha1:135b09b11146837e847df3d01f38426c2ef22e06 + docs/models/operations/list-queues-request.md: + last_write_checksum: sha1:cfd151738e93fc7b1ed3ec3ca5334f568b25b843 + docs/models/operations/list-queues-response-body.md: + last_write_checksum: sha1:0a1725ddbd96ab053d18e1ac8153f82ddd4f77f5 + docs/models/operations/list-queues-response.md: + last_write_checksum: sha1:8504feca580e2128c3d9b9a1845ce3c08cc85c28 docs/models/operations/list-webhooks-data.md: last_write_checksum: sha1:da21d2eaa6ae59d066fca7a90676c3f366c4b5c8 docs/models/operations/list-webhooks-event-type.md: @@ -416,7 +468,7 @@ trackedFiles: docs/models/operations/list-webhooks-payload-version.md: last_write_checksum: sha1:96ac775d5025e05cd94afa91b7cab7ec6fab076a docs/models/operations/list-webhooks-request.md: - last_write_checksum: sha1:2ec3733c6fe2e4b4f76404ce51ac5acc418ec123 + last_write_checksum: sha1:de55562eeb1ef3f1ce25a39ab7975ecc183a500a docs/models/operations/list-webhooks-response-body.md: last_write_checksum: sha1:1f607ad9e6009ad425af44ef5cc1ebd2b2a82ddf docs/models/operations/list-webhooks-response.md: @@ -424,7 +476,7 @@ trackedFiles: docs/models/operations/list-wordlists-data.md: last_write_checksum: sha1:0a710da678fb4956280502641ba9756b756e5981 docs/models/operations/list-wordlists-request.md: - last_write_checksum: sha1:fae07bf6f9d9d6e430bace62e1e4bbc02f2f6696 + last_write_checksum: sha1:47cfd88173bb2aaba698cd6ee75fdaee909adc9c docs/models/operations/list-wordlists-response-body.md: last_write_checksum: sha1:eb7932e4f58dabf7597c5e5ccb4f50e9af534103 docs/models/operations/list-wordlists-response.md: @@ -435,16 +487,12 @@ trackedFiles: last_write_checksum: sha1:f7ed85e25ebeb9f557f0c6eac29cab4a1e2a8b40 docs/models/operations/matched-rule.md: last_write_checksum: sha1:e4d59e5742d5c69aff621298d74b4eab275381e6 - docs/models/operations/media-type.md: - last_write_checksum: sha1:52ef9dbac6697c5abde83204fbec4e6ea5c9d9bc docs/models/operations/meta-status.md: last_write_checksum: sha1:d0df2acb77491d3232622dfec1b9a91b599e9df0 docs/models/operations/meta-type.md: last_write_checksum: sha1:e9913f962ff7527c0d00484d5e7af8cbfdb69a18 docs/models/operations/meta.md: last_write_checksum: sha1:ed7578476dfa1a19456c22bd4e63d3845e4d0ec8 - docs/models/operations/metadata-filter.md: - last_write_checksum: sha1:5df373ef8e5fa26d4fa19af3416301d8bddb12cb docs/models/operations/method.md: last_write_checksum: sha1:97e2d10511d120e8108a9d10bc01814a50339c7a docs/models/operations/modified.md: @@ -459,38 +507,42 @@ trackedFiles: last_write_checksum: sha1:3c674a750c7c7775944628de7acb19ebc4479b25 docs/models/operations/policy-request.md: last_write_checksum: sha1:339ec81b98fc5024e4825493a4482d0e958acbe7 - docs/models/operations/policy-response.md: - last_write_checksum: sha1:4011698b281673aef3556362984b18a9810efb07 docs/models/operations/political.md: last_write_checksum: sha1:40983d2c92799a101b982f876c941352695d4208 + docs/models/operations/previous-period.md: + last_write_checksum: sha1:768526d56af4620b3079bb1b3adea13bed1b0dd4 docs/models/operations/profanity.md: last_write_checksum: sha1:af7399b082d44d28999479a76d5aa3a0cf0cf9cb docs/models/operations/promotion.md: last_write_checksum: sha1:7404c0b13b9936359be364ea9e31fa9bb0168ee3 - docs/models/operations/queue.md: - last_write_checksum: sha1:c1b6fe8d597e1e730cf2d1eac7e63ba7675c160a docs/models/operations/reason-code-enum.md: last_write_checksum: sha1:629ccd3d590076953bfbee154e8b608e9baefea7 docs/models/operations/reason-code.md: last_write_checksum: sha1:26f74f9e85d3a097658fdbae0ec2f0766be3797d docs/models/operations/recommendation.md: - last_write_checksum: sha1:7fe36800a0e17b46a5b66c0b7f99802a036229cb + last_write_checksum: sha1:159ef93a181cd94d8a58009f6639d903be5b55b4 docs/models/operations/religion.md: last_write_checksum: sha1:ebb4d54c6e5080e8cc95379858faba8ad981c8d0 docs/models/operations/remove-wordlist-words-request.md: - last_write_checksum: sha1:eb747ee8460bcd139b97b8cce9d5a12878f20ae9 + last_write_checksum: sha1:5a765fa96186cf423caf9a48587042722db15494 docs/models/operations/remove-wordlist-words-response.md: last_write_checksum: sha1:e23252b42245e21a8ef0934a68b7cb04de441274 - docs/models/operations/resolve-queue-item-request-body.md: - last_write_checksum: sha1:eb50a2fdbfc1786137121facf2d7cb7c397509df docs/models/operations/resolve-queue-item-request.md: - last_write_checksum: sha1:2d7c9e1c95eee1cfc0f3d8e7ed09e691e8ad06c0 + last_write_checksum: sha1:c0fc47730a6eb1d6897463d0ec1ac2e722d81fab docs/models/operations/resolve-queue-item-response.md: - last_write_checksum: sha1:2a0cf0a5df0ee5cd0bc10a99d58295a58f2c3aec + last_write_checksum: sha1:b8520e9effc3834840068b5198ae8f8121656e6f + docs/models/operations/resolve-queue-items-request-body.md: + last_write_checksum: sha1:cfc86a24bf0df27b60782185ecfff09e7f9efd22 + docs/models/operations/resolve-queue-items-request.md: + last_write_checksum: sha1:fc11bbc90ae968ccf192a0fd5cad362da5847d2e + docs/models/operations/resolve-queue-items-response.md: + last_write_checksum: sha1:417bfdf7a8e4db709c26bf2be811b369a44bb6fb docs/models/operations/respect-insight.md: last_write_checksum: sha1:4b1a6f187a513f87358067533f2daf28f27c38be docs/models/operations/review-stats.md: - last_write_checksum: sha1:5e563015cf73b9c6e62009da0b55610528b23bee + last_write_checksum: sha1:a10043101251cc2f2db7695be5b23ff777f21b37 + docs/models/operations/rule.md: + last_write_checksum: sha1:120a78f1ee751f069ed7249d69ec7d5264beadee docs/models/operations/scores.md: last_write_checksum: sha1:506a81b3710e38efbfd27beb265d7c5170a10af1 docs/models/operations/self-harm.md: @@ -510,21 +562,25 @@ trackedFiles: docs/models/operations/signals-response.md: last_write_checksum: sha1:90fa445fb617bdf3fd648d7835ca614a607af024 docs/models/operations/sort-by.md: - last_write_checksum: sha1:f32a01d2296df1cfdc254eaa3497735cf53f6e64 - docs/models/operations/sort-field.md: - last_write_checksum: sha1:5e7e384283b0d515c47ee40a7725bf8d709821f2 + last_write_checksum: sha1:297b8387bd740dd2e5e5c300a3b57d8c21185a02 + docs/models/operations/sort-direction.md: + last_write_checksum: sha1:1b7b85096a9455025e1ef1cc6018279d0bee9ee2 + docs/models/operations/sort.md: + last_write_checksum: sha1:410b2f69e4e04be7fb3d5c8b4ef816a8ca98a80a + docs/models/operations/source.md: + last_write_checksum: sha1:d4ec80710bbb63e1c3447704275cd0f700b2f5e5 docs/models/operations/spam.md: last_write_checksum: sha1:915e7d376831fbbc79edf756462baa188678d4c2 - docs/models/operations/submit-content-label.md: - last_write_checksum: sha1:7d1ff73d106e8307b162d63feae1b606ede9c0bd - docs/models/operations/submit-content-recommendation-action.md: - last_write_checksum: sha1:2514acb074b6a84b552457d939fac38caeaff726 + docs/models/operations/submit-content-author.md: + last_write_checksum: sha1:2626920a8808dcbb8b653156e813229a3f6774a5 + docs/models/operations/submit-content-policy-response.md: + last_write_checksum: sha1:89835680f7e68306df9b9cf1358ae066b43ed06b docs/models/operations/submit-content-request-body.md: - last_write_checksum: sha1:a4e3f3af74a58590cfb9974632ddc6d4efc6786b + last_write_checksum: sha1:328b2809cdd0546a73abaaa9eb6f8a3f368a4338 docs/models/operations/submit-content-request.md: - last_write_checksum: sha1:4a3d8248a9cee74c3435f8454c7521fd419a552c + last_write_checksum: sha1:618ad532892eacee33fb6764913f6108b5130d98 docs/models/operations/submit-content-response.md: - last_write_checksum: sha1:bc242c48c0b2d816c144783c7d19545e09626d59 + last_write_checksum: sha1:6b2df2610c83c88c210b2c5eae5a777a72669787 docs/models/operations/text-request.md: last_write_checksum: sha1:6737b0c0a8d8692dde7211d87fe89238aef52e94 docs/models/operations/text-response.md: @@ -533,28 +589,28 @@ trackedFiles: last_write_checksum: sha1:3b1fc742078559104005969d51cbc10f0083b1a0 docs/models/operations/tobacco.md: last_write_checksum: sha1:1927b81b1db88cb4154c846dbe1d4092388e76ec - docs/models/operations/top-action.md: - last_write_checksum: sha1:3c22446b2e9b43f366c81c8e3fceec6520255488 docs/models/operations/top-reviewer.md: - last_write_checksum: sha1:dce2bff3c9b4b3847e9abafaa860368a7b878652 + last_write_checksum: sha1:d9adb298d661eefaf4cb8292e63d7d30c5ed88e9 docs/models/operations/topic.md: last_write_checksum: sha1:f5fa84e5e0d52fd77742b3e5690fd47dff2219bb + docs/models/operations/totals.md: + last_write_checksum: sha1:a87487ef5900bc8ee737b835e9f30d0021c61fa7 docs/models/operations/toxicity.md: last_write_checksum: sha1:26d63a91920c60d3440d5898fce98dd03571d90e docs/models/operations/transcription-quality.md: last_write_checksum: sha1:6bce5be95d4da014312e87eb0c696ad25a62353f docs/models/operations/trends.md: - last_write_checksum: sha1:34215c0fae6ba28da21982855c3e269d7ae10c84 + last_write_checksum: sha1:5e0c833fe16e96ce671fa036f19a7ccb0a22b13f docs/models/operations/trust-level.md: last_write_checksum: sha1:78da4e58c4a4fd23904f507ab74a713dcd2172c5 docs/models/operations/unicode-spoofing.md: last_write_checksum: sha1:46001ecb3e3d7cceb9d0bda3687ce1cf001ab296 - docs/models/operations/unresolve-queue-item-request-body.md: - last_write_checksum: sha1:befb3650deba6f87ae978ff6a020705d022e3d15 docs/models/operations/unresolve-queue-item-request.md: - last_write_checksum: sha1:2e170734b0d8b0e16fa13fa0c3036d8998a05b2d + last_write_checksum: sha1:6fc38de44a4181b6a9ba7b8ca7e40a70af60a9e3 docs/models/operations/unresolve-queue-item-response.md: - last_write_checksum: sha1:914a833cb3fe2c7be241e1811b320a53f7617343 + last_write_checksum: sha1:27c007356cb2e365f5e54da0429d6ae5f6a77502 + docs/models/operations/unresolve-queue-item-status.md: + last_write_checksum: sha1:2665a866a019ac776855d3a0b6737db8ae1d992f docs/models/operations/update-action-position-request.md: last_write_checksum: sha1:96ac3887563b75bcc1f07ab20eb20283d4f59664 docs/models/operations/update-action-position-response.md: @@ -570,7 +626,7 @@ trackedFiles: docs/models/operations/update-action-request-body.md: last_write_checksum: sha1:d6db2adee9cef0d7baf847844de5580fb10e8ca9 docs/models/operations/update-action-request.md: - last_write_checksum: sha1:a4b16210e48a1bf783ff6b78a190a8db66e8ac09 + last_write_checksum: sha1:d43cf9730f97a2ec7bc2e125b1a811ab91abc027 docs/models/operations/update-action-response.md: last_write_checksum: sha1:c26128748689722552d4db4c7a27e94b71a27d45 docs/models/operations/update-action-type-request.md: @@ -582,7 +638,7 @@ trackedFiles: docs/models/operations/update-author-request-body.md: last_write_checksum: sha1:fd1591a0367da42fe5b6f34e64c8d8bbb584b84b docs/models/operations/update-author-request.md: - last_write_checksum: sha1:d03e75866f856aad5a31ce1b554ba100bf7a9149 + last_write_checksum: sha1:646b76d1aba1f1a2ca8167b746925f837fef32c1 docs/models/operations/update-channel-content-type.md: last_write_checksum: sha1:93f08aceb660f34d40fc6bafe973725b7fcf3b08 docs/models/operations/update-channel-request-body.md: @@ -602,13 +658,13 @@ trackedFiles: docs/models/operations/update-webhook-request-body.md: last_write_checksum: sha1:da06b19a591b9f3644401bc459f1e54e19dc7e16 docs/models/operations/update-webhook-request.md: - last_write_checksum: sha1:849f4669e91ae80666783175806005a892e8c2bd + last_write_checksum: sha1:56af8249d8cd6d4dfb38cbe06f45d589b00c57ae docs/models/operations/update-webhook-response.md: last_write_checksum: sha1:7a4027d284b8b754474eeafbefe720c1f5405415 docs/models/operations/update-wordlist-request-body.md: - last_write_checksum: sha1:a10650e6b0e045034bc1c366867f66bb4c0cc791 + last_write_checksum: sha1:f79acfda055a9c7a2f886593da3798cc1c69e309 docs/models/operations/update-wordlist-request.md: - last_write_checksum: sha1:bf0836f660c81547a17bed9d5e5e91d2934d5a39 + last_write_checksum: sha1:fd7bc2114d6672e0549175353e9cd6cb4d5c25cd docs/models/operations/update-wordlist-response.md: last_write_checksum: sha1:d1bcfa842e01f00e817271692c356bbb61aabca8 docs/models/operations/url-masking.md: @@ -625,16 +681,18 @@ trackedFiles: last_write_checksum: sha1:58e593051e7f725c6d3378af60beeea6ba02d7b2 docs/models/operations/violence.md: last_write_checksum: sha1:10aebd90afe71d5c493734d14621c56209d8ffea + docs/models/operations/volume.md: + last_write_checksum: sha1:170705fb2bd12e3526e15bb574df6b52156b9397 docs/models/operations/weapons.md: last_write_checksum: sha1:b3703e25df6c87f9e275d7f9c6f937e384b239fa - docs/models/operations/within-unit.md: - last_write_checksum: sha1:feb8b654ac4c0797b054f22654085a75b2fdb2e5 docs/models/pagination.md: last_write_checksum: sha1:8e053dfad04f8ecfde28ddd79e4371f5b31c19e3 docs/models/path.md: last_write_checksum: sha1:000f66a8cdd02ed7c05e8e80aa1fd09a1ed2d2ee docs/models/permission-denied-error-code.md: last_write_checksum: sha1:a0c3b391ec07d6a0632478a2042f111f92dc5663 + docs/models/project-api-key.md: + last_write_checksum: sha1:23176c3f51465d917f0686b903657cd21062bbf7 docs/models/project-global-flagging-mode.md: last_write_checksum: sha1:d2c5e7e20fe2c4128e5a954355381bb0ad2eb9fd docs/models/project-with-key-global-flagging-mode.md: @@ -643,44 +701,86 @@ trackedFiles: last_write_checksum: sha1:d356d9ecaf826f15c09126db4df00b0ab667ef9e docs/models/project.md: last_write_checksum: sha1:7f02a22f5cc852c6bcd7251d9468a05bf8619e86 + docs/models/public-author-status.md: + last_write_checksum: sha1:bf7405577881f0f7c365dd40e86fbfe65eb514b1 docs/models/public-author.md: - last_write_checksum: sha1:d5f42bb5c4feb82c7f8b5e538520e22fbaae5e03 + last_write_checksum: sha1:516aefd18aec202fa2a815874a649e3c415ebad7 + docs/models/queue-item-audio.md: + last_write_checksum: sha1:d326a9b8188b5d12e324104dc6712e1abcfea43f + docs/models/queue-item-brand-impersonation.md: + last_write_checksum: sha1:09655f84e365e96ea0ef460cf342bd2fdd991e16 + docs/models/queue-item-content-leaf-audio.md: + last_write_checksum: sha1:cd4f1eb518e71d454abaae4d9eb25d27304d3977 + docs/models/queue-item-content-leaf-image.md: + last_write_checksum: sha1:59de3948fe94a0a0ae37fad616d03940452f4c34 + docs/models/queue-item-content-leaf-text.md: + last_write_checksum: sha1:672fdc125f193c00ba24e4868871301b12cc85ff + docs/models/queue-item-content-leaf-video.md: + last_write_checksum: sha1:4b359b5806b89e3a27a30ae1a69e7766bcbd55bd + docs/models/queue-item-content-leaf.md: + last_write_checksum: sha1:551a480a2a64f7f507484e16158c37103940c2a9 + docs/models/queue-item-content.md: + last_write_checksum: sha1:9c9b94d75af512bf2730ef325889275f8087d0d9 + docs/models/queue-item-image.md: + last_write_checksum: sha1:fc4d7806b29e4e35fbb2b2ccc992b45822bdfe59 + docs/models/queue-item-match.md: + last_write_checksum: sha1:916221d7de9195da397e4b3847dd2aa6d02c148a + docs/models/queue-item-object.md: + last_write_checksum: sha1:d5a6a21be6667018129e60ffd498cae2132f5a18 + docs/models/queue-item-signals.md: + last_write_checksum: sha1:85401dbdb8a197dd42239b79f5267dbdb8177549 + docs/models/queue-item-status.md: + last_write_checksum: sha1:c8979f56eb1370e0e9fd1491994ab8441b8267c3 + docs/models/queue-item-text.md: + last_write_checksum: sha1:dea31cc574c9bda0377041859d3f19894b796568 + docs/models/queue-item-video.md: + last_write_checksum: sha1:04761ec0f349c7e26f5a11b293ebe8b50a9eef7c + docs/models/queue-item.md: + last_write_checksum: sha1:9038f1cf671820407f2a561c2d6fb786234ed2df + docs/models/queue-with-counts.md: + last_write_checksum: sha1:82df58d0f4093b31351bf31ea3ea2b134767e2b4 + docs/models/queue.md: + last_write_checksum: sha1:66c31a6eccce4aa131561f0984a30c0e259e29a6 docs/models/rate-limit-error-code.md: last_write_checksum: sha1:5b2542ff8b19eedb584f2cf71b01cca634e914e3 docs/models/risk-evaluation.md: last_write_checksum: sha1:1a67320a3397c130ae7574d0ff337454193dd208 docs/models/security.md: last_write_checksum: sha1:5b675d144790c68e32185ed63584ae7326f30081 - docs/models/status.md: - last_write_checksum: sha1:59993a07e1e072e241e0bb4a99d92fc7f39193b9 docs/models/transcription-quality.md: last_write_checksum: sha1:26fc11331dee7bda256a1eef89429b3c61ec1ca6 docs/models/trust-level.md: last_write_checksum: sha1:fbd2f87580c0a6f92a88899ab764c9aa97d562a8 docs/sdks/account/README.md: - last_write_checksum: sha1:c362f326561e234bfd195d45d6aa4f653de7ab7a + last_write_checksum: sha1:059fed03cb41253ac7d36f0683b67d68d584c974 docs/sdks/actions/README.md: - last_write_checksum: sha1:fc74c894b10d3ed4f5f04effdbc261d223618fc0 + last_write_checksum: sha1:efb3e4aaa786d2f6f8f9b9496685c04c1db3af48 + docs/sdks/analytics/README.md: + last_write_checksum: sha1:4b69eb107c5f39db87bf4182612e2f092aab25b3 + docs/sdks/apikeys/README.md: + last_write_checksum: sha1:a092ea30162aba4182557f85a1332122c79cfaac docs/sdks/authors/README.md: - last_write_checksum: sha1:bb82e264379aa8169ccfc97f6ff879567e49aee0 + last_write_checksum: sha1:075e8e8ecf7556fa7b7e0ea8d520c1afe42ed15b docs/sdks/channels/README.md: last_write_checksum: sha1:0dc23f6f60598b2cbd22b0437e671cfda686562c docs/sdks/content/README.md: - last_write_checksum: sha1:f99c782a1bab737590c4795949b9aaaacbf2afd8 + last_write_checksum: sha1:25b36c70c1cab595dd4c193c3069001bb8bb64a6 + docs/sdks/feedback/README.md: + last_write_checksum: sha1:209a6ea1eab58021ca88d175ca9304087eef15f8 docs/sdks/items/README.md: - last_write_checksum: sha1:049c5c291a257599b7c93cab133dea4e12a53df0 + last_write_checksum: sha1:f527557054ae862320fb15adf1610a2bb2597114 docs/sdks/projects/README.md: last_write_checksum: sha1:5099f84c9c94c5588cc8c8b646ae74054d4be863 docs/sdks/queue/README.md: - last_write_checksum: sha1:ff03507002d7ec54bb21e2e9dd4418434b273856 + last_write_checksum: sha1:fa720eafe959c93f45ba03fd9fa0779fad4f4b1a docs/sdks/webhooks/README.md: - last_write_checksum: sha1:e51d6d77e2ce0e07dc0f58703bed11e3a1ea9a09 + last_write_checksum: sha1:1e7ca844fb547c0f06e0b40b30685a1c956d6e08 docs/sdks/webhooksecret/README.md: - last_write_checksum: sha1:55f458a9214267e58990b23823c7944b1f3ef83f + last_write_checksum: sha1:cab757440af86a7d567f79312b737d9845e0d6a2 docs/sdks/wordlist/README.md: - last_write_checksum: sha1:cfb69280acc8ae3adaeb1d567c0ae15b40af6b66 + last_write_checksum: sha1:8835b8497ca8ace37e6f0a3211e40f0843638b27 docs/sdks/words/README.md: - last_write_checksum: sha1:2feb2b2b8f5e2060ba638cb7e8fbea64afaf846a + last_write_checksum: sha1:04f7705c5f43e60d149f5a4d1f519bfbe728c4bd examples/.env.template: last_write_checksum: sha1:b9b5c0aa9e791535de9c5f1c75634faef4b4b030 examples/README.md: @@ -690,9 +790,9 @@ trackedFiles: examples/package.json: last_write_checksum: sha1:72d702bad23c84698d27164ca08d5f0ff931af65 jsr.json: - last_write_checksum: sha1:d9f5d71a49c0d43a9668b8caa46a1526aacba781 + last_write_checksum: sha1:06dd576f267b7cd04041eba64710d91e07f1b7e9 package.json: - last_write_checksum: sha1:f8d16c8a36dbd37faf95aa8e2987a3057a82df41 + last_write_checksum: sha1:e317ca7d796fde818116327831b8246a129b5d41 src/core.ts: last_write_checksum: sha1:72b4c09e9228c63a9cc3335baa0ae5be47c2bc9c src/funcs/account-retrieve.ts: @@ -709,12 +809,24 @@ trackedFiles: last_write_checksum: sha1:352c4bc9b37efc482a45cb06fa66ac73c2bdcef4 src/funcs/actions-update.ts: last_write_checksum: sha1:2efd3a0254a88bdfab2400094668acbb5c55afbc + src/funcs/analytics-authors.ts: + last_write_checksum: sha1:f6b3a01407d3073d9b60ff1972c5671130bbe090 + src/funcs/analytics-automation.ts: + last_write_checksum: sha1:d82e5ef0bf8593dda04b12b29925d7f93d807f7a + src/funcs/analytics-channels.ts: + last_write_checksum: sha1:01db546fc1548ba234a60ff0256035cda71a3efe + src/funcs/analytics-policies.ts: + last_write_checksum: sha1:6ab6c52c64c1a8401669312d9f757b0fa5c6130d + src/funcs/analytics-summary.ts: + last_write_checksum: sha1:6081e08cbc3a84abf954c50274b2d0eb0828c309 + src/funcs/analytics-volumes.ts: + last_write_checksum: sha1:ba7c046dcc29244ee55f2b6713992d0b4d5fd1b6 src/funcs/authors-create.ts: last_write_checksum: sha1:926d3251f649dc8e8a301acbed96427e712db3b1 src/funcs/authors-delete.ts: last_write_checksum: sha1:5b89d5be1f1de7530b3ccdf54fda5f92f7d74bb3 src/funcs/authors-list.ts: - last_write_checksum: sha1:772f322623e813cb312c9f8503c6525955538479 + last_write_checksum: sha1:ecb7897c309109435e738f06f399021f80cb9e37 src/funcs/authors-retrieve.ts: last_write_checksum: sha1:2b7dab0749ee6eeb86204e14bd794dbac65b9ace src/funcs/authors-update.ts: @@ -733,6 +845,10 @@ trackedFiles: last_write_checksum: sha1:d28482419848661dc8a626a089112e73d1f8134e src/funcs/content-submit.ts: last_write_checksum: sha1:fdca5b9045341128939058fb21071d48d2c01eb0 + src/funcs/feedback-create.ts: + last_write_checksum: sha1:2af67a5a1a2ce4186dbe3ac33760fe9735e9a808 + src/funcs/projects-api-keys-create.ts: + last_write_checksum: sha1:25afc3031255ddbba47e2671d268374f180665ca src/funcs/projects-create.ts: last_write_checksum: sha1:1d5128fe44c57de6e610339e681d17dece464c8c src/funcs/projects-delete.ts: @@ -746,15 +862,19 @@ trackedFiles: src/funcs/projects-update.ts: last_write_checksum: sha1:4ef61801136131f80690ebd5a1a0c16acc4a43f8 src/funcs/queue-get-stats.ts: - last_write_checksum: sha1:0c7d4ba3424f7b1fa32325a8f58551951b9857b6 + last_write_checksum: sha1:801c6ca33c1d877de0eb56091c22e704ad5cfb2c src/funcs/queue-items-list.ts: - last_write_checksum: sha1:41e37714a624e3454112aaebc95e211e44d752a3 + last_write_checksum: sha1:ea9e8def9e2cec9f8520e70038ad4c1228ac7186 + src/funcs/queue-items-resolve-many.ts: + last_write_checksum: sha1:202289781cddcc4ce13153e3ee86b87a65bbbe7c src/funcs/queue-items-resolve.ts: - last_write_checksum: sha1:c2dd25d9e59921c30a029a9ec7f6f5c2eba5da6c + last_write_checksum: sha1:0805245dbc3a8bbf6858c7257c4a46be60996c98 src/funcs/queue-items-unresolve.ts: - last_write_checksum: sha1:b11867b188626362bc68df053029bd47dbe36240 + last_write_checksum: sha1:b1edda3eb427580e272988f8f8430887b9e4c993 + src/funcs/queue-list.ts: + last_write_checksum: sha1:614b769cc2e06fdbac173fdeed67679e212da08c src/funcs/queue-retrieve.ts: - last_write_checksum: sha1:79aa33a78055bae924d0e737f28d79553bad8ef8 + last_write_checksum: sha1:98d4aa5702136293ded5f76f63abdbb9fb61a88f src/funcs/webhook-secret-retrieve.ts: last_write_checksum: sha1:07bc465157648defa15c9832db1fc6dd3c1a699d src/funcs/webhooks-create.ts: @@ -767,6 +887,8 @@ trackedFiles: last_write_checksum: sha1:8ea9dc79cb031bf6655acbafec397570f3c9ec87 src/funcs/webhooks-update.ts: last_write_checksum: sha1:4d3f0ae4628a57342d8a7c4bbf727787c7346f23 + src/funcs/wordlist-create.ts: + last_write_checksum: sha1:a919a6d383a431a3958e3b27b1ba9f21cd6f32a2 src/funcs/wordlist-get-embedding-status.ts: last_write_checksum: sha1:738292d954d7d25e91906d4e53df02f7671da44a src/funcs/wordlist-list.ts: @@ -774,7 +896,7 @@ trackedFiles: src/funcs/wordlist-retrieve.ts: last_write_checksum: sha1:96f1e2b3a83bca1b51ac8e4769d49112b0c5d9a3 src/funcs/wordlist-update.ts: - last_write_checksum: sha1:ce8693657b7b6f8379d01c17e2955613dee2a515 + last_write_checksum: sha1:988584b3d846c3f0d0a9219e3ba7467dbca950d4 src/funcs/wordlist-words-add.ts: last_write_checksum: sha1:9b0a83ce2267519aec8e443d031594a92b155fb7 src/funcs/wordlist-words-remove.ts: @@ -790,7 +912,7 @@ trackedFiles: src/lib/base64.ts: last_write_checksum: sha1:8c94164f2f78e6041c853186fa01f659591f5913 src/lib/config.ts: - last_write_checksum: sha1:16d4a4e113b0da24d571561048a490241f7d38b7 + last_write_checksum: sha1:bf890a8476bcdeee22e18f4a132009d36534a226 src/lib/encodings.ts: last_write_checksum: sha1:4481b2a380f8a16856ef92c66fb370299f56d135 src/lib/env.ts: @@ -818,7 +940,7 @@ trackedFiles: src/models/authentication-error.ts: last_write_checksum: sha1:9040431089f953dc7918ac6a919803e6bdcdf1a1 src/models/bad-request-error.ts: - last_write_checksum: sha1:7fab44fcda0f75a44dcb14bd581d1ce3e5479bf2 + last_write_checksum: sha1:393ef7de99804307f370e0024d025e9e968464a1 src/models/channel.ts: last_write_checksum: sha1:18563c2ea4d555d86e6f3058b869e07d3562cf35 src/models/conflict-error.ts: @@ -828,7 +950,7 @@ trackedFiles: src/models/errors/authentication-error.ts: last_write_checksum: sha1:9eb1e70491b83c8549b9e670c0cd82abe182584d src/models/errors/bad-request-error.ts: - last_write_checksum: sha1:80f6fca704345fca0b2a5aeb093bdca3c7b0dcbc + last_write_checksum: sha1:4627fb65fc0b43c9d5552d81d0e80664087c6976 src/models/errors/conflict-error.ts: last_write_checksum: sha1:31a0683d7e721a3e08e4a0d53e9247b11e621732 src/models/errors/http-client-errors.ts: @@ -842,7 +964,7 @@ trackedFiles: src/models/errors/moderation-api-error.ts: last_write_checksum: sha1:a1e32858c00483f1ed312c64fba4beef8c973727 src/models/errors/not-found-error.ts: - last_write_checksum: sha1:96491fb201f8b00bac0baa90f52013821c9442a3 + last_write_checksum: sha1:b464e90c7474330376d46f96599d9b575e11e75c src/models/errors/permission-denied-error.ts: last_write_checksum: sha1:a7f2ccb2f0960afa276e4966f1c4872e6ed28c0f src/models/errors/rate-limit-error.ts: @@ -852,107 +974,137 @@ trackedFiles: src/models/errors/sdk-validation-error.ts: last_write_checksum: sha1:92771987c251f02fd86cfd824a3be709cd3c2837 src/models/index.ts: - last_write_checksum: sha1:28daf656cb6db17e0ac3792ba5ef6210c7c74da6 + last_write_checksum: sha1:3a90a419ece9fa6fe72b78bfc22fb54512742e4c src/models/internal-server-error.ts: last_write_checksum: sha1:051d77aea80454b563c750064b121fc814184602 src/models/not-found-error.ts: - last_write_checksum: sha1:e529ab165b42ef34e33fb4ebcf5ec244f916d7d5 + last_write_checksum: sha1:3f2385a6f32bdc7a3a40e711cc2103f20929179c src/models/operations/add-wordlist-words.ts: - last_write_checksum: sha1:54527ccc2d4491e2718f7dcbdb53055640e0e7a6 + last_write_checksum: sha1:bca0ce826472d0d4ff7e3bc8034cafc93513c652 src/models/operations/create-action.ts: - last_write_checksum: sha1:54a2c326251775a7089e95328660aad0cbdecb89 + last_write_checksum: sha1:465b5a649cce0ae44431b729dad38b70d2e70196 src/models/operations/create-author.ts: - last_write_checksum: sha1:28fde3888b923d9434426b731d2c77f283bedfe1 + last_write_checksum: sha1:c23f0550714142a84d64636f645dad7bb19aa381 src/models/operations/create-channel.ts: last_write_checksum: sha1:cabc482911728dd312e75fb1f3b2ffd0721b45e2 + src/models/operations/create-feedback.ts: + last_write_checksum: sha1:88b8470347137076fb1d2a3ef7e9727bbf6d5b30 + src/models/operations/create-project-api-key.ts: + last_write_checksum: sha1:606574e5c23a6d5ee707da020a88ec52c2000108 src/models/operations/create-project.ts: last_write_checksum: sha1:147c8396e20ae365554d1bd3a9cf82094b5d6957 src/models/operations/create-webhook.ts: - last_write_checksum: sha1:81d7e3c315e7a79aa76617bf3fb5c86f292a0365 + last_write_checksum: sha1:76a0b5cbd202f3e78450d90a46214839f7de4eaa + src/models/operations/create-wordlist.ts: + last_write_checksum: sha1:51ab65f72a941b720e3c09808f844ddaeb261523 src/models/operations/delete-action.ts: - last_write_checksum: sha1:76e057d379c9f5df4f0e5953fc2aafea71fdfe50 + last_write_checksum: sha1:e92441531b296ef818372fb39e75e39200aa4135 src/models/operations/delete-author.ts: - last_write_checksum: sha1:2249b7539fb89ff293c69dd17f1f86220daaaa79 + last_write_checksum: sha1:3af991c73d2f89b907f6be8a2bd87efb7b02c9d4 src/models/operations/delete-channel.ts: last_write_checksum: sha1:152a14565d6146a631789cefc6d4bcaecace08f6 src/models/operations/delete-project.ts: last_write_checksum: sha1:1b89d788b30bda054ddb0832e8099ed31b78a2a0 src/models/operations/delete-webhook.ts: - last_write_checksum: sha1:3f5dc13439e7206673547d5ca77240a7607d536a + last_write_checksum: sha1:ec5c079025ca28b92c865f42493fc728a37bb3aa src/models/operations/duplicate-channel.ts: last_write_checksum: sha1:1992ab1dec599b6c6751fa259119fc6ccf4d2974 src/models/operations/duplicate-project.ts: last_write_checksum: sha1:111826d4d5e53c6622cce8be741c81b39b13d1d7 src/models/operations/execute-action.ts: - last_write_checksum: sha1:8621e5b5565830bbf348a3a071401db8f25fa5bf + last_write_checksum: sha1:6cb2505aa4ddd4d5f9b439189f95fd024525c099 src/models/operations/get-account.ts: - last_write_checksum: sha1:dbb94046a69604a6b60e9afb25ef03d8c58632c7 + last_write_checksum: sha1:45071f887a86c43c4cf29f07ca70be8261aae3e2 src/models/operations/get-action.ts: - last_write_checksum: sha1:c1ae06915429e2c3298043346d3e3b521716887d + last_write_checksum: sha1:7fb890d4779237d3ed2fc42b3c057d4dd8429373 + src/models/operations/get-analytics-authors.ts: + last_write_checksum: sha1:ee05d485b20a41d7c5071ebe9d7b9e165af51c23 + src/models/operations/get-analytics-automation.ts: + last_write_checksum: sha1:34c11f02031e61260af22ddf7f8ca83596440f10 + src/models/operations/get-analytics-channels.ts: + last_write_checksum: sha1:4d66068da3145fd2b3c9705fe538998dee3c212f + src/models/operations/get-analytics-policies.ts: + last_write_checksum: sha1:474eda326517b1ebb32f15e2cc00469046d0768f + src/models/operations/get-analytics-summary.ts: + last_write_checksum: sha1:2c17ef498584ad90955b15dd349ca756c68f7e0f + src/models/operations/get-analytics-volumes.ts: + last_write_checksum: sha1:617e2001590449f7bc50336c31976224ab069537 src/models/operations/get-author.ts: - last_write_checksum: sha1:38cf61572641cd12bf6a9d1ca329b20e989b8ca8 + last_write_checksum: sha1:b4a8bdc108b5699eb961a6c9296e7e77c1d89464 src/models/operations/get-channel.ts: last_write_checksum: sha1:2379dbe5480531f8afc81e18f7645e2fb3367b23 src/models/operations/get-project.ts: last_write_checksum: sha1:f2398da115bc20dfd88f8b56cc34ab4744ae09b8 src/models/operations/get-queue-stats.ts: - last_write_checksum: sha1:f8e31d9aaa8f4b09d0c51c70789ac1b1f92071e9 + last_write_checksum: sha1:468afe851024209146658c90d1ddffb7d8f5085b src/models/operations/get-queue.ts: - last_write_checksum: sha1:cddcd5751e5d5ed4aa849d0d8704e005579f1faf + last_write_checksum: sha1:a053096a97edfa32b76427695a90ddf94b55004d src/models/operations/get-webhook-secret.ts: - last_write_checksum: sha1:b1130791d1fb2cbeca443ae277c702d665f32daa + last_write_checksum: sha1:f7e699d5bec632436ea4ab03b71793c534353647 src/models/operations/get-webhook.ts: - last_write_checksum: sha1:a5126442e1520aacfac1469e58a896013ad3244b + last_write_checksum: sha1:01ca5b8ccad1258b5583fc42ca074e77604d3fbf src/models/operations/get-wordlist-embedding-status.ts: - last_write_checksum: sha1:3d49b8496f4f0f1585952ad768addb96c8819c8b + last_write_checksum: sha1:55e32cbf1d736b068f7a8d861ae980b3a6bdf727 src/models/operations/get-wordlist.ts: - last_write_checksum: sha1:3dc8da3c97b367a7c6de937cfc4baf5d5b8b9c47 + last_write_checksum: sha1:0cfd3f20b74b9dafa1c2ab8159bf165bc99ae830 src/models/operations/index.ts: - last_write_checksum: sha1:ea0b8356e80095f33a542d7ca190af965a681c65 + last_write_checksum: sha1:af2ba2596503a29cb1551928ad84be82ccb6a1f0 src/models/operations/list-actions.ts: - last_write_checksum: sha1:31caed7f3cef0dc36f2a9b53614bb8dd71ff526b + last_write_checksum: sha1:2d872ead1fa82d0e580eae92cfcb6593b71972cb src/models/operations/list-authors.ts: - last_write_checksum: sha1:7ce4521cbd7ccb0e923854d6563f59e9e7eb4ade + last_write_checksum: sha1:daea243eea8f7df48c49f846487bbcfa2278529f src/models/operations/list-channels.ts: last_write_checksum: sha1:7552a7851b969bea092d45e6db748aa11b2bf18d src/models/operations/list-projects.ts: last_write_checksum: sha1:0c1cf0e09f7c0ae20c42b1707947474386d11ab9 src/models/operations/list-queue-items.ts: - last_write_checksum: sha1:33b798e8fe1d37ee6fab361d3eb91dca0f0e9703 + last_write_checksum: sha1:1771d05789d49fd2e81023c86350fdcde9910713 + src/models/operations/list-queues.ts: + last_write_checksum: sha1:15e04b75447d297b9358dce77b8f170237e15d16 src/models/operations/list-webhooks.ts: - last_write_checksum: sha1:3020f3ae92e40817168a546d2dcc8f19fdeca452 + last_write_checksum: sha1:f7571c32c6ed72a21fa4d2f9408daf4c614e99d0 src/models/operations/list-wordlists.ts: - last_write_checksum: sha1:b5d9e320705feff178d04ff556f1f835b367eec8 + last_write_checksum: sha1:9ac9dc22488a6c34c99dcf4180b08406986c8152 src/models/operations/remove-wordlist-words.ts: - last_write_checksum: sha1:c172df18b3e4eb7574f6a0eceb86138c10294641 + last_write_checksum: sha1:494ac821a6346f6b08e16b57b95b895300c887a1 src/models/operations/resolve-queue-item.ts: - last_write_checksum: sha1:cc0c6b0b26d1b242010592882c054f5a8319bd8d + last_write_checksum: sha1:f01edb613a78312ab0ec62654f75aca858bee0b7 + src/models/operations/resolve-queue-items.ts: + last_write_checksum: sha1:36c6625998810befaf0dc01f6b0f9bd080376beb src/models/operations/submit-content.ts: - last_write_checksum: sha1:b21588210b0a83679b1561ab2f73dee1bf909f74 + last_write_checksum: sha1:74f926880df58f87473373c25f10f31bf052272d src/models/operations/unresolve-queue-item.ts: - last_write_checksum: sha1:cfdb1409a28455beb758cb9b7f817eab92635943 + last_write_checksum: sha1:1a8c9d9bed905a703b8ac81a2d486a70ee014760 src/models/operations/update-action.ts: - last_write_checksum: sha1:eb850a459c462444caf46e436490cc8af2b14cc1 + last_write_checksum: sha1:835852cd8092e2ec95ec1ad43071ee792647c49a src/models/operations/update-author.ts: - last_write_checksum: sha1:a09c8738c241f8aaa9dfd409fbbb59a986303641 + last_write_checksum: sha1:4ab9677cb73ebd6d92b0ad88bb9d8b40bec8b1a3 src/models/operations/update-channel.ts: last_write_checksum: sha1:19c31967441efd4cc33f2b2d4eb2c93961b4fe5f src/models/operations/update-project.ts: last_write_checksum: sha1:79d26d42ab8a8220eccb1270ae771bb9922c407a src/models/operations/update-webhook.ts: - last_write_checksum: sha1:d5be48cddff706c174946272029e55541a2b2e74 + last_write_checksum: sha1:e4fa6c421e0afcf5d2ba899c820072f806ad7877 src/models/operations/update-wordlist.ts: - last_write_checksum: sha1:768058d8ffaa2e2826496eeede6d0a3a3c141f9c + last_write_checksum: sha1:3076b032c3d4c8bc51c638a53f67a3314eea96ca src/models/pagination.ts: last_write_checksum: sha1:8652b1b5bd88e5f1505c99836ed9ab906d2de6b6 src/models/permission-denied-error.ts: last_write_checksum: sha1:10b45009baf666d78072f06f0136e229ccd99e75 + src/models/project-api-key.ts: + last_write_checksum: sha1:bedfb27ab7ee77eeb290c4f7ee69b28002720094 src/models/project-with-key.ts: last_write_checksum: sha1:4cfe9bc82338a25ac5f0b9871caa3bfb2968a71d src/models/project.ts: last_write_checksum: sha1:b6ef96a4ad8927ba1791c36f2b8781d4860992c1 src/models/public-author.ts: - last_write_checksum: sha1:c27b677db8fdac3bbe6af95c03faa5cc364da127 + last_write_checksum: sha1:ff635e9ed284567e3580b5787fb1f293c088629e + src/models/queue-item.ts: + last_write_checksum: sha1:d9c5481bc6fd8d8f3c811f68b84f45ef34d048d1 + src/models/queue-with-counts.ts: + last_write_checksum: sha1:ea9b1238c047a7dd712729bad27cf53a9b863d8e + src/models/queue.ts: + last_write_checksum: sha1:b18895cdc32d38d2d48e5603dbf7a2c338999e60 src/models/rate-limit-error.ts: last_write_checksum: sha1:533686f832fa590b3eab57023c16f7351dec9d3c src/models/security.ts: @@ -961,28 +1113,34 @@ trackedFiles: last_write_checksum: sha1:af45ed201b0dba505aa28dd9669afeb5ad9a9fb9 src/sdk/actions.ts: last_write_checksum: sha1:7533f896c27b4343d8ae84ba15399fda3569abb3 + src/sdk/analytics.ts: + last_write_checksum: sha1:44bd573cb4f17fc2fd6cc4c8652b3d67b25dd72d + src/sdk/api-keys.ts: + last_write_checksum: sha1:ce7ee16b0359bab65b9715e0abf84e6a8fff7eb2 src/sdk/authors.ts: - last_write_checksum: sha1:ac017c586ca8100b30fe03bfdf04e45e65a054f8 + last_write_checksum: sha1:8b8e4087f217fa252dedd2c724f4082d9a54b308 src/sdk/channels.ts: last_write_checksum: sha1:30ea1fc231cc208918a776570e51d37b21969e01 src/sdk/content.ts: last_write_checksum: sha1:7a941de88ba8482161ee358018d683b4e8cac9fd + src/sdk/feedback.ts: + last_write_checksum: sha1:cfc19d13959b3e43a97772382809ee2561187d96 src/sdk/index.ts: last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f src/sdk/items.ts: - last_write_checksum: sha1:0f07549211c8c74f8c8fb58d535cf8dc10c132f6 + last_write_checksum: sha1:3a8e7e952201f3dc7232b0234a92762a8d7f3192 src/sdk/projects.ts: - last_write_checksum: sha1:48a2494349c8196a94d46ff5204485a2c2020e80 + last_write_checksum: sha1:096e08f34b6f2b9c04001f41fddef32218ebdde5 src/sdk/queue.ts: - last_write_checksum: sha1:90f5da61236b0b72552412c512f1d17f34116425 + last_write_checksum: sha1:6a346243301e89e4f43fa50344325a81b325eafc src/sdk/sdk.ts: - last_write_checksum: sha1:c5587883135f0b6fcf0ee0f17688abf0eadd7d5c + last_write_checksum: sha1:510b6ee3687be90e994b5bb85751eb5073cbeb45 src/sdk/webhook-secret.ts: last_write_checksum: sha1:47978211eeb6939caf86d3c42fb241a6c0501f09 src/sdk/webhooks.ts: last_write_checksum: sha1:f881d70a682584be49f29e421c23b1c1e0ba0a79 src/sdk/wordlist.ts: - last_write_checksum: sha1:0b0bf03ee5be860cef59bf6b4d0acfad09564baa + last_write_checksum: sha1:3d21518dcac32f2f6ea53a06b28cedcacccc3f5f src/sdk/words.ts: last_write_checksum: sha1:6ee7d96e5571a9d5bea929d3b49a252d522879f6 src/types/async.ts: @@ -1124,7 +1282,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": @@ -1146,7 +1304,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": @@ -1170,7 +1328,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": @@ -1214,7 +1372,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": @@ -1765,4 +1923,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 8c13b16..aee97b4 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 5.1.1 + version: 5.2.0 acceptHeaderEnum: false additionalDependencies: dependencies: {} 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 d1dc9bb..d55b7e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,141 @@ # Changelog +## 5.2.0 (2026-10-26) + +Full Changelog: [v5.1.1...v5.2.0](https://github.com/moderation-api/sdk-typescript/compare/v5.1.1...v5.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 + ## 5.1.1 (2026-10-22) Full Changelog: [v5.1.0...v5.1.1](https://github.com/moderation-api/sdk-typescript/compare/v5.1.0...v5.1.1) diff --git a/README.md b/README.md index 1abda03..7aaf234 100644 --- a/README.md +++ b/README.md @@ -327,11 +327,9 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.authors.list({}); + const result = await moderationApi.analytics.summary(); - for await (const page of result) { - console.log(page); - } + console.log(result); } run(); @@ -344,9 +342,9 @@ run(); 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: ```typescript import { ModerationApi } from "@moderation-api/sdk"; @@ -389,6 +387,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 @@ -410,6 +417,10 @@ Create the organization client only where you manage projects and channels, for * [submit](docs/sdks/content/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 @@ -419,15 +430,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/queue/README.md) +* [list](docs/sdks/queue/README.md#list) - List queues * [retrieve](docs/sdks/queue/README.md#retrieve) - Get a queue * [getStats](docs/sdks/queue/README.md#getstats) - 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 +* [resolveMany](docs/sdks/items/README.md#resolvemany) - Resolve queue items * [unresolve](docs/sdks/items/README.md#unresolve) - Unresolve a queue item ### [Webhooks](docs/sdks/webhooks/README.md) @@ -445,6 +462,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 * [getEmbeddingStatus](docs/sdks/wordlist/README.md#getembeddingstatus) - Get embedding status @@ -479,6 +497,12 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`actionsList`](docs/sdks/actions/README.md#list) - List moderation actions - [`actionsRetrieve`](docs/sdks/actions/README.md#retrieve) - Get an action - [`actionsUpdate`](docs/sdks/actions/README.md#update) - Update an action +- [`analyticsAuthors`](docs/sdks/analytics/README.md#authors) - Get the most flagged authors +- [`analyticsAutomation`](docs/sdks/analytics/README.md#automation) - Get the automation breakdown +- [`analyticsChannels`](docs/sdks/analytics/README.md#channels) - Get analytics per channel +- [`analyticsPolicies`](docs/sdks/analytics/README.md#policies) - Get the most flagged policies +- [`analyticsSummary`](docs/sdks/analytics/README.md#summary) - Get the analytics summary +- [`analyticsVolumes`](docs/sdks/analytics/README.md#volumes) - Get volumes over time - [`authorsCreate`](docs/sdks/authors/README.md#create) - Create a new author - [`authorsDelete`](docs/sdks/authors/README.md#delete) - Delete an author - [`authorsList`](docs/sdks/authors/README.md#list) - List authors @@ -491,6 +515,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`channelsRetrieve`](docs/sdks/channels/README.md#retrieve) - Get a channel - [`channelsUpdate`](docs/sdks/channels/README.md#update) - Update a channel - [`contentSubmit`](docs/sdks/content/README.md#submit) - Submit content +- [`feedbackCreate`](docs/sdks/feedback/README.md#create) - Send feedback +- [`projectsApiKeysCreate`](docs/sdks/apikeys/README.md#create) - Create a project API key - [`projectsCreate`](docs/sdks/projects/README.md#create) - Create a project - [`projectsDelete`](docs/sdks/projects/README.md#delete) - Delete a project - [`projectsDuplicate`](docs/sdks/projects/README.md#duplicate) - Duplicate a project @@ -498,9 +524,11 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`projectsRetrieve`](docs/sdks/projects/README.md#retrieve) - Get a project - [`projectsUpdate`](docs/sdks/projects/README.md#update) - Update a project - [`queueGetStats`](docs/sdks/queue/README.md#getstats) - Get queue statistics -- [`queueItemsList`](docs/sdks/items/README.md#list) - Get queue items +- [`queueItemsList`](docs/sdks/items/README.md#list) - List queue items - [`queueItemsResolve`](docs/sdks/items/README.md#resolve) - Resolve a queue item +- [`queueItemsResolveMany`](docs/sdks/items/README.md#resolvemany) - Resolve queue items - [`queueItemsUnresolve`](docs/sdks/items/README.md#unresolve) - Unresolve a queue item +- [`queueList`](docs/sdks/queue/README.md#list) - List queues - [`queueRetrieve`](docs/sdks/queue/README.md#retrieve) - Get a queue - [`webhooksCreate`](docs/sdks/webhooks/README.md#create) - Create a webhook - [`webhooksDelete`](docs/sdks/webhooks/README.md#delete) - Delete a webhook @@ -508,6 +536,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`webhooksList`](docs/sdks/webhooks/README.md#list) - List webhooks - [`webhooksRetrieve`](docs/sdks/webhooks/README.md#retrieve) - Get a webhook - [`webhooksUpdate`](docs/sdks/webhooks/README.md#update) - Update a webhook +- [`wordlistCreate`](docs/sdks/wordlist/README.md#create) - Create wordlist - [`wordlistGetEmbeddingStatus`](docs/sdks/wordlist/README.md#getembeddingstatus) - Get embedding status - [`wordlistList`](docs/sdks/wordlist/README.md#list) - List wordlists - [`wordlistRetrieve`](docs/sdks/wordlist/README.md#retrieve) - Get wordlist @@ -564,22 +593,25 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.authors.list({}, { - retries: { - strategy: "backoff", - backoff: { - initialInterval: 1, - maxInterval: 50, - exponent: 1.1, - maxElapsedTime: 100, + const result = await moderationApi.analytics.summary( + undefined, + undefined, + undefined, + { + retries: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, }, - retryConnectionErrors: false, }, - }); + ); - for await (const page of result) { - console.log(page); - } + console.log(result); } run(); @@ -605,11 +637,9 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.authors.list({}); + const result = await moderationApi.analytics.summary(); - for await (const page of result) { - console.log(page); - } + console.log(result); } run(); @@ -642,11 +672,9 @@ const moderationApi = new ModerationApi({ async function run() { try { - const result = await moderationApi.authors.list({}); + const result = await moderationApi.analytics.summary(); - for await (const page of result) { - console.log(page); - } + console.log(result); } catch (error) { // The base class for HTTP error responses if (error instanceof errors.ModerationAPIError) { @@ -676,8 +704,9 @@ run(); * [`ModerationAPIError`](./src/models/errors/moderation-api-error.ts): The base class for HTTP error responses. * [`AuthenticationError`](./src/models/errors/authentication-error.ts): The API key is missing, invalid or revoked. Status code `401`. * [`RateLimitError`](./src/models/errors/rate-limit-error.ts): Too many requests. Retry after the number of seconds in the `Retry-After` header. Status code `429`. + * [`BadRequestError`](./src/models/errors/bad-request-error.ts): The request is malformed or a parameter is invalid. Status code `400`. * -
Less common errors (11) +
Less common errors (10)
@@ -690,11 +719,10 @@ run(); **Inherit from [`ModerationAPIError`](./src/models/errors/moderation-api-error.ts)**: -* [`BadRequestError`](./src/models/errors/bad-request-error.ts): The request is malformed or a parameter is invalid. Status code `400`. Applicable to 32 of 42 methods.* -* [`NotFoundError`](./src/models/errors/not-found-error.ts): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 31 of 42 methods.* -* [`PermissionDeniedError`](./src/models/errors/permission-denied-error.ts): 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/models/errors/internal-server-error.ts): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 15 of 42 methods.* -* [`ConflictError`](./src/models/errors/conflict-error.ts): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 42 methods.* +* [`NotFoundError`](./src/models/errors/not-found-error.ts): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 39 of 53 methods.* +* [`PermissionDeniedError`](./src/models/errors/permission-denied-error.ts): 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/models/errors/internal-server-error.ts): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 23 of 53 methods.* +* [`ConflictError`](./src/models/errors/conflict-error.ts): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 53 methods.* * [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
@@ -717,11 +745,9 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.authors.list({}); + const result = await moderationApi.analytics.summary(); - for await (const page of result) { - console.log(page); - } + console.log(result); } run(); diff --git a/docs/models/bad-request-error-code.md b/docs/models/bad-request-error-code.md index 76f5708..9da1d8a 100644 --- a/docs/models/bad-request-error-code.md +++ b/docs/models/bad-request-error-code.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 @@ -19,5 +20,5 @@ let value: BadRequestErrorCode = "invalid_request"; ## Values ```typescript -"invalid_request" | "project_id_required" | "validation_failed" | Unrecognized +"invalid_request" | "project_id_required" | "project_name_ambiguous" | "validation_failed" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/errors/bad-request-error.md b/docs/models/errors/bad-request-error.md index 8c4be77..35bc34b 100644 --- a/docs/models/errors/bad-request-error.md +++ b/docs/models/errors/bad-request-error.md @@ -12,11 +12,11 @@ import { BadRequestError } from "@moderation-api/sdk/models/errors"; ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | *"invalid_request_error"* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | -| `code` | [models.BadRequestErrorCode](../../models/bad-request-error-code.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` | *string* | :heavy_check_mark: | Human-readable explanation. | Invalid input data | -| `issues` | [models.ErrorIssue](../../models/error-issue.md)[] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | -| `requestId` | *string* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | -| `docUrl` | *string* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *"invalid_request_error"* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [models.BadRequestErrorCode](../../models/bad-request-error-code.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` | *string* | :heavy_check_mark: | Human-readable explanation. | Invalid input data | +| `issues` | [models.ErrorIssue](../../models/error-issue.md)[] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `requestId` | *string* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `docUrl` | *string* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file diff --git a/docs/models/errors/not-found-error.md b/docs/models/errors/not-found-error.md index 39bd73c..decdfe5 100644 --- a/docs/models/errors/not-found-error.md +++ b/docs/models/errors/not-found-error.md @@ -12,11 +12,11 @@ import { NotFoundError } from "@moderation-api/sdk/models/errors"; ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | *"not_found_error"* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | -| `code` | [models.NotFoundErrorCode](../../models/not-found-error-code.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` | *string* | :heavy_check_mark: | Human-readable explanation. | Not found | -| `issues` | [models.ErrorIssue](../../models/error-issue.md)[] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | -| `requestId` | *string* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | -| `docUrl` | *string* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *"not_found_error"* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [models.NotFoundErrorCode](../../models/not-found-error-code.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` | *string* | :heavy_check_mark: | Human-readable explanation. | Not found | +| `issues` | [models.ErrorIssue](../../models/error-issue.md)[] | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `requestId` | *string* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `docUrl` | *string* | :heavy_check_mark: | Documentation for this `code`. | | \ No newline at end of file diff --git a/docs/models/label.md b/docs/models/label.md new file mode 100644 index 0000000..b8fc399 --- /dev/null +++ b/docs/models/label.md @@ -0,0 +1,23 @@ +# Label + +## Example Usage + +```typescript +import { Label } from "@moderation-api/sdk/models"; + +let value: Label = { + label: "", + score: 1430.61, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `label` | *string* | :heavy_check_mark: | The label name | +| `score` | *number* | :heavy_check_mark: | Confidence score between 0 and 1 | +| `manual` | *boolean* | :heavy_minus_sign: | True if the label was applied manually by a moderator | +| `flagged` | *boolean* | :heavy_minus_sign: | Whether this label crossed its flagging threshold | +| `shadowFlagged` | *boolean* | :heavy_minus_sign: | Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision | +| `matches` | [models.QueueItemMatch](../models/queue-item-match.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/not-found-error-code.md b/docs/models/not-found-error-code.md index d39b772..0c865cb 100644 --- a/docs/models/not-found-error-code.md +++ b/docs/models/not-found-error-code.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. @@ -24,5 +25,5 @@ let value: NotFoundErrorCode = "resource_not_found"; ## Values ```typescript -"resource_not_found" | "action_not_found" | "author_not_found" | "queue_not_found" | "wordlist_not_found" | "webhook_not_found" | "project_not_found" | "channel_not_found" | Unrecognized +"resource_not_found" | "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" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/operations/submit-content-recommendation-action.md b/docs/models/operations/action-response.md similarity index 56% rename from docs/models/operations/submit-content-recommendation-action.md rename to docs/models/operations/action-response.md index 3c56bd1..fff0097 100644 --- a/docs/models/operations/submit-content-recommendation-action.md +++ b/docs/models/operations/action-response.md @@ -1,13 +1,13 @@ -# SubmitContentRecommendationAction +# ActionResponse The action to take based on the recommendation ## Example Usage ```typescript -import { SubmitContentRecommendationAction } from "@moderation-api/sdk/models/operations"; +import { ActionResponse } from "@moderation-api/sdk/models/operations"; -let value: SubmitContentRecommendationAction = "reject"; +let value: ActionResponse = "review"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/operations/action-stat.md b/docs/models/operations/action-stat.md deleted file mode 100644 index fdb9c61..0000000 --- a/docs/models/operations/action-stat.md +++ /dev/null @@ -1,23 +0,0 @@ -# ActionStat - -## Example Usage - -```typescript -import { ActionStat } from "@moderation-api/sdk/models/operations"; - -let value: ActionStat = { - actionId: "", - actionName: "", - count: 215.41, - percentageOfTotal: 1522.88, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `actionId` | *string* | :heavy_check_mark: | ID of the moderation action | -| `actionName` | *string* | :heavy_check_mark: | Name of the moderation action | -| `count` | *number* | :heavy_check_mark: | Number of times this action was taken | -| `percentageOfTotal` | *number* | :heavy_check_mark: | Percentage this action represents of all actions | \ No newline at end of file diff --git a/docs/models/operations/add-wordlist-words-request.md b/docs/models/operations/add-wordlist-words-request.md index 04b4a9c..c2a8be1 100644 --- a/docs/models/operations/add-wordlist-words-request.md +++ b/docs/models/operations/add-wordlist-words-request.md @@ -18,8 +18,8 @@ let value: AddWordlistWordsRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to add words to | -| `projectId` | *string* | :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` | [operations.AddWordlistWordsRequestBody](../../models/operations/add-wordlist-words-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to add words to | +| `projectId` | *string* | :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` | [operations.AddWordlistWordsRequestBody](../../models/operations/add-wordlist-words-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/bucket.md b/docs/models/operations/bucket.md new file mode 100644 index 0000000..42b9080 --- /dev/null +++ b/docs/models/operations/bucket.md @@ -0,0 +1,19 @@ +# Bucket + +The size of each entry in `volumes`. + +## Example Usage + +```typescript +import { Bucket } from "@moderation-api/sdk/models/operations"; + +let value: Bucket = "day"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"hour" | "day" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/casebook-agreement.md b/docs/models/operations/casebook-agreement.md deleted file mode 100644 index 2c70f4d..0000000 --- a/docs/models/operations/casebook-agreement.md +++ /dev/null @@ -1,17 +0,0 @@ -# CasebookAgreement - -## Example Usage - -```typescript -import { CasebookAgreement } from "@moderation-api/sdk/models/operations"; - -let value: CasebookAgreement = "ALL"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"ALL" | "OVERRULED" | "AGREED" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/casebook-answer.md b/docs/models/operations/casebook-answer.md deleted file mode 100644 index 570af0c..0000000 --- a/docs/models/operations/casebook-answer.md +++ /dev/null @@ -1,17 +0,0 @@ -# CasebookAnswer - -## Example Usage - -```typescript -import { CasebookAnswer } from "@moderation-api/sdk/models/operations"; - -let value: CasebookAnswer = "ALLOWED"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"ALL" | "ALLOWED" | "REJECTED" | "NO_ANSWER" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/channel.md b/docs/models/operations/channel.md new file mode 100644 index 0000000..a5a8c68 --- /dev/null +++ b/docs/models/operations/channel.md @@ -0,0 +1,25 @@ +# Channel + +## Example Usage + +```typescript +import { Channel } from "@moderation-api/sdk/models/operations"; + +let value: Channel = { + id: "", + name: "", + requests: 343828, + flagged: 704730, + flagRate: 3554.49, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The channel ID. | +| `name` | *string* | :heavy_check_mark: | The channel name. | +| `requests` | *number* | :heavy_check_mark: | Requests received in this channel. | +| `flagged` | *number* | :heavy_check_mark: | Requests flagged in this channel. | +| `flagRate` | *number* | :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/operations/check-status.md b/docs/models/operations/check-status.md deleted file mode 100644 index 05850ac..0000000 --- a/docs/models/operations/check-status.md +++ /dev/null @@ -1,17 +0,0 @@ -# CheckStatus - -## Example Usage - -```typescript -import { CheckStatus } from "@moderation-api/sdk/models/operations"; - -let value: CheckStatus = "unchecked"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"all" | "checked" | "unchecked" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/classifier-output.md b/docs/models/operations/classifier-output.md index 62c49aa..773ec43 100644 --- a/docs/models/operations/classifier-output.md +++ b/docs/models/operations/classifier-output.md @@ -24,5 +24,5 @@ let value: ClassifierOutput = { | `probability` | *number* | :heavy_check_mark: | N/A | | `flagged` | *boolean* | :heavy_check_mark: | N/A | | `flaggedFields` | *string*[] | :heavy_minus_sign: | The keys of the flagged fields if submitting an object. | -| `labels` | [operations.SubmitContentLabel](../../models/operations/submit-content-label.md)[] | :heavy_minus_sign: | N/A | +| `labels` | [operations.Label](../../models/operations/label.md)[] | :heavy_minus_sign: | N/A | | `data` | Record | :heavy_minus_sign: | Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }. | \ No newline at end of file diff --git a/docs/models/operations/create-action-request.md b/docs/models/operations/create-action-request.md index 8296efd..5805282 100644 --- a/docs/models/operations/create-action-request.md +++ b/docs/models/operations/create-action-request.md @@ -14,7 +14,7 @@ let value: CreateActionRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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` | [operations.CreateActionRequestBody](../../models/operations/create-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.CreateActionRequestBody](../../models/operations/create-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-author-request.md b/docs/models/operations/create-author-request.md index 4b6a3c7..495edbf 100644 --- a/docs/models/operations/create-author-request.md +++ b/docs/models/operations/create-author-request.md @@ -14,7 +14,7 @@ let value: CreateAuthorRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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` | [operations.CreateAuthorRequestBody](../../models/operations/create-author-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.CreateAuthorRequestBody](../../models/operations/create-author-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-feedback-request-body.md b/docs/models/operations/create-feedback-request-body.md new file mode 100644 index 0000000..43d4e57 --- /dev/null +++ b/docs/models/operations/create-feedback-request-body.md @@ -0,0 +1,22 @@ +# CreateFeedbackRequestBody + +## Example Usage + +```typescript +import { CreateFeedbackRequestBody } from "@moderation-api/sdk/models/operations"; + +let value: CreateFeedbackRequestBody = { + title: "", + description: + "self-reliant viciously before ick athwart categorise liberalize", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `title` | *string* | :heavy_check_mark: | A short summary of the request. | +| `description` | *string* | :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` | [operations.CreateFeedbackType](../../models/operations/create-feedback-type.md) | :heavy_minus_sign: | The kind of feedback. | +| `source` | [operations.Source](../../models/operations/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/operations/create-feedback-request.md b/docs/models/operations/create-feedback-request.md new file mode 100644 index 0000000..6f4822e --- /dev/null +++ b/docs/models/operations/create-feedback-request.md @@ -0,0 +1,21 @@ +# CreateFeedbackRequest + +## Example Usage + +```typescript +import { CreateFeedbackRequest } from "@moderation-api/sdk/models/operations"; + +let value: CreateFeedbackRequest = { + body: { + title: "", + description: "zesty tuxedo notwithstanding but spork economise", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.CreateFeedbackRequestBody](../../models/operations/create-feedback-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-feedback-response.md b/docs/models/operations/create-feedback-response.md new file mode 100644 index 0000000..e8ae982 --- /dev/null +++ b/docs/models/operations/create-feedback-response.md @@ -0,0 +1,21 @@ +# CreateFeedbackResponse + +Feedback received + +## Example Usage + +```typescript +import { CreateFeedbackResponse } from "@moderation-api/sdk/models/operations"; + +let value: CreateFeedbackResponse = { + id: "", + status: "received", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the feedback. | +| `status` | *"received"* | :heavy_check_mark: | The team received the feedback. | \ No newline at end of file diff --git a/docs/models/operations/create-feedback-type.md b/docs/models/operations/create-feedback-type.md new file mode 100644 index 0000000..c4a530c --- /dev/null +++ b/docs/models/operations/create-feedback-type.md @@ -0,0 +1,17 @@ +# CreateFeedbackType + +The kind of feedback. + +## Example Usage + +```typescript +import { CreateFeedbackType } from "@moderation-api/sdk/models/operations"; + +let value: CreateFeedbackType = "other"; +``` + +## Values + +```typescript +"feature_request" | "bug" | "other" +``` \ No newline at end of file diff --git a/docs/models/operations/create-project-api-key-request-body.md b/docs/models/operations/create-project-api-key-request-body.md new file mode 100644 index 0000000..6a77084 --- /dev/null +++ b/docs/models/operations/create-project-api-key-request-body.md @@ -0,0 +1,15 @@ +# CreateProjectApiKeyRequestBody + +## Example Usage + +```typescript +import { CreateProjectApiKeyRequestBody } from "@moderation-api/sdk/models/operations"; + +let value: CreateProjectApiKeyRequestBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *string* | :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/operations/create-project-api-key-request.md b/docs/models/operations/create-project-api-key-request.md new file mode 100644 index 0000000..e342705 --- /dev/null +++ b/docs/models/operations/create-project-api-key-request.md @@ -0,0 +1,19 @@ +# CreateProjectApiKeyRequest + +## Example Usage + +```typescript +import { CreateProjectApiKeyRequest } from "@moderation-api/sdk/models/operations"; + +let value: CreateProjectApiKeyRequest = { + id: "", + body: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the project. | +| `body` | [operations.CreateProjectApiKeyRequestBody](../../models/operations/create-project-api-key-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-webhook-request.md b/docs/models/operations/create-webhook-request.md index 1b741d0..b3241e7 100644 --- a/docs/models/operations/create-webhook-request.md +++ b/docs/models/operations/create-webhook-request.md @@ -16,7 +16,7 @@ let value: CreateWebhookRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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` | [operations.CreateWebhookRequestBody](../../models/operations/create-webhook-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.CreateWebhookRequestBody](../../models/operations/create-webhook-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-wordlist-request-body.md b/docs/models/operations/create-wordlist-request-body.md new file mode 100644 index 0000000..ce5bdf5 --- /dev/null +++ b/docs/models/operations/create-wordlist-request-body.md @@ -0,0 +1,20 @@ +# CreateWordlistRequestBody + +## Example Usage + +```typescript +import { CreateWordlistRequestBody } from "@moderation-api/sdk/models/operations"; + +let value: CreateWordlistRequestBody = { + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of the wordlist | +| `key` | *string* | :heavy_minus_sign: | Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. | +| `description` | *string* | :heavy_minus_sign: | Description of the wordlist | +| `words` | *string*[] | :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/operations/create-wordlist-request.md b/docs/models/operations/create-wordlist-request.md new file mode 100644 index 0000000..0880633 --- /dev/null +++ b/docs/models/operations/create-wordlist-request.md @@ -0,0 +1,20 @@ +# CreateWordlistRequest + +## Example Usage + +```typescript +import { CreateWordlistRequest } from "@moderation-api/sdk/models/operations"; + +let value: CreateWordlistRequest = { + body: { + name: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.CreateWordlistRequestBody](../../models/operations/create-wordlist-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/create-wordlist-response.md b/docs/models/operations/create-wordlist-response.md new file mode 100644 index 0000000..31d46e4 --- /dev/null +++ b/docs/models/operations/create-wordlist-response.md @@ -0,0 +1,35 @@ +# CreateWordlistResponse + +Wordlist created successfully + +## Example Usage + +```typescript +import { CreateWordlistResponse } from "@moderation-api/sdk/models/operations"; + +let value: CreateWordlistResponse = { + id: "", + name: "", + words: [ + "", + "", + "", + ], + createdAt: "1713571541251", + organizationId: "", + userId: "", + strict: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist | +| `name` | *string* | :heavy_check_mark: | N/A | +| `words` | *string*[] | :heavy_check_mark: | Words in the wordlist | +| `createdAt` | *string* | :heavy_check_mark: | Creation date of the wordlist | +| `organizationId` | *string* | :heavy_check_mark: | ID of the organization | +| `userId` | *string* | :heavy_check_mark: | N/A | +| `strict` | *boolean* | :heavy_check_mark: | Strict mode | \ No newline at end of file diff --git a/docs/models/operations/daily-review-count.md b/docs/models/operations/daily-review-count.md index 8252b03..8a94073 100644 --- a/docs/models/operations/daily-review-count.md +++ b/docs/models/operations/daily-review-count.md @@ -7,13 +7,13 @@ import { DailyReviewCount } from "@moderation-api/sdk/models/operations"; let value: DailyReviewCount = { date: "2024-04-26", - count: 8454.25, + count: 845425, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `date` | *string* | :heavy_check_mark: | Date in YYYY-MM-DD format | -| `count` | *number* | :heavy_check_mark: | Number of reviews on this date | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `date` | *string* | :heavy_check_mark: | Date in YYYY-MM-DD format (UTC). | +| `count` | *number* | :heavy_check_mark: | Number of items resolved. | \ No newline at end of file diff --git a/docs/models/operations/delete-action-request.md b/docs/models/operations/delete-action-request.md index 0304a9b..81bb874 100644 --- a/docs/models/operations/delete-action-request.md +++ b/docs/models/operations/delete-action-request.md @@ -12,7 +12,7 @@ let value: DeleteActionRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to delete. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The ID of the action to delete. | +| `projectId` | *string* | :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/operations/delete-author-request.md b/docs/models/operations/delete-author-request.md index 3f925af..e31c1aa 100644 --- a/docs/models/operations/delete-author-request.md +++ b/docs/models/operations/delete-author-request.md @@ -12,7 +12,7 @@ let value: DeleteAuthorRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *string* | :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/operations/delete-webhook-request.md b/docs/models/operations/delete-webhook-request.md index d4d9836..37c7678 100644 --- a/docs/models/operations/delete-webhook-request.md +++ b/docs/models/operations/delete-webhook-request.md @@ -12,7 +12,7 @@ let value: DeleteWebhookRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to delete. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The ID of the webhook to delete. | +| `projectId` | *string* | :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/operations/execute-action-request.md b/docs/models/operations/execute-action-request.md index 402b25d..39458b7 100644 --- a/docs/models/operations/execute-action-request.md +++ b/docs/models/operations/execute-action-request.md @@ -14,7 +14,7 @@ let value: ExecuteActionRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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` | [operations.ExecuteActionRequestBody](../../models/operations/execute-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.ExecuteActionRequestBody](../../models/operations/execute-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/filter-label.md b/docs/models/operations/filter-label.md deleted file mode 100644 index f698322..0000000 --- a/docs/models/operations/filter-label.md +++ /dev/null @@ -1,21 +0,0 @@ -# FilterLabel - -## Example Usage - -```typescript -import { FilterLabel } from "@moderation-api/sdk/models/operations"; - -let value: FilterLabel = { - label: "", - type: "FLAGGED", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `label` | *string* | :heavy_check_mark: | N/A | -| `type` | [operations.GetQueueType](../../models/operations/get-queue-type.md) | :heavy_check_mark: | N/A | -| `minThreshold` | *number* | :heavy_minus_sign: | N/A | -| `maxThreshold` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md deleted file mode 100644 index 594d5b6..0000000 --- a/docs/models/operations/filter.md +++ /dev/null @@ -1,39 +0,0 @@ -# Filter - -## Example Usage - -```typescript -import { Filter } from "@moderation-api/sdk/models/operations"; - -let value: Filter = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `isFlagged` | [operations.IsFlagged](../../models/operations/is-flagged.md) | :heavy_minus_sign: | N/A | -| `casebookAnswer` | [operations.CasebookAnswer](../../models/operations/casebook-answer.md) | :heavy_minus_sign: | N/A | -| `casebookAgreement` | [operations.CasebookAgreement](../../models/operations/casebook-agreement.md) | :heavy_minus_sign: | N/A | -| `labels` | *string*[] | :heavy_minus_sign: | N/A | -| `filterLabels` | [operations.FilterLabel](../../models/operations/filter-label.md)[] | :heavy_minus_sign: | N/A | -| `metadataFilters` | [operations.MetadataFilter](../../models/operations/metadata-filter.md)[] | :heavy_minus_sign: | N/A | -| `filteredChannelIds` | *string*[] | :heavy_minus_sign: | N/A | -| `filteredActionIds` | *string*[] | :heavy_minus_sign: | N/A | -| `languages` | *string*[] | :heavy_minus_sign: | N/A | -| `contentTypes` | [operations.GetQueueContentType](../../models/operations/get-queue-content-type.md)[] | :heavy_minus_sign: | N/A | -| `mediaTypes` | [operations.MediaType](../../models/operations/media-type.md)[] | :heavy_minus_sign: | N/A | -| `authorTrustLevels` | *number*[] | :heavy_minus_sign: | N/A | -| `recommendationActions` | [operations.GetQueueRecommendationAction](../../models/operations/get-queue-recommendation-action.md)[] | :heavy_minus_sign: | N/A | -| `minSeverity` | *number* | :heavy_minus_sign: | N/A | -| `maxSeverity` | *number* | :heavy_minus_sign: | N/A | -| `afterDate` | *string* | :heavy_minus_sign: | N/A | -| `beforeDate` | *string* | :heavy_minus_sign: | N/A | -| `within` | *number* | :heavy_minus_sign: | N/A | -| `withinUnit` | [operations.WithinUnit](../../models/operations/within-unit.md) | :heavy_minus_sign: | N/A | -| `clearDateWindow` | *boolean* | :heavy_minus_sign: | N/A | -| `checkStatus` | [operations.CheckStatus](../../models/operations/check-status.md) | :heavy_minus_sign: | N/A | -| `authorID` | *string* | :heavy_minus_sign: | N/A | -| `contentID` | *string* | :heavy_minus_sign: | N/A | -| `conversationIds` | *string*[] | :heavy_minus_sign: | N/A | -| `search` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/flag-rate-spike.md b/docs/models/operations/flag-rate-spike.md new file mode 100644 index 0000000..7dac36f --- /dev/null +++ b/docs/models/operations/flag-rate-spike.md @@ -0,0 +1,25 @@ +# FlagRateSpike + +## Example Usage + +```typescript +import { FlagRateSpike } from "@moderation-api/sdk/models/operations"; + +let value: FlagRateSpike = { + multiple: 6864.85, + recentFlagRate: 6834.63, + baselineFlagRate: 4818.31, + recentFlagged: 179584, + recentRequests: 580461, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `multiple` | *number* | :heavy_check_mark: | How many times higher the recent flag rate is than the baseline, for example 2.4. | +| `recentFlagRate` | *number* | :heavy_check_mark: | The flag rate in the last 2 days. | +| `baselineFlagRate` | *number* | :heavy_check_mark: | The flag rate in the 30 days before that. | +| `recentFlagged` | *number* | :heavy_check_mark: | Flagged requests in the last 2 days. | +| `recentRequests` | *number* | :heavy_check_mark: | Requests in the last 2 days. | \ No newline at end of file diff --git a/docs/models/operations/flagged-content-trend.md b/docs/models/operations/flagged-content-trend.md deleted file mode 100644 index b8514ed..0000000 --- a/docs/models/operations/flagged-content-trend.md +++ /dev/null @@ -1,19 +0,0 @@ -# FlaggedContentTrend - -## Example Usage - -```typescript -import { FlaggedContentTrend } from "@moderation-api/sdk/models/operations"; - -let value: FlaggedContentTrend = { - label: "", - trend: 3612.71, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `label` | *string* | :heavy_check_mark: | Content flag/label | -| `trend` | *number* | :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/operations/get-account-request.md b/docs/models/operations/get-account-request.md index ec1ba87..6c8610d 100644 --- a/docs/models/operations/get-account-request.md +++ b/docs/models/operations/get-account-request.md @@ -10,6 +10,6 @@ let value: GetAccountRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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/operations/get-action-request.md b/docs/models/operations/get-action-request.md index d3d8c00..dfa3133 100644 --- a/docs/models/operations/get-action-request.md +++ b/docs/models/operations/get-action-request.md @@ -12,7 +12,7 @@ let value: GetActionRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to get. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The ID of the action to get. | +| `projectId` | *string* | :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/operations/get-analytics-authors-author.md b/docs/models/operations/get-analytics-authors-author.md new file mode 100644 index 0000000..c874335 --- /dev/null +++ b/docs/models/operations/get-analytics-authors-author.md @@ -0,0 +1,21 @@ +# GetAnalyticsAuthorsAuthor + +## Example Usage + +```typescript +import { GetAnalyticsAuthorsAuthor } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAuthorsAuthor = { + authorId: "", + name: null, + flagged: 957707, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `authorId` | *string* | :heavy_check_mark: | The author ID from your system. Use it with the authors endpoints. | +| `name` | *string* | :heavy_check_mark: | The author name, if known. | +| `flagged` | *number* | :heavy_check_mark: | Flagged requests from this author in the window. | \ No newline at end of file diff --git a/docs/models/operations/get-analytics-authors-query-param-range.md b/docs/models/operations/get-analytics-authors-query-param-range.md new file mode 100644 index 0000000..7a69768 --- /dev/null +++ b/docs/models/operations/get-analytics-authors-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsAuthorsQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAuthorsQueryParamRange = "30d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-authors-range-response.md b/docs/models/operations/get-analytics-authors-range-response.md new file mode 100644 index 0000000..6d69a40 --- /dev/null +++ b/docs/models/operations/get-analytics-authors-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsAuthorsRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsAuthorsRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAuthorsRangeResponse = "30d"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-authors-request.md b/docs/models/operations/get-analytics-authors-request.md new file mode 100644 index 0000000..31686be --- /dev/null +++ b/docs/models/operations/get-analytics-authors-request.md @@ -0,0 +1,18 @@ +# GetAnalyticsAuthorsRequest + +## Example Usage + +```typescript +import { GetAnalyticsAuthorsRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAuthorsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAuthorsQueryParamRange](../../models/operations/get-analytics-authors-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `limit` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-analytics-authors-response.md b/docs/models/operations/get-analytics-authors-response.md new file mode 100644 index 0000000..fcb713a --- /dev/null +++ b/docs/models/operations/get-analytics-authors-response.md @@ -0,0 +1,29 @@ +# GetAnalyticsAuthorsResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsAuthorsResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAuthorsResponse = { + range: "90d", + channelId: "", + authors: [ + { + authorId: "", + name: "", + flagged: 179965, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAuthorsRangeResponse](../../models/operations/get-analytics-authors-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channelId` | *string* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `authors` | [operations.GetAnalyticsAuthorsAuthor](../../models/operations/get-analytics-authors-author.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/operations/get-analytics-automation-query-param-range.md b/docs/models/operations/get-analytics-automation-query-param-range.md new file mode 100644 index 0000000..11e8ecb --- /dev/null +++ b/docs/models/operations/get-analytics-automation-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsAutomationQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAutomationQueryParamRange = "7d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-automation-range-response.md b/docs/models/operations/get-analytics-automation-range-response.md new file mode 100644 index 0000000..20ea178 --- /dev/null +++ b/docs/models/operations/get-analytics-automation-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsAutomationRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsAutomationRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAutomationRangeResponse = "7d"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-automation-request.md b/docs/models/operations/get-analytics-automation-request.md new file mode 100644 index 0000000..13f7f04 --- /dev/null +++ b/docs/models/operations/get-analytics-automation-request.md @@ -0,0 +1,17 @@ +# GetAnalyticsAutomationRequest + +## Example Usage + +```typescript +import { GetAnalyticsAutomationRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAutomationRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAutomationQueryParamRange](../../models/operations/get-analytics-automation-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-analytics-automation-response.md b/docs/models/operations/get-analytics-automation-response.md new file mode 100644 index 0000000..b7831b9 --- /dev/null +++ b/docs/models/operations/get-analytics-automation-response.md @@ -0,0 +1,45 @@ +# GetAnalyticsAutomationResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsAutomationResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsAutomationResponse = { + range: "90d", + channelId: "", + flagged: 708855, + handledByRules: 534494, + handledByCasebook: 4222, + sentToReview: 120949, + mergedDuplicates: 820450, + automationRate: 9807.95, + reviewsAllowed: 850470, + reviewsRejected: 437053, + reviewsResolvedWithoutDecision: 676678, + reviewsUnresolved: 541499, + casebookOverrulings: 696303, + rules: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAutomationRangeResponse](../../models/operations/get-analytics-automation-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channelId` | *string* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `flagged` | *number* | :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. | +| `handledByRules` | *number* | :heavy_check_mark: | Flagged requests that a rule allowed or rejected without human review. | +| `handledByCasebook` | *number* | :heavy_check_mark: | Flagged requests that the casebook settled without human review. | +| `sentToReview` | *number* | :heavy_check_mark: | Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue. | +| `mergedDuplicates` | *number* | :heavy_check_mark: | Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later. | +| `automationRate` | *number* | :heavy_check_mark: | N/A | +| `reviewsAllowed` | *number* | :heavy_check_mark: | Review queue items from this window that a moderator allowed. | +| `reviewsRejected` | *number* | :heavy_check_mark: | Review queue items from this window that a moderator rejected. | +| `reviewsResolvedWithoutDecision` | *number* | :heavy_check_mark: | Review queue items from this window that a moderator marked as done without allow or reject. | +| `reviewsUnresolved` | *number* | :heavy_check_mark: | Review queue items from this window that are still open. | +| `casebookOverrulings` | *number* | :heavy_check_mark: | Requests where the casebook decision was different from the decision based on severity. | +| `rules` | [operations.Rule](../../models/operations/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/operations/get-analytics-channels-query-param-range.md b/docs/models/operations/get-analytics-channels-query-param-range.md new file mode 100644 index 0000000..10257be --- /dev/null +++ b/docs/models/operations/get-analytics-channels-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsChannelsQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsChannelsQueryParamRange = "24h"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-channels-range-response.md b/docs/models/operations/get-analytics-channels-range-response.md new file mode 100644 index 0000000..581cef0 --- /dev/null +++ b/docs/models/operations/get-analytics-channels-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsChannelsRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsChannelsRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsChannelsRangeResponse = "7d"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-channels-request.md b/docs/models/operations/get-analytics-channels-request.md new file mode 100644 index 0000000..c3a1dae --- /dev/null +++ b/docs/models/operations/get-analytics-channels-request.md @@ -0,0 +1,16 @@ +# GetAnalyticsChannelsRequest + +## Example Usage + +```typescript +import { GetAnalyticsChannelsRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsChannelsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsChannelsQueryParamRange](../../models/operations/get-analytics-channels-query-param-range.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. | +| `projectId` | *string* | :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/operations/get-analytics-channels-response.md b/docs/models/operations/get-analytics-channels-response.md new file mode 100644 index 0000000..95dc41d --- /dev/null +++ b/docs/models/operations/get-analytics-channels-response.md @@ -0,0 +1,21 @@ +# GetAnalyticsChannelsResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsChannelsResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsChannelsResponse = { + range: "90d", + channels: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsChannelsRangeResponse](../../models/operations/get-analytics-channels-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channels` | [operations.Channel](../../models/operations/channel.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/operations/get-analytics-policies-policy.md b/docs/models/operations/get-analytics-policies-policy.md new file mode 100644 index 0000000..77fc6d8 --- /dev/null +++ b/docs/models/operations/get-analytics-policies-policy.md @@ -0,0 +1,21 @@ +# GetAnalyticsPoliciesPolicy + +## Example Usage + +```typescript +import { GetAnalyticsPoliciesPolicy } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsPoliciesPolicy = { + label: "", + flagged: 663628, + previousFlagged: 41854, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `label` | *string* | :heavy_check_mark: | The policy label, for example `toxicity`. | +| `flagged` | *number* | :heavy_check_mark: | Flagged requests with this label in the window. Repeats count each time. | +| `previousFlagged` | *number* | :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/operations/get-analytics-policies-query-param-range.md b/docs/models/operations/get-analytics-policies-query-param-range.md new file mode 100644 index 0000000..a878bfb --- /dev/null +++ b/docs/models/operations/get-analytics-policies-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsPoliciesQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsPoliciesQueryParamRange = "7d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-policies-range-response.md b/docs/models/operations/get-analytics-policies-range-response.md new file mode 100644 index 0000000..51cc5da --- /dev/null +++ b/docs/models/operations/get-analytics-policies-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsPoliciesRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsPoliciesRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsPoliciesRangeResponse = "24h"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-policies-request.md b/docs/models/operations/get-analytics-policies-request.md new file mode 100644 index 0000000..4fe1c2b --- /dev/null +++ b/docs/models/operations/get-analytics-policies-request.md @@ -0,0 +1,18 @@ +# GetAnalyticsPoliciesRequest + +## Example Usage + +```typescript +import { GetAnalyticsPoliciesRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsPoliciesRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsPoliciesQueryParamRange](../../models/operations/get-analytics-policies-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `limit` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-analytics-policies-response.md b/docs/models/operations/get-analytics-policies-response.md new file mode 100644 index 0000000..5e9aba8 --- /dev/null +++ b/docs/models/operations/get-analytics-policies-response.md @@ -0,0 +1,23 @@ +# GetAnalyticsPoliciesResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsPoliciesResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsPoliciesResponse = { + range: "7d", + channelId: "", + policies: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsPoliciesRangeResponse](../../models/operations/get-analytics-policies-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channelId` | *string* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `policies` | [operations.GetAnalyticsPoliciesPolicy](../../models/operations/get-analytics-policies-policy.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/operations/get-analytics-summary-query-param-range.md b/docs/models/operations/get-analytics-summary-query-param-range.md new file mode 100644 index 0000000..90c9e32 --- /dev/null +++ b/docs/models/operations/get-analytics-summary-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsSummaryQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsSummaryQueryParamRange = "30d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-summary-range-response.md b/docs/models/operations/get-analytics-summary-range-response.md new file mode 100644 index 0000000..1713064 --- /dev/null +++ b/docs/models/operations/get-analytics-summary-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsSummaryRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsSummaryRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsSummaryRangeResponse = "24h"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-summary-request.md b/docs/models/operations/get-analytics-summary-request.md new file mode 100644 index 0000000..0dc2308 --- /dev/null +++ b/docs/models/operations/get-analytics-summary-request.md @@ -0,0 +1,17 @@ +# GetAnalyticsSummaryRequest + +## Example Usage + +```typescript +import { GetAnalyticsSummaryRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsSummaryRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsSummaryQueryParamRange](../../models/operations/get-analytics-summary-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-analytics-summary-response.md b/docs/models/operations/get-analytics-summary-response.md new file mode 100644 index 0000000..1a61d9e --- /dev/null +++ b/docs/models/operations/get-analytics-summary-response.md @@ -0,0 +1,54 @@ +# GetAnalyticsSummaryResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsSummaryResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsSummaryResponse = { + range: "30d", + channelId: "", + totals: { + requests: 789439, + flagged: 789288, + flagRate: 5698.19, + allowed: 734790, + rejected: 197732, + sentToReview: 95950, + handledAutomatically: 457645, + flaggedButAllowed: 433985, + distinctAuthors: 767900, + }, + previousPeriod: { + requests: 797890, + flagged: 628486, + flagRate: 8967.36, + allowed: 771785, + rejected: 353129, + sentToReview: 147782, + handledAutomatically: 773644, + flaggedButAllowed: 615674, + }, + pendingReview: 452057, + flagRateSpike: { + multiple: 3439.81, + recentFlagRate: 8141.03, + baselineFlagRate: 9067.79, + recentFlagged: 79611, + recentRequests: 315181, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsSummaryRangeResponse](../../models/operations/get-analytics-summary-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channelId` | *string* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `totals` | [operations.Totals](../../models/operations/totals.md) | :heavy_check_mark: | Request counts for the window. A flagged request has one recommendation: allow, reject or review. | +| `previousPeriod` | [operations.PreviousPeriod](../../models/operations/previous-period.md) | :heavy_check_mark: | The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. | +| `pendingReview` | *number* | :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. | +| `flagRateSpike` | [operations.FlagRateSpike](../../models/operations/flag-rate-spike.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/operations/get-analytics-volumes-query-param-range.md b/docs/models/operations/get-analytics-volumes-query-param-range.md new file mode 100644 index 0000000..cf9a29f --- /dev/null +++ b/docs/models/operations/get-analytics-volumes-query-param-range.md @@ -0,0 +1,17 @@ +# 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 + +```typescript +import { GetAnalyticsVolumesQueryParamRange } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsVolumesQueryParamRange = "90d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-volumes-range-response.md b/docs/models/operations/get-analytics-volumes-range-response.md new file mode 100644 index 0000000..110bc6e --- /dev/null +++ b/docs/models/operations/get-analytics-volumes-range-response.md @@ -0,0 +1,19 @@ +# GetAnalyticsVolumesRangeResponse + +The time window of the numbers. + +## Example Usage + +```typescript +import { GetAnalyticsVolumesRangeResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsVolumesRangeResponse = "30d"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/get-analytics-volumes-request.md b/docs/models/operations/get-analytics-volumes-request.md new file mode 100644 index 0000000..9b6c482 --- /dev/null +++ b/docs/models/operations/get-analytics-volumes-request.md @@ -0,0 +1,17 @@ +# GetAnalyticsVolumesRequest + +## Example Usage + +```typescript +import { GetAnalyticsVolumesRequest } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsVolumesRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsVolumesQueryParamRange](../../models/operations/get-analytics-volumes-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-analytics-volumes-response.md b/docs/models/operations/get-analytics-volumes-response.md new file mode 100644 index 0000000..2f166d8 --- /dev/null +++ b/docs/models/operations/get-analytics-volumes-response.md @@ -0,0 +1,33 @@ +# GetAnalyticsVolumesResponse + +Successful response + +## Example Usage + +```typescript +import { GetAnalyticsVolumesResponse } from "@moderation-api/sdk/models/operations"; + +let value: GetAnalyticsVolumesResponse = { + range: "7d", + channelId: "", + bucket: "hour", + volumes: [ + { + start: "", + requests: 729318, + flagged: 667937, + rejected: 663382, + sentToReview: 881734, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsVolumesRangeResponse](../../models/operations/get-analytics-volumes-range-response.md) | :heavy_check_mark: | The time window of the numbers. | +| `channelId` | *string* | :heavy_check_mark: | The channel the numbers are for. Null when they are for all channels. | +| `bucket` | [operations.Bucket](../../models/operations/bucket.md) | :heavy_check_mark: | The size of each entry in `volumes`. | +| `volumes` | [operations.Volume](../../models/operations/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/operations/get-author-request.md b/docs/models/operations/get-author-request.md index 67309d2..abd268f 100644 --- a/docs/models/operations/get-author-request.md +++ b/docs/models/operations/get-author-request.md @@ -12,7 +12,7 @@ let value: GetAuthorRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *string* | :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/operations/get-queue-content-type.md b/docs/models/operations/get-queue-content-type.md deleted file mode 100644 index a254a9a..0000000 --- a/docs/models/operations/get-queue-content-type.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetQueueContentType - -## Example Usage - -```typescript -import { GetQueueContentType } from "@moderation-api/sdk/models/operations"; - -let value: GetQueueContentType = "voice"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"profile" | "message" | "post" | "comment" | "event" | "product" | "review" | "voice" | "other" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/get-queue-recommendation-action.md b/docs/models/operations/get-queue-recommendation-action.md deleted file mode 100644 index 448f5e1..0000000 --- a/docs/models/operations/get-queue-recommendation-action.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetQueueRecommendationAction - -## Example Usage - -```typescript -import { GetQueueRecommendationAction } from "@moderation-api/sdk/models/operations"; - -let value: GetQueueRecommendationAction = "allow"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"review" | "allow" | "reject" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/get-queue-request.md b/docs/models/operations/get-queue-request.md index d14077b..650e894 100644 --- a/docs/models/operations/get-queue-request.md +++ b/docs/models/operations/get-queue-request.md @@ -12,7 +12,7 @@ let value: GetQueueRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The queue ID. | +| `projectId` | *string* | :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/operations/get-queue-response.md b/docs/models/operations/get-queue-response.md index 638350b..565cacc 100644 --- a/docs/models/operations/get-queue-response.md +++ b/docs/models/operations/get-queue-response.md @@ -11,17 +11,17 @@ let value: GetQueueResponse = { queue: { id: "", name: "", - description: "until pointed schematise", - filter: {}, - unresolvedItemsCount: 8405.32, - resolvedItemsCount: 2502.72, - totalItemsCount: 206.32, + description: null, + isDefault: true, + unresolvedItemsCount: 120098, + resolvedItemsCount: 340268, + totalItemsCount: 340987, }, }; ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `queue` | [operations.Queue](../../models/operations/queue.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `queue` | [models.QueueWithCounts](../../models/queue-with-counts.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/get-queue-stats-request.md b/docs/models/operations/get-queue-stats-request.md index 48b9045..a170514 100644 --- a/docs/models/operations/get-queue-stats-request.md +++ b/docs/models/operations/get-queue-stats-request.md @@ -12,8 +12,8 @@ let value: GetQueueStatsRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `withinDays` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The queue ID. | +| `withinDays` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/get-queue-stats-response.md b/docs/models/operations/get-queue-stats-response.md index e2bfc06..2b313d2 100644 --- a/docs/models/operations/get-queue-stats-response.md +++ b/docs/models/operations/get-queue-stats-response.md @@ -9,38 +9,15 @@ import { GetQueueStatsResponse } from "@moderation-api/sdk/models/operations"; let value: GetQueueStatsResponse = { reviewStats: { - averageTimeToReview: 2727.84, - totalReviewed: 1836.69, - totalPending: 2916.33, + totalReviewed: 272784, + totalPending: 183669, }, - actionStats: [ - { - actionId: "", - actionName: "", - count: 5884.78, - percentageOfTotal: 5129.76, - }, - ], - topReviewers: [ - { - userId: "", - name: "", - reviewCount: 6229.9, - averageTimePerReview: 9557.94, - topActions: [], - }, - ], + topReviewers: [], trends: { dailyReviewCounts: [ { - date: "2024-12-05", - count: 58.82, - }, - ], - flaggedContentTrends: [ - { - label: "", - trend: 1814.78, + date: "2024-08-03", + count: 512976, }, ], }, @@ -52,6 +29,5 @@ let value: GetQueueStatsResponse = { | Field | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `reviewStats` | [operations.ReviewStats](../../models/operations/review-stats.md) | :heavy_check_mark: | N/A | -| `actionStats` | [operations.ActionStat](../../models/operations/action-stat.md)[] | :heavy_check_mark: | N/A | -| `topReviewers` | [operations.TopReviewer](../../models/operations/top-reviewer.md)[] | :heavy_check_mark: | List of top reviewers and their statistics | +| `topReviewers` | [operations.TopReviewer](../../models/operations/top-reviewer.md)[] | :heavy_check_mark: | Reviewers with the most resolved items, most first. Up to 10. | | `trends` | [operations.Trends](../../models/operations/trends.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/get-queue-type.md b/docs/models/operations/get-queue-type.md deleted file mode 100644 index 4490bb9..0000000 --- a/docs/models/operations/get-queue-type.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetQueueType - -## Example Usage - -```typescript -import { GetQueueType } from "@moderation-api/sdk/models/operations"; - -let value: GetQueueType = "NOT_FLAGGED"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"FLAGGED" | "NOT_FLAGGED" | "THRESHOLDS" | "MATCHED" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/get-webhook-request.md b/docs/models/operations/get-webhook-request.md index ee09ad2..9efc8f0 100644 --- a/docs/models/operations/get-webhook-request.md +++ b/docs/models/operations/get-webhook-request.md @@ -12,7 +12,7 @@ let value: GetWebhookRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to get. | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The ID of the webhook to get. | +| `projectId` | *string* | :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/operations/get-webhook-secret-request.md b/docs/models/operations/get-webhook-secret-request.md index 57cf3fe..c2d8bb9 100644 --- a/docs/models/operations/get-webhook-secret-request.md +++ b/docs/models/operations/get-webhook-secret-request.md @@ -10,6 +10,6 @@ let value: GetWebhookSecretRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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/operations/get-wordlist-embedding-status-request.md b/docs/models/operations/get-wordlist-embedding-status-request.md index af317d9..7dfca68 100644 --- a/docs/models/operations/get-wordlist-embedding-status-request.md +++ b/docs/models/operations/get-wordlist-embedding-status-request.md @@ -12,7 +12,7 @@ let value: GetWordlistEmbeddingStatusRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to check embedding status for | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | ID of the wordlist to check embedding status for | +| `projectId` | *string* | :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/operations/get-wordlist-request.md b/docs/models/operations/get-wordlist-request.md index 67e7400..aa41b6a 100644 --- a/docs/models/operations/get-wordlist-request.md +++ b/docs/models/operations/get-wordlist-request.md @@ -12,7 +12,7 @@ let value: GetWordlistRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to get | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | ID of the wordlist to get | +| `projectId` | *string* | :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/operations/is-flagged.md b/docs/models/operations/is-flagged.md deleted file mode 100644 index b2bf827..0000000 --- a/docs/models/operations/is-flagged.md +++ /dev/null @@ -1,17 +0,0 @@ -# IsFlagged - -## Example Usage - -```typescript -import { IsFlagged } from "@moderation-api/sdk/models/operations"; - -let value: IsFlagged = "FLAGGED"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"ALL" | "FLAGGED" | "NOT_FLAGGED" | "SHADOW_FLAGGED" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/submit-content-label.md b/docs/models/operations/label.md similarity index 79% rename from docs/models/operations/submit-content-label.md rename to docs/models/operations/label.md index 598f13f..d4b8a7e 100644 --- a/docs/models/operations/submit-content-label.md +++ b/docs/models/operations/label.md @@ -1,13 +1,13 @@ -# SubmitContentLabel +# Label ## Example Usage ```typescript -import { SubmitContentLabel } from "@moderation-api/sdk/models/operations"; +import { Label } from "@moderation-api/sdk/models/operations"; -let value: SubmitContentLabel = { +let value: Label = { id: "", - probability: 2723.57, + probability: 1430.61, flagged: false, }; ``` diff --git a/docs/models/operations/list-actions-request.md b/docs/models/operations/list-actions-request.md index aa5d4ea..a42b143 100644 --- a/docs/models/operations/list-actions-request.md +++ b/docs/models/operations/list-actions-request.md @@ -10,9 +10,9 @@ let value: ListActionsRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `queueId` | *string* | :heavy_minus_sign: | N/A | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `queueId` | *string* | :heavy_minus_sign: | N/A | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/list-authors-request.md b/docs/models/operations/list-authors-request.md index 80f4846..11c2d92 100644 --- a/docs/models/operations/list-authors-request.md +++ b/docs/models/operations/list-authors-request.md @@ -10,13 +10,12 @@ let value: ListAuthorsRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `sortBy` | [operations.SortBy](../../models/operations/sort-by.md) | :heavy_minus_sign: | N/A | -| `sortDirection` | [operations.ListAuthorsSortDirection](../../models/operations/list-authors-sort-direction.md) | :heavy_minus_sign: | Sort direction | -| `memberSinceDate` | *string* | :heavy_minus_sign: | N/A | -| `lastActiveDate` | *string* | :heavy_minus_sign: | N/A | -| `contentTypes` | *string*[] | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `sortBy` | [operations.SortBy](../../models/operations/sort-by.md) | :heavy_minus_sign: | N/A | +| `sortDirection` | [operations.SortDirection](../../models/operations/sort-direction.md) | :heavy_minus_sign: | Sort direction | +| `memberSinceDate` | *string* | :heavy_minus_sign: | N/A | +| `lastActiveDate` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/list-authors-sort-direction.md b/docs/models/operations/list-authors-sort-direction.md deleted file mode 100644 index 3c70a3f..0000000 --- a/docs/models/operations/list-authors-sort-direction.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListAuthorsSortDirection - -Sort direction - -## Example Usage - -```typescript -import { ListAuthorsSortDirection } from "@moderation-api/sdk/models/operations"; - -let value: ListAuthorsSortDirection = "asc"; -``` - -## Values - -```typescript -"asc" | "desc" -``` \ No newline at end of file diff --git a/docs/models/operations/list-queue-items-action.md b/docs/models/operations/list-queue-items-action.md deleted file mode 100644 index 7b34ed4..0000000 --- a/docs/models/operations/list-queue-items-action.md +++ /dev/null @@ -1,23 +0,0 @@ -# ListQueueItemsAction - -## Example Usage - -```typescript -import { ListQueueItemsAction } from "@moderation-api/sdk/models/operations"; - -let value: ListQueueItemsAction = { - id: "", - name: "", - timestamp: 9860.52, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Action ID | -| `name` | *string* | :heavy_check_mark: | Action name | -| `comment` | *string* | :heavy_minus_sign: | Action comment | -| `timestamp` | *number* | :heavy_check_mark: | Unix timestamp of when the action was taken | -| `reviewer` | *string* | :heavy_minus_sign: | Moderator userID | \ No newline at end of file diff --git a/docs/models/operations/list-queue-items-data.md b/docs/models/operations/list-queue-items-data.md deleted file mode 100644 index bc29c16..0000000 --- a/docs/models/operations/list-queue-items-data.md +++ /dev/null @@ -1,38 +0,0 @@ -# ListQueueItemsData - -## Example Usage - -```typescript -import { ListQueueItemsData } from "@moderation-api/sdk/models/operations"; - -let value: ListQueueItemsData = { - id: "", - content: "", - labels: [ - { - label: "", - score: 7651.06, - flagged: false, - }, - ], - flagged: false, - status: "pending", - timestamp: 6097.53, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Content ID | -| `content` | *string* | :heavy_check_mark: | The content to be moderated | -| `language` | *string* | :heavy_minus_sign: | Content language | -| `labels` | [operations.ListQueueItemsLabel](../../models/operations/list-queue-items-label.md)[] | :heavy_check_mark: | N/A | -| `conversationId` | *string* | :heavy_minus_sign: | Conversation ID | -| `authorId` | *string* | :heavy_minus_sign: | Author ID | -| `actions` | [operations.ListQueueItemsAction](../../models/operations/list-queue-items-action.md)[] | :heavy_minus_sign: | Action IDs taken on this item | -| `flagged` | *boolean* | :heavy_check_mark: | Whether the item is flagged by any label | -| `status` | [operations.ListQueueItemsStatus](../../models/operations/list-queue-items-status.md) | :heavy_check_mark: | Status of the item | -| `timestamp` | *number* | :heavy_check_mark: | Unix timestamp of when the item was created | -| `contentType` | *string* | :heavy_minus_sign: | Type of the content object | \ No newline at end of file diff --git a/docs/models/operations/list-queue-items-label.md b/docs/models/operations/list-queue-items-label.md deleted file mode 100644 index 1bcddc1..0000000 --- a/docs/models/operations/list-queue-items-label.md +++ /dev/null @@ -1,21 +0,0 @@ -# ListQueueItemsLabel - -## Example Usage - -```typescript -import { ListQueueItemsLabel } from "@moderation-api/sdk/models/operations"; - -let value: ListQueueItemsLabel = { - label: "", - score: 1816.52, - flagged: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `label` | *string* | :heavy_check_mark: | Label name | -| `score` | *number* | :heavy_check_mark: | Confidence score of the label | -| `flagged` | *boolean* | :heavy_check_mark: | Whether this label caused a flag | \ No newline at end of file diff --git a/docs/models/operations/list-queue-items-request.md b/docs/models/operations/list-queue-items-request.md index 6bdb757..80faad3 100644 --- a/docs/models/operations/list-queue-items-request.md +++ b/docs/models/operations/list-queue-items-request.md @@ -12,18 +12,17 @@ let value: ListQueueItemsRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `sortField` | [operations.SortField](../../models/operations/sort-field.md) | :heavy_minus_sign: | N/A | -| `sortDirection` | [operations.ListQueueItemsSortDirection](../../models/operations/list-queue-items-sort-direction.md) | :heavy_minus_sign: | Sort direction | -| `conversationIds` | *string*[] | :heavy_minus_sign: | N/A | -| `labels` | *string*[] | :heavy_minus_sign: | N/A | -| `afterDate` | *string* | :heavy_minus_sign: | N/A | -| `beforeDate` | *string* | :heavy_minus_sign: | N/A | -| `includeResolved` | *boolean* | :heavy_minus_sign: | N/A | -| `authorId` | *string* | :heavy_minus_sign: | N/A | -| `filteredActionIds` | *string*[] | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | The queue ID. | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `sort` | [operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | N/A | +| `includeResolved` | *boolean* | :heavy_minus_sign: | N/A | +| `conversationIds` | *string*[] | :heavy_minus_sign: | N/A | +| `labels` | *string*[] | :heavy_minus_sign: | N/A | +| `authorId` | *string* | :heavy_minus_sign: | N/A | +| `filteredActionIds` | *string*[] | :heavy_minus_sign: | N/A | +| `afterDate` | *string* | :heavy_minus_sign: | N/A | +| `beforeDate` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/list-queue-items-response-body.md b/docs/models/operations/list-queue-items-response-body.md index 80b6355..4efba68 100644 --- a/docs/models/operations/list-queue-items-response-body.md +++ b/docs/models/operations/list-queue-items-response-body.md @@ -11,17 +11,25 @@ let value: ListQueueItemsResponseBody = { data: [ { id: "", - content: "", + contentId: "", + content: { + type: "text", + text: "", + }, labels: [ { label: "", - score: 7651.06, - flagged: false, + score: 9550.55, }, ], flagged: true, - status: "resolved", - timestamp: 9550.55, + severity: 2551.88, + status: "pending", + timestamp: 2968.32, + language: "", + conversationId: "", + authorId: "", + contentType: "", }, ], pagination: { @@ -36,7 +44,7 @@ let value: ListQueueItemsResponseBody = { ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `data` | [operations.ListQueueItemsData](../../models/operations/list-queue-items-data.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` | [models.QueueItem](../../models/queue-item.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/operations/list-queue-items-response.md b/docs/models/operations/list-queue-items-response.md index a21a1ca..97628a6 100644 --- a/docs/models/operations/list-queue-items-response.md +++ b/docs/models/operations/list-queue-items-response.md @@ -10,17 +10,25 @@ let value: ListQueueItemsResponse = { data: [ { id: "", - content: "", + contentId: "", + content: { + type: "text", + text: "", + }, labels: [ { label: "", - score: 7651.06, - flagged: false, + score: 9550.55, }, ], flagged: true, - status: "resolved", - timestamp: 9550.55, + severity: 2551.88, + status: "pending", + timestamp: 2968.32, + language: "", + conversationId: "", + authorId: "", + contentType: "", }, ], pagination: { diff --git a/docs/models/operations/list-queue-items-sort-direction.md b/docs/models/operations/list-queue-items-sort-direction.md deleted file mode 100644 index ea26316..0000000 --- a/docs/models/operations/list-queue-items-sort-direction.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListQueueItemsSortDirection - -Sort direction - -## Example Usage - -```typescript -import { ListQueueItemsSortDirection } from "@moderation-api/sdk/models/operations"; - -let value: ListQueueItemsSortDirection = "desc"; -``` - -## Values - -```typescript -"asc" | "desc" -``` \ No newline at end of file diff --git a/docs/models/operations/list-queues-request.md b/docs/models/operations/list-queues-request.md new file mode 100644 index 0000000..7897351 --- /dev/null +++ b/docs/models/operations/list-queues-request.md @@ -0,0 +1,17 @@ +# ListQueuesRequest + +## Example Usage + +```typescript +import { ListQueuesRequest } from "@moderation-api/sdk/models/operations"; + +let value: ListQueuesRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/list-queues-response-body.md b/docs/models/operations/list-queues-response-body.md new file mode 100644 index 0000000..70bc25e --- /dev/null +++ b/docs/models/operations/list-queues-response-body.md @@ -0,0 +1,27 @@ +# ListQueuesResponseBody + +Successful response + +## Example Usage + +```typescript +import { ListQueuesResponseBody } from "@moderation-api/sdk/models/operations"; + +let value: ListQueuesResponseBody = { + data: [], + pagination: { + page: 335492, + pageSize: 148408, + total: 57774, + totalPages: 915803, + hasMore: false, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `data` | [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/operations/list-queues-response.md b/docs/models/operations/list-queues-response.md new file mode 100644 index 0000000..0b883e1 --- /dev/null +++ b/docs/models/operations/list-queues-response.md @@ -0,0 +1,34 @@ +# ListQueuesResponse + +## Example Usage + +```typescript +import { ListQueuesResponse } from "@moderation-api/sdk/models/operations"; + +let value: ListQueuesResponse = { + result: { + data: [ + { + id: "", + name: "", + description: + "baggy jot sans tenderly while fork cuckoo miserable where", + isDefault: false, + }, + ], + pagination: { + page: 335492, + pageSize: 148408, + total: 57774, + totalPages: 915803, + hasMore: false, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `result` | [operations.ListQueuesResponseBody](../../models/operations/list-queues-response-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/list-webhooks-request.md b/docs/models/operations/list-webhooks-request.md index a0e4c8a..ff30ce7 100644 --- a/docs/models/operations/list-webhooks-request.md +++ b/docs/models/operations/list-webhooks-request.md @@ -10,8 +10,8 @@ let value: ListWebhooksRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/list-wordlists-request.md b/docs/models/operations/list-wordlists-request.md index 1d8222b..166bfeb 100644 --- a/docs/models/operations/list-wordlists-request.md +++ b/docs/models/operations/list-wordlists-request.md @@ -10,8 +10,8 @@ let value: ListWordlistsRequest = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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/operations/media-type.md b/docs/models/operations/media-type.md deleted file mode 100644 index 308b9f8..0000000 --- a/docs/models/operations/media-type.md +++ /dev/null @@ -1,17 +0,0 @@ -# MediaType - -## Example Usage - -```typescript -import { MediaType } from "@moderation-api/sdk/models/operations"; - -let value: MediaType = "audio"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"text" | "image" | "video" | "object" | "audio" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/metadata-filter.md b/docs/models/operations/metadata-filter.md deleted file mode 100644 index 56cf78f..0000000 --- a/docs/models/operations/metadata-filter.md +++ /dev/null @@ -1,19 +0,0 @@ -# MetadataFilter - -## Example Usage - -```typescript -import { MetadataFilter } from "@moderation-api/sdk/models/operations"; - -let value: MetadataFilter = { - key: "", - value: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `key` | *string* | :heavy_check_mark: | N/A | -| `value` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/previous-period.md b/docs/models/operations/previous-period.md new file mode 100644 index 0000000..4cdc6ed --- /dev/null +++ b/docs/models/operations/previous-period.md @@ -0,0 +1,33 @@ +# PreviousPeriod + +The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. + +## Example Usage + +```typescript +import { PreviousPeriod } from "@moderation-api/sdk/models/operations"; + +let value: PreviousPeriod = { + requests: 678062, + flagged: 277299, + flagRate: 564.59, + allowed: 694147, + rejected: 664660, + sentToReview: 880678, + handledAutomatically: 881700, + flaggedButAllowed: 286973, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `requests` | *number* | :heavy_check_mark: | Requests received. Every request counts, also repeats and edits of the same content. | +| `flagged` | *number* | :heavy_check_mark: | Requests that were flagged. | +| `flagRate` | *number* | :heavy_check_mark: | The share of requests that were flagged: flagged / requests. 0 when there were no requests. | +| `allowed` | *number* | :heavy_check_mark: | Requests with the recommendation "allow". Includes content that was not flagged. | +| `rejected` | *number* | :heavy_check_mark: | Requests with the recommendation "reject". All of them were flagged. | +| `sentToReview` | *number* | :heavy_check_mark: | Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. | +| `handledAutomatically` | *number* | :heavy_check_mark: | Flagged requests that were settled without human review: rejected plus flaggedButAllowed. | +| `flaggedButAllowed` | *number* | :heavy_check_mark: | Flagged requests that were allowed without human review. | \ No newline at end of file diff --git a/docs/models/operations/recommendation.md b/docs/models/operations/recommendation.md index f065886..9ecea9d 100644 --- a/docs/models/operations/recommendation.md +++ b/docs/models/operations/recommendation.md @@ -17,6 +17,6 @@ let value: Recommendation = { | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `action` | [operations.SubmitContentRecommendationAction](../../models/operations/submit-content-recommendation-action.md) | :heavy_check_mark: | The action to take based on the recommendation | +| `action` | [operations.ActionResponse](../../models/operations/action-response.md) | :heavy_check_mark: | The action to take based on the recommendation | | `reasonCodes` | *operations.ReasonCode*[] | :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. | | `matchedRules` | [operations.MatchedRule](../../models/operations/matched-rule.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/operations/remove-wordlist-words-request.md b/docs/models/operations/remove-wordlist-words-request.md index 6ab6400..67af5d5 100644 --- a/docs/models/operations/remove-wordlist-words-request.md +++ b/docs/models/operations/remove-wordlist-words-request.md @@ -13,8 +13,8 @@ let value: RemoveWordlistWordsRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to remove words from | -| `words` | *string*[] | :heavy_check_mark: | Array of words to remove from the wordlist | -| `projectId` | *string* | :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` | *string* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | *string*[] | :heavy_check_mark: | Array of words to remove from the wordlist | +| `projectId` | *string* | :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/operations/resolve-queue-item-request-body.md b/docs/models/operations/resolve-queue-item-request-body.md deleted file mode 100644 index b197248..0000000 --- a/docs/models/operations/resolve-queue-item-request-body.md +++ /dev/null @@ -1,15 +0,0 @@ -# ResolveQueueItemRequestBody - -## Example Usage - -```typescript -import { ResolveQueueItemRequestBody } from "@moderation-api/sdk/models/operations"; - -let value: ResolveQueueItemRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `comment` | *string* | :heavy_minus_sign: | Optional comment | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-item-request.md b/docs/models/operations/resolve-queue-item-request.md index bdc891d..7fd56e3 100644 --- a/docs/models/operations/resolve-queue-item-request.md +++ b/docs/models/operations/resolve-queue-item-request.md @@ -8,15 +8,13 @@ import { ResolveQueueItemRequest } from "@moderation-api/sdk/models/operations"; let value: ResolveQueueItemRequest = { id: "", itemId: "", - body: {}, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve | -| `projectId` | *string* | :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` | [operations.ResolveQueueItemRequestBody](../../models/operations/resolve-queue-item-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve. | +| `projectId` | *string* | :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/operations/resolve-queue-item-response.md b/docs/models/operations/resolve-queue-item-response.md index 839c869..29e013a 100644 --- a/docs/models/operations/resolve-queue-item-response.md +++ b/docs/models/operations/resolve-queue-item-response.md @@ -15,8 +15,7 @@ let value: ResolveQueueItemResponse = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `success` | *boolean* | :heavy_check_mark: | N/A | -| `resolvedAt` | *string* | :heavy_check_mark: | Timestamp when the item was resolved | -| `comment` | *string* | :heavy_minus_sign: | Optional comment | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `success` | *boolean* | :heavy_check_mark: | N/A | +| `resolvedAt` | *string* | :heavy_check_mark: | When the item was resolved (ISO 8601). | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-items-request-body.md b/docs/models/operations/resolve-queue-items-request-body.md new file mode 100644 index 0000000..24570a0 --- /dev/null +++ b/docs/models/operations/resolve-queue-items-request-body.md @@ -0,0 +1,19 @@ +# ResolveQueueItemsRequestBody + +## Example Usage + +```typescript +import { ResolveQueueItemsRequestBody } from "@moderation-api/sdk/models/operations"; + +let value: ResolveQueueItemsRequestBody = { + itemIds: [ + "", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `itemIds` | *string*[] | :heavy_check_mark: | The item IDs to resolve. Up to 100. | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-items-request.md b/docs/models/operations/resolve-queue-items-request.md new file mode 100644 index 0000000..10b4baf --- /dev/null +++ b/docs/models/operations/resolve-queue-items-request.md @@ -0,0 +1,25 @@ +# ResolveQueueItemsRequest + +## Example Usage + +```typescript +import { ResolveQueueItemsRequest } from "@moderation-api/sdk/models/operations"; + +let value: ResolveQueueItemsRequest = { + id: "", + body: { + itemIds: [ + "", + "", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `projectId` | *string* | :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` | [operations.ResolveQueueItemsRequestBody](../../models/operations/resolve-queue-items-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-items-response.md b/docs/models/operations/resolve-queue-items-response.md new file mode 100644 index 0000000..1be5900 --- /dev/null +++ b/docs/models/operations/resolve-queue-items-response.md @@ -0,0 +1,23 @@ +# ResolveQueueItemsResponse + +Successful response + +## Example Usage + +```typescript +import { ResolveQueueItemsResponse } from "@moderation-api/sdk/models/operations"; + +let value: ResolveQueueItemsResponse = { + resolved: 270113, + notFoundIds: [ + "", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `resolved` | *number* | :heavy_check_mark: | Number of items resolved. | +| `notFoundIds` | *string*[] | :heavy_check_mark: | Item IDs that do not exist in the project. | \ No newline at end of file diff --git a/docs/models/operations/review-stats.md b/docs/models/operations/review-stats.md index 476d499..47c439a 100644 --- a/docs/models/operations/review-stats.md +++ b/docs/models/operations/review-stats.md @@ -6,16 +6,14 @@ import { ReviewStats } from "@moderation-api/sdk/models/operations"; let value: ReviewStats = { - averageTimeToReview: 5134.09, - totalReviewed: 2591.46, - totalPending: 9962.95, + totalReviewed: 513409, + totalPending: 259146, }; ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `averageTimeToReview` | *number* | :heavy_check_mark: | Average time in milliseconds to review an item | -| `totalReviewed` | *number* | :heavy_check_mark: | Total number of items reviewed | -| `totalPending` | *number* | :heavy_check_mark: | Total number of items pending review | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `totalReviewed` | *number* | :heavy_check_mark: | Number of items resolved in this queue in the period. | +| `totalPending` | *number* | :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/operations/rule.md b/docs/models/operations/rule.md new file mode 100644 index 0000000..15147c1 --- /dev/null +++ b/docs/models/operations/rule.md @@ -0,0 +1,19 @@ +# Rule + +## Example Usage + +```typescript +import { Rule } from "@moderation-api/sdk/models/operations"; + +let value: Rule = { + name: "", + count: 379695, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The rule name. "Other rules" holds all rules after the largest ones. | +| `count` | *number* | :heavy_check_mark: | Flagged requests that this rule settled. | \ No newline at end of file diff --git a/docs/models/operations/sort-by.md b/docs/models/operations/sort-by.md index 4a7b97c..f55225e 100644 --- a/docs/models/operations/sort-by.md +++ b/docs/models/operations/sort-by.md @@ -11,5 +11,5 @@ let value: SortBy = "averageSentiment"; ## Values ```typescript -"trustLevel" | "violationCount" | "reportCount" | "memberSince" | "lastActive" | "contentCount" | "flaggedContentRatio" | "averageSentiment" +"trustLevel" | "violationCount" | "memberSince" | "lastActive" | "contentCount" | "flaggedContentRatio" | "averageSentiment" ``` \ No newline at end of file diff --git a/docs/models/operations/sort-direction.md b/docs/models/operations/sort-direction.md new file mode 100644 index 0000000..8f66816 --- /dev/null +++ b/docs/models/operations/sort-direction.md @@ -0,0 +1,17 @@ +# SortDirection + +Sort direction + +## Example Usage + +```typescript +import { SortDirection } from "@moderation-api/sdk/models/operations"; + +let value: SortDirection = "asc"; +``` + +## Values + +```typescript +"asc" | "desc" +``` \ No newline at end of file diff --git a/docs/models/operations/sort-field.md b/docs/models/operations/sort-field.md deleted file mode 100644 index 90c1752..0000000 --- a/docs/models/operations/sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ -# SortField - -## Example Usage - -```typescript -import { SortField } from "@moderation-api/sdk/models/operations"; - -let value: SortField = "createdAt"; -``` - -## Values - -```typescript -"createdAt" | "severity" | "reviewedAt" -``` \ No newline at end of file diff --git a/docs/models/operations/sort.md b/docs/models/operations/sort.md new file mode 100644 index 0000000..bbccf14 --- /dev/null +++ b/docs/models/operations/sort.md @@ -0,0 +1,15 @@ +# Sort + +## Example Usage + +```typescript +import { Sort } from "@moderation-api/sdk/models/operations"; + +let value: Sort = "LIFO"; +``` + +## Values + +```typescript +"FIFO" | "LIFO" | "RANDOM" | "SEVERITY_DESC" +``` \ No newline at end of file diff --git a/docs/models/operations/source.md b/docs/models/operations/source.md new file mode 100644 index 0000000..d456980 --- /dev/null +++ b/docs/models/operations/source.md @@ -0,0 +1,17 @@ +# Source + +Where the feedback was written: MCP server, agent skill, CLI or API. + +## Example Usage + +```typescript +import { Source } from "@moderation-api/sdk/models/operations"; + +let value: Source = "mcp"; +``` + +## Values + +```typescript +"mcp" | "skill" | "cli" | "api" +``` \ No newline at end of file diff --git a/docs/models/operations/author.md b/docs/models/operations/submit-content-author.md similarity index 92% rename from docs/models/operations/author.md rename to docs/models/operations/submit-content-author.md index fd8e726..3a0105f 100644 --- a/docs/models/operations/author.md +++ b/docs/models/operations/submit-content-author.md @@ -1,16 +1,16 @@ -# Author +# SubmitContentAuthor ## Example Usage ```typescript -import { Author } from "@moderation-api/sdk/models/operations"; +import { SubmitContentAuthor } from "@moderation-api/sdk/models/operations"; -let value: Author = { +let value: SubmitContentAuthor = { id: "", block: {}, - status: "blocked", + status: "suspended", trustLevel: { - level: 6111.07, + level: 6025.09, manual: true, }, }; diff --git a/docs/models/operations/policy-response.md b/docs/models/operations/submit-content-policy-response.md similarity index 93% rename from docs/models/operations/policy-response.md rename to docs/models/operations/submit-content-policy-response.md index f57e1f4..4d85b47 100644 --- a/docs/models/operations/policy-response.md +++ b/docs/models/operations/submit-content-policy-response.md @@ -1,4 +1,4 @@ -# PolicyResponse +# SubmitContentPolicyResponse Policy output schema. diff --git a/docs/models/operations/submit-content-request-body.md b/docs/models/operations/submit-content-request-body.md index 4ab6043..a2f52bf 100644 --- a/docs/models/operations/submit-content-request-body.md +++ b/docs/models/operations/submit-content-request-body.md @@ -14,16 +14,16 @@ let value: SubmitContentRequestBody = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *operations.ContentRequest* | :heavy_check_mark: | The content sent for moderation | -| `timestamp` | *number* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | -| `channel` | *string* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | -| `contentId` | *string* | :heavy_minus_sign: | The unique ID of the content in your database. | -| `metaType` | [operations.MetaType](../../models/operations/meta-type.md) | :heavy_minus_sign: | The meta type of content being moderated | -| `authorId` | *string* | :heavy_minus_sign: | The author of the content. | -| `conversationId` | *string* | :heavy_minus_sign: | For example the ID of a chat room or a post | -| `metadata` | Record | :heavy_minus_sign: | Any metadata you want to store with the content | -| `clientAction` | [operations.ClientAction](../../models/operations/client-action.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. | -| `doNotStore` | *boolean* | :heavy_minus_sign: | Do not store the content. The content won't enter the review queue | -| `policies` | *operations.PolicyRequest*[] | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content` | *operations.ContentRequest* | :heavy_check_mark: | The content sent for moderation | +| `timestamp` | *number* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | +| `channel` | *string* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | +| `contentId` | *string* | :heavy_minus_sign: | The unique ID of the content in your database. | +| `metaType` | [operations.MetaType](../../models/operations/meta-type.md) | :heavy_minus_sign: | The meta type of content being moderated | +| `authorId` | *string* | :heavy_minus_sign: | The author of the content. | +| `conversationId` | *string* | :heavy_minus_sign: | For example the ID of a chat room or a post | +| `metadata` | Record | :heavy_minus_sign: | Any metadata you want to store with the content | +| `clientAction` | [operations.ClientAction](../../models/operations/client-action.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. | +| `doNotStore` | *boolean* | :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` | *operations.PolicyRequest*[] | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | \ No newline at end of file diff --git a/docs/models/operations/submit-content-request.md b/docs/models/operations/submit-content-request.md index ed23c48..292c5eb 100644 --- a/docs/models/operations/submit-content-request.md +++ b/docs/models/operations/submit-content-request.md @@ -17,7 +17,7 @@ let value: SubmitContentRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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` | [operations.SubmitContentRequestBody](../../models/operations/submit-content-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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` | [operations.SubmitContentRequestBody](../../models/operations/submit-content-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/submit-content-response.md b/docs/models/operations/submit-content-response.md index 93705ba..a8e00a0 100644 --- a/docs/models/operations/submit-content-response.md +++ b/docs/models/operations/submit-content-response.md @@ -19,7 +19,7 @@ let value: SubmitContentResponse = { block: {}, status: "enabled", trustLevel: { - level: 6111.07, + level: 6025.09, manual: true, }, }, @@ -61,11 +61,11 @@ let value: SubmitContentResponse = { | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `content` | [operations.ContentResponse](../../models/operations/content-response.md) | :heavy_check_mark: | Potentially modified content. | -| `author` | [operations.Author](../../models/operations/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` | [operations.SubmitContentAuthor](../../models/operations/submit-content-author.md) | :heavy_check_mark: | The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. | | `evaluation` | [operations.Evaluation](../../models/operations/evaluation.md) | :heavy_check_mark: | The evaluation of the content after running the channel policies. | | `recommendation` | [operations.Recommendation](../../models/operations/recommendation.md) | :heavy_check_mark: | The recommendation for the content based on the evaluation. | | `casebook` | [operations.Casebook](../../models/operations/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` | *operations.PolicyResponse*[] | :heavy_check_mark: | Results of all policies in the channel. Sorted by highest probability. | +| `policies` | *operations.SubmitContentPolicyResponse*[] | :heavy_check_mark: | Results of all policies in the channel. Sorted by highest probability. | | `insights` | *operations.Insight*[] | :heavy_check_mark: | Results of all insights enabled in the channel. | | `meta` | [operations.Meta](../../models/operations/meta.md) | :heavy_check_mark: | Metadata about the moderation request | | `errors` | [operations.ErrorT](../../models/operations/error-t.md)[] | :heavy_minus_sign: | Policies that had errors | \ No newline at end of file diff --git a/docs/models/operations/top-action.md b/docs/models/operations/top-action.md deleted file mode 100644 index 4f37351..0000000 --- a/docs/models/operations/top-action.md +++ /dev/null @@ -1,21 +0,0 @@ -# TopAction - -## Example Usage - -```typescript -import { TopAction } from "@moderation-api/sdk/models/operations"; - -let value: TopAction = { - actionId: "", - actionName: "", - count: 605.8, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `actionId` | *string* | :heavy_check_mark: | Most used action by this reviewer | -| `actionName` | *string* | :heavy_check_mark: | Name of the most used action | -| `count` | *number* | :heavy_check_mark: | Number of times this action was used | \ No newline at end of file diff --git a/docs/models/operations/top-reviewer.md b/docs/models/operations/top-reviewer.md index 9b7811c..2b0fab4 100644 --- a/docs/models/operations/top-reviewer.md +++ b/docs/models/operations/top-reviewer.md @@ -8,19 +8,14 @@ import { TopReviewer } from "@moderation-api/sdk/models/operations"; let value: TopReviewer = { userId: "", name: "", - reviewCount: 3747.23, - averageTimePerReview: 3548.02, - topActions: [], + reviewCount: 318453, }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `userId` | *string* | :heavy_check_mark: | ID of the reviewer | -| `name` | *string* | :heavy_check_mark: | Name of the reviewer | -| `reviewCount` | *number* | :heavy_check_mark: | Number of items reviewed | -| `averageTimePerReview` | *number* | :heavy_check_mark: | Average review time in milliseconds | -| `accuracyScore` | *number* | :heavy_minus_sign: | Optional accuracy score based on review quality metrics | -| `topActions` | [operations.TopAction](../../models/operations/top-action.md)[] | :heavy_check_mark: | Most common actions taken by this reviewer | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `userId` | *string* | :heavy_check_mark: | The user ID of the reviewer. `null` for items resolved with an API key. | +| `name` | *string* | :heavy_check_mark: | The name of the reviewer. | +| `reviewCount` | *number* | :heavy_check_mark: | Number of items the reviewer resolved in the period. | \ No newline at end of file diff --git a/docs/models/operations/totals.md b/docs/models/operations/totals.md new file mode 100644 index 0000000..543755a --- /dev/null +++ b/docs/models/operations/totals.md @@ -0,0 +1,35 @@ +# Totals + +Request counts for the window. A flagged request has one recommendation: allow, reject or review. + +## Example Usage + +```typescript +import { Totals } from "@moderation-api/sdk/models/operations"; + +let value: Totals = { + requests: 299586, + flagged: 873533, + flagRate: 2329.4, + allowed: 90248, + rejected: 565808, + sentToReview: 553330, + handledAutomatically: 732255, + flaggedButAllowed: 818361, + distinctAuthors: 92764, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `requests` | *number* | :heavy_check_mark: | Requests received. Every request counts, also repeats and edits of the same content. | +| `flagged` | *number* | :heavy_check_mark: | Requests that were flagged. | +| `flagRate` | *number* | :heavy_check_mark: | The share of requests that were flagged: flagged / requests. 0 when there were no requests. | +| `allowed` | *number* | :heavy_check_mark: | Requests with the recommendation "allow". Includes content that was not flagged. | +| `rejected` | *number* | :heavy_check_mark: | Requests with the recommendation "reject". All of them were flagged. | +| `sentToReview` | *number* | :heavy_check_mark: | Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. | +| `handledAutomatically` | *number* | :heavy_check_mark: | Flagged requests that were settled without human review: rejected plus flaggedButAllowed. | +| `flaggedButAllowed` | *number* | :heavy_check_mark: | Flagged requests that were allowed without human review. | +| `distinctAuthors` | *number* | :heavy_check_mark: | Distinct authors that sent content in the window. Approximate. | \ No newline at end of file diff --git a/docs/models/operations/trends.md b/docs/models/operations/trends.md index cf3824e..1440660 100644 --- a/docs/models/operations/trends.md +++ b/docs/models/operations/trends.md @@ -7,13 +7,11 @@ import { Trends } from "@moderation-api/sdk/models/operations"; let value: Trends = { dailyReviewCounts: [], - flaggedContentTrends: [], }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `dailyReviewCounts` | [operations.DailyReviewCount](../../models/operations/daily-review-count.md)[] | :heavy_check_mark: | N/A | -| `flaggedContentTrends` | [operations.FlaggedContentTrend](../../models/operations/flagged-content-trend.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `dailyReviewCounts` | [operations.DailyReviewCount](../../models/operations/daily-review-count.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/operations/unresolve-queue-item-request-body.md b/docs/models/operations/unresolve-queue-item-request-body.md deleted file mode 100644 index 49c391a..0000000 --- a/docs/models/operations/unresolve-queue-item-request-body.md +++ /dev/null @@ -1,15 +0,0 @@ -# UnresolveQueueItemRequestBody - -## Example Usage - -```typescript -import { UnresolveQueueItemRequestBody } from "@moderation-api/sdk/models/operations"; - -let value: UnresolveQueueItemRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `comment` | *string* | :heavy_minus_sign: | Optional reason for unresolving the item | \ No newline at end of file diff --git a/docs/models/operations/unresolve-queue-item-request.md b/docs/models/operations/unresolve-queue-item-request.md index e149b83..6881b1c 100644 --- a/docs/models/operations/unresolve-queue-item-request.md +++ b/docs/models/operations/unresolve-queue-item-request.md @@ -8,15 +8,13 @@ import { UnresolveQueueItemRequest } from "@moderation-api/sdk/models/operations let value: UnresolveQueueItemRequest = { id: "", itemId: "", - body: {}, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve | -| `projectId` | *string* | :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` | [operations.UnresolveQueueItemRequestBody](../../models/operations/unresolve-queue-item-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve. | +| `projectId` | *string* | :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/operations/unresolve-queue-item-response.md b/docs/models/operations/unresolve-queue-item-response.md index 0a1034b..9d2473f 100644 --- a/docs/models/operations/unresolve-queue-item-response.md +++ b/docs/models/operations/unresolve-queue-item-response.md @@ -9,15 +9,15 @@ import { UnresolveQueueItemResponse } from "@moderation-api/sdk/models/operation let value: UnresolveQueueItemResponse = { success: true, - status: "", + status: "pending", unresolvedAt: "", }; ``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `success` | *boolean* | :heavy_check_mark: | N/A | -| `status` | *string* | :heavy_check_mark: | New status of the item | -| `unresolvedAt` | *string* | :heavy_check_mark: | Timestamp when the item was unresolved | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `success` | *boolean* | :heavy_check_mark: | N/A | +| `status` | [operations.UnresolveQueueItemStatus](../../models/operations/unresolve-queue-item-status.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | +| `unresolvedAt` | *string* | :heavy_check_mark: | When the item was unresolved (ISO 8601). | \ No newline at end of file diff --git a/docs/models/operations/unresolve-queue-item-status.md b/docs/models/operations/unresolve-queue-item-status.md new file mode 100644 index 0000000..2d572d4 --- /dev/null +++ b/docs/models/operations/unresolve-queue-item-status.md @@ -0,0 +1,19 @@ +# UnresolveQueueItemStatus + +`pending` waits for review. `resolved` is reviewed. + +## Example Usage + +```typescript +import { UnresolveQueueItemStatus } from "@moderation-api/sdk/models/operations"; + +let value: UnresolveQueueItemStatus = "pending"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"pending" | "resolved" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/update-action-request.md b/docs/models/operations/update-action-request.md index e1c8e8a..2191dd8 100644 --- a/docs/models/operations/update-action-request.md +++ b/docs/models/operations/update-action-request.md @@ -13,8 +13,8 @@ let value: UpdateActionRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to update. | -| `projectId` | *string* | :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` | [operations.UpdateActionRequestBody](../../models/operations/update-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the action to update. | +| `projectId` | *string* | :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` | [operations.UpdateActionRequestBody](../../models/operations/update-action-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/update-author-request.md b/docs/models/operations/update-author-request.md index f8d6d6d..95abb55 100644 --- a/docs/models/operations/update-author-request.md +++ b/docs/models/operations/update-author-request.md @@ -13,8 +13,8 @@ let value: UpdateAuthorRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `projectId` | *string* | :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` | [operations.UpdateAuthorRequestBody](../../models/operations/update-author-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *string* | :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` | [operations.UpdateAuthorRequestBody](../../models/operations/update-author-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/update-webhook-request.md b/docs/models/operations/update-webhook-request.md index 3a75aae..993733f 100644 --- a/docs/models/operations/update-webhook-request.md +++ b/docs/models/operations/update-webhook-request.md @@ -13,8 +13,8 @@ let value: UpdateWebhookRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to update. | -| `projectId` | *string* | :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` | [operations.UpdateWebhookRequestBody](../../models/operations/update-webhook-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the webhook to update. | +| `projectId` | *string* | :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` | [operations.UpdateWebhookRequestBody](../../models/operations/update-webhook-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/update-wordlist-request-body.md b/docs/models/operations/update-wordlist-request-body.md index 6ca5920..20cd45b 100644 --- a/docs/models/operations/update-wordlist-request-body.md +++ b/docs/models/operations/update-wordlist-request-body.md @@ -10,10 +10,10 @@ let value: UpdateWordlistRequestBody = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `name` | *string* | :heavy_minus_sign: | New name for the wordlist | -| `key` | *string* | :heavy_minus_sign: | New key for the wordlist | -| `description` | *string* | :heavy_minus_sign: | New description for the wordlist | -| `words` | *string*[] | :heavy_minus_sign: | New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. | -| `strict` | *boolean* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_minus_sign: | New name for the wordlist | +| `key` | *string* | :heavy_minus_sign: | New key for the wordlist | +| `description` | *string* | :heavy_minus_sign: | New description for the wordlist | +| `words` | *string*[] | :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` | *boolean* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | \ No newline at end of file diff --git a/docs/models/operations/update-wordlist-request.md b/docs/models/operations/update-wordlist-request.md index 43fe25c..0659196 100644 --- a/docs/models/operations/update-wordlist-request.md +++ b/docs/models/operations/update-wordlist-request.md @@ -13,8 +13,8 @@ let value: UpdateWordlistRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to update | -| `projectId` | *string* | :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` | [operations.UpdateWordlistRequestBody](../../models/operations/update-wordlist-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to update | +| `projectId` | *string* | :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` | [operations.UpdateWordlistRequestBody](../../models/operations/update-wordlist-request-body.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/volume.md b/docs/models/operations/volume.md new file mode 100644 index 0000000..4f53c25 --- /dev/null +++ b/docs/models/operations/volume.md @@ -0,0 +1,25 @@ +# Volume + +## Example Usage + +```typescript +import { Volume } from "@moderation-api/sdk/models/operations"; + +let value: Volume = { + start: "", + requests: 586833, + flagged: 580842, + rejected: 918786, + sentToReview: 978855, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `start` | *string* | :heavy_check_mark: | Start of the bucket, as an ISO 8601 timestamp in UTC. | +| `requests` | *number* | :heavy_check_mark: | Requests received in the bucket. | +| `flagged` | *number* | :heavy_check_mark: | Requests flagged in the bucket. | +| `rejected` | *number* | :heavy_check_mark: | Requests with the recommendation "reject" in the bucket. | +| `sentToReview` | *number* | :heavy_check_mark: | Requests with the recommendation "review" in the bucket. | \ No newline at end of file diff --git a/docs/models/operations/within-unit.md b/docs/models/operations/within-unit.md deleted file mode 100644 index c8ef302..0000000 --- a/docs/models/operations/within-unit.md +++ /dev/null @@ -1,17 +0,0 @@ -# WithinUnit - -## Example Usage - -```typescript -import { WithinUnit } from "@moderation-api/sdk/models/operations"; - -let value: WithinUnit = "HOURS"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"MINUTES" | "HOURS" | "DAYS" | "WEEKS" | "MONTHS" | "YEARS" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/project-api-key.md b/docs/models/project-api-key.md new file mode 100644 index 0000000..261336a --- /dev/null +++ b/docs/models/project-api-key.md @@ -0,0 +1,25 @@ +# ProjectApiKey + +## Example Usage + +```typescript +import { ProjectApiKey } from "@moderation-api/sdk/models"; + +let value: ProjectApiKey = { + id: "", + name: "", + projectId: "", + createdAt: "1719832482347", + secretKey: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the API key. | +| `name` | *string* | :heavy_check_mark: | The key's name. | +| `projectId` | *string* | :heavy_check_mark: | The ID of the project the key belongs to. | +| `createdAt` | *string* | :heavy_check_mark: | When the key was created. | +| `secretKey` | *string* | :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/status.md b/docs/models/public-author-status.md similarity index 63% rename from docs/models/status.md rename to docs/models/public-author-status.md index a7b96ad..d7bb9af 100644 --- a/docs/models/status.md +++ b/docs/models/public-author-status.md @@ -1,13 +1,13 @@ -# Status +# PublicAuthorStatus Current author status ## Example Usage ```typescript -import { Status } from "@moderation-api/sdk/models"; +import { PublicAuthorStatus } from "@moderation-api/sdk/models"; -let value: Status = "suspended"; +let value: PublicAuthorStatus = "enabled"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/public-author.md b/docs/models/public-author.md index b08f436..f2b06bd 100644 --- a/docs/models/public-author.md +++ b/docs/models/public-author.md @@ -38,7 +38,7 @@ let value: PublicAuthor = { | `firstSeen` | *number* | :heavy_check_mark: | Timestamp when author first appeared | | `lastSeen` | *number* | :heavy_check_mark: | Timestamp of last activity | | `lastIncident` | *number* | :heavy_minus_sign: | Timestamp of last incident | -| `status` | [models.Status](../models/status.md) | :heavy_check_mark: | Current author status | +| `status` | [models.PublicAuthorStatus](../models/public-author-status.md) | :heavy_check_mark: | Current author status | | `trustLevel` | [models.TrustLevel](../models/trust-level.md) | :heavy_check_mark: | N/A | | `block` | [models.Block](../models/block.md) | :heavy_check_mark: | Block or suspension details, if applicable. Null if the author is enabled. | | `riskEvaluation` | [models.RiskEvaluation](../models/risk-evaluation.md) | :heavy_check_mark: | Risk assessment details, if available. | diff --git a/docs/models/queue-item-audio.md b/docs/models/queue-item-audio.md new file mode 100644 index 0000000..6553479 --- /dev/null +++ b/docs/models/queue-item-audio.md @@ -0,0 +1,21 @@ +# QueueItemAudio + +Audio + +## Example Usage + +```typescript +import { QueueItemAudio } from "@moderation-api/sdk/models"; + +let value: QueueItemAudio = { + type: "audio", + url: "https://close-alliance.info", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *"audio"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/queue-item-brand-impersonation.md b/docs/models/queue-item-brand-impersonation.md new file mode 100644 index 0000000..0586bf2 --- /dev/null +++ b/docs/models/queue-item-brand-impersonation.md @@ -0,0 +1,19 @@ +# QueueItemBrandImpersonation + +## Example Usage + +```typescript +import { QueueItemBrandImpersonation } from "@moderation-api/sdk/models"; + +let value: QueueItemBrandImpersonation = { + brand: "", + method: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `brand` | *string* | :heavy_check_mark: | N/A | +| `method` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/queue-item-content-leaf-audio.md b/docs/models/queue-item-content-leaf-audio.md new file mode 100644 index 0000000..bb73bf9 --- /dev/null +++ b/docs/models/queue-item-content-leaf-audio.md @@ -0,0 +1,21 @@ +# QueueItemContentLeafAudio + +Audio + +## Example Usage + +```typescript +import { QueueItemContentLeafAudio } from "@moderation-api/sdk/models"; + +let value: QueueItemContentLeafAudio = { + type: "audio", + url: "https://steel-provision.org", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *"audio"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/queue-item-content-leaf-image.md b/docs/models/queue-item-content-leaf-image.md new file mode 100644 index 0000000..4e32526 --- /dev/null +++ b/docs/models/queue-item-content-leaf-image.md @@ -0,0 +1,21 @@ +# QueueItemContentLeafImage + +Image + +## Example Usage + +```typescript +import { QueueItemContentLeafImage } from "@moderation-api/sdk/models"; + +let value: QueueItemContentLeafImage = { + type: "image", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *"image"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *string* | :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/queue-item-content-leaf-text.md b/docs/models/queue-item-content-leaf-text.md new file mode 100644 index 0000000..0f7ad92 --- /dev/null +++ b/docs/models/queue-item-content-leaf-text.md @@ -0,0 +1,21 @@ +# QueueItemContentLeafText + +Text + +## Example Usage + +```typescript +import { QueueItemContentLeafText } from "@moderation-api/sdk/models"; + +let value: QueueItemContentLeafText = { + type: "text", + text: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *"text"* | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/queue-item-content-leaf-video.md b/docs/models/queue-item-content-leaf-video.md new file mode 100644 index 0000000..1f3db44 --- /dev/null +++ b/docs/models/queue-item-content-leaf-video.md @@ -0,0 +1,21 @@ +# QueueItemContentLeafVideo + +Video + +## Example Usage + +```typescript +import { QueueItemContentLeafVideo } from "@moderation-api/sdk/models"; + +let value: QueueItemContentLeafVideo = { + type: "video", + url: "https://any-grandson.net", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *"video"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/queue-item-content-leaf.md b/docs/models/queue-item-content-leaf.md new file mode 100644 index 0000000..61aca1f --- /dev/null +++ b/docs/models/queue-item-content-leaf.md @@ -0,0 +1,40 @@ +# QueueItemContentLeaf + + +## Supported Types + +### `models.QueueItemContentLeafText` + +```typescript +const value: models.QueueItemContentLeafText = { + type: "text", + text: "", +}; +``` + +### `models.QueueItemContentLeafImage` + +```typescript +const value: models.QueueItemContentLeafImage = { + type: "image", +}; +``` + +### `models.QueueItemContentLeafVideo` + +```typescript +const value: models.QueueItemContentLeafVideo = { + type: "video", + url: "https://any-grandson.net", +}; +``` + +### `models.QueueItemContentLeafAudio` + +```typescript +const value: models.QueueItemContentLeafAudio = { + type: "audio", + url: "https://steel-provision.org", +}; +``` + diff --git a/docs/models/queue-item-content.md b/docs/models/queue-item-content.md new file mode 100644 index 0000000..5327744 --- /dev/null +++ b/docs/models/queue-item-content.md @@ -0,0 +1,54 @@ +# QueueItemContent + + +## Supported Types + +### `models.QueueItemText` + +```typescript +const value: models.QueueItemText = { + type: "text", + text: "", +}; +``` + +### `models.QueueItemImage` + +```typescript +const value: models.QueueItemImage = { + type: "image", +}; +``` + +### `models.QueueItemVideo` + +```typescript +const value: models.QueueItemVideo = { + type: "video", + url: "https://grumpy-morning.com", +}; +``` + +### `models.QueueItemAudio` + +```typescript +const value: models.QueueItemAudio = { + type: "audio", + url: "https://close-alliance.info", +}; +``` + +### `models.QueueItemObject` + +```typescript +const value: models.QueueItemObject = { + type: "object", + data: { + "key": { + type: "video", + url: "https://oily-marathon.biz", + }, + }, +}; +``` + diff --git a/docs/models/queue-item-image.md b/docs/models/queue-item-image.md new file mode 100644 index 0000000..9bd2669 --- /dev/null +++ b/docs/models/queue-item-image.md @@ -0,0 +1,21 @@ +# QueueItemImage + +Image + +## Example Usage + +```typescript +import { QueueItemImage } from "@moderation-api/sdk/models"; + +let value: QueueItemImage = { + type: "image", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *"image"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *string* | :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/queue-item-match.md b/docs/models/queue-item-match.md new file mode 100644 index 0000000..8eefad7 --- /dev/null +++ b/docs/models/queue-item-match.md @@ -0,0 +1,30 @@ +# QueueItemMatch + +## Example Usage + +```typescript +import { QueueItemMatch } from "@moderation-api/sdk/models"; + +let value: QueueItemMatch = { + match: "", + probability: 5602.27, + span: [ + 9147.06, + 2646.74, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `match` | *string* | :heavy_check_mark: | The matched substring | +| `probability` | *number* | :heavy_check_mark: | Match confidence between 0 and 1 | +| `span` | *number*[] | :heavy_check_mark: | [start, end] character offsets in the source text | +| `mask` | *string* | :heavy_minus_sign: | N/A | +| `reasons` | *string*[] | :heavy_minus_sign: | N/A | +| `signals` | [models.QueueItemSignals](../models/queue-item-signals.md) | :heavy_minus_sign: | N/A | +| `entityType` | *string* | :heavy_minus_sign: | N/A | +| `scripts` | *string*[] | :heavy_minus_sign: | N/A | +| `skeleton` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/queue-item-object.md b/docs/models/queue-item-object.md new file mode 100644 index 0000000..aa2c015 --- /dev/null +++ b/docs/models/queue-item-object.md @@ -0,0 +1,26 @@ +# QueueItemObject + +Object + +## Example Usage + +```typescript +import { QueueItemObject } from "@moderation-api/sdk/models"; + +let value: QueueItemObject = { + type: "object", + data: { + "key": { + type: "video", + url: "https://oily-marathon.biz", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `type` | *"object"* | :heavy_check_mark: | N/A | +| `data` | Record | :heavy_check_mark: | Values in the object. Can be mixed content types. | \ No newline at end of file diff --git a/docs/models/queue-item-signals.md b/docs/models/queue-item-signals.md new file mode 100644 index 0000000..84cae48 --- /dev/null +++ b/docs/models/queue-item-signals.md @@ -0,0 +1,36 @@ +# QueueItemSignals + +## Example Usage + +```typescript +import { QueueItemSignals } from "@moderation-api/sdk/models"; + +let value: QueueItemSignals = { + brandImpersonation: { + brand: "", + method: "", + }, + hasSuspiciousCharacters: true, + isLinkShortener: true, + domainAgeDays: 7954.89, + hasEmailSetup: false, + redirectCount: 6044.44, + finalUrl: "https://infatuated-mobility.com/", + botProtection: true, + isReported: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `brandImpersonation` | [models.QueueItemBrandImpersonation](../models/queue-item-brand-impersonation.md) | :heavy_check_mark: | N/A | +| `hasSuspiciousCharacters` | *boolean* | :heavy_check_mark: | N/A | +| `isLinkShortener` | *boolean* | :heavy_check_mark: | N/A | +| `domainAgeDays` | *number* | :heavy_check_mark: | N/A | +| `hasEmailSetup` | *boolean* | :heavy_check_mark: | N/A | +| `redirectCount` | *number* | :heavy_check_mark: | N/A | +| `finalUrl` | *string* | :heavy_check_mark: | N/A | +| `botProtection` | *boolean* | :heavy_check_mark: | N/A | +| `isReported` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/list-queue-items-status.md b/docs/models/queue-item-status.md similarity index 51% rename from docs/models/operations/list-queue-items-status.md rename to docs/models/queue-item-status.md index ea78ceb..4c39676 100644 --- a/docs/models/operations/list-queue-items-status.md +++ b/docs/models/queue-item-status.md @@ -1,13 +1,13 @@ -# ListQueueItemsStatus +# QueueItemStatus -Status of the item +`pending` waits for review. `resolved` is reviewed. ## Example Usage ```typescript -import { ListQueueItemsStatus } from "@moderation-api/sdk/models/operations"; +import { QueueItemStatus } from "@moderation-api/sdk/models"; -let value: ListQueueItemsStatus = "pending"; +let value: QueueItemStatus = "resolved"; // Open enum: unrecognized values are captured as Unrecognized ``` diff --git a/docs/models/queue-item-text.md b/docs/models/queue-item-text.md new file mode 100644 index 0000000..7759a97 --- /dev/null +++ b/docs/models/queue-item-text.md @@ -0,0 +1,21 @@ +# QueueItemText + +Text + +## Example Usage + +```typescript +import { QueueItemText } from "@moderation-api/sdk/models"; + +let value: QueueItemText = { + type: "text", + text: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *"text"* | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/queue-item-video.md b/docs/models/queue-item-video.md new file mode 100644 index 0000000..af10cc5 --- /dev/null +++ b/docs/models/queue-item-video.md @@ -0,0 +1,21 @@ +# QueueItemVideo + +Video + +## Example Usage + +```typescript +import { QueueItemVideo } from "@moderation-api/sdk/models"; + +let value: QueueItemVideo = { + type: "video", + url: "https://grumpy-morning.com", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *"video"* | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/queue-item.md b/docs/models/queue-item.md new file mode 100644 index 0000000..762613d --- /dev/null +++ b/docs/models/queue-item.md @@ -0,0 +1,47 @@ +# QueueItem + +## Example Usage + +```typescript +import { QueueItem } from "@moderation-api/sdk/models"; + +let value: QueueItem = { + id: "", + contentId: "", + content: { + type: "video", + url: "https://sinful-scorn.org", + }, + labels: [ + { + label: "", + score: 9550.55, + }, + ], + flagged: false, + severity: 716.36, + status: "pending", + timestamp: 8468.02, + language: "", + conversationId: "", + authorId: "", + contentType: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The item ID. Use it to resolve or unresolve the item in this queue. | +| `contentId` | *string* | :heavy_check_mark: | Your content ID, as you sent it to `POST /moderate`. | +| `content` | *models.QueueItemContent* | :heavy_check_mark: | The submitted content. | +| `labels` | [models.Label](../models/label.md)[] | :heavy_check_mark: | The moderation labels of the content. | +| `flagged` | *boolean* | :heavy_check_mark: | Whether moderation flagged the content. | +| `severity` | *number* | :heavy_check_mark: | Severity score from 0 to 1, if available. | +| `status` | [models.QueueItemStatus](../models/queue-item-status.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | +| `timestamp` | *number* | :heavy_check_mark: | When the content was submitted, as Unix time in milliseconds. | +| `language` | *string* | :heavy_check_mark: | Detected ISO language code. | +| `conversationId` | *string* | :heavy_check_mark: | Conversation ID, if any. | +| `authorId` | *string* | :heavy_check_mark: | Your author ID, if any. | +| `contentType` | *string* | :heavy_check_mark: | Content type, for example `message` or `profile`. | \ No newline at end of file diff --git a/docs/models/operations/queue.md b/docs/models/queue-with-counts.md similarity index 57% rename from docs/models/operations/queue.md rename to docs/models/queue-with-counts.md index 6ec9c28..e652208 100644 --- a/docs/models/operations/queue.md +++ b/docs/models/queue-with-counts.md @@ -1,18 +1,18 @@ -# Queue +# QueueWithCounts ## Example Usage ```typescript -import { Queue } from "@moderation-api/sdk/models/operations"; +import { QueueWithCounts } from "@moderation-api/sdk/models"; -let value: Queue = { +let value: QueueWithCounts = { id: "", name: "", - description: "except boohoo draft", - filter: {}, - unresolvedItemsCount: 6843.26, - resolvedItemsCount: 2678.59, - totalItemsCount: 3719.24, + description: "kick hm freely", + isDefault: false, + unresolvedItemsCount: 413400, + resolvedItemsCount: 766647, + totalItemsCount: 525372, }; ``` @@ -20,10 +20,10 @@ let value: Queue = { | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_check_mark: | N/A | -| `filter` | [operations.Filter](../../models/operations/filter.md) | :heavy_check_mark: | N/A | -| `unresolvedItemsCount` | *number* | :heavy_check_mark: | N/A | -| `resolvedItemsCount` | *number* | :heavy_check_mark: | N/A | -| `totalItemsCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `name` | *string* | :heavy_check_mark: | The queue name. | +| `description` | *string* | :heavy_check_mark: | The queue description. | +| `isDefault` | *boolean* | :heavy_check_mark: | Whether this is the default queue of the project. | +| `unresolvedItemsCount` | *number* | :heavy_check_mark: | Number of items that wait for review. | +| `resolvedItemsCount` | *number* | :heavy_check_mark: | Number of items that are resolved. | +| `totalItemsCount` | *number* | :heavy_check_mark: | Number of items in the queue, resolved and unresolved. | \ No newline at end of file diff --git a/docs/models/queue.md b/docs/models/queue.md new file mode 100644 index 0000000..e359ad8 --- /dev/null +++ b/docs/models/queue.md @@ -0,0 +1,23 @@ +# Queue + +## Example Usage + +```typescript +import { Queue } from "@moderation-api/sdk/models"; + +let value: Queue = { + id: "", + name: "", + description: "gracefully trench plumber canter", + isDefault: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `name` | *string* | :heavy_check_mark: | The queue name. | +| `description` | *string* | :heavy_check_mark: | The queue description. | +| `isDefault` | *boolean* | :heavy_check_mark: | Whether this is the default queue of the project. | \ No newline at end of file diff --git a/docs/sdks/account/README.md b/docs/sdks/account/README.md index 005fb11..f73d8cb 100644 --- a/docs/sdks/account/README.md +++ b/docs/sdks/account/README.md @@ -58,12 +58,12 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/actions/README.md b/docs/sdks/actions/README.md index a00da79..4abff2c 100644 --- a/docs/sdks/actions/README.md +++ b/docs/sdks/actions/README.md @@ -67,15 +67,15 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `queueId` | *string* | :heavy_minus_sign: | N/A | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `queueId` | *string* | :heavy_minus_sign: | N/A | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -155,13 +155,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `body` | [operations.CreateActionRequestBody](../../models/operations/create-action-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.CreateActionRequestBody](../../models/operations/create-action-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -229,13 +229,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to get. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the action to get. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -303,14 +303,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to update. | -| `body` | [operations.UpdateActionRequestBody](../../models/operations/update-action-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the action to update. | +| `body` | [operations.UpdateActionRequestBody](../../models/operations/update-action-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -379,13 +379,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the action to delete. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the action to delete. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -463,13 +463,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `body` | [operations.ExecuteActionRequestBody](../../models/operations/execute-action-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.ExecuteActionRequestBody](../../models/operations/execute-action-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/analytics/README.md b/docs/sdks/analytics/README.md new file mode 100644 index 0000000..e6d0c73 --- /dev/null +++ b/docs/sdks/analytics/README.md @@ -0,0 +1,475 @@ +# 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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.summary(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsSummary } from "@moderation-api/sdk/funcs/analytics-summary.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsSummary(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsSummary failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsSummaryQueryParamRange](../../models/operations/get-analytics-summary-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsSummaryResponse](../../models/operations/get-analytics-summary-response.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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.policies(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsPolicies } from "@moderation-api/sdk/funcs/analytics-policies.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsPolicies(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsPolicies failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsPoliciesQueryParamRange](../../models/operations/get-analytics-policies-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `limit` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsPoliciesResponse](../../models/operations/get-analytics-policies-response.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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.authors(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsAuthors } from "@moderation-api/sdk/funcs/analytics-authors.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsAuthors(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsAuthors failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAuthorsQueryParamRange](../../models/operations/get-analytics-authors-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `limit` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsAuthorsResponse](../../models/operations/get-analytics-authors-response.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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.channels(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsChannels } from "@moderation-api/sdk/funcs/analytics-channels.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsChannels(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsChannels failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsChannelsQueryParamRange](../../models/operations/get-analytics-channels-query-param-range.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. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsChannelsResponse](../../models/operations/get-analytics-channels-response.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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.volumes(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsVolumes } from "@moderation-api/sdk/funcs/analytics-volumes.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsVolumes(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsVolumes failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsVolumesQueryParamRange](../../models/operations/get-analytics-volumes-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsVolumesResponse](../../models/operations/get-analytics-volumes-response.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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.analytics.automation(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { analyticsAutomation } from "@moderation-api/sdk/funcs/analytics-automation.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await analyticsAutomation(moderationApi); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("analyticsAutomation failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `range` | [operations.GetAnalyticsAutomationQueryParamRange](../../models/operations/get-analytics-automation-query-param-range.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` | *string* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAnalyticsAutomationResponse](../../models/operations/get-analytics-automation-response.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..f0e4008 --- /dev/null +++ b/docs/sdks/apikeys/README.md @@ -0,0 +1,82 @@ +# 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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.projects.apiKeys.create("", {}); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { projectsApiKeysCreate } from "@moderation-api/sdk/funcs/projects-api-keys-create.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await projectsApiKeysCreate(moderationApi, "", {}); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("projectsApiKeysCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The ID of the project. | +| `body` | [operations.CreateProjectApiKeyRequestBody](../../models/operations/create-project-api-key-request-body.md) | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[models.ProjectApiKey](../../models/project-api-key.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 fc89162..bd2a7f1 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 @@ -157,13 +157,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `body` | [operations.CreateAuthorRequestBody](../../models/operations/create-author-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.CreateAuthorRequestBody](../../models/operations/create-author-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -232,13 +232,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -318,14 +318,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `body` | [operations.UpdateAuthorRequestBody](../../models/operations/update-author-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [operations.UpdateAuthorRequestBody](../../models/operations/update-author-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -395,13 +395,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md index 61d71f9..ea43e19 100644 --- a/docs/sdks/content/README.md +++ b/docs/sdks/content/README.md @@ -80,13 +80,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `body` | [operations.SubmitContentRequestBody](../../models/operations/submit-content-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.SubmitContentRequestBody](../../models/operations/submit-content-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/feedback/README.md b/docs/sdks/feedback/README.md new file mode 100644 index 0000000..fe58383 --- /dev/null +++ b/docs/sdks/feedback/README.md @@ -0,0 +1,88 @@ +# 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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.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.", + source: "mcp", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { feedbackCreate } from "@moderation-api/sdk/funcs/feedback-create.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await feedbackCreate(moderationApi, { + 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.", + source: "mcp", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("feedbackCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.CreateFeedbackRequestBody](../../models/operations/create-feedback-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.CreateFeedbackResponse](../../models/operations/create-feedback-response.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 8b11f6e..89ece4e 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 +* [resolveMany](#resolvemany) - 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 @@ -93,7 +94,7 @@ run(); ## 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 @@ -106,9 +107,7 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.queue.items.resolve("", "", { - comment: "Reviewed: no violation.", - }); + const result = await moderationApi.queue.items.resolve("", ""); console.log(result); } @@ -131,9 +130,7 @@ const moderationApi = new ModerationApiCore({ }); async function run() { - const res = await queueItemsResolve(moderationApi, "", "", { - comment: "Reviewed: no violation.", - }); + const res = await queueItemsResolve(moderationApi, "", ""); if (res.ok) { const { value: result } = res; console.log(result); @@ -147,15 +144,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve | -| `body` | [operations.ResolveQueueItemRequestBody](../../models/operations/resolve-queue-item-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -172,9 +168,95 @@ run(); | errors.InternalServerError | 500 | application/json | | errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | +## resolveMany + +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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.queue.items.resolveMany("", { + itemIds: [ + "clx8k2v0e000108l4a9bz3f7q", + "clx8k2v0e000208l4h2mc6d1r", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { queueItemsResolveMany } from "@moderation-api/sdk/funcs/queue-items-resolve-many.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await queueItemsResolveMany(moderationApi, "", { + itemIds: [ + "clx8k2v0e000108l4a9bz3f7q", + "clx8k2v0e000208l4h2mc6d1r", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("queueItemsResolveMany failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `body` | [operations.ResolveQueueItemsRequestBody](../../models/operations/resolve-queue-items-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ResolveQueueItemsResponse](../../models/operations/resolve-queue-items-response.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 @@ -187,9 +269,7 @@ const moderationApi = new ModerationApi({ }); async function run() { - const result = await moderationApi.queue.items.unresolve("", "", { - comment: "Reopened after an appeal.", - }); + const result = await moderationApi.queue.items.unresolve("", ""); console.log(result); } @@ -212,9 +292,7 @@ const moderationApi = new ModerationApiCore({ }); async function run() { - const res = await queueItemsUnresolve(moderationApi, "", "", { - comment: "Reopened after an appeal.", - }); + const res = await queueItemsUnresolve(moderationApi, "", ""); if (res.ok) { const { value: result } = res; console.log(result); @@ -228,15 +306,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve | -| `body` | [operations.UnresolveQueueItemRequestBody](../../models/operations/unresolve-queue-item-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/queue/README.md b/docs/sdks/queue/README.md index a164a0b..313a4a9 100644 --- a/docs/sdks/queue/README.md +++ b/docs/sdks/queue/README.md @@ -4,12 +4,94 @@ ### Available Operations +* [list](#list) - List queues * [retrieve](#retrieve) - Get a queue * [getStats](#getstats) - 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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.queue.list(); + + for await (const page of result) { + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { queueList } from "@moderation-api/sdk/funcs/queue-list.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await queueList(moderationApi); + if (res.ok) { + const { value: result } = res; + for await (const page of result) { + console.log(page); + } + } else { + console.log("queueList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListQueuesResponse](../../models/operations/list-queues-response.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 @@ -59,13 +141,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -85,7 +167,7 @@ run(); ## getStats -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 @@ -135,14 +217,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID | -| `withinDays` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `withinDays` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index caa1605..57c047e 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -66,14 +66,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -153,13 +153,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `body` | [operations.CreateWebhookRequestBody](../../models/operations/create-webhook-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.CreateWebhookRequestBody](../../models/operations/create-webhook-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -226,13 +226,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to get. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the webhook to get. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -299,14 +299,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to update. | -| `body` | [operations.UpdateWebhookRequestBody](../../models/operations/update-webhook-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the webhook to update. | +| `body` | [operations.UpdateWebhookRequestBody](../../models/operations/update-webhook-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -374,13 +374,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the webhook to delete. | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the webhook to delete. | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/webhooksecret/README.md b/docs/sdks/webhooksecret/README.md index b301b53..789a1ea 100644 --- a/docs/sdks/webhooksecret/README.md +++ b/docs/sdks/webhooksecret/README.md @@ -58,12 +58,12 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/wordlist/README.md b/docs/sdks/wordlist/README.md index ff72465..64ca4b9 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 * [getEmbeddingStatus](#getembeddingstatus) - Get embedding status @@ -65,14 +66,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `pageSize` | *number* | :heavy_minus_sign: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -90,6 +91,83 @@ run(); | 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 + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.wordlist.create({ + name: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { wordlistCreate } from "@moderation-api/sdk/funcs/wordlist-create.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await wordlistCreate(moderationApi, { + name: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("wordlistCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `body` | [operations.CreateWordlistRequestBody](../../models/operations/create-wordlist-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.CreateWordlistResponse](../../models/operations/create-wordlist-response.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 @@ -142,13 +220,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to get | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to get | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -168,7 +246,7 @@ run(); ## 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 @@ -218,14 +296,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to update | -| `body` | [operations.UpdateWordlistRequestBody](../../models/operations/update-wordlist-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to update | +| `body` | [operations.UpdateWordlistRequestBody](../../models/operations/update-wordlist-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -293,13 +371,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to check embedding status for | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to check embedding status for | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/words/README.md b/docs/sdks/words/README.md index cd9f648..dca31f8 100644 --- a/docs/sdks/words/README.md +++ b/docs/sdks/words/README.md @@ -69,14 +69,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to add words to | -| `body` | [operations.AddWordlistWordsRequestBody](../../models/operations/add-wordlist-words-request-body.md) | :heavy_check_mark: | N/A | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to add words to | +| `body` | [operations.AddWordlistWordsRequestBody](../../models/operations/add-wordlist-words-request-body.md) | :heavy_check_mark: | N/A | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -152,14 +152,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | ID of the wordlist to remove words from | -| `words` | *string*[] | :heavy_check_mark: | Array of words to remove from the wordlist | -| `projectId` | *string* | :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. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | *string*[] | :heavy_check_mark: | Array of words to remove from the wordlist | +| `projectId` | *string* | :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. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/jsr.json b/jsr.json index 55c5209..8d7a9ee 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@moderation-api/sdk", - "version": "5.1.1", + "version": "5.2.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index ba0c22f..6f678f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moderation-api/sdk", - "version": "5.1.1", + "version": "5.2.0", "author": "Moderation API", "license": "Apache-2.0", "type": "module", diff --git a/src/funcs/analytics-authors.ts b/src/funcs/analytics-authors.ts new file mode 100644 index 0000000..abc85ae --- /dev/null +++ b/src/funcs/analytics-authors.ts @@ -0,0 +1,222 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the most flagged authors + * + * @remarks + * Get the authors with the most flagged content in a time window, largest first. + */ +export function analyticsAuthors( + client: ModerationApiCore, + range?: operations.GetAnalyticsAuthorsQueryParamRange | undefined, + channel?: string | undefined, + limit?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsAuthorsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + channel, + limit, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsAuthorsQueryParamRange | undefined, + channel?: string | undefined, + limit?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsAuthorsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsAuthorsRequest | undefined = { + range: range, + channel: channel, + limit: limit, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsAuthorsRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/authors")(); + + const query = encodeFormQuery({ + "channel": payload?.channel, + "limit": payload?.limit, + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsAuthors", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsAuthorsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsAuthorsResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/analytics-automation.ts b/src/funcs/analytics-automation.ts new file mode 100644 index 0000000..abf3b54 --- /dev/null +++ b/src/funcs/analytics-automation.ts @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the automation breakdown + * + * @remarks + * 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. + */ +export function analyticsAutomation( + client: ModerationApiCore, + range?: operations.GetAnalyticsAutomationQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsAutomationResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + channel, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsAutomationQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsAutomationResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsAutomationRequest | undefined = { + range: range, + channel: channel, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsAutomationRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/automation")(); + + const query = encodeFormQuery({ + "channel": payload?.channel, + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsAutomation", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsAutomationResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsAutomationResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/analytics-channels.ts b/src/funcs/analytics-channels.ts new file mode 100644 index 0000000..4d1b33b --- /dev/null +++ b/src/funcs/analytics-channels.ts @@ -0,0 +1,212 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get analytics per channel + * + * @remarks + * Get requests, flags and flag rate for each channel of the project in a time window. + */ +export function analyticsChannels( + client: ModerationApiCore, + range?: operations.GetAnalyticsChannelsQueryParamRange | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsChannelsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsChannelsQueryParamRange | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsChannelsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsChannelsRequest | undefined = { + range: range, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsChannelsRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/channels")(); + + const query = encodeFormQuery({ + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsChannels", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsChannelsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsChannelsResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/analytics-policies.ts b/src/funcs/analytics-policies.ts new file mode 100644 index 0000000..4599d27 --- /dev/null +++ b/src/funcs/analytics-policies.ts @@ -0,0 +1,222 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the most flagged policies + * + * @remarks + * Get the policy labels that flagged the most content in a time window, largest first, with the count in the window before. + */ +export function analyticsPolicies( + client: ModerationApiCore, + range?: operations.GetAnalyticsPoliciesQueryParamRange | undefined, + channel?: string | undefined, + limit?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsPoliciesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + channel, + limit, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsPoliciesQueryParamRange | undefined, + channel?: string | undefined, + limit?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsPoliciesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsPoliciesRequest | undefined = { + range: range, + channel: channel, + limit: limit, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsPoliciesRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/policies")(); + + const query = encodeFormQuery({ + "channel": payload?.channel, + "limit": payload?.limit, + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsPolicies", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsPoliciesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsPoliciesResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/analytics-summary.ts b/src/funcs/analytics-summary.ts new file mode 100644 index 0000000..f7e7aa2 --- /dev/null +++ b/src/funcs/analytics-summary.ts @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the analytics summary + * + * @remarks + * 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. + */ +export function analyticsSummary( + client: ModerationApiCore, + range?: operations.GetAnalyticsSummaryQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsSummaryResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + channel, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsSummaryQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsSummaryResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsSummaryRequest | undefined = { + range: range, + channel: channel, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsSummaryRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/summary")(); + + const query = encodeFormQuery({ + "channel": payload?.channel, + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsSummary", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsSummaryResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsSummaryResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/analytics-volumes.ts b/src/funcs/analytics-volumes.ts new file mode 100644 index 0000000..d9f8901 --- /dev/null +++ b/src/funcs/analytics-volumes.ts @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get volumes over time + * + * @remarks + * Get requests, flags, rejections and reviews per hour (24h) or per day (7d, 30d, 90d), oldest first. + */ +export function analyticsVolumes( + client: ModerationApiCore, + range?: operations.GetAnalyticsVolumesQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetAnalyticsVolumesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + range, + channel, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + range?: operations.GetAnalyticsVolumesQueryParamRange | undefined, + channel?: string | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAnalyticsVolumesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetAnalyticsVolumesRequest | undefined = { + range: range, + channel: channel, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse( + z.optional(operations.GetAnalyticsVolumesRequest$outboundSchema), + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/analytics/volumes")(); + + const query = encodeFormQuery({ + "channel": payload?.channel, + "range": payload?.range, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getAnalyticsVolumes", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetAnalyticsVolumesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetAnalyticsVolumesResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/authors-list.ts b/src/funcs/authors-list.ts index a6ecac4..5bb7619 100644 --- a/src/funcs/authors-list.ts +++ b/src/funcs/authors-list.ts @@ -37,7 +37,7 @@ import { * List authors * * @remarks - * 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. */ export function authorsList( client: ModerationApiCore, @@ -116,7 +116,6 @@ async function $do( const path = pathToFunc("/authors")(); const query = encodeFormQuery({ - "contentTypes": payload?.contentTypes, "lastActiveDate": payload?.lastActiveDate, "memberSinceDate": payload?.memberSinceDate, "page": payload?.page, diff --git a/src/funcs/feedback-create.ts b/src/funcs/feedback-create.ts new file mode 100644 index 0000000..a7c886a --- /dev/null +++ b/src/funcs/feedback-create.ts @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Send feedback + * + * @remarks + * 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. + */ +export function feedbackCreate( + client: ModerationApiCore, + body: operations.CreateFeedbackRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.CreateFeedbackResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + body, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + body: operations.CreateFeedbackRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateFeedbackResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.CreateFeedbackRequest = { + body: body, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => z.parse(operations.CreateFeedbackRequest$outboundSchema, value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body$ = encodeJSON("body", payload.body, { explode: true }); + + const path = pathToFunc("/feedback")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createFeedback", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body$, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.CreateFeedbackResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.CreateFeedbackResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/projects-api-keys-create.ts b/src/funcs/projects-api-keys-create.ts new file mode 100644 index 0000000..ab0e065 --- /dev/null +++ b/src/funcs/projects-api-keys-create.ts @@ -0,0 +1,204 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as models from "../models/index.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a project API key + * + * @remarks + * 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. + */ +export function projectsApiKeysCreate( + client: ModerationApiCore, + id: string, + body: operations.CreateProjectApiKeyRequestBody, + options?: RequestOptions, +): APIPromise< + Result< + models.ProjectApiKey, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + id, + body, + options, + )); +} + +async function $do( + client: ModerationApiCore, + id: string, + body: operations.CreateProjectApiKeyRequestBody, + options?: RequestOptions, +): Promise< + [ + Result< + models.ProjectApiKey, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.CreateProjectApiKeyRequest = { + id: id, + body: body, + }; + + const parsed = safeParse( + input, + (value) => + z.parse(operations.CreateProjectApiKeyRequest$outboundSchema, value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body$ = encodeJSON("body", payload.body, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/projects/{id}/api-keys")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createProjectApiKey", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body$, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + models.ProjectApiKey, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, models.ProjectApiKey$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/queue-get-stats.ts b/src/funcs/queue-get-stats.ts index a266809..9920db4 100644 --- a/src/funcs/queue-get-stats.ts +++ b/src/funcs/queue-get-stats.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Get queue statistics * * @remarks - * 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. */ export function queueGetStats( client: ModerationApiCore, diff --git a/src/funcs/queue-items-list.ts b/src/funcs/queue-items-list.ts index 70ae588..8f10da8 100644 --- a/src/funcs/queue-items-list.ts +++ b/src/funcs/queue-items-list.ts @@ -34,10 +34,10 @@ import { } from "../types/operations.js"; /** - * Get queue items + * List queue items * * @remarks - * 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. */ export function queueItemsList( client: ModerationApiCore, @@ -130,8 +130,7 @@ async function $do( "labels": payload.labels, "page": payload.page, "pageSize": payload.pageSize, - "sortDirection": payload.sortDirection, - "sortField": payload.sortField, + "sort": payload.sort, }); const headers = new Headers(compactMap({ diff --git a/src/funcs/queue-items-resolve-many.ts b/src/funcs/queue-items-resolve-many.ts new file mode 100644 index 0000000..dd5e84d --- /dev/null +++ b/src/funcs/queue-items-resolve-many.ts @@ -0,0 +1,211 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Resolve queue items + * + * @remarks + * 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`. + */ +export function queueItemsResolveMany( + client: ModerationApiCore, + id: string, + body: operations.ResolveQueueItemsRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.ResolveQueueItemsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + id, + body, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + id: string, + body: operations.ResolveQueueItemsRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ResolveQueueItemsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.ResolveQueueItemsRequest = { + id: id, + body: body, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse(operations.ResolveQueueItemsRequest$outboundSchema, value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body$ = encodeJSON("body", payload.body, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/queue/{id}/items/resolve")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "resolveQueueItems", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body$, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.ResolveQueueItemsResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ResolveQueueItemsResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/queue-items-resolve.ts b/src/funcs/queue-items-resolve.ts index d90c415..7e78626 100644 --- a/src/funcs/queue-items-resolve.ts +++ b/src/funcs/queue-items-resolve.ts @@ -4,7 +4,7 @@ import * as z from "zod/v4-mini"; import { ModerationApiCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { encodeSimple } from "../lib/encodings.js"; import { matchStatusCode } from "../lib/http.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; @@ -31,13 +31,12 @@ import { Result } from "../types/fp.js"; * Resolve a queue item * * @remarks - * 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`. */ export function queueItemsResolve( client: ModerationApiCore, id: string, itemId: string, - body: operations.ResolveQueueItemRequestBody, projectId?: string | undefined, options?: RequestOptions, ): APIPromise< @@ -62,7 +61,6 @@ export function queueItemsResolve( client, id, itemId, - body, projectId, options, )); @@ -72,7 +70,6 @@ async function $do( client: ModerationApiCore, id: string, itemId: string, - body: operations.ResolveQueueItemRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise< @@ -99,7 +96,6 @@ async function $do( const input: operations.ResolveQueueItemRequest = { id: id, itemId: itemId, - body: body, projectId: projectId, }; @@ -113,7 +109,7 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body$ = encodeJSON("body", payload.body, { explode: true }); + const body = null; const pathParams = { id: encodeSimple("id", payload.id, { @@ -128,7 +124,6 @@ async function $do( const path = pathToFunc("/queue/{id}/items/{itemId}/resolve")(pathParams); const headers = new Headers(compactMap({ - "Content-Type": "application/json", Accept: "application/json", "Project-Id": encodeSimple("Project-Id", payload.projectId, { explode: false, @@ -161,7 +156,7 @@ async function $do( baseURL: options?.serverURL, path: path, headers: headers, - body: body$, + body: body, userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); diff --git a/src/funcs/queue-items-unresolve.ts b/src/funcs/queue-items-unresolve.ts index 7b84d2d..4a8d75c 100644 --- a/src/funcs/queue-items-unresolve.ts +++ b/src/funcs/queue-items-unresolve.ts @@ -4,7 +4,7 @@ import * as z from "zod/v4-mini"; import { ModerationApiCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { encodeSimple } from "../lib/encodings.js"; import { matchStatusCode } from "../lib/http.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; @@ -31,13 +31,12 @@ import { Result } from "../types/fp.js"; * Unresolve a queue item * * @remarks - * 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. */ export function queueItemsUnresolve( client: ModerationApiCore, id: string, itemId: string, - body: operations.UnresolveQueueItemRequestBody, projectId?: string | undefined, options?: RequestOptions, ): APIPromise< @@ -62,7 +61,6 @@ export function queueItemsUnresolve( client, id, itemId, - body, projectId, options, )); @@ -72,7 +70,6 @@ async function $do( client: ModerationApiCore, id: string, itemId: string, - body: operations.UnresolveQueueItemRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise< @@ -99,7 +96,6 @@ async function $do( const input: operations.UnresolveQueueItemRequest = { id: id, itemId: itemId, - body: body, projectId: projectId, }; @@ -113,7 +109,7 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body$ = encodeJSON("body", payload.body, { explode: true }); + const body = null; const pathParams = { id: encodeSimple("id", payload.id, { @@ -128,7 +124,6 @@ async function $do( const path = pathToFunc("/queue/{id}/items/{itemId}/unresolve")(pathParams); const headers = new Headers(compactMap({ - "Content-Type": "application/json", Accept: "application/json", "Project-Id": encodeSimple("Project-Id", payload.projectId, { explode: false, @@ -161,7 +156,7 @@ async function $do( baseURL: options?.serverURL, path: path, headers: headers, - body: body$, + body: body, userAgent: client._options.userAgent, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); diff --git a/src/funcs/queue-list.ts b/src/funcs/queue-list.ts new file mode 100644 index 0000000..c13fbc0 --- /dev/null +++ b/src/funcs/queue-list.ts @@ -0,0 +1,292 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; + +/** + * List queues + * + * @remarks + * 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}`. + */ +export function queueList( + client: ModerationApiCore, + page?: number | undefined, + pageSize?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + PageIterator< + Result< + operations.ListQueuesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { page: number } + > +> { + return new APIPromise($do( + client, + page, + pageSize, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + page?: number | undefined, + pageSize?: number | undefined, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListQueuesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { page: number } + >, + APICall, + ] +> { + const input: operations.ListQueuesRequest | undefined = { + page: page, + pageSize: pageSize, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => + z.parse(z.optional(operations.ListQueuesRequest$outboundSchema), value), + "Input validation failed", + ); + if (!parsed.ok) { + return [haltIterator(parsed), { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/queue")(); + + const query = encodeFormQuery({ + "page": payload?.page, + "pageSize": payload?.pageSize, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload?.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listQueues", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [haltIterator(requestRes), { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [haltIterator(doResult), { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result, raw] = await M.match< + operations.ListQueuesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListQueuesResponse$inboundSchema, { key: "Result" }), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(403, errors.PermissionDeniedError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; + } + + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListQueuesResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.PermissionDeniedError + | errors.NotFoundError + | errors.RateLimitError + | errors.InternalServerError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { page: number }; + } => { + const page = input?.page ?? 1; + const nextPage = page + 1; + const numPages = + (responseData as { pagination: { totalPages: unknown } }).pagination + .totalPages; + if (typeof numPages !== "number" || numPages <= page) { + return { next: () => null }; + } + + if (!responseData) { + return { next: () => null }; + } + const results = (responseData as { data: unknown }).data; + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + const limit = input?.pageSize ?? 20; + if (results.length < limit) { + return { next: () => null }; + } + + const nextVal = () => + queueList( + client, + nextPage, + pageSize, + projectId, + options, + ); + + return { next: nextVal, "~next": { page: nextPage } }; + }; + + const page$ = { ...result, ...nextFunc(raw) }; + return [{ ...page$, ...createPageIterator(page$, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; +} diff --git a/src/funcs/queue-retrieve.ts b/src/funcs/queue-retrieve.ts index c8e5d52..8b04011 100644 --- a/src/funcs/queue-retrieve.ts +++ b/src/funcs/queue-retrieve.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Get a queue * * @remarks - * 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. */ export function queueRetrieve( client: ModerationApiCore, diff --git a/src/funcs/wordlist-create.ts b/src/funcs/wordlist-create.ts new file mode 100644 index 0000000..e58bc6d --- /dev/null +++ b/src/funcs/wordlist-create.ts @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create wordlist + * + * @remarks + * 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. + */ +export function wordlistCreate( + client: ModerationApiCore, + body: operations.CreateWordlistRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.CreateWordlistResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + body, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + body: operations.CreateWordlistRequestBody, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateWordlistResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.CreateWordlistRequest = { + body: body, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => z.parse(operations.CreateWordlistRequest$outboundSchema, value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body$ = encodeJSON("body", payload.body, { explode: true }); + + const path = pathToFunc("/wordlist")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createWordlist", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body$, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.CreateWordlistResponse, + | errors.BadRequestError + | errors.AuthenticationError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.CreateWordlistResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestError$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/wordlist-update.ts b/src/funcs/wordlist-update.ts index a7f42b0..293e37e 100644 --- a/src/funcs/wordlist-update.ts +++ b/src/funcs/wordlist-update.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Update wordlist * * @remarks - * 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. */ export function wordlistUpdate( client: ModerationApiCore, diff --git a/src/lib/config.ts b/src/lib/config.ts index 41f2fd5..0d3431e 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.1.0", - sdkVersion: "5.1.1", + sdkVersion: "5.2.0", genVersion: "internal", userAgent: - "speakeasy-sdk/typescript 5.1.1 internal 1.1.0 @moderation-api/sdk", + "speakeasy-sdk/typescript 5.2.0 internal 1.1.0 @moderation-api/sdk", } as const; diff --git a/src/models/bad-request-error.ts b/src/models/bad-request-error.ts index 3b11744..3a8f5b6 100644 --- a/src/models/bad-request-error.ts +++ b/src/models/bad-request-error.ts @@ -12,12 +12,14 @@ import { OpenEnum } from "../types/enums.js"; * @remarks * * - `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`. */ export const BadRequestErrorCode = { InvalidRequest: "invalid_request", ProjectIdRequired: "project_id_required", + ProjectNameAmbiguous: "project_name_ambiguous", ValidationFailed: "validation_failed", } as const; /** @@ -26,7 +28,8 @@ export const BadRequestErrorCode = { * @remarks * * - `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`. */ export type BadRequestErrorCode = OpenEnum; diff --git a/src/models/errors/bad-request-error.ts b/src/models/errors/bad-request-error.ts index 04da000..aecd521 100644 --- a/src/models/errors/bad-request-error.ts +++ b/src/models/errors/bad-request-error.ts @@ -22,7 +22,8 @@ export type BadRequestErrorData = { * @remarks * * - `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`. */ code: models.BadRequestErrorCode; @@ -58,7 +59,8 @@ export class BadRequestError extends ModerationAPIError { * @remarks * * - `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`. */ code: models.BadRequestErrorCode; diff --git a/src/models/errors/not-found-error.ts b/src/models/errors/not-found-error.ts index 3e17249..53d0da2 100644 --- a/src/models/errors/not-found-error.ts +++ b/src/models/errors/not-found-error.ts @@ -25,6 +25,7 @@ export type NotFoundErrorData = { * - `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. @@ -66,6 +67,7 @@ export class NotFoundError extends ModerationAPIError { * - `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/models/index.ts b/src/models/index.ts index e6707ca..f1a6621 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -11,8 +11,12 @@ export * from "./internal-server-error.js"; export * from "./not-found-error.js"; export * from "./pagination.js"; export * from "./permission-denied-error.js"; +export * from "./project-api-key.js"; export * from "./project-with-key.js"; export * from "./project.js"; export * from "./public-author.js"; +export * from "./queue-item.js"; +export * from "./queue-with-counts.js"; +export * from "./queue.js"; export * from "./rate-limit-error.js"; export * from "./security.js"; diff --git a/src/models/not-found-error.ts b/src/models/not-found-error.ts index c072ced..103b8c6 100644 --- a/src/models/not-found-error.ts +++ b/src/models/not-found-error.ts @@ -15,6 +15,7 @@ import { OpenEnum } from "../types/enums.js"; * - `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. @@ -25,6 +26,7 @@ export const NotFoundErrorCode = { ActionNotFound: "action_not_found", AuthorNotFound: "author_not_found", QueueNotFound: "queue_not_found", + QueueItemNotFound: "queue_item_not_found", WordlistNotFound: "wordlist_not_found", WebhookNotFound: "webhook_not_found", ProjectNotFound: "project_not_found", @@ -39,6 +41,7 @@ export const NotFoundErrorCode = { * - `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/models/operations/add-wordlist-words.ts b/src/models/operations/add-wordlist-words.ts index 6c88bbf..e2a8b4f 100644 --- a/src/models/operations/add-wordlist-words.ts +++ b/src/models/operations/add-wordlist-words.ts @@ -21,7 +21,7 @@ export type AddWordlistWordsRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: AddWordlistWordsRequestBody; diff --git a/src/models/operations/create-action.ts b/src/models/operations/create-action.ts index 4809a87..6c8b795 100644 --- a/src/models/operations/create-action.ts +++ b/src/models/operations/create-action.ts @@ -112,7 +112,7 @@ export type CreateActionRequestBody = { export type CreateActionRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: CreateActionRequestBody; diff --git a/src/models/operations/create-author.ts b/src/models/operations/create-author.ts index 44f4a03..5b2107a 100644 --- a/src/models/operations/create-author.ts +++ b/src/models/operations/create-author.ts @@ -70,7 +70,7 @@ export type CreateAuthorRequestBody = { export type CreateAuthorRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: CreateAuthorRequestBody; diff --git a/src/models/operations/create-feedback.ts b/src/models/operations/create-feedback.ts new file mode 100644 index 0000000..cc155be --- /dev/null +++ b/src/models/operations/create-feedback.ts @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * The kind of feedback. + */ +export const CreateFeedbackType = { + FeatureRequest: "feature_request", + Bug: "bug", + Other: "other", +} as const; +/** + * The kind of feedback. + */ +export type CreateFeedbackType = ClosedEnum; + +/** + * Where the feedback was written: MCP server, agent skill, CLI or API. + */ +export const Source = { + Mcp: "mcp", + Skill: "skill", + Cli: "cli", + Api: "api", +} as const; +/** + * Where the feedback was written: MCP server, agent skill, CLI or API. + */ +export type Source = ClosedEnum; + +export type CreateFeedbackRequestBody = { + /** + * A short summary of the request. + */ + title: string; + /** + * What you tried to do, why, and what is missing or does not work. Plain text. Blank lines start new paragraphs. + */ + description: string; + /** + * The kind of feedback. + */ + type?: CreateFeedbackType | undefined; + /** + * Where the feedback was written: MCP server, agent skill, CLI or API. + */ + source?: Source | undefined; +}; + +export type CreateFeedbackRequest = { + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; + body: CreateFeedbackRequestBody; +}; + +/** + * Feedback received + */ +export type CreateFeedbackResponse = { + /** + * ID of the feedback. + */ + id: string; + /** + * The team received the feedback. + */ + status: "received"; +}; + +/** @internal */ +export const CreateFeedbackType$outboundSchema: z.ZodMiniEnum< + typeof CreateFeedbackType +> = z.enum(CreateFeedbackType); + +/** @internal */ +export const Source$outboundSchema: z.ZodMiniEnum = z.enum( + Source, +); + +/** @internal */ +export type CreateFeedbackRequestBody$Outbound = { + title: string; + description: string; + type: string; + source: string; +}; + +/** @internal */ +export const CreateFeedbackRequestBody$outboundSchema: z.ZodMiniType< + CreateFeedbackRequestBody$Outbound, + CreateFeedbackRequestBody +> = z.object({ + title: z.string(), + description: z.string(), + type: z._default(CreateFeedbackType$outboundSchema, "feature_request"), + source: z._default(Source$outboundSchema, "api"), +}); + +export function createFeedbackRequestBodyToJSON( + createFeedbackRequestBody: CreateFeedbackRequestBody, +): string { + return JSON.stringify( + CreateFeedbackRequestBody$outboundSchema.parse(createFeedbackRequestBody), + ); +} + +/** @internal */ +export type CreateFeedbackRequest$Outbound = { + projectId?: string | undefined; + body: CreateFeedbackRequestBody$Outbound; +}; + +/** @internal */ +export const CreateFeedbackRequest$outboundSchema: z.ZodMiniType< + CreateFeedbackRequest$Outbound, + CreateFeedbackRequest +> = z.object({ + projectId: z.optional(z.string()), + body: z.lazy(() => CreateFeedbackRequestBody$outboundSchema), +}); + +export function createFeedbackRequestToJSON( + createFeedbackRequest: CreateFeedbackRequest, +): string { + return JSON.stringify( + CreateFeedbackRequest$outboundSchema.parse(createFeedbackRequest), + ); +} + +/** @internal */ +export const CreateFeedbackResponse$inboundSchema: z.ZodMiniType< + CreateFeedbackResponse, + unknown +> = z.object({ + id: types.string(), + status: types.literal("received"), +}); + +export function createFeedbackResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateFeedbackResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateFeedbackResponse' from JSON`, + ); +} diff --git a/src/models/operations/create-project-api-key.ts b/src/models/operations/create-project-api-key.ts new file mode 100644 index 0000000..889c559 --- /dev/null +++ b/src/models/operations/create-project-api-key.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; + +export type CreateProjectApiKeyRequestBody = { + /** + * 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. + */ + name?: string | undefined; +}; + +export type CreateProjectApiKeyRequest = { + /** + * The ID of the project. + */ + id: string; + body: CreateProjectApiKeyRequestBody; +}; + +/** @internal */ +export type CreateProjectApiKeyRequestBody$Outbound = { + name: string; +}; + +/** @internal */ +export const CreateProjectApiKeyRequestBody$outboundSchema: z.ZodMiniType< + CreateProjectApiKeyRequestBody$Outbound, + CreateProjectApiKeyRequestBody +> = z.object({ + name: z._default(z.string(), "API key"), +}); + +export function createProjectApiKeyRequestBodyToJSON( + createProjectApiKeyRequestBody: CreateProjectApiKeyRequestBody, +): string { + return JSON.stringify( + CreateProjectApiKeyRequestBody$outboundSchema.parse( + createProjectApiKeyRequestBody, + ), + ); +} + +/** @internal */ +export type CreateProjectApiKeyRequest$Outbound = { + id: string; + body: CreateProjectApiKeyRequestBody$Outbound; +}; + +/** @internal */ +export const CreateProjectApiKeyRequest$outboundSchema: z.ZodMiniType< + CreateProjectApiKeyRequest$Outbound, + CreateProjectApiKeyRequest +> = z.object({ + id: z.string(), + body: z.lazy(() => CreateProjectApiKeyRequestBody$outboundSchema), +}); + +export function createProjectApiKeyRequestToJSON( + createProjectApiKeyRequest: CreateProjectApiKeyRequest, +): string { + return JSON.stringify( + CreateProjectApiKeyRequest$outboundSchema.parse(createProjectApiKeyRequest), + ); +} diff --git a/src/models/operations/create-webhook.ts b/src/models/operations/create-webhook.ts index e1e8158..5c9c243 100644 --- a/src/models/operations/create-webhook.ts +++ b/src/models/operations/create-webhook.ts @@ -48,7 +48,7 @@ export type CreateWebhookRequestBody = { export type CreateWebhookRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: CreateWebhookRequestBody; diff --git a/src/models/operations/create-wordlist.ts b/src/models/operations/create-wordlist.ts new file mode 100644 index 0000000..fae96f4 --- /dev/null +++ b/src/models/operations/create-wordlist.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +export type CreateWordlistRequestBody = { + /** + * Name of the wordlist + */ + name: string; + /** + * Key of the wordlist. Default: made from the name. If the key is already in use, a suffix is added. + */ + key?: string | undefined; + /** + * Description of the wordlist + */ + description?: string | undefined; + /** + * Words to add to the wordlist. Words are converted to lowercase. Duplicate and empty words are ignored. Maximum 5000 words. + */ + words?: Array | undefined; +}; + +export type CreateWordlistRequest = { + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; + body: CreateWordlistRequestBody; +}; + +/** + * Wordlist created successfully + */ +export type CreateWordlistResponse = { + /** + * ID of the wordlist + */ + id: string; + name: string | null; + /** + * Words in the wordlist + */ + words: Array; + /** + * Creation date of the wordlist + */ + createdAt: string; + /** + * ID of the organization + */ + organizationId: string; + userId: string | null; + /** + * Strict mode + */ + strict: boolean; +}; + +/** @internal */ +export type CreateWordlistRequestBody$Outbound = { + name: string; + key?: string | undefined; + description?: string | undefined; + words?: Array | undefined; +}; + +/** @internal */ +export const CreateWordlistRequestBody$outboundSchema: z.ZodMiniType< + CreateWordlistRequestBody$Outbound, + CreateWordlistRequestBody +> = z.object({ + name: z.string(), + key: z.optional(z.string()), + description: z.optional(z.string()), + words: z.optional(z.array(z.string())), +}); + +export function createWordlistRequestBodyToJSON( + createWordlistRequestBody: CreateWordlistRequestBody, +): string { + return JSON.stringify( + CreateWordlistRequestBody$outboundSchema.parse(createWordlistRequestBody), + ); +} + +/** @internal */ +export type CreateWordlistRequest$Outbound = { + projectId?: string | undefined; + body: CreateWordlistRequestBody$Outbound; +}; + +/** @internal */ +export const CreateWordlistRequest$outboundSchema: z.ZodMiniType< + CreateWordlistRequest$Outbound, + CreateWordlistRequest +> = z.object({ + projectId: z.optional(z.string()), + body: z.lazy(() => CreateWordlistRequestBody$outboundSchema), +}); + +export function createWordlistRequestToJSON( + createWordlistRequest: CreateWordlistRequest, +): string { + return JSON.stringify( + CreateWordlistRequest$outboundSchema.parse(createWordlistRequest), + ); +} + +/** @internal */ +export const CreateWordlistResponse$inboundSchema: z.ZodMiniType< + CreateWordlistResponse, + unknown +> = z.object({ + id: types.string(), + name: types.nullable(types.string()), + words: z.array(types.string()), + createdAt: types.string(), + organizationId: types.string(), + userId: types.nullable(types.string()), + strict: types.boolean(), +}); + +export function createWordlistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWordlistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWordlistResponse' from JSON`, + ); +} diff --git a/src/models/operations/delete-action.ts b/src/models/operations/delete-action.ts index f714e20..7690b2c 100644 --- a/src/models/operations/delete-action.ts +++ b/src/models/operations/delete-action.ts @@ -14,7 +14,7 @@ export type DeleteActionRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/delete-author.ts b/src/models/operations/delete-author.ts index ab669f1..444311d 100644 --- a/src/models/operations/delete-author.ts +++ b/src/models/operations/delete-author.ts @@ -14,7 +14,7 @@ export type DeleteAuthorRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/delete-webhook.ts b/src/models/operations/delete-webhook.ts index 1f26216..0d4be19 100644 --- a/src/models/operations/delete-webhook.ts +++ b/src/models/operations/delete-webhook.ts @@ -14,7 +14,7 @@ export type DeleteWebhookRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/execute-action.ts b/src/models/operations/execute-action.ts index 9fdf3f5..26e2972 100644 --- a/src/models/operations/execute-action.ts +++ b/src/models/operations/execute-action.ts @@ -40,7 +40,7 @@ export type ExecuteActionRequestBody = { export type ExecuteActionRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: ExecuteActionRequestBody; diff --git a/src/models/operations/get-account.ts b/src/models/operations/get-account.ts index 001e196..866e56e 100644 --- a/src/models/operations/get-account.ts +++ b/src/models/operations/get-account.ts @@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetAccountRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-action.ts b/src/models/operations/get-action.ts index 27b21b7..fc6320a 100644 --- a/src/models/operations/get-action.ts +++ b/src/models/operations/get-action.ts @@ -16,7 +16,7 @@ export type GetActionRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-analytics-authors.ts b/src/models/operations/get-analytics-authors.ts new file mode 100644 index 0000000..b0976f4 --- /dev/null +++ b/src/models/operations/get-analytics-authors.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsAuthorsQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsAuthorsQueryParamRange = ClosedEnum< + typeof GetAnalyticsAuthorsQueryParamRange +>; + +export type GetAnalyticsAuthorsRequest = { + /** + * 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. + */ + range?: GetAnalyticsAuthorsQueryParamRange | undefined; + channel?: string | undefined; + limit?: number | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsAuthorsRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsAuthorsRangeResponse = OpenEnum< + typeof GetAnalyticsAuthorsRangeResponse +>; + +export type GetAnalyticsAuthorsAuthor = { + /** + * The author ID from your system. Use it with the authors endpoints. + */ + authorId: string; + /** + * The author name, if known. + */ + name: string | null; + /** + * Flagged requests from this author in the window. + */ + flagged: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsAuthorsResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsAuthorsRangeResponse; + /** + * The channel the numbers are for. Null when they are for all channels. + */ + channelId: string | null; + /** + * The authors with the most flagged requests, largest first. Requests without an author are not included. + */ + authors: Array; +}; + +/** @internal */ +export const GetAnalyticsAuthorsQueryParamRange$outboundSchema: z.ZodMiniEnum< + typeof GetAnalyticsAuthorsQueryParamRange +> = z.enum(GetAnalyticsAuthorsQueryParamRange); + +/** @internal */ +export type GetAnalyticsAuthorsRequest$Outbound = { + range: string; + channel?: string | undefined; + limit: number; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsAuthorsRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsAuthorsRequest$Outbound, + GetAnalyticsAuthorsRequest +> = z.object({ + range: z._default(GetAnalyticsAuthorsQueryParamRange$outboundSchema, "30d"), + channel: z.optional(z.string()), + limit: z._default(z.int(), 6), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsAuthorsRequestToJSON( + getAnalyticsAuthorsRequest: GetAnalyticsAuthorsRequest, +): string { + return JSON.stringify( + GetAnalyticsAuthorsRequest$outboundSchema.parse(getAnalyticsAuthorsRequest), + ); +} + +/** @internal */ +export const GetAnalyticsAuthorsRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsAuthorsRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsAuthorsRangeResponse); + +/** @internal */ +export const GetAnalyticsAuthorsAuthor$inboundSchema: z.ZodMiniType< + GetAnalyticsAuthorsAuthor, + unknown +> = z.object({ + authorId: types.string(), + name: types.nullable(types.string()), + flagged: types.number(), +}); + +export function getAnalyticsAuthorsAuthorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsAuthorsAuthor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsAuthorsAuthor' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsAuthorsResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsAuthorsResponse, + unknown +> = z.object({ + range: GetAnalyticsAuthorsRangeResponse$inboundSchema, + channelId: types.nullable(types.string()), + authors: z.array(z.lazy(() => GetAnalyticsAuthorsAuthor$inboundSchema)), +}); + +export function getAnalyticsAuthorsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsAuthorsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsAuthorsResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-analytics-automation.ts b/src/models/operations/get-analytics-automation.ts new file mode 100644 index 0000000..320c497 --- /dev/null +++ b/src/models/operations/get-analytics-automation.ts @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsAutomationQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsAutomationQueryParamRange = ClosedEnum< + typeof GetAnalyticsAutomationQueryParamRange +>; + +export type GetAnalyticsAutomationRequest = { + /** + * 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. + */ + range?: GetAnalyticsAutomationQueryParamRange | undefined; + channel?: string | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsAutomationRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsAutomationRangeResponse = OpenEnum< + typeof GetAnalyticsAutomationRangeResponse +>; + +export type Rule = { + /** + * The rule name. "Other rules" holds all rules after the largest ones. + */ + name: string; + /** + * Flagged requests that this rule settled. + */ + count: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsAutomationResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsAutomationRangeResponse; + /** + * The channel the numbers are for. Null when they are for all channels. + */ + channelId: string | null; + /** + * Flagged requests in the window. Counted on a rolling window from the raw requests, so it can be a little different from the summary. + */ + flagged: number; + /** + * Flagged requests that a rule allowed or rejected without human review. + */ + handledByRules: number; + /** + * Flagged requests that the casebook settled without human review. + */ + handledByCasebook: number; + /** + * Distinct content items sent to the review queue. Repeats of the same content count once, as in the queue. + */ + sentToReview: number; + /** + * Flagged requests that the review queue merged into an item it already shows: repeats, edits and content that was settled later. + */ + mergedDuplicates: number; + automationRate: number | null; + /** + * Review queue items from this window that a moderator allowed. + */ + reviewsAllowed: number; + /** + * Review queue items from this window that a moderator rejected. + */ + reviewsRejected: number; + /** + * Review queue items from this window that a moderator marked as done without allow or reject. + */ + reviewsResolvedWithoutDecision: number; + /** + * Review queue items from this window that are still open. + */ + reviewsUnresolved: number; + /** + * Requests where the casebook decision was different from the decision based on severity. + */ + casebookOverrulings: number; + /** + * The rules that settled flagged requests without review, largest first. The 5 largest have their own entry. The casebook is one of the rules. + */ + rules: Array; +}; + +/** @internal */ +export const GetAnalyticsAutomationQueryParamRange$outboundSchema: + z.ZodMiniEnum = z.enum( + GetAnalyticsAutomationQueryParamRange, + ); + +/** @internal */ +export type GetAnalyticsAutomationRequest$Outbound = { + range: string; + channel?: string | undefined; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsAutomationRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsAutomationRequest$Outbound, + GetAnalyticsAutomationRequest +> = z.object({ + range: z._default( + GetAnalyticsAutomationQueryParamRange$outboundSchema, + "30d", + ), + channel: z.optional(z.string()), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsAutomationRequestToJSON( + getAnalyticsAutomationRequest: GetAnalyticsAutomationRequest, +): string { + return JSON.stringify( + GetAnalyticsAutomationRequest$outboundSchema.parse( + getAnalyticsAutomationRequest, + ), + ); +} + +/** @internal */ +export const GetAnalyticsAutomationRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsAutomationRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsAutomationRangeResponse); + +/** @internal */ +export const Rule$inboundSchema: z.ZodMiniType = z.object({ + name: types.string(), + count: types.number(), +}); + +export function ruleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Rule$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Rule' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsAutomationResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsAutomationResponse, + unknown +> = z.object({ + range: GetAnalyticsAutomationRangeResponse$inboundSchema, + channelId: types.nullable(types.string()), + flagged: types.number(), + handledByRules: types.number(), + handledByCasebook: types.number(), + sentToReview: types.number(), + mergedDuplicates: types.number(), + automationRate: types.nullable(types.number()), + reviewsAllowed: types.number(), + reviewsRejected: types.number(), + reviewsResolvedWithoutDecision: types.number(), + reviewsUnresolved: types.number(), + casebookOverrulings: types.number(), + rules: z.array(z.lazy(() => Rule$inboundSchema)), +}); + +export function getAnalyticsAutomationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsAutomationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsAutomationResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-analytics-channels.ts b/src/models/operations/get-analytics-channels.ts new file mode 100644 index 0000000..5ae8448 --- /dev/null +++ b/src/models/operations/get-analytics-channels.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsChannelsQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsChannelsQueryParamRange = ClosedEnum< + typeof GetAnalyticsChannelsQueryParamRange +>; + +export type GetAnalyticsChannelsRequest = { + /** + * 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. + */ + range?: GetAnalyticsChannelsQueryParamRange | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsChannelsRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsChannelsRangeResponse = OpenEnum< + typeof GetAnalyticsChannelsRangeResponse +>; + +export type Channel = { + /** + * The channel ID. + */ + id: string; + /** + * The channel name. + */ + name: string; + /** + * Requests received in this channel. + */ + requests: number; + /** + * Requests flagged in this channel. + */ + flagged: number; + /** + * The share of requests in this channel that were flagged: flagged / requests. + */ + flagRate: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsChannelsResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsChannelsRangeResponse; + /** + * Requests and flags per channel. Channels with no requests in the window are not included. + */ + channels: Array; +}; + +/** @internal */ +export const GetAnalyticsChannelsQueryParamRange$outboundSchema: z.ZodMiniEnum< + typeof GetAnalyticsChannelsQueryParamRange +> = z.enum(GetAnalyticsChannelsQueryParamRange); + +/** @internal */ +export type GetAnalyticsChannelsRequest$Outbound = { + range: string; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsChannelsRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsChannelsRequest$Outbound, + GetAnalyticsChannelsRequest +> = z.object({ + range: z._default(GetAnalyticsChannelsQueryParamRange$outboundSchema, "30d"), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsChannelsRequestToJSON( + getAnalyticsChannelsRequest: GetAnalyticsChannelsRequest, +): string { + return JSON.stringify( + GetAnalyticsChannelsRequest$outboundSchema.parse( + getAnalyticsChannelsRequest, + ), + ); +} + +/** @internal */ +export const GetAnalyticsChannelsRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsChannelsRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsChannelsRangeResponse); + +/** @internal */ +export const Channel$inboundSchema: z.ZodMiniType = z.object({ + id: types.string(), + name: types.string(), + requests: types.number(), + flagged: types.number(), + flagRate: types.number(), +}); + +export function channelFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Channel$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Channel' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsChannelsResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsChannelsResponse, + unknown +> = z.object({ + range: GetAnalyticsChannelsRangeResponse$inboundSchema, + channels: z.array(z.lazy(() => Channel$inboundSchema)), +}); + +export function getAnalyticsChannelsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsChannelsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsChannelsResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-analytics-policies.ts b/src/models/operations/get-analytics-policies.ts new file mode 100644 index 0000000..8d45771 --- /dev/null +++ b/src/models/operations/get-analytics-policies.ts @@ -0,0 +1,169 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsPoliciesQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsPoliciesQueryParamRange = ClosedEnum< + typeof GetAnalyticsPoliciesQueryParamRange +>; + +export type GetAnalyticsPoliciesRequest = { + /** + * 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. + */ + range?: GetAnalyticsPoliciesQueryParamRange | undefined; + channel?: string | undefined; + limit?: number | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsPoliciesRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsPoliciesRangeResponse = OpenEnum< + typeof GetAnalyticsPoliciesRangeResponse +>; + +export type GetAnalyticsPoliciesPolicy = { + /** + * The policy label, for example `toxicity`. + */ + label: string; + /** + * Flagged requests with this label in the window. Repeats count each time. + */ + flagged: number; + /** + * Flagged requests with this label in the window of equal length before. + */ + previousFlagged: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsPoliciesResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsPoliciesRangeResponse; + /** + * The channel the numbers are for. Null when they are for all channels. + */ + channelId: string | null; + /** + * The policy labels with the most flagged requests, largest first. + */ + policies: Array; +}; + +/** @internal */ +export const GetAnalyticsPoliciesQueryParamRange$outboundSchema: z.ZodMiniEnum< + typeof GetAnalyticsPoliciesQueryParamRange +> = z.enum(GetAnalyticsPoliciesQueryParamRange); + +/** @internal */ +export type GetAnalyticsPoliciesRequest$Outbound = { + range: string; + channel?: string | undefined; + limit: number; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsPoliciesRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsPoliciesRequest$Outbound, + GetAnalyticsPoliciesRequest +> = z.object({ + range: z._default(GetAnalyticsPoliciesQueryParamRange$outboundSchema, "30d"), + channel: z.optional(z.string()), + limit: z._default(z.int(), 8), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsPoliciesRequestToJSON( + getAnalyticsPoliciesRequest: GetAnalyticsPoliciesRequest, +): string { + return JSON.stringify( + GetAnalyticsPoliciesRequest$outboundSchema.parse( + getAnalyticsPoliciesRequest, + ), + ); +} + +/** @internal */ +export const GetAnalyticsPoliciesRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsPoliciesRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsPoliciesRangeResponse); + +/** @internal */ +export const GetAnalyticsPoliciesPolicy$inboundSchema: z.ZodMiniType< + GetAnalyticsPoliciesPolicy, + unknown +> = z.object({ + label: types.string(), + flagged: types.number(), + previousFlagged: types.number(), +}); + +export function getAnalyticsPoliciesPolicyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsPoliciesPolicy$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsPoliciesPolicy' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsPoliciesResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsPoliciesResponse, + unknown +> = z.object({ + range: GetAnalyticsPoliciesRangeResponse$inboundSchema, + channelId: types.nullable(types.string()), + policies: z.array(z.lazy(() => GetAnalyticsPoliciesPolicy$inboundSchema)), +}); + +export function getAnalyticsPoliciesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsPoliciesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsPoliciesResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-analytics-summary.ts b/src/models/operations/get-analytics-summary.ts new file mode 100644 index 0000000..23c118c --- /dev/null +++ b/src/models/operations/get-analytics-summary.ts @@ -0,0 +1,317 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsSummaryQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsSummaryQueryParamRange = ClosedEnum< + typeof GetAnalyticsSummaryQueryParamRange +>; + +export type GetAnalyticsSummaryRequest = { + /** + * 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. + */ + range?: GetAnalyticsSummaryQueryParamRange | undefined; + channel?: string | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsSummaryRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsSummaryRangeResponse = OpenEnum< + typeof GetAnalyticsSummaryRangeResponse +>; + +/** + * Request counts for the window. A flagged request has one recommendation: allow, reject or review. + */ +export type Totals = { + /** + * Requests received. Every request counts, also repeats and edits of the same content. + */ + requests: number; + /** + * Requests that were flagged. + */ + flagged: number; + /** + * The share of requests that were flagged: flagged / requests. 0 when there were no requests. + */ + flagRate: number; + /** + * Requests with the recommendation "allow". Includes content that was not flagged. + */ + allowed: number; + /** + * Requests with the recommendation "reject". All of them were flagged. + */ + rejected: number; + /** + * Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. + */ + sentToReview: number; + /** + * Flagged requests that were settled without human review: rejected plus flaggedButAllowed. + */ + handledAutomatically: number; + /** + * Flagged requests that were allowed without human review. + */ + flaggedButAllowed: number; + /** + * Distinct authors that sent content in the window. Approximate. + */ + distinctAuthors: number; +}; + +/** + * The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. + */ +export type PreviousPeriod = { + /** + * Requests received. Every request counts, also repeats and edits of the same content. + */ + requests: number; + /** + * Requests that were flagged. + */ + flagged: number; + /** + * The share of requests that were flagged: flagged / requests. 0 when there were no requests. + */ + flagRate: number; + /** + * Requests with the recommendation "allow". Includes content that was not flagged. + */ + allowed: number; + /** + * Requests with the recommendation "reject". All of them were flagged. + */ + rejected: number; + /** + * Requests with the recommendation "review". This counts requests, not the deduplicated items in the review queue. + */ + sentToReview: number; + /** + * Flagged requests that were settled without human review: rejected plus flaggedButAllowed. + */ + handledAutomatically: number; + /** + * Flagged requests that were allowed without human review. + */ + flaggedButAllowed: number; +}; + +export type FlagRateSpike = { + /** + * How many times higher the recent flag rate is than the baseline, for example 2.4. + */ + multiple: number; + /** + * The flag rate in the last 2 days. + */ + recentFlagRate: number; + /** + * The flag rate in the 30 days before that. + */ + baselineFlagRate: number; + /** + * Flagged requests in the last 2 days. + */ + recentFlagged: number; + /** + * Requests in the last 2 days. + */ + recentRequests: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsSummaryResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsSummaryRangeResponse; + /** + * The channel the numbers are for. Null when they are for all channels. + */ + channelId: string | null; + /** + * Request counts for the window. A flagged request has one recommendation: allow, reject or review. + */ + totals: Totals; + /** + * The same counts for the window of equal length just before this one. Compare with `totals` to see the trend. + */ + previousPeriod: PreviousPeriod; + /** + * 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. + */ + pendingReview: number; + /** + * 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. + */ + flagRateSpike: FlagRateSpike | null; +}; + +/** @internal */ +export const GetAnalyticsSummaryQueryParamRange$outboundSchema: z.ZodMiniEnum< + typeof GetAnalyticsSummaryQueryParamRange +> = z.enum(GetAnalyticsSummaryQueryParamRange); + +/** @internal */ +export type GetAnalyticsSummaryRequest$Outbound = { + range: string; + channel?: string | undefined; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsSummaryRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsSummaryRequest$Outbound, + GetAnalyticsSummaryRequest +> = z.object({ + range: z._default(GetAnalyticsSummaryQueryParamRange$outboundSchema, "30d"), + channel: z.optional(z.string()), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsSummaryRequestToJSON( + getAnalyticsSummaryRequest: GetAnalyticsSummaryRequest, +): string { + return JSON.stringify( + GetAnalyticsSummaryRequest$outboundSchema.parse(getAnalyticsSummaryRequest), + ); +} + +/** @internal */ +export const GetAnalyticsSummaryRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsSummaryRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsSummaryRangeResponse); + +/** @internal */ +export const Totals$inboundSchema: z.ZodMiniType = z.object({ + requests: types.number(), + flagged: types.number(), + flagRate: types.number(), + allowed: types.number(), + rejected: types.number(), + sentToReview: types.number(), + handledAutomatically: types.number(), + flaggedButAllowed: types.number(), + distinctAuthors: types.number(), +}); + +export function totalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Totals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Totals' from JSON`, + ); +} + +/** @internal */ +export const PreviousPeriod$inboundSchema: z.ZodMiniType< + PreviousPeriod, + unknown +> = z.object({ + requests: types.number(), + flagged: types.number(), + flagRate: types.number(), + allowed: types.number(), + rejected: types.number(), + sentToReview: types.number(), + handledAutomatically: types.number(), + flaggedButAllowed: types.number(), +}); + +export function previousPeriodFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PreviousPeriod$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PreviousPeriod' from JSON`, + ); +} + +/** @internal */ +export const FlagRateSpike$inboundSchema: z.ZodMiniType< + FlagRateSpike, + unknown +> = z.object({ + multiple: types.number(), + recentFlagRate: types.number(), + baselineFlagRate: types.number(), + recentFlagged: types.number(), + recentRequests: types.number(), +}); + +export function flagRateSpikeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FlagRateSpike$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FlagRateSpike' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsSummaryResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsSummaryResponse, + unknown +> = z.object({ + range: GetAnalyticsSummaryRangeResponse$inboundSchema, + channelId: types.nullable(types.string()), + totals: z.lazy(() => Totals$inboundSchema), + previousPeriod: z.lazy(() => PreviousPeriod$inboundSchema), + pendingReview: types.number(), + flagRateSpike: types.nullable(z.lazy(() => FlagRateSpike$inboundSchema)), +}); + +export function getAnalyticsSummaryResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsSummaryResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsSummaryResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-analytics-volumes.ts b/src/models/operations/get-analytics-volumes.ts new file mode 100644 index 0000000..2b4160a --- /dev/null +++ b/src/models/operations/get-analytics-volumes.ts @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +/** + * 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. + */ +export const GetAnalyticsVolumesQueryParamRange = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * 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. + */ +export type GetAnalyticsVolumesQueryParamRange = ClosedEnum< + typeof GetAnalyticsVolumesQueryParamRange +>; + +export type GetAnalyticsVolumesRequest = { + /** + * 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. + */ + range?: GetAnalyticsVolumesQueryParamRange | undefined; + channel?: string | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * The time window of the numbers. + */ +export const GetAnalyticsVolumesRangeResponse = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", +} as const; +/** + * The time window of the numbers. + */ +export type GetAnalyticsVolumesRangeResponse = OpenEnum< + typeof GetAnalyticsVolumesRangeResponse +>; + +/** + * The size of each entry in `volumes`. + */ +export const Bucket = { + Hour: "hour", + Day: "day", +} as const; +/** + * The size of each entry in `volumes`. + */ +export type Bucket = OpenEnum; + +export type Volume = { + /** + * Start of the bucket, as an ISO 8601 timestamp in UTC. + */ + start: string; + /** + * Requests received in the bucket. + */ + requests: number; + /** + * Requests flagged in the bucket. + */ + flagged: number; + /** + * Requests with the recommendation "reject" in the bucket. + */ + rejected: number; + /** + * Requests with the recommendation "review" in the bucket. + */ + sentToReview: number; +}; + +/** + * Successful response + */ +export type GetAnalyticsVolumesResponse = { + /** + * The time window of the numbers. + */ + range: GetAnalyticsVolumesRangeResponse; + /** + * The channel the numbers are for. Null when they are for all channels. + */ + channelId: string | null; + /** + * The size of each entry in `volumes`. + */ + bucket: Bucket; + /** + * Counts over time, oldest first. Buckets with no requests are included with zeros. + */ + volumes: Array; +}; + +/** @internal */ +export const GetAnalyticsVolumesQueryParamRange$outboundSchema: z.ZodMiniEnum< + typeof GetAnalyticsVolumesQueryParamRange +> = z.enum(GetAnalyticsVolumesQueryParamRange); + +/** @internal */ +export type GetAnalyticsVolumesRequest$Outbound = { + range: string; + channel?: string | undefined; + projectId?: string | undefined; +}; + +/** @internal */ +export const GetAnalyticsVolumesRequest$outboundSchema: z.ZodMiniType< + GetAnalyticsVolumesRequest$Outbound, + GetAnalyticsVolumesRequest +> = z.object({ + range: z._default(GetAnalyticsVolumesQueryParamRange$outboundSchema, "30d"), + channel: z.optional(z.string()), + projectId: z.optional(z.string()), +}); + +export function getAnalyticsVolumesRequestToJSON( + getAnalyticsVolumesRequest: GetAnalyticsVolumesRequest, +): string { + return JSON.stringify( + GetAnalyticsVolumesRequest$outboundSchema.parse(getAnalyticsVolumesRequest), + ); +} + +/** @internal */ +export const GetAnalyticsVolumesRangeResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsVolumesRangeResponse, + unknown +> = openEnums.inboundSchema(GetAnalyticsVolumesRangeResponse); + +/** @internal */ +export const Bucket$inboundSchema: z.ZodMiniType = openEnums + .inboundSchema(Bucket); + +/** @internal */ +export const Volume$inboundSchema: z.ZodMiniType = z.object({ + start: types.string(), + requests: types.number(), + flagged: types.number(), + rejected: types.number(), + sentToReview: types.number(), +}); + +export function volumeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Volume$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Volume' from JSON`, + ); +} + +/** @internal */ +export const GetAnalyticsVolumesResponse$inboundSchema: z.ZodMiniType< + GetAnalyticsVolumesResponse, + unknown +> = z.object({ + range: GetAnalyticsVolumesRangeResponse$inboundSchema, + channelId: types.nullable(types.string()), + bucket: Bucket$inboundSchema, + volumes: z.array(z.lazy(() => Volume$inboundSchema)), +}); + +export function getAnalyticsVolumesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAnalyticsVolumesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAnalyticsVolumesResponse' from JSON`, + ); +} diff --git a/src/models/operations/get-author.ts b/src/models/operations/get-author.ts index 6e77389..d934aa8 100644 --- a/src/models/operations/get-author.ts +++ b/src/models/operations/get-author.ts @@ -10,7 +10,7 @@ export type GetAuthorRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-queue-stats.ts b/src/models/operations/get-queue-stats.ts index b56d988..a5fd2e6 100644 --- a/src/models/operations/get-queue-stats.ts +++ b/src/models/operations/get-queue-stats.ts @@ -10,117 +10,58 @@ import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetQueueStatsRequest = { /** - * The queue ID + * The queue ID. */ id: string; withinDays?: number | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; export type ReviewStats = { /** - * Average time in milliseconds to review an item - */ - averageTimeToReview: number; - /** - * Total number of items reviewed + * Number of items resolved in this queue in the period. */ totalReviewed: number; /** - * Total number of items pending review + * Number of items submitted in the period that wait for review now. */ totalPending: number; }; -export type ActionStat = { - /** - * ID of the moderation action - */ - actionId: string; - /** - * Name of the moderation action - */ - actionName: string; - /** - * Number of times this action was taken - */ - count: number; - /** - * Percentage this action represents of all actions - */ - percentageOfTotal: number; -}; - -export type TopAction = { - /** - * Most used action by this reviewer - */ - actionId: string; - /** - * Name of the most used action - */ - actionName: string; - /** - * Number of times this action was used - */ - count: number; -}; - export type TopReviewer = { /** - * ID of the reviewer + * The user ID of the reviewer. `null` for items resolved with an API key. */ - userId: string; + userId: string | null; /** - * Name of the reviewer + * The name of the reviewer. */ - name: string; + name: string | null; /** - * Number of items reviewed + * Number of items the reviewer resolved in the period. */ reviewCount: number; - /** - * Average review time in milliseconds - */ - averageTimePerReview: number; - /** - * Optional accuracy score based on review quality metrics - */ - accuracyScore?: number | undefined; - /** - * Most common actions taken by this reviewer - */ - topActions: Array; }; export type DailyReviewCount = { /** - * Date in YYYY-MM-DD format + * Date in YYYY-MM-DD format (UTC). */ date: string; /** - * Number of reviews on this date + * Number of items resolved. */ count: number; }; -export type FlaggedContentTrend = { - /** - * Content flag/label - */ - label: string; +export type Trends = { /** - * Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing + * Resolved items per day. Days with no reviews are left out. */ - trend: number; -}; - -export type Trends = { dailyReviewCounts: Array; - flaggedContentTrends: Array; }; /** @@ -128,9 +69,8 @@ export type Trends = { */ export type GetQueueStatsResponse = { reviewStats: ReviewStats; - actionStats: Array; /** - * List of top reviewers and their statistics + * Reviewers with the most resolved items, most first. Up to 10. */ topReviewers: Array; trends: Trends; @@ -164,7 +104,6 @@ export function getQueueStatsRequestToJSON( /** @internal */ export const ReviewStats$inboundSchema: z.ZodMiniType = z .object({ - averageTimeToReview: types.number(), totalReviewed: types.number(), totalPending: types.number(), }); @@ -179,52 +118,12 @@ export function reviewStatsFromJSON( ); } -/** @internal */ -export const ActionStat$inboundSchema: z.ZodMiniType = z - .object({ - actionId: types.string(), - actionName: types.string(), - count: types.number(), - percentageOfTotal: types.number(), - }); - -export function actionStatFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ActionStat$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ActionStat' from JSON`, - ); -} - -/** @internal */ -export const TopAction$inboundSchema: z.ZodMiniType = z - .object({ - actionId: types.string(), - actionName: types.string(), - count: types.number(), - }); - -export function topActionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TopAction$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TopAction' from JSON`, - ); -} - /** @internal */ export const TopReviewer$inboundSchema: z.ZodMiniType = z .object({ - userId: types.string(), - name: types.string(), + userId: types.nullable(types.string()), + name: types.nullable(types.string()), reviewCount: types.number(), - averageTimePerReview: types.number(), - accuracyScore: types.optional(types.number()), - topActions: z.array(z.lazy(() => TopAction$inboundSchema)), }); export function topReviewerFromJSON( @@ -256,31 +155,9 @@ export function dailyReviewCountFromJSON( ); } -/** @internal */ -export const FlaggedContentTrend$inboundSchema: z.ZodMiniType< - FlaggedContentTrend, - unknown -> = z.object({ - label: types.string(), - trend: types.number(), -}); - -export function flaggedContentTrendFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => FlaggedContentTrend$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'FlaggedContentTrend' from JSON`, - ); -} - /** @internal */ export const Trends$inboundSchema: z.ZodMiniType = z.object({ dailyReviewCounts: z.array(z.lazy(() => DailyReviewCount$inboundSchema)), - flaggedContentTrends: z.array( - z.lazy(() => FlaggedContentTrend$inboundSchema), - ), }); export function trendsFromJSON( @@ -299,7 +176,6 @@ export const GetQueueStatsResponse$inboundSchema: z.ZodMiniType< unknown > = z.object({ reviewStats: z.lazy(() => ReviewStats$inboundSchema), - actionStats: z.array(z.lazy(() => ActionStat$inboundSchema)), topReviewers: z.array(z.lazy(() => TopReviewer$inboundSchema)), trends: z.lazy(() => Trends$inboundSchema), }); diff --git a/src/models/operations/get-queue.ts b/src/models/operations/get-queue.ts index 7b44d16..11e5dec 100644 --- a/src/models/operations/get-queue.ts +++ b/src/models/operations/get-queue.ts @@ -4,157 +4,26 @@ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; -import * as openEnums from "../../types/enums.js"; -import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; -import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; +import * as models from "../index.js"; export type GetQueueRequest = { /** - * The queue ID + * The queue ID. */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; -export const IsFlagged = { - All: "ALL", - Flagged: "FLAGGED", - NotFlagged: "NOT_FLAGGED", - ShadowFlagged: "SHADOW_FLAGGED", -} as const; -export type IsFlagged = OpenEnum; - -export const CasebookAnswer = { - All: "ALL", - Allowed: "ALLOWED", - Rejected: "REJECTED", - NoAnswer: "NO_ANSWER", -} as const; -export type CasebookAnswer = OpenEnum; - -export const CasebookAgreement = { - All: "ALL", - Overruled: "OVERRULED", - Agreed: "AGREED", -} as const; -export type CasebookAgreement = OpenEnum; - -export const GetQueueType = { - Flagged: "FLAGGED", - NotFlagged: "NOT_FLAGGED", - Thresholds: "THRESHOLDS", - Matched: "MATCHED", -} as const; -export type GetQueueType = OpenEnum; - -export type FilterLabel = { - label: string; - type: GetQueueType; - minThreshold?: number | null | undefined; - maxThreshold?: number | null | undefined; -}; - -export type MetadataFilter = { - key: string; - value: string; -}; - -export const GetQueueContentType = { - Profile: "profile", - Message: "message", - Post: "post", - Comment: "comment", - Event: "event", - Product: "product", - Review: "review", - Voice: "voice", - Other: "other", -} as const; -export type GetQueueContentType = OpenEnum; - -export const MediaType = { - Text: "text", - Image: "image", - Video: "video", - Object: "object", - Audio: "audio", -} as const; -export type MediaType = OpenEnum; - -export const GetQueueRecommendationAction = { - Review: "review", - Allow: "allow", - Reject: "reject", -} as const; -export type GetQueueRecommendationAction = OpenEnum< - typeof GetQueueRecommendationAction ->; - -export const WithinUnit = { - Minutes: "MINUTES", - Hours: "HOURS", - Days: "DAYS", - Weeks: "WEEKS", - Months: "MONTHS", - Years: "YEARS", -} as const; -export type WithinUnit = OpenEnum; - -export const CheckStatus = { - All: "all", - Checked: "checked", - Unchecked: "unchecked", -} as const; -export type CheckStatus = OpenEnum; - -export type Filter = { - isFlagged?: IsFlagged | undefined; - casebookAnswer?: CasebookAnswer | undefined; - casebookAgreement?: CasebookAgreement | undefined; - labels?: Array | undefined; - filterLabels?: Array | undefined; - metadataFilters?: Array | undefined; - filteredChannelIds?: Array | undefined; - filteredActionIds?: Array | undefined; - languages?: Array | undefined; - contentTypes?: Array | undefined; - mediaTypes?: Array | undefined; - authorTrustLevels?: Array | undefined; - recommendationActions?: Array | undefined; - minSeverity?: number | undefined; - maxSeverity?: number | undefined; - afterDate?: string | undefined; - beforeDate?: string | undefined; - within?: number | undefined; - withinUnit?: WithinUnit | undefined; - clearDateWindow?: boolean | undefined; - checkStatus?: CheckStatus | null | undefined; - authorID?: string | undefined; - contentID?: string | undefined; - conversationIds?: Array | undefined; - search?: Array | undefined; -}; - -export type Queue = { - id: string; - name: string; - description: string; - filter: Filter; - unresolvedItemsCount: number; - resolvedItemsCount: number; - totalItemsCount: number; -}; - /** * Successful response */ export type GetQueueResponse = { - queue: Queue; + queue: models.QueueWithCounts; }; /** @internal */ @@ -178,160 +47,12 @@ export function getQueueRequestToJSON( return JSON.stringify(GetQueueRequest$outboundSchema.parse(getQueueRequest)); } -/** @internal */ -export const IsFlagged$inboundSchema: z.ZodMiniType = - openEnums.inboundSchema(IsFlagged); - -/** @internal */ -export const CasebookAnswer$inboundSchema: z.ZodMiniType< - CasebookAnswer, - unknown -> = openEnums.inboundSchema(CasebookAnswer); - -/** @internal */ -export const CasebookAgreement$inboundSchema: z.ZodMiniType< - CasebookAgreement, - unknown -> = openEnums.inboundSchema(CasebookAgreement); - -/** @internal */ -export const GetQueueType$inboundSchema: z.ZodMiniType = - openEnums.inboundSchema(GetQueueType); - -/** @internal */ -export const FilterLabel$inboundSchema: z.ZodMiniType = z - .object({ - label: types.string(), - type: GetQueueType$inboundSchema, - minThreshold: z.optional(z.nullable(types.number())), - maxThreshold: z.optional(z.nullable(types.number())), - }); - -export function filterLabelFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => FilterLabel$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'FilterLabel' from JSON`, - ); -} - -/** @internal */ -export const MetadataFilter$inboundSchema: z.ZodMiniType< - MetadataFilter, - unknown -> = z.object({ - key: types.string(), - value: types.string(), -}); - -export function metadataFilterFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => MetadataFilter$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'MetadataFilter' from JSON`, - ); -} - -/** @internal */ -export const GetQueueContentType$inboundSchema: z.ZodMiniType< - GetQueueContentType, - unknown -> = openEnums.inboundSchema(GetQueueContentType); - -/** @internal */ -export const MediaType$inboundSchema: z.ZodMiniType = - openEnums.inboundSchema(MediaType); - -/** @internal */ -export const GetQueueRecommendationAction$inboundSchema: z.ZodMiniType< - GetQueueRecommendationAction, - unknown -> = openEnums.inboundSchema(GetQueueRecommendationAction); - -/** @internal */ -export const WithinUnit$inboundSchema: z.ZodMiniType = - openEnums.inboundSchema(WithinUnit); - -/** @internal */ -export const CheckStatus$inboundSchema: z.ZodMiniType = - openEnums.inboundSchema(CheckStatus); - -/** @internal */ -export const Filter$inboundSchema: z.ZodMiniType = z.object({ - isFlagged: types.optional(IsFlagged$inboundSchema), - casebookAnswer: types.optional(CasebookAnswer$inboundSchema), - casebookAgreement: types.optional(CasebookAgreement$inboundSchema), - labels: types.optional(z.array(types.string())), - filterLabels: types.optional( - z.array(z.lazy(() => FilterLabel$inboundSchema)), - ), - metadataFilters: types.optional( - z.array(z.lazy(() => MetadataFilter$inboundSchema)), - ), - filteredChannelIds: types.optional(z.array(types.string())), - filteredActionIds: types.optional(z.array(types.string())), - languages: types.optional(z.array(types.string())), - contentTypes: types.optional(z.array(GetQueueContentType$inboundSchema)), - mediaTypes: types.optional(z.array(MediaType$inboundSchema)), - authorTrustLevels: types.optional(z.array(types.number())), - recommendationActions: types.optional( - z.array(GetQueueRecommendationAction$inboundSchema), - ), - minSeverity: types.optional(types.number()), - maxSeverity: types.optional(types.number()), - afterDate: types.optional(types.string()), - beforeDate: types.optional(types.string()), - within: types.optional(types.number()), - withinUnit: types.optional(WithinUnit$inboundSchema), - clearDateWindow: types.optional(types.boolean()), - checkStatus: z.optional(z.nullable(CheckStatus$inboundSchema)), - authorID: types.optional(types.string()), - contentID: types.optional(types.string()), - conversationIds: types.optional(z.array(types.nullable(types.string()))), - search: types.optional(z.array(types.string())), -}); - -export function filterFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Filter$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Filter' from JSON`, - ); -} - -/** @internal */ -export const Queue$inboundSchema: z.ZodMiniType = z.object({ - id: types.string(), - name: types.string(), - description: types.string(), - filter: z.lazy(() => Filter$inboundSchema), - unresolvedItemsCount: types.number(), - resolvedItemsCount: types.number(), - totalItemsCount: types.number(), -}); - -export function queueFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Queue$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Queue' from JSON`, - ); -} - /** @internal */ export const GetQueueResponse$inboundSchema: z.ZodMiniType< GetQueueResponse, unknown > = z.object({ - queue: z.lazy(() => Queue$inboundSchema), + queue: models.QueueWithCounts$inboundSchema, }); export function getQueueResponseFromJSON( diff --git a/src/models/operations/get-webhook-secret.ts b/src/models/operations/get-webhook-secret.ts index 9ba9f0f..46fd716 100644 --- a/src/models/operations/get-webhook-secret.ts +++ b/src/models/operations/get-webhook-secret.ts @@ -10,7 +10,7 @@ import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetWebhookSecretRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-webhook.ts b/src/models/operations/get-webhook.ts index c969415..83c49f0 100644 --- a/src/models/operations/get-webhook.ts +++ b/src/models/operations/get-webhook.ts @@ -16,7 +16,7 @@ export type GetWebhookRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-wordlist-embedding-status.ts b/src/models/operations/get-wordlist-embedding-status.ts index 915834d..23dbbd2 100644 --- a/src/models/operations/get-wordlist-embedding-status.ts +++ b/src/models/operations/get-wordlist-embedding-status.ts @@ -14,7 +14,7 @@ export type GetWordlistEmbeddingStatusRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/get-wordlist.ts b/src/models/operations/get-wordlist.ts index ac948d7..0a469a3 100644 --- a/src/models/operations/get-wordlist.ts +++ b/src/models/operations/get-wordlist.ts @@ -14,7 +14,7 @@ export type GetWordlistRequest = { */ id: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 53d2b79..25871d8 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -6,8 +6,11 @@ export * from "./add-wordlist-words.js"; export * from "./create-action.js"; export * from "./create-author.js"; export * from "./create-channel.js"; +export * from "./create-feedback.js"; +export * from "./create-project-api-key.js"; export * from "./create-project.js"; export * from "./create-webhook.js"; +export * from "./create-wordlist.js"; export * from "./delete-action.js"; export * from "./delete-author.js"; export * from "./delete-channel.js"; @@ -18,6 +21,12 @@ export * from "./duplicate-project.js"; export * from "./execute-action.js"; export * from "./get-account.js"; export * from "./get-action.js"; +export * from "./get-analytics-authors.js"; +export * from "./get-analytics-automation.js"; +export * from "./get-analytics-channels.js"; +export * from "./get-analytics-policies.js"; +export * from "./get-analytics-summary.js"; +export * from "./get-analytics-volumes.js"; export * from "./get-author.js"; export * from "./get-channel.js"; export * from "./get-project.js"; @@ -32,10 +41,12 @@ export * from "./list-authors.js"; export * from "./list-channels.js"; export * from "./list-projects.js"; export * from "./list-queue-items.js"; +export * from "./list-queues.js"; export * from "./list-webhooks.js"; export * from "./list-wordlists.js"; export * from "./remove-wordlist-words.js"; export * from "./resolve-queue-item.js"; +export * from "./resolve-queue-items.js"; export * from "./submit-content.js"; export * from "./unresolve-queue-item.js"; export * from "./update-action.js"; diff --git a/src/models/operations/list-actions.ts b/src/models/operations/list-actions.ts index ab8f378..79e1fef 100644 --- a/src/models/operations/list-actions.ts +++ b/src/models/operations/list-actions.ts @@ -17,7 +17,7 @@ export type ListActionsRequest = { page?: number | undefined; pageSize?: number | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/list-authors.ts b/src/models/operations/list-authors.ts index c16e63f..a0c3031 100644 --- a/src/models/operations/list-authors.ts +++ b/src/models/operations/list-authors.ts @@ -13,7 +13,6 @@ import * as models from "../index.js"; export const SortBy = { TrustLevel: "trustLevel", ViolationCount: "violationCount", - ReportCount: "reportCount", MemberSince: "memberSince", LastActive: "lastActive", ContentCount: "contentCount", @@ -25,16 +24,14 @@ export type SortBy = ClosedEnum; /** * Sort direction */ -export const ListAuthorsSortDirection = { +export const SortDirection = { Asc: "asc", Desc: "desc", } as const; /** * Sort direction */ -export type ListAuthorsSortDirection = ClosedEnum< - typeof ListAuthorsSortDirection ->; +export type SortDirection = ClosedEnum; export type ListAuthorsRequest = { page?: number | undefined; @@ -43,12 +40,11 @@ export type ListAuthorsRequest = { /** * Sort direction */ - sortDirection?: ListAuthorsSortDirection | undefined; + sortDirection?: SortDirection | undefined; memberSinceDate?: string | undefined; lastActiveDate?: string | undefined; - contentTypes?: Array | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; @@ -77,9 +73,8 @@ export const SortBy$outboundSchema: z.ZodMiniEnum = z.enum( ); /** @internal */ -export const ListAuthorsSortDirection$outboundSchema: z.ZodMiniEnum< - typeof ListAuthorsSortDirection -> = z.enum(ListAuthorsSortDirection); +export const SortDirection$outboundSchema: z.ZodMiniEnum = + z.enum(SortDirection); /** @internal */ export type ListAuthorsRequest$Outbound = { @@ -89,7 +84,6 @@ export type ListAuthorsRequest$Outbound = { sortDirection: string; memberSinceDate?: string | undefined; lastActiveDate?: string | undefined; - contentTypes?: Array | undefined; projectId?: string | undefined; }; @@ -101,10 +95,9 @@ export const ListAuthorsRequest$outboundSchema: z.ZodMiniType< page: z._default(z.int(), 1), pageSize: z._default(z.int(), 20), sortBy: z.optional(SortBy$outboundSchema), - sortDirection: z._default(ListAuthorsSortDirection$outboundSchema, "desc"), + sortDirection: z._default(SortDirection$outboundSchema, "desc"), memberSinceDate: z.optional(z.string()), lastActiveDate: z.optional(z.string()), - contentTypes: z.optional(z.array(z.string())), projectId: z.optional(z.string()), }); diff --git a/src/models/operations/list-queue-items.ts b/src/models/operations/list-queue-items.ts index d78a142..0779fb4 100644 --- a/src/models/operations/list-queue-items.ts +++ b/src/models/operations/list-queue-items.ts @@ -5,153 +5,40 @@ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; -import * as openEnums from "../../types/enums.js"; -import { ClosedEnum, OpenEnum } from "../../types/enums.js"; +import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; -import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; import * as models from "../index.js"; -export const SortField = { - CreatedAt: "createdAt", - Severity: "severity", - ReviewedAt: "reviewedAt", +export const Sort = { + Fifo: "FIFO", + Lifo: "LIFO", + Random: "RANDOM", + SeverityDesc: "SEVERITY_DESC", } as const; -export type SortField = ClosedEnum; - -/** - * Sort direction - */ -export const ListQueueItemsSortDirection = { - Asc: "asc", - Desc: "desc", -} as const; -/** - * Sort direction - */ -export type ListQueueItemsSortDirection = ClosedEnum< - typeof ListQueueItemsSortDirection ->; +export type Sort = ClosedEnum; export type ListQueueItemsRequest = { /** - * The queue ID + * The queue ID. */ id: string; page?: number | undefined; pageSize?: number | undefined; - sortField?: SortField | undefined; - /** - * Sort direction - */ - sortDirection?: ListQueueItemsSortDirection | undefined; + sort?: Sort | undefined; + includeResolved?: boolean | undefined; conversationIds?: Array | undefined; labels?: Array | undefined; - afterDate?: string | undefined; - beforeDate?: string | undefined; - includeResolved?: boolean | undefined; authorId?: string | undefined; filteredActionIds?: Array | undefined; + afterDate?: string | undefined; + beforeDate?: string | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; -export type ListQueueItemsLabel = { - /** - * Label name - */ - label: string; - /** - * Confidence score of the label - */ - score: number; - /** - * Whether this label caused a flag - */ - flagged: boolean; -}; - -export type ListQueueItemsAction = { - /** - * Action ID - */ - id: string; - /** - * Action name - */ - name: string; - /** - * Action comment - */ - comment?: string | undefined; - /** - * Unix timestamp of when the action was taken - */ - timestamp: number; - /** - * Moderator userID - */ - reviewer?: string | undefined; -}; - -/** - * Status of the item - */ -export const ListQueueItemsStatus = { - Pending: "pending", - Resolved: "resolved", -} as const; -/** - * Status of the item - */ -export type ListQueueItemsStatus = OpenEnum; - -export type ListQueueItemsData = { - /** - * Content ID - */ - id: string; - /** - * The content to be moderated - */ - content: string; - /** - * Content language - */ - language?: string | undefined; - labels: Array; - /** - * Conversation ID - */ - conversationId?: string | undefined; - /** - * Author ID - */ - authorId?: string | undefined; - /** - * Action IDs taken on this item - */ - actions?: Array | undefined; - /** - * Whether the item is flagged by any label - */ - flagged: boolean; - /** - * Status of the item - */ - status: ListQueueItemsStatus; - /** - * Unix timestamp of when the item was created - */ - timestamp: number; - /** - * Type of the content object - */ - contentType?: string | undefined; -}; - /** * Successful response */ @@ -159,7 +46,7 @@ export type ListQueueItemsResponseBody = { /** * The items on this page. */ - data: Array; + data: Array; /** * Where this page is in the full list. */ @@ -171,29 +58,21 @@ export type ListQueueItemsResponse = { }; /** @internal */ -export const SortField$outboundSchema: z.ZodMiniEnum = z.enum( - SortField, -); - -/** @internal */ -export const ListQueueItemsSortDirection$outboundSchema: z.ZodMiniEnum< - typeof ListQueueItemsSortDirection -> = z.enum(ListQueueItemsSortDirection); +export const Sort$outboundSchema: z.ZodMiniEnum = z.enum(Sort); /** @internal */ export type ListQueueItemsRequest$Outbound = { id: string; page: number; pageSize: number; - sortField?: string | undefined; - sortDirection: string; + sort?: string | undefined; + includeResolved?: boolean | undefined; conversationIds?: Array | undefined; labels?: Array | undefined; - afterDate?: string | undefined; - beforeDate?: string | undefined; - includeResolved?: boolean | undefined; authorId?: string | undefined; filteredActionIds?: Array | undefined; + afterDate?: string | undefined; + beforeDate?: string | undefined; projectId?: string | undefined; }; @@ -205,15 +84,14 @@ export const ListQueueItemsRequest$outboundSchema: z.ZodMiniType< id: z.string(), page: z._default(z.int(), 1), pageSize: z._default(z.int(), 20), - sortField: z.optional(SortField$outboundSchema), - sortDirection: z._default(ListQueueItemsSortDirection$outboundSchema, "desc"), + sort: z.optional(Sort$outboundSchema), + includeResolved: z.optional(z.boolean()), conversationIds: z.optional(z.array(z.string())), labels: z.optional(z.array(z.string())), - afterDate: z.optional(z.string()), - beforeDate: z.optional(z.string()), - includeResolved: z.optional(z.boolean()), authorId: z.optional(z.string()), filteredActionIds: z.optional(z.array(z.string())), + afterDate: z.optional(z.string()), + beforeDate: z.optional(z.string()), projectId: z.optional(z.string()), }); @@ -225,90 +103,12 @@ export function listQueueItemsRequestToJSON( ); } -/** @internal */ -export const ListQueueItemsLabel$inboundSchema: z.ZodMiniType< - ListQueueItemsLabel, - unknown -> = z.object({ - label: types.string(), - score: types.number(), - flagged: types.boolean(), -}); - -export function listQueueItemsLabelFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListQueueItemsLabel$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListQueueItemsLabel' from JSON`, - ); -} - -/** @internal */ -export const ListQueueItemsAction$inboundSchema: z.ZodMiniType< - ListQueueItemsAction, - unknown -> = z.object({ - id: types.string(), - name: types.string(), - comment: types.optional(types.string()), - timestamp: types.number(), - reviewer: types.optional(types.string()), -}); - -export function listQueueItemsActionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListQueueItemsAction$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListQueueItemsAction' from JSON`, - ); -} - -/** @internal */ -export const ListQueueItemsStatus$inboundSchema: z.ZodMiniType< - ListQueueItemsStatus, - unknown -> = openEnums.inboundSchema(ListQueueItemsStatus); - -/** @internal */ -export const ListQueueItemsData$inboundSchema: z.ZodMiniType< - ListQueueItemsData, - unknown -> = z.object({ - id: types.string(), - content: types.string(), - language: types.optional(types.string()), - labels: z.array(z.lazy(() => ListQueueItemsLabel$inboundSchema)), - conversationId: types.optional(types.string()), - authorId: types.optional(types.string()), - actions: types.optional( - z.array(z.lazy(() => ListQueueItemsAction$inboundSchema)), - ), - flagged: types.boolean(), - status: ListQueueItemsStatus$inboundSchema, - timestamp: types.number(), - contentType: types.optional(types.string()), -}); - -export function listQueueItemsDataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListQueueItemsData$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListQueueItemsData' from JSON`, - ); -} - /** @internal */ export const ListQueueItemsResponseBody$inboundSchema: z.ZodMiniType< ListQueueItemsResponseBody, unknown > = z.object({ - data: z.array(z.lazy(() => ListQueueItemsData$inboundSchema)), + data: z.array(models.QueueItem$inboundSchema), pagination: models.Pagination$inboundSchema, }); diff --git a/src/models/operations/list-queues.ts b/src/models/operations/list-queues.ts new file mode 100644 index 0000000..0633460 --- /dev/null +++ b/src/models/operations/list-queues.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; +import * as models from "../index.js"; + +export type ListQueuesRequest = { + page?: number | undefined; + pageSize?: number | undefined; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * Successful response + */ +export type ListQueuesResponseBody = { + /** + * The items on this page. + */ + data: Array; + /** + * Where this page is in the full list. + */ + pagination: models.Pagination; +}; + +export type ListQueuesResponse = { + result: ListQueuesResponseBody; +}; + +/** @internal */ +export type ListQueuesRequest$Outbound = { + page: number; + pageSize: number; + projectId?: string | undefined; +}; + +/** @internal */ +export const ListQueuesRequest$outboundSchema: z.ZodMiniType< + ListQueuesRequest$Outbound, + ListQueuesRequest +> = z.object({ + page: z._default(z.int(), 1), + pageSize: z._default(z.int(), 20), + projectId: z.optional(z.string()), +}); + +export function listQueuesRequestToJSON( + listQueuesRequest: ListQueuesRequest, +): string { + return JSON.stringify( + ListQueuesRequest$outboundSchema.parse(listQueuesRequest), + ); +} + +/** @internal */ +export const ListQueuesResponseBody$inboundSchema: z.ZodMiniType< + ListQueuesResponseBody, + unknown +> = z.object({ + data: z.array(models.Queue$inboundSchema), + pagination: models.Pagination$inboundSchema, +}); + +export function listQueuesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListQueuesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListQueuesResponseBody' from JSON`, + ); +} + +/** @internal */ +export const ListQueuesResponse$inboundSchema: z.ZodMiniType< + ListQueuesResponse, + unknown +> = z.pipe( + z.object({ + Result: z.lazy(() => ListQueuesResponseBody$inboundSchema), + }), + z.transform((v) => { + return remap$(v, { + "Result": "result", + }); + }), +); + +export function listQueuesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListQueuesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListQueuesResponse' from JSON`, + ); +} diff --git a/src/models/operations/list-webhooks.ts b/src/models/operations/list-webhooks.ts index 42d8140..6b30b8a 100644 --- a/src/models/operations/list-webhooks.ts +++ b/src/models/operations/list-webhooks.ts @@ -16,7 +16,7 @@ export type ListWebhooksRequest = { page?: number | undefined; pageSize?: number | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/list-wordlists.ts b/src/models/operations/list-wordlists.ts index ed620c0..8772aa5 100644 --- a/src/models/operations/list-wordlists.ts +++ b/src/models/operations/list-wordlists.ts @@ -14,7 +14,7 @@ export type ListWordlistsRequest = { page?: number | undefined; pageSize?: number | undefined; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/remove-wordlist-words.ts b/src/models/operations/remove-wordlist-words.ts index b931f64..214481d 100644 --- a/src/models/operations/remove-wordlist-words.ts +++ b/src/models/operations/remove-wordlist-words.ts @@ -18,7 +18,7 @@ export type RemoveWordlistWordsRequest = { */ words: Array; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; }; diff --git a/src/models/operations/resolve-queue-item.ts b/src/models/operations/resolve-queue-item.ts index 0e35252..64f387a 100644 --- a/src/models/operations/resolve-queue-item.ts +++ b/src/models/operations/resolve-queue-item.ts @@ -8,27 +8,19 @@ import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; -export type ResolveQueueItemRequestBody = { - /** - * Optional comment - */ - comment?: string | undefined; -}; - export type ResolveQueueItemRequest = { /** - * The queue ID + * The queue ID. */ id: string; /** - * The item ID to resolve + * The item ID to resolve. */ itemId: string; /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; - body: ResolveQueueItemRequestBody; }; /** @@ -37,44 +29,16 @@ export type ResolveQueueItemRequest = { export type ResolveQueueItemResponse = { success: boolean; /** - * Timestamp when the item was resolved + * When the item was resolved (ISO 8601). */ resolvedAt: string; - /** - * Optional comment - */ - comment?: string | undefined; -}; - -/** @internal */ -export type ResolveQueueItemRequestBody$Outbound = { - comment?: string | undefined; }; -/** @internal */ -export const ResolveQueueItemRequestBody$outboundSchema: z.ZodMiniType< - ResolveQueueItemRequestBody$Outbound, - ResolveQueueItemRequestBody -> = z.object({ - comment: z.optional(z.string()), -}); - -export function resolveQueueItemRequestBodyToJSON( - resolveQueueItemRequestBody: ResolveQueueItemRequestBody, -): string { - return JSON.stringify( - ResolveQueueItemRequestBody$outboundSchema.parse( - resolveQueueItemRequestBody, - ), - ); -} - /** @internal */ export type ResolveQueueItemRequest$Outbound = { id: string; itemId: string; projectId?: string | undefined; - body: ResolveQueueItemRequestBody$Outbound; }; /** @internal */ @@ -85,7 +49,6 @@ export const ResolveQueueItemRequest$outboundSchema: z.ZodMiniType< id: z.string(), itemId: z.string(), projectId: z.optional(z.string()), - body: z.lazy(() => ResolveQueueItemRequestBody$outboundSchema), }); export function resolveQueueItemRequestToJSON( @@ -103,7 +66,6 @@ export const ResolveQueueItemResponse$inboundSchema: z.ZodMiniType< > = z.object({ success: types.boolean(), resolvedAt: types.string(), - comment: types.optional(types.string()), }); export function resolveQueueItemResponseFromJSON( diff --git a/src/models/operations/resolve-queue-items.ts b/src/models/operations/resolve-queue-items.ts new file mode 100644 index 0000000..afa2327 --- /dev/null +++ b/src/models/operations/resolve-queue-items.ts @@ -0,0 +1,109 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +export type ResolveQueueItemsRequestBody = { + /** + * The item IDs to resolve. Up to 100. + */ + itemIds: Array; +}; + +export type ResolveQueueItemsRequest = { + /** + * The queue ID. + */ + id: string; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; + body: ResolveQueueItemsRequestBody; +}; + +/** + * Successful response + */ +export type ResolveQueueItemsResponse = { + /** + * Number of items resolved. + */ + resolved: number; + /** + * Item IDs that do not exist in the project. + */ + notFoundIds: Array; +}; + +/** @internal */ +export type ResolveQueueItemsRequestBody$Outbound = { + itemIds: Array; +}; + +/** @internal */ +export const ResolveQueueItemsRequestBody$outboundSchema: z.ZodMiniType< + ResolveQueueItemsRequestBody$Outbound, + ResolveQueueItemsRequestBody +> = z.object({ + itemIds: z.array(z.string()), +}); + +export function resolveQueueItemsRequestBodyToJSON( + resolveQueueItemsRequestBody: ResolveQueueItemsRequestBody, +): string { + return JSON.stringify( + ResolveQueueItemsRequestBody$outboundSchema.parse( + resolveQueueItemsRequestBody, + ), + ); +} + +/** @internal */ +export type ResolveQueueItemsRequest$Outbound = { + id: string; + projectId?: string | undefined; + body: ResolveQueueItemsRequestBody$Outbound; +}; + +/** @internal */ +export const ResolveQueueItemsRequest$outboundSchema: z.ZodMiniType< + ResolveQueueItemsRequest$Outbound, + ResolveQueueItemsRequest +> = z.object({ + id: z.string(), + projectId: z.optional(z.string()), + body: z.lazy(() => ResolveQueueItemsRequestBody$outboundSchema), +}); + +export function resolveQueueItemsRequestToJSON( + resolveQueueItemsRequest: ResolveQueueItemsRequest, +): string { + return JSON.stringify( + ResolveQueueItemsRequest$outboundSchema.parse(resolveQueueItemsRequest), + ); +} + +/** @internal */ +export const ResolveQueueItemsResponse$inboundSchema: z.ZodMiniType< + ResolveQueueItemsResponse, + unknown +> = z.object({ + resolved: types.number(), + notFoundIds: z.array(types.string()), +}); + +export function resolveQueueItemsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ResolveQueueItemsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ResolveQueueItemsResponse' from JSON`, + ); +} diff --git a/src/models/operations/submit-content.ts b/src/models/operations/submit-content.ts index 4694232..eec194c 100644 --- a/src/models/operations/submit-content.ts +++ b/src/models/operations/submit-content.ts @@ -579,7 +579,7 @@ export type SubmitContentRequestBody = { */ clientAction?: ClientAction | undefined; /** - * Do not store the content. The content won't enter the review queue + * 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. */ doNotStore?: boolean | undefined; /** @@ -633,7 +633,7 @@ export type SubmitContentRequestBody = { export type SubmitContentRequest = { /** - * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. */ projectId?: string | undefined; body: SubmitContentRequestBody; @@ -771,7 +771,7 @@ export type TrustLevel = { manual: boolean; }; -export type Author = { +export type SubmitContentAuthor = { /** * Author ID in Moderation API */ @@ -820,7 +820,7 @@ export type Evaluation = { /** * The action to take based on the recommendation */ -export const SubmitContentRecommendationAction = { +export const ActionResponse = { Review: "review", Allow: "allow", Reject: "reject", @@ -828,9 +828,7 @@ export const SubmitContentRecommendationAction = { /** * The action to take based on the recommendation */ -export type SubmitContentRecommendationAction = OpenEnum< - typeof SubmitContentRecommendationAction ->; +export type ActionResponse = OpenEnum; export const ReasonCodeEnum = { SeverityReject: "severity_reject", @@ -861,7 +859,7 @@ export type Recommendation = { /** * The action to take based on the recommendation */ - action: SubmitContentRecommendationAction; + action: ActionResponse; /** * 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. */ @@ -972,7 +970,7 @@ export type EntityMatcherOutput = { matches: Array; }; -export type SubmitContentLabel = { +export type Label = { id: string; probability: number; flagged: boolean; @@ -994,7 +992,7 @@ export type ClassifierOutput = { * The keys of the flagged fields if submitting an object. */ flaggedFields?: Array | undefined; - labels?: Array | undefined; + labels?: Array