Send user events

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://api-reference.lassomoderation.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Lasso Moderation API MCP server": {
    "url": "https://api-reference.lassomoderation.com/mcp"
  }
}

Close
POST /events

Send things your users do besides posting content, such as joining or leaving a channel, removing or blocking another user, or liking a piece of content. Events use the same category and subcategory as content (a room, channel, thread, post or conversation) and show up between the content in its context and in the user's content history, so moderators can see what happened around a message.

An event type is created the first time you send its event.id; a later request with a different event.name renames it. The number of event types is limited per plan (Free and Starter 3, Pro 5, Enterprise 20). Events of a new type that would go over the limit are rejected per item; the others are still stored. Delete event types you no longer send in Settings → Events to free a slot.

Events are stored asynchronously. Up to 100 events per request.

Default rate limit: 300 requests per minute.

application/json

Body

  • events array[object] Required

    Provide at least one of user_id, target_user_id, content_id or category.

    At least 1 but not more than 100 elements.

    Hide events attributes Show events attributes object

    Provide at least one of user_id, target_user_id, content_id or category.

    • event object Required

      The event type.

      Hide event attributes Show event attributes object
      • id string Required

        Your id for the event type. Letters, numbers, _, ., : and -.

        Maximum length is 100. Format should match the following pattern: ^[A-Za-z0-9_.:-]+$.

      • name string Required

        Display name of the event type, shown to moderators.

        Maximum length is 100.

    • user_id string

      The user who did it, with the same id as in the user and content APIs. The user doesn't need to exist in Lasso yet; events of users Lasso doesn't know show this id until the user appears.

      Maximum length is 100.

    • target_user_id string

      The user it was done to, for example the user who was blocked.

      Maximum length is 100.

    • content_id string

      The content the event is about, for example the message a user liked. Use the same id as when you sent the content. Without a category the event is placed in the content's category and subcategory.

      Maximum length is 100.

    • value number

      How much the event counts for, for example 250 for an "Added credits" event that added 250 credits. Defaults to 1. Put the unit in the event name.

      Default value is 1.

    • category object

      Where it happened, same as the category of content.

      Hide category attributes Show category attributes object
      • id string Required

        Maximum length is 100.

      • name string

        Maximum length is 100.

    • subcategory object

      Where within the category it happened (a room, channel, thread, post or conversation), same as the subcategory of content. Accepts the same fields as the content subcategory. Requires category.

      Hide subcategory attributes Show subcategory attributes object
      • id string Required

        Maximum length is 100.

      • name string

        Maximum length is 300.

    • timestamp string(date-time)

      When it happened. Defaults to the time the request is received.

    • metadata object

      Extra free-form data about the object as key-value pairs. Values can be strings, numbers, booleans, null, or an object with one more level of key-value pairs.

      • The metadata may be at most 4KB (4096 bytes) when serialized as JSON.
      • Keys are not allowed to contain /.

Responses

  • 200 application/json

    OK. At least one event was accepted; rejected lists the events that were not.

    Hide response attributes Show response attributes object
    • success boolean Required
    • data object Required
      Hide data attributes Show data attributes object
      • accepted integer Required

        Number of events accepted for storage.

      • rejected array[object] Required

        Events refused because their event type would go over the plan limit.

        Hide rejected attributes Show rejected attributes object
        • index integer Required

          Position of the event in the request's events array.

        • event string Required

          The rejected event type id.

        • error string Required
  • 400 application/json

    The request is invalid, see the error field for details

    Hide response attributes Show response attributes object
    • success boolean Required
    • error string | object Required

      A message describing the error. For validation errors this is an object with an error message per field.

  • 401 application/json

    The API token is missing or invalid

    Hide response attributes Show response attributes object
    • success boolean Required
    • error string | object Required

      A message describing the error. For validation errors this is an object with an error message per field.

  • 422 application/json

    Every event in the request was rejected because of the event type limit.

    Hide response attributes Show response attributes object
    • success boolean Required
    • error object Required
      Hide error attributes Show error attributes object
      • message string Required
      • rejected array[object] Required
        Hide rejected attributes Show rejected attributes object
        • index integer
        • event string
        • error string
  • 429 application/json

    The rate limit has been exceeded, check the X-RateLimit headers for limits

    Hide headers attributes Show headers attributes
    • X-RateLimit-Limit

      The rate limit interval in milliseconds

    • X-RateLimit-Remaining

      The number of requests remaining in the current interval

    • X-RateLimit-Reset

      The number of milliseconds until requests are allowed again

    Hide response attribute Show response attribute object
    • error string Required
POST /events
curl \
 --request POST 'https://api.lassomoderation.com/api/v1/events' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "events": [
    {
      "event": {
        "id": "join_channel",
        "name": "Joined channel"
      },
      "user_id": "user_123",
      "category": {
        "id": "community",
        "name": "Community"
      },
      "subcategory": {
        "id": "general",
        "name": "General"
      },
      "timestamp": "2026-11-12T14:02:31Z"
    },
    {
      "event": {
        "id": "like",
        "name": "Liked"
      },
      "user_id": "user_123",
      "content_id": "message_789",
      "timestamp": "2026-11-12T14:03:10Z"
    },
    {
      "event": {
        "id": "add_credits",
        "name": "Added credits"
      },
      "user_id": "user_123",
      "value": 250,
      "timestamp": "2026-11-12T14:04:12Z"
    },
    {
      "event": {
        "id": "block",
        "name": "Blocked user"
      },
      "user_id": "buyer_42",
      "target_user_id": "seller_7",
      "category": {
        "id": "marketplace",
        "name": "Marketplace"
      },
      "subcategory": {
        "id": "conversation_1138",
        "name": "Bike listing chat"
      },
      "timestamp": "2026-11-12T14:05:02Z"
    }
  ]
}'
Request example
{
  "events": [
    {
      "event": {
        "id": "join_channel",
        "name": "Joined channel"
      },
      "user_id": "user_123",
      "category": {
        "id": "community",
        "name": "Community"
      },
      "subcategory": {
        "id": "general",
        "name": "General"
      },
      "timestamp": "2026-11-12T14:02:31Z"
    },
    {
      "event": {
        "id": "like",
        "name": "Liked"
      },
      "user_id": "user_123",
      "content_id": "message_789",
      "timestamp": "2026-11-12T14:03:10Z"
    },
    {
      "event": {
        "id": "add_credits",
        "name": "Added credits"
      },
      "user_id": "user_123",
      "value": 250,
      "timestamp": "2026-11-12T14:04:12Z"
    },
    {
      "event": {
        "id": "block",
        "name": "Blocked user"
      },
      "user_id": "buyer_42",
      "target_user_id": "seller_7",
      "category": {
        "id": "marketplace",
        "name": "Marketplace"
      },
      "subcategory": {
        "id": "conversation_1138",
        "name": "Bike listing chat"
      },
      "timestamp": "2026-11-12T14:05:02Z"
    }
  ]
}
Response examples (200)
{
  "success": true,
  "data": {
    "accepted": 3,
    "rejected": []
  }
}
Response examples (400)
{
  "success": false,
  "error": {
    "content_id": "Value can be at most 100 characters"
  }
}
Response examples (401)
{
  "success": false,
  "error": "Invalid API key"
}
Response examples (422)
{
  "success": false,
  "error": {
    "message": "All events were rejected",
    "rejected": [
      {
        "index": 0,
        "event": "voice_mute",
        "error": "string"
      }
    ]
  }
}
Response examples (429)
{
  "error": "Too many requests, check headers for limits"
}