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

# Send a Session Event (SSE)

> Appends a user message and streams the agent response. Same SSE vocabulary as POST /v1/agents/run. Billing precharges per event, not per session. Closing the stream does not cancel the run. The same body while a run is generating resubscribes; a different body returns 409.



## OpenAPI

````yaml POST /v1/sessions/{session_id}/events
openapi: 3.0.0
info:
  title: Profy Platform API
  version: 1.0.0
  description: >-
    Platform API for building on Profy — invoke Experts, use models, report
    billing events, and manage OAuth.
servers:
  - url: https://api.profy.cn
    description: Production
security: []
paths:
  /v1/sessions/{session_id}/events:
    post:
      tags:
        - Platform API
      summary: Send a user event (SSE)
      description: >-
        Appends a user message and streams the agent response. Same SSE
        vocabulary as POST /v1/agents/run. Billing precharges per event, not per
        session. Closing the stream does not cancel the run. The same body while
        a run is generating resubscribes; a different body returns 409.
      operationId: createSessionEvent
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - content
              properties:
                type:
                  type: string
                  enum:
                    - user.message
                  default: user.message
                content:
                  type: string
                model:
                  type: string
                attachment_file_ids:
                  type: array
                  items:
                    type: string
                  maxItems: 20
                tool_confirmations:
                  type: array
                  items:
                    type: object
                    required:
                      - tool_call_id
                      - tool_name
                      - decision
                    properties:
                      tool_call_id:
                        type: string
                      tool_name:
                        type: string
                      decision:
                        type: string
                      modified_parameters:
                        type: object
                enabled_plugins:
                  type: array
                  items:
                    type: string
                skill_names:
                  type: array
                  items:
                    type: string
                enable_memory:
                  type: boolean
                  default: false
                permission_mode:
                  type: string
                  enum:
                    - plan
                working_directory:
                  type: string
                selected_image_model:
                  type: string
                selected_video_model:
                  type: string
                selected_speech_model:
                  type: string
                selected_music_model:
                  type: string
                image_parameters:
                  type: object
                video_parameters:
                  type: object
      responses:
        '200':
          description: SSE stream (text/event-stream)
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: Unsupported event type or missing content
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '409':
          description: >-
            A run is already in progress for this session and the body differs
            from it.
      security:
        - BearerToken: []
        - ApiKey: []
components:
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token issued via POST /oauth/token
    ApiKey:
      type: http
      scheme: bearer
      description: Developer API Key (sk-pro-xxx) created at platform.profy.cn

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.