Synchronously add/update content

POST /content/sync

Add or update content to the platform synchronously. Only use this for low volume use-cases. For high availablity and higher rate limits use the async /content endpoint.

Headers

application/json

Body

User, subcategory & category will be automatically created in Lasso if they don't exist yet.

  • content_id string Required
  • parent_content_id string

    Set this if this is a reply to another comment/chat message

  • created_at string(date)

    ISO Date e.g. 2022-07-21T18:12:39.000Z https://en.wikipedia.org/wiki/ISO_8601

  • category object Required

    Model for a category that a message can be part of. If the category does not yet exist in Lasso it will be created.

    Hide category attributes Show category attributes object
    • id string Required
    • name string Required

      Maximum length is 100.

  • subcategory object Required

    Model for a subcategory that a message can be part of. If the subcategory does not yet exist in Lasso it will be created.

    Hide subcategory attributes Show subcategory attributes object
    • id string Required
    • name string Required

      Maximum length is 300.

    • created_by_user_id string

      The ID of the user that created this subcategory

    • metadata object

      Extra information about the subcategory

    • image_url string
  • user object Required

    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.

    Hide user attributes Show user attributes object
    • id string Required
    • name string
    • created_at string(date)

      ISO Date e.g. 2022-07-21T18:12:39.000Z https://en.wikipedia.org/wiki/ISO_8601

    • email_domain string

      The email domain of your user. So "user@example.com" would be "example.com"

    • email string
    • phone_number string
    • country_code string

      Two letter code according to the https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 standard

    • ip_address string

      The IP address of the user

    • profile_image_url string
    • signup_method string

      The method the user has used to sign up on your platform. This can be apple, facebook, google, email, password, or unknown.

    • metadata object
    • category_id string

      Set this if the user is only part of a specific category

    • type

      Specify what kind of user this is in your platform. By default this is a "normal" user

      Values are normal, moderator, admin, or trusted. Default value is normal.

    • status string

      The status of an object

      Values are allowed, flagged, or hidden.

    • tags array[string]

      The identifiers of the tags. When tags is set, it will override all currently set tags on the user.

  • text string

    Maximum length is 4000.

  • image_urls array[string]

    Maximum length of each is 600.

  • video_urls array[string]

    Maximum length of each is 600.

  • metadata object

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • success boolean Required
    • status string

      The status of an object

      Values are allowed, flagged, or hidden.

    • timeout boolean

      Only set when the synchronous request times out. In this case use the content status to poll the status of the content.

    • actions array[object]

      Note: This is not set when the request times out

      Hide actions attributes Show actions attributes object
      • action_id string Required
      • action_created_at string(date) Required

        ISO Date e.g. 2022-07-21T18:12:39.000Z https://en.wikipedia.org/wiki/ISO_8601

      • action_type string Required
      • type string Required
      • tags_added array[string]
      • rule_id string
      • actor_id string
      • content object
        Hide content attributes Show content attributes object
        • id string Required
        • created_at string(date) Required

          ISO Date e.g. 2022-07-21T18:12:39.000Z https://en.wikipedia.org/wiki/ISO_8601

        • category_id string Required
        • subcategory_id string Required
        • user_id string Required
        • tags array[string] Required
      • status string

        The status of an object

        Values are allowed, flagged, or hidden.

      • previous_status string

        The status of an object

        Values are allowed, flagged, or hidden.

      • policy_id string
      • policy_name string
POST /content/sync
curl \
 --request POST 'https://api.lassomoderation.com/api/v1/content/sync' \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer lasso.a35afd...a6ea" \
 --data '{"text":"This is the content of the message 🎉","user":{"id":"clpmqe04k00grsarr9jqdq1mq","name":"John Doe","metadata":{"tag_line":"I am a person of mystery...","connections":8},"created_at":"2022-07-21T18:12:39.000Z","country_code":"US","email_domain":"gmail.com","signup_method":"google","profile_image_url":"https://www.example.com/profile/image.png"},"category":{"id":"clpmr76lz00icsarraeb9334v","name":"Mobile Chat"},"metadata":{"likes":8},"content_id":"clpmqe04600g7sarrxxg0mbjo","created_at":"2022-07-21T18:12:39.000Z","image_urls":["https://example.com/image.png"],"video_urls":["https://example.com/video.mov"],"subcategory":{"id":"clczbfbhh0000sa90h45xv3cg","name":"General Channel","metadata":{"description":"This channel is used for general communication"},"createdByUserId":"clg3k5ypi000gsad0v1znilap"},"parent_content_id":"clpwuqoxi0001saas891t1jn7"}'
Request example
{
  "text": "This is the content of the message 🎉",
  "user": {
    "id": "clpmqe04k00grsarr9jqdq1mq",
    "name": "John Doe",
    "metadata": {
      "tag_line": "I am a person of mystery...",
      "connections": 8
    },
    "created_at": "2022-07-21T18:12:39.000Z",
    "country_code": "US",
    "email_domain": "gmail.com",
    "signup_method": "google",
    "profile_image_url": "https://www.example.com/profile/image.png"
  },
  "category": {
    "id": "clpmr76lz00icsarraeb9334v",
    "name": "Mobile Chat"
  },
  "metadata": {
    "likes": 8
  },
  "content_id": "clpmqe04600g7sarrxxg0mbjo",
  "created_at": "2022-07-21T18:12:39.000Z",
  "image_urls": [
    "https://example.com/image.png"
  ],
  "video_urls": [
    "https://example.com/video.mov"
  ],
  "subcategory": {
    "id": "clczbfbhh0000sa90h45xv3cg",
    "name": "General Channel",
    "metadata": {
      "description": "This channel is used for general communication"
    },
    "createdByUserId": "clg3k5ypi000gsad0v1znilap"
  },
  "parent_content_id": "clpwuqoxi0001saas891t1jn7"
}
Response examples (200)
{
  "status": "flagged",
  "actions": [
    {
      "type": "content",
      "status": "flagged",
      "content": {
        "id": "5065614664",
        "tags": [
          "another-tag"
        ],
        "user_id": "therese",
        "created_at": "2024-07-12T11:44:25.500Z",
        "category_id": "chat",
        "subcategory_id": "chat-community"
      },
      "rule_id": "clesjpsib0001ukkq5e62gwnw",
      "action_id": "clyimre7x001sei5oaa3k8wmn",
      "policy_id": "other",
      "action_type": "ChangeStatus",
      "policy_name": "Other",
      "previous_status": null,
      "action_created_at": "2024-07-12T11:44:26.300Z"
    }
  ],
  "success": true
}