{"openapi":"3.1.0","info":{"title":"Lasso Moderation API","version":"1.0","description":"API for Lasso's content moderation platform. To generate an API token, please go\nto https://app.lassomoderation.com/settings.\n\n## Rate limiting\nEvery endpoint has a default rate limit, listed in the endpoint's description. Rate limits can be\nadjusted per workspace — reach out if you need higher limits. Every response includes the current\nrate limit state in the `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`\nheaders. When the limit is exceeded the API responds with `429 Too Many Requests`.\n\n## Errors\nErrors are returned as JSON with `success: false` and an `error` field. For validation errors the\n`error` field is an object with a message per invalid field; otherwise it is a string.","contact":{"name":"Ruud Visser","email":"info@lassomoderation.com","url":"https://www.lassomoderation.com"},"termsOfService":"https://www.lassomoderation.com/terms-conditions/"},"servers":[{"url":"https://api.lassomoderation.com/api/v1","description":"Lasso Moderation API V1"}],"paths":{"/content":{"post":{"summary":"Add or update content","operationId":"post-content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Add or update content to the platform. The content is ingested asynchronously; use the\nwebhooks or the get content status endpoint to get the moderation result.\n\nDefault rate limit: 300 requests per minute (free workspaces: 1000 pieces of content per week).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentInput"},"examples":{"Example 1":{"value":{"content_id":"clpmqe04600g7sarrxxg0mbjo","created_at":"2022-07-21T18:12:39.000Z","text":"This is the content of the message 🎉","image_urls":["https://example.com/image.png"],"video_urls":["https://example.com/video.mov"],"audio_urls":["https://example.com/audio.mp3"],"pdf_urls":["https://example.com/document.pdf"],"metadata":{"likes":8},"parent_content_id":"clpwuqoxi0001saas891t1jn7","user":{"id":"clpmqe04k00grsarr9jqdq1mq","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","profile_image_url":"https://www.example.com/profile/image.png","metadata":{"tag_line":"I am a person of mystery...","connections":8}},"category":{"id":"clpmr76lz00icsarraeb9334v","name":"Mobile Chat"},"subcategory":{"id":"clczbfbhh0000sa90h45xv3cg","name":"General Channel","created_by_user_id":"clg3k5ypi000gsad0v1znilap","metadata":{"description":"This channel is used for general communication"}}}}}}},"description":"User, subcategory \u0026 category will be automatically created in Lasso if they don't exist yet."},"tags":["Content"]}},"/content/sync":{"post":{"summary":"Synchronously add or update content","operationId":"post-content-sync","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"status":{"$ref":"#/components/schemas/Status","description":"Note: This is not set when the request times out"},"timeout":{"type":"boolean","description":"Only set when the synchronous request times out.\nIn this case use the content status to poll the status of the content."},"actions":{"type":"array","description":"Note: This is not set when the request times out","items":{"$ref":"#/components/schemas/Action"}}}},"examples":{"Example 1":{"value":{"success":true,"status":"flagged","actions":[{"action_id":"clyimre7x001sei5oaa3k8wmn","action_created_at":"2024-07-12T11:44:26.300Z","action_type":"ChangeStatus","status":"flagged","previous_status":null,"rule_id":"clesjpsib0001ukkq5e62gwnw","content":{"id":"5065614664","created_at":"2024-07-12T11:44:25.500Z","category_id":"chat","subcategory_id":"chat-community","user_id":"therese","tags":["another-tag"]},"type":"content","policy_id":"other","policy_name":"Other"}]}},"Timeout":{"value":{"success":true,"timeout":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Add or update content to the platform synchronously. Only use this for low volume use-cases.\nFor high availability and higher rate limits use the async /content endpoint.\n\nThe request waits for the moderation rules to run and returns the resulting status and actions.\nWhen the moderation result is not available within 15 seconds the request returns\n`timeout: true`; in that case poll the get content status endpoint for the result.\nIngesting videos synchronously is not supported — use the async /content endpoint for videos.\n\nDefault rate limit: 120 requests per minute (free workspaces: 1000 pieces of content per week).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentInput"},"examples":{"Example 1":{"value":{"content_id":"clpmqe04600g7sarrxxg0mbjo","created_at":"2022-07-21T18:12:39.000Z","text":"This is the content of the message 🎉","image_urls":["https://example.com/image.png"],"video_urls":["https://example.com/video.mov"],"audio_urls":["https://example.com/audio.mp3"],"metadata":{"likes":8},"parent_content_id":"clpwuqoxi0001saas891t1jn7","user":{"id":"clpmqe04k00grsarr9jqdq1mq","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","profile_image_url":"https://www.example.com/profile/image.png","metadata":{"tag_line":"I am a person of mystery...","connections":8}},"category":{"id":"clpmr76lz00icsarraeb9334v","name":"Mobile Chat"},"subcategory":{"id":"clczbfbhh0000sa90h45xv3cg","name":"General Channel","created_by_user_id":"clg3k5ypi000gsad0v1znilap","metadata":{"description":"This channel is used for general communication"}}}}}}},"description":"User, subcategory \u0026 category will be automatically created in Lasso if they don't exist yet."},"tags":["Content"]}},"/import/content":{"post":{"summary":"Import content","operationId":"post-import-content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Import up to 1000 pieces of content into Lasso per request.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["contents"],"properties":{"contents":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/ContentInput"}}}},"examples":{"Example 1":{"value":{"contents":[{"content_id":"clpmqe04600g7sarrxxg0mbjo","created_at":"2022-07-21T18:12:39.000Z","text":"This is the content of the message 🎉","image_urls":["https://example.com/image.png"],"video_urls":["https://example.com/video.mov"],"audio_urls":["https://example.com/audio.mp3"],"metadata":{"likes":8},"parent_content_id":"clpwuqoxi0001saas891t1jn7","user":{"id":"clpmqe04e00gjsarrtctnyr7d","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","profile_image_url":"https://www.example.com/profile/image.png","metadata":{"tag_line":"I am a person of mystery...","connections":8}},"category":{"id":"clpmqe03y00ftsarr9hwvsf1x","name":"Mobile Chat"},"subcategory":{"id":"clpmqe03y00fvsarrqv084d4x","name":"General Channel","created_by_user_id":"clg3k5ypi000gsad0v1znilap","metadata":{"description":"This channel is used for general communication"}}}]}}}}}},"tags":["Content"]}},"/user":{"post":{"summary":"Add or update a user","operationId":"post-user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Add or update a user. The user is ingested asynchronously.\n\nDefault rate limit: 300 requests per minute (free workspaces: 1000 users per week).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"]},"examples":{"Example 1":{"value":{"user":{"id":"clczbfbhh0000sa90h45xv3cg","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","profile_image_url":"https://www.example.com/profile/image.png","tags":["suspicious-user"],"metadata":{"tag_line":"I am a person of mystery...","connections":8}}}}}}}},"tags":["Users"]}},"/import/users":{"post":{"summary":"Import users","operationId":"post-import-users","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Import up to 1000 users into Lasso per request.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/User"}}},"required":["users"]},"examples":{"Example 1":{"value":{"users":[{"id":"clczbfbhh0000sa90h45xv3cg","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","profile_image_url":"https://www.example.com/profile/image.png","tags":["suspicious-user"],"metadata":{"tag_line":"I am a person of mystery...","connections":8}}]}}}}}},"tags":["Users"]}},"/status":{"put":{"summary":"Update status","operationId":"update-status","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Update the status of content, users or subcategories. This endpoint should only be\nused if you have actions that change the object's status. Call this endpoint if you want to sync\nthe status of the object(s) with Lasso.\n\nIDs that don't exist in Lasso are silently ignored. Updating the status of content that already\nhas a newer version returns a 400 error.\n\nDefault rate limit: 300 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"moderator_email":{"type":"string","format":"email","example":"moderator@example.com"},"content_ids":{"type":"array","items":{"type":"string","maxLength":100}},"subcategory_ids":{"type":"array","items":{"type":"string","maxLength":100}},"user_ids":{"type":"array","items":{"type":"string","maxLength":100}},"temporary":{"type":"object","additionalProperties":false,"description":"Can be used when temporarily hiding/banning a user. To ban a user for 2 weeks, set `ban_duration` to `2` and the `ban_duration_period` to `week`. Only applied when setting users to `hidden`.","properties":{"ban_duration":{"type":"number"},"ban_duration_period":{"type":"string","enum":["hour","day","week"]}}},"policy_id":{"type":"string","description":"The id of the policy that is used for the status change"},"category_id":{"type":"string","description":"Required when updating subcategories"}}},"examples":{"Example 1":{"value":{"status":"hidden","moderator_email":"moderator@example.com","content_ids":["clemwm8ix0007sa8stctcndvj"]}},"Example 2":{"value":{"status":"allowed","user_ids":["cleslnvoo0006ukjygou5r4r6"],"content_ids":["clf43i7hw00nusax3u298ucmu","clf43i6v600ltsax3mjdko2r1"]}},"Temporary ban":{"value":{"status":"hidden","user_ids":["cleslnvoo0006ukjygou5r4r6"],"policy_id":"harassment","temporary":{"ban_duration":2,"ban_duration_period":"week"}}}}}},"description":"Send status updates in bulk by sending a list of IDs, or send a single ID in a list.\nOptionally, you can send the email of a moderator if you want to attribute the action to this moderator. Otherwise, it will by default attribute it to the API bot."},"tags":["Moderation"]}},"/user/publish":{"put":{"summary":"Publish user","operationId":"publish-user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"description":"Returned when the user is already published, or when the request is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"User already published"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Mark the user as published. Use this for users that were created with `published_at: null`.\n\nDefault rate limit: 300 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user_id","published_at"],"properties":{"user_id":{"type":"string","maxLength":100},"published_at":{"$ref":"#/components/schemas/Date","description":"The date the user was published"}}},"examples":{"Example 1":{"value":{"user_id":"clemwm8ix0007sa8stctcndvj","published_at":"2022-07-21T18:12:39.000Z"}}}}},"description":"Mark a user as published."},"tags":["Users"]}},"/content/publish":{"put":{"summary":"Publish content","operationId":"publish-content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"description":"Returned when the content is already published, or when the request is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Content already published"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the content is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Content not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Mark content as published. Use this for content that was created with `published_at: null`.\n\nDefault rate limit: 300 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["content_id","published_at"],"properties":{"content_id":{"type":"string","maxLength":100},"published_at":{"$ref":"#/components/schemas/Date","description":"The date the content was published"}}},"examples":{"Example 1":{"value":{"content_id":"clemwm8ix0007sa8stctcndvj","published_at":"2022-07-21T18:12:39.000Z"}}}}},"description":"Mark content as published."},"tags":["Content"]}},"/content/metadata":{"put":{"summary":"Update content metadata","operationId":"metadata-content","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","metadata"],"properties":{"success":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"examples":{"Example 1":{"value":{"success":true,"metadata":{"likes":12,"replies":4}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the content is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Content not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Update the metadata of content without creating a new version of the content.\nThe metadata is merged with the content's existing metadata; setting a key to `null` removes\nit. The response returns the content's full metadata after the update.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["content_id","metadata"],"properties":{"content_id":{"type":"string","maxLength":100},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"examples":{"Example 1":{"value":{"content_id":"clemwm8ix0007sa8stctcndvj","metadata":{"likes":12,"replies":4}}}}}},"description":"Update the metadata of content without creating a new version of the content"},"tags":["Content"]}},"/status/{contentId}":{"parameters":[{"schema":{"type":"string"},"name":"contentId","in":"path","required":true,"description":"The id of the content (the content_id you sent when ingesting it)"}],"get":{"summary":"Get content status","tags":["Moderation"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","status","actions"],"properties":{"success":{"type":"boolean"},"status":{"oneOf":[{"$ref":"#/components/schemas/Status"},{"type":"null"}],"description":"The status of the content. `null` when the moderation rules have not run against the content yet."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}}}},"examples":{"Example 1":{"value":{"success":true,"status":"flagged","actions":[{"action_id":"clyhfrweo0002wx1z402kp4id","action_created_at":"2024-07-11T15:41:06.383Z","action_type":"ChangeStatus","status":"flagged","previous_status":null,"rule_id":"clesjpsib0001ukkq5e62gwnw","content":{"id":"1188620289","created_at":"2024-07-11T15:41:06.027Z","category_id":"chat","subcategory_id":"chat-community","user_id":"9876545634","tags":["another-tag"]},"type":"content","policy_id":"other","policy_name":"Other"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the content is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Content not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"operationId":"get-status-content","description":"Get the status and the actions taken upon a piece of content.\nWhen the status is `null` this means that we have not yet run the moderation rules against the content.\n\nDefault rate limit: 300 requests per minute."}},"/subcategory":{"put":{"summary":"Update subcategory","operationId":"update-subcategory","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Update the name and other metadata of a subcategory. The subcategory (and category) is created\nif it does not exist yet.\n\nDefault rate limit: 120 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["category_id","subcategory"],"properties":{"category_id":{"type":"string","description":"The ID of the category the subcategory is part of"},"subcategory":{"$ref":"#/components/schemas/Subcategory"}}},"examples":{"Example 1":{"value":{"category_id":"some-category-id","subcategory":{"id":"some-subcategory-id","name":"Updated subcategory name","metadata":{"total_users":12}}}}}}}},"tags":["Categories"]}},"/category":{"put":{"summary":"Update category","operationId":"update-category","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Update the name of a category. The category is created if it does not exist yet.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"$ref":"#/components/schemas/Category"}}},"examples":{"Example 1":{"value":{"category":{"id":"some-category-id","name":"Updated category name"}}}}}}},"tags":["Categories"]}},"/lists":{"post":{"summary":"Create list","operationId":"create-list","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"listId":{"type":"string"}}},"examples":{"Example 1":{"value":{"success":true,"listId":"clp765qpz06r0saam8dv1p6uh"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Create a new list. The number of lists a workspace can have depends on its plan; a 400 error\nis returned when the plan limit is reached.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ListType"}},"required":["name","type"]},"examples":{"Example 1":{"value":{"name":"Bad word list","type":"strings"}}}}}},"tags":["Lists"]},"get":{"summary":"List lists","operationId":"get-lists","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lists":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","properties":{"items":{"type":"number","description":"The number of items in the list"}}}]}}}},"examples":{"Example 1":{"value":{"success":true,"lists":[{"id":"clp72q7pv06pqsaamyeqn1bb8","createdAt":"2023-11-20T15:40:49.940Z","name":"Bad words","type":"strings","items":23},{"id":"clp72pz7f06plsaamj7vv3iq9","createdAt":"2023-11-20T15:40:38.873Z","name":"Allowed domains","type":"urls","items":10},{"id":"clfha90p90000sa0lwso8ehub","createdAt":"2023-03-20T20:32:03.021Z","name":"Banned countries","type":"locations","items":3}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"List all lists.\n\nDefault rate limit: 60 requests per minute.","tags":["Lists"]}},"/lists/{listId}":{"parameters":[{"schema":{"type":"string"},"name":"listId","in":"path","required":true,"description":"The id of the list"}],"get":{"summary":"Get list items","operationId":"get-lists-items","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"list":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","properties":{"items":{"type":"array","description":"The items in the list","items":{"type":"string"}}}}]}}},"examples":{"Example 1":{"value":{"success":true,"list":{"id":"clf3twurb0005sas3keq74fqp","createdAt":"2023-03-11T10:33:41.304Z","name":"Bad words","type":"strings","items":["shut up","f*ck"]}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the list is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"List not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Get all items in a list.\n\nDefault rate limit: 60 requests per minute.","tags":["Lists"]},"post":{"summary":"Add list items","operationId":"add-list-items","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"addedItems":{"type":"array","items":{"type":"string"}}}},"examples":{"Example 1":{"value":{"success":true,"addedItems":["bad word","another bad word"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the list is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"List not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Add new items to a list. The response returns the items that were newly added (items that were\nalready in the list are not returned).\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]},"examples":{"Example 1":{"value":{"items":["Bad word","other bad word"]}}}}}},"tags":["Lists"]},"delete":{"summary":"Delete list items","operationId":"delete-lists-items","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deletedItems":{"type":"array","items":{"type":"string"}}}},"examples":{"Example 1":{"value":{"success":true,"deletedItems":["bad word"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the list is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"List not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Delete items from a list. The response returns the items that were deleted.\n\nDefault rate limit: 60 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]},"examples":{"Example 1":{"value":{"items":["Bad word"]}}}}}},"tags":["Lists"]}},"/user-reports":{"get":{"summary":"Get report policy options","tags":["Reporting"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["policies"],"properties":{"success":{"type":"boolean"},"policies":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","example":"rude_gestures"},"name":{"type":"string","example":"Rude Gestures"},"description":{"type":"string"},"translations":{"type":"object","description":"Translated names and descriptions, keyed by language code (e.g. `en`, `nl`, `fr`). Only returned when the languages feature is enabled for your workspace.","properties":{"name":{"type":"object","description":"Translated policy names keyed by language code","additionalProperties":{"type":"string"}},"description":{"type":"object","description":"Translated policy descriptions keyed by language code","additionalProperties":{"type":"string"}}}}}}}}},"examples":{"Example 1":{"value":{"success":true,"policies":[{"id":"rude_gestures","name":"Rude Gestures","description":"Images containing rude gestures","translations":{"name":{"en":"Rude Gestures","nl":"Onbeschofte gebaren"},"description":{"en":"Images containing rude gestures","nl":"Afbeeldingen met onbeschofte gebaren"}}},{"id":"other","name":"Other"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"operationId":"get-reports","description":"Get all the possible policy options that a user can select when making a user report.\n\nDefault rate limit: 100 requests per minute."},"post":{"summary":"Create report","tags":["Reporting"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"description":"Returned when the request is invalid, e.g. the policy is not found, or both a user_id and a content_id were provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Policy not found"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the reported content is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Reported Content not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"operationId":"post-reports","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["report"],"properties":{"report":{"type":"object","required":["policy_id"],"properties":{"reported_by_id":{"type":"string","maxLength":100,"example":"some_user_id","description":"The id of the user who makes the report. Specify exactly one of reported_by_id and reported_by, not both."},"reported_by":{"type":"object","description":"The user who makes the report. Specify exactly one of reported_by_id and reported_by, not both. These fields are only applied when the reporter does not exist in Lasso yet — an existing user is never updated through this endpoint (use the user API for that).","required":["id"],"properties":{"id":{"type":"string","maxLength":100},"name":{"type":"string","maxLength":100},"email":{"type":"string","maxLength":100},"email_domain":{"type":"string","maxLength":100,"description":"The email domain of the reporter. So \"user@example.com\" would be \"example.com\""},"phone_number":{"type":"string","maxLength":100},"country_code":{"type":"string","minLength":2,"maxLength":2,"description":"Two letter code according to the https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 standard"},"ip_address":{"type":"string","maxLength":100},"profile_image_url":{"type":"string","format":"uri","maxLength":1400},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"reported_by_type":{"type":"string","enum":["normal","admin","moderator","trusted","testing","state_actor"],"example":"normal","description":"You can specify if the report was made by a normal user, admin, moderator, test user, trusted user or state actor. The \"state_actor\" type requires the DSA compliance feature."},"reported_by_entity":{"type":"string","minLength":1,"maxLength":255,"example":"Trusted Flagger Organisation","description":"The name of the entity on whose behalf the report is made, e.g. a trusted flagger organisation (optional)"},"user_id":{"type":"string","maxLength":100,"description":"The id of the user who is reported. Specify either a user_id or a content_id, not both.","example":"some_user_id"},"content_id":{"type":"string","maxLength":100,"example":"some_content_id","description":"The id of the content that is being reported. Specify either a user_id or a content_id, not both."},"policy_id":{"type":"string","description":"The id of the policy that the user specifies","example":"other"},"extra_info":{"type":"string","example":"Some explanation from the user why it is reported"}}}}},"examples":{"Example 1":{"value":{"report":{"reported_by":{"id":"device-8f3a2c","name":"PixelPirate","email":"reporter@example.com","country_code":"NL","ip_address":"203.0.113.42","metadata":{"app_version":"4.2.1"}},"reported_by_type":"normal","user_id":"some_user_id","content_id":"some_content_id","policy_id":"other","extra_info":"Some explanation from the user why it is reported"}}}}}},"description":"Make a report about a user or piece of content."},"description":"This endpoint should be called when a user on your product reports another user or\npiece of content.\n\nDefault rate limit: 100 requests per minute."}},"/user/delete":{"post":{"summary":"Delete user","operationId":"delete-user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"examples":{"Example 1":{"value":{"success":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the user is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"User not found"}}}}}},"409":{"description":"Returned when the user is on legal hold and cannot be deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Delete all information from a specific user. This endpoint should be used in case a\nuser would like to delete all their information from your and our systems (e.g. GDPR).\n\nDefault rate limit: 100 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","maxLength":100,"description":"The id of the user you would like to delete"},"reason":{"type":"string","description":"In case you want to give it a reason. e.g. GDPR request"}},"required":["user_id"]},"examples":{"Example 1":{"value":{"user_id":"clczbfbhh0000sa90h45xv3cg","reason":"GDPR Deletion Request"}}}}}},"tags":["Users"]}},"/user/delete-batch":{"post":{"summary":"Delete users in batch","operationId":"delete-user-batch","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","queued"],"properties":{"success":{"type":"boolean"},"queued":{"type":"integer","description":"The number of unique users queued for deletion"}}},"examples":{"Example 1":{"value":{"success":true,"queued":2}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"Returned when one or more of the users are on legal hold and cannot be deleted. No users are deleted in that case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Delete all information from up to 1000 users in batch. This endpoint should be used\nin case a user would like to delete all their information from your and our systems (e.g. GDPR).\nDeletions are processed asynchronously; duplicate ids are deduplicated.\n\nDefault rate limit: 20 requests per minute.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user_ids"],"properties":{"user_ids":{"type":"array","minItems":1,"maxItems":1000,"description":"The ids of the user you would like to delete","items":{"type":"string","maxLength":100}},"reason":{"type":"string","description":"In case you want to give it a reason. e.g. GDPR request"}}},"examples":{"Example 1":{"value":{"user_ids":["clczbfbhh0000sa90h45xv3cg","clx0bg0g9000yu4zvb7e7o36t"],"reason":"GDPR Deletion Request"}}}}}},"tags":["Users"]}},"/user/{userId}":{"parameters":[{"schema":{"type":"string"},"name":"userId","in":"path","required":true,"description":"The id of the user (the user id you sent when ingesting them)"}],"get":{"summary":"Get user","tags":["Users"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","user"],"properties":{"success":{"type":"boolean"},"user":{"type":"object","required":["id","created_at"],"properties":{"id":{"type":"string"},"created_at":{"$ref":"#/components/schemas/Date"},"name":{"type":"string"},"profile_image_url":{"type":"string"},"email":{"type":"string"},"email_domain":{"type":"string"},"country_code":{"type":"string"},"signup_method":{"type":"string"},"ip_address":{"type":"string"},"status":{"$ref":"#/components/schemas/Status"},"type":{"type":"string","enum":["normal","moderator","admin","trusted","testing","state_actor"]},"temporarily_banned_until":{"$ref":"#/components/schemas/Date","description":"Only set when the user is temporarily banned"},"strike_until":{"$ref":"#/components/schemas/Date","description":"Only set when the user currently has a strike"},"last_accepted_profile_name":{"description":"The last profile name that was accepted by Lasso.","type":"string"},"last_accepted_profile_image":{"type":"string","description":"The last profile image that was accepted by Lasso"},"metadata":{"oneOf":[{"$ref":"#/components/schemas/Metadata"},{"type":"null"}],"description":"The metadata of the user, `null` when no metadata is set"},"tags":{"type":"array","description":"The identifiers of the tags set on the user","items":{"type":"string"}},"published_at":{"type":["string","null"],"format":"date-time","description":"The date the user was published, `null` when the user is not published yet"}}}}},"examples":{"Example 1":{"value":{"success":true,"user":{"id":"user_api_test","created_at":"2024-03-05T14:02:02.236Z","name":"Fred","profile_image_url":"https://i.pravatar.cc/180?u=2user_api_test","email":"fred@privaterelay.appleid.com","email_domain":"privaterelay.appleid.com","country_code":"NL","signup_method":"apple","status":"hidden","type":"normal","strike_until":"2024-03-05T15:19:12.522Z","last_accepted_profile_name":"Fred","metadata":{"connections":8},"tags":["suspicious-user"],"published_at":"2024-03-05T14:02:02.236Z"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Returned when the user is not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"User not found"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}},"operationId":"get-user","description":"Get information about a user.\n\nDefault rate limit: 120 requests per minute."}}},"components":{"schemas":{"Action":{"title":"Action","type":"object","description":"An action that was taken on an object (e.g. a status change), in the same format as webhook action payloads.","required":["action_id","action_created_at","action_type","type"],"properties":{"action_id":{"type":"string"},"action_created_at":{"$ref":"#/components/schemas/Date"},"action_type":{"type":"string"},"type":{"type":"string"},"tags_added":{"type":"array","items":{"type":"string"}},"rule_id":{"type":"string"},"actor_id":{"type":"string"},"content":{"type":"object","required":["id","created_at","category_id","subcategory_id","user_id","tags"],"properties":{"id":{"type":"string"},"created_at":{"$ref":"#/components/schemas/Date"},"category_id":{"type":"string"},"subcategory_id":{"type":"string"},"user_id":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"status":{"$ref":"#/components/schemas/Status"},"previous_status":{"oneOf":[{"$ref":"#/components/schemas/Status"},{"type":"null"}],"description":"The status the object had before this action. `null` when the object had no status yet."},"policy_id":{"type":"string"},"policy_name":{"type":"string"}}},"Category":{"type":"object","description":"Model for a category that content can be part of. If the category does not yet exist in Lasso it will be created.","examples":[{"id":"clczbfbhh0000sa90h45xv3cg","name":"Mobile Chat"}],"title":"Category","properties":{"id":{"type":"string","maxLength":100,"example":"clczbfbhh0000sa90h45xv3cg"},"name":{"type":"string","maxLength":100,"example":"Mobile Chat"}},"required":["id","name"]},"ContentInput":{"title":"Content","type":"object","description":"A piece of content (e.g. a chat message, comment or post) to be moderated by Lasso. Content must contain at least one of `text`, `image_urls`, `video_urls`, `audio_urls` or `pdf_urls`.","required":["content_id","category","subcategory","user"],"properties":{"content_id":{"type":"string","maxLength":100},"parent_content_id":{"type":"string","maxLength":100,"description":"Set this if this is a reply to another comment/chat message"},"created_at":{"$ref":"#/components/schemas/Date"},"category":{"$ref":"#/components/schemas/Category"},"subcategory":{"$ref":"#/components/schemas/Subcategory"},"user":{"$ref":"#/components/schemas/User"},"text":{"type":"string","maxLength":4000},"image_urls":{"type":"array","maxItems":10,"items":{"type":"string","format":"uri","maxLength":1400}},"video_urls":{"type":"array","maxItems":5,"items":{"type":"string","format":"uri","maxLength":1400}},"audio_urls":{"type":"array","maxItems":5,"items":{"type":"string","format":"uri","maxLength":1400}},"pdf_urls":{"type":"array","maxItems":5,"items":{"type":"string","format":"uri","maxLength":1400}},"metadata":{"$ref":"#/components/schemas/Metadata"},"status":{"$ref":"#/components/schemas/Status","description":"Optional status to set the initial status of the content. This status will only be set when creating the content, not when it is updated. Use the update status API for this."},"published_at":{"$ref":"#/components/schemas/PublishedAt"}}},"Date":{"title":"Date","type":"string","format":"date-time","example":"2022-07-21T18:12:39.000Z","description":"ISO Date e.g. 2022-07-21T18:12:39.000Z\nhttps://en.wikipedia.org/wiki/ISO_8601","examples":["2022-07-21T18:12:39.000Z"]},"ErrorResponse":{"title":"Error","type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","example":false},"error":{"description":"A message describing the error. For validation errors this is an object with an error message per field.","oneOf":[{"type":"string"},{"type":"object"}]}}},"List":{"title":"List","type":"object","description":"A list (words, URLs, locations, ...) that can be used by moderation rules.","required":["id","createdAt","name","type"],"properties":{"id":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/Date"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ListType"}}},"ListType":{"title":"ListType","type":"string","description":"The type of items a list holds","example":"strings","enum":["strings","locations","phone_numbers","urls","ips","regexes"]},"Metadata":{"title":"Metadata","type":"object","description":"Extra free-form data about the object as key-value pairs. Values can be strings, numbers,\nbooleans, null, or an object with one more level of key-value pairs.\n- The metadata may be at most 4KB (4096 bytes) when serialized as JSON.\n- Keys are not allowed to contain `/`.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object"}]}},"PublishedAt":{"title":"PublishedAt","type":["string","null"],"format":"date-time","description":"(optional) ISO Date e.g. 2022-07-21T18:12:39.000Z https://en.wikipedia.org/wiki/ISO_8601\n\nThis field can be used to let Lasso know this object has not yet been published.\n- If the field is set to `null` the object is marked as not yet published.\n- If the field is set to a date, we use that date as the published date.\n- If the field is not specified, we assume the created at date as the published date.\n**Note**: this field can only be set when creating the object, use the publish endpoint to publish it."},"Status":{"title":"Status","type":"string","example":"hidden","description":"The status of an object","examples":["hidden"],"enum":["allowed","flagged","hidden"]},"Subcategory":{"type":"object","description":"Model for a subcategory that content can be part of. If the subcategory does not yet exist in Lasso it will be created.","examples":[{"id":"clczbfbhh0000sa90h45xv3cg","name":"General Channel","metadata":{"description":"This channel is used for general communication"},"created_by_user_id":"clg3k5ypi000gsad0v1znilap","image_url":"https://www.example.com/channel_image.png"}],"title":"Subcategory","properties":{"id":{"type":"string","maxLength":100,"example":"clczbfbhh0000sa90h45xv3cg"},"name":{"type":"string","maxLength":300,"example":"General Channel"},"created_by_user_id":{"type":"string","maxLength":100,"description":"The ID of the user that created this subcategory"},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Extra information about the subcategory"},"image_url":{"type":"string","format":"uri","maxLength":1400},"status":{"$ref":"#/components/schemas/Status","description":"Optional status to set the initial status of the subcategory. Use the update status API to change it afterwards."}},"required":["id","name"]},"SuccessResponse":{"title":"Success","type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"User":{"type":"object","examples":[{"id":"clczbfbhh0000sa90h45xv3cg","created_at":"2022-07-21T18:12:39.000Z","name":"John Doe","email_domain":"gmail.com","signup_method":"google","country_code":"US","ip_address":"123.123.123.123","profile_image_url":"https://www.example.com/profile/image.png","tags":["suspicious-user"],"metadata":{"tag_line":"I am a person of mystery...","connections":8}}],"description":"Model for a user that you can send to Lasso. If the id of the user does not yet exist a new user will be made.","title":"User","required":["id"],"properties":{"id":{"type":"string","maxLength":100,"example":"clczbfbhh0000sa90h45xv3cg"},"name":{"type":"string","maxLength":100},"created_at":{"$ref":"#/components/schemas/Date"},"email_domain":{"type":"string","maxLength":100,"example":"gmail.com","description":"The email domain of your user. So \"user@example.com\" would be \"example.com\""},"email":{"type":"string","maxLength":100},"phone_number":{"type":"string","maxLength":100},"country_code":{"type":"string","minLength":2,"maxLength":2,"description":"Two letter code according to the https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 standard"},"ip_address":{"type":"string","maxLength":100,"description":"The IP address of the user"},"profile_image_url":{"type":"string","format":"uri","maxLength":1400,"example":"https://www.example.com/profile/image.png"},"signup_method":{"type":"string","maxLength":100,"example":"google","description":"The method the user has used to sign up on your platform. This can be email, google, facebook, apple, phone, twitter, or unknown."},"metadata":{"$ref":"#/components/schemas/Metadata"},"category_id":{"type":"string","maxLength":100,"description":"Set this if the user is only part of a specific category. Cannot be changed after the user is created."},"type":{"type":"string","enum":["normal","moderator","admin","trusted","testing","state_actor"],"default":"normal","description":"Specify what kind of user this is in your platform. By default this is a \"normal\" user. The \"state_actor\" type requires the DSA compliance feature."},"status":{"$ref":"#/components/schemas/Status","description":"Optional status to set the initial status of the user. This status is only applied when creating the user, not when it is updated. Use the update status API for this."},"tags":{"type":"array","maxItems":100,"description":"The identifiers of the tags. When tags is set, it will override all currently set tags on the user.","items":{"type":"string","maxLength":100}},"published_at":{"$ref":"#/components/schemas/PublishedAt"},"photo_id_urls":{"type":"array","maxItems":25,"description":"Photo IDs can be used to recognize this user's face in the content.","items":{"type":"string","format":"uri","maxLength":1400,"example":"https://www.example.com/profile/image.png"}}}}},"headers":{"X-RateLimit-Limit":{"description":"The rate limit interval in milliseconds","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current interval","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The number of milliseconds until requests are allowed again","schema":{"type":"integer"}}},"responses":{"BadRequest":{"description":"The request is invalid, see the error field for details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Validation error":{"value":{"success":false,"error":{"content_id":"Value can be at most 100 characters"}}}}}}},"Unauthorized":{"description":"The API token is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"Example 1":{"value":{"success":false,"error":"Invalid API key"}}}}}},"TooManyRequests":{"description":"The rate limit has been exceeded, check the X-RateLimit headers for limits","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"examples":{"Example 1":{"value":{"error":"Too many requests, check headers for limits"}}}}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API token, sent as `Authorization: Bearer \u003ctoken\u003e`. To generate a token go to https://app.lassomoderation.com/settings."}}},"security":[{"bearerAuth":[]}],"tags":[{"name":"Content","description":"Send, import and manage the content to be moderated.","x-page-icon":"comments"},{"name":"Users","description":"Manage the users on your platform.","x-page-icon":"users"},{"name":"Moderation","description":"Update and read moderation statuses.","x-page-icon":"shield-check"},{"name":"Categories","description":"Manage categories and subcategories.","x-page-icon":"folder-tree"},{"name":"Lists","description":"Manage the lists (words, URLs, locations) used by moderation rules.","x-page-icon":"list"},{"name":"Reporting","description":"Handle reports made by users on your platform.","x-page-icon":"flag"}]}