Import Content

POST /import/content

Import up to a 1000 pieces of content into Lasso per request. Rate limit: 60 per minute

Headers

application/json

Body

  • contents array[object]
    Hide contents attributes Show contents attributes object
    • content_id string Required
    • 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
    • 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
      • 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
    • created_at string(date)

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

    • status string

      Optional status to set the initial status of the user. This status will only be set when creating the user, not when it is updated. Use the update status API for this.

      Values are allowed, flagged, or hidden.

    • text string
    • image_urls array[string]

      Maximum length of each is 400.

    • video_urls array[string]

      Maximum length of each is 400.

    • metadata object
    • The ID of the parent content. This could for instance be the content this is a reply to.

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
POST /import/content
curl \
 -X POST https://api.lassomoderation.com/api/v1/import/content \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer lasso.a35afd...a6ea" \
 -d '{"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"],"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","createdByUserId":"clg3k5ypi000gsad0v1znilap","metadata":{"description":"This channel is used for general communication"}}}]}'
Request example
# Headers
Authorization: Bearer lasso.a35afd...a6ea

# Payload
{
  "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"
      ],
      "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",
        "createdByUserId": "clg3k5ypi000gsad0v1znilap",
        "metadata": {
          "description": "This channel is used for general communication"
        }
      }
    }
  ]
}
Response examples (200)
{
  "success": true
}