> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send event

> Sends an [event object](/api/agent-chat/v3.5/data-structures#events). Use this method to send a message by specifying the `message` event type in the request.

The user must be added to the chat before they can send an event. Events with `visibility: agents` are sent to agents only; events with `visibility: all` are sent to all users. Users with `visibility: agents` cannot send events with `visibility: all`.

The method updates the requester's `events_seen_up_to` as if they've seen all chat events.

**Required scopes:** <Tooltip tip="To send an event to a chat taking place in any group.">`chats--all:rw`</Tooltip> or <Tooltip tip="To send an event to a chat taking place in groups that the requester (related to the token) is a member of. The agent groups and the chat groups must overlap — at least one group must be in common.">`chats--access:rw`</Tooltip>


## OpenAPI

````yaml /api/agent-chat/v3.5/openapi.json post /action/send_event
openapi: 3.0.0
info:
  title: Agent Chat API
  description: >-
    The Agent Chat API allows you to manage chats, threads, events, and agent
    state.
  version: '3.5'
servers:
  - url: https://api.livechatinc.com/v3.5/agent
    description: Production server
security: []
paths:
  /action/send_event:
    post:
      tags:
        - Events
      summary: Send event
      description: >-
        Sends an [event object](/api/agent-chat/v3.5/data-structures#events).
        Use this method to send a message by specifying the `message` event type
        in the request.


        The user must be added to the chat before they can send an event. Events
        with `visibility: agents` are sent to agents only; events with
        `visibility: all` are sent to all users. Users with `visibility: agents`
        cannot send events with `visibility: all`.


        The method updates the requester's `events_seen_up_to` as if they've
        seen all chat events.
      operationId: send-event
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEventRequest'
            example:
              chat_id: PW94SJTGW6
              event:
                type: message
                text: hello world
                visibility: all
      responses:
        '200':
          description: Event sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEventResponse'
              example:
                event_id: K600PKZON8
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - chats--all:rw
components:
  schemas:
    SendEventRequest:
      type: object
      required:
        - chat_id
        - event
      properties:
        chat_id:
          type: string
          description: The ID of the chat to send the event to.
        event:
          allOf:
            - $ref: '#/components/schemas/Event'
          description: >-
            An event object. Does not support the `form` type in the Text app.
            For field details, see the [Agent Chat API data structures
            reference](/api/agent-chat/v3.5/data-structures).
    SendEventResponse:
      type: object
      properties:
        event_id:
          type: string
          description: The ID of the sent event.
    Event:
      type: object
      description: >-
        Event object. Event types include `message`, `file`, `form`,
        `filled_form`, `rich_message`, `custom`, `system_message`, and `system`.
        For full field details per type, see the [Agent Chat API data structures
        reference](/api/agent-chat/v3.5/data-structures).
      properties:
        id:
          type: string
          description: Event ID.
        type:
          type: string
          description: Event type.
        created_at:
          type: string
          format: date-time
          description: Event creation timestamp (RFC3339 with microseconds).
        author_id:
          type: string
          description: ID of the event author.
        visibility:
          type: string
          enum:
            - all
            - agents
          description: Event visibility.
        properties:
          $ref: '#/components/schemas/Properties'
    Properties:
      type: object
      description: Custom properties organized by namespace, then property name.
      additionalProperties:
        type: object
        additionalProperties: true
  securitySchemes:
    PersonalAccessToken:
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
      type: http
      scheme: basic
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of

````