> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-pb-update-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# createEvent

> Creates a new [Event](#schema_event). When creating a new [Event](#schema_event), the required tags must be provided. See the specific integration for more details.



## OpenAPI

````yaml /runtime-openapi.json post /v1/chat/events
openapi: 3.0.0
info:
  title: Botpress Runtime API
  description: API for Botpress Runtime
  version: 1.112.0
servers:
  - url: https://api.botpress.cloud
security:
  - BearerAuth: []
tags:
  - name: documented
  - name: experimental
paths:
  /v1/chat/events:
    post:
      tags:
        - Endpoints
      description: >-
        Creates a new [Event](#schema_event). When creating a new
        [Event](#schema_event), the required tags must be provided. See the
        specific integration for more details.
      operationId: createEvent
      parameters:
        - name: x-bp-authenticated-principal
          in: header
          description: Authenticated principal. Injected by the authentication middleware.
          required: true
          schema:
            type: string
        - name: x-bot-id
          in: header
          description: Bot id
          required: true
          schema:
            type: string
        - name: x-integration-id
          in: header
          description: Integration id
          required: false
          schema:
            type: string
        - name: x-integration-alias
          in: header
          description: Integration alias
          required: false
          schema:
            type: string
        - name: x-real-ip
          in: header
          description: Caller's IP address. Injected by the edge proxy.
          required: false
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/createEventBody'
      responses:
        '201':
          $ref: '#/components/responses/createEventResponse'
        default:
          $ref: '#/components/responses/createEventResponse'
components:
  requestBodies:
    createEventBody:
      description: Event data
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                maxLength: 200
                description: Type of the [Event](#schema_event).
              payload:
                type: object
                additionalProperties: true
                description: >-
                  Payload is the content of the event defined by the integration
                  installed on your bot or one of the default events created by
                  our API.
              schedule:
                type: object
                properties:
                  dateTime:
                    type: string
                    maxLength: 28
                    minLength: 24
                    description: >-
                      When the [Event](#schema_event) will be sent, in the ISO
                      8601 format
                  delay:
                    type: number
                    description: >-
                      Delay in milliseconds before sending the
                      [Event](#schema_event)
                description: >-
                  Schedule the Event to be sent at a specific time. Either
                  dateTime or delay must be provided.
                additionalProperties: false
              conversationId:
                type: string
                minLength: 28
                maxLength: 36
                description: >-
                  ID of the [Conversation](#schema_conversation) to link the
                  event to.
              userId:
                type: string
                minLength: 28
                maxLength: 36
                description: ID of the [User](#schema_user) to link the event to.
              workflowId:
                type: string
                minLength: 28
                maxLength: 36
                description: ID of the [Workflow](#schema_workflow) to link the event to.
              messageId:
                type: string
                minLength: 28
                maxLength: 36
                description: ID of the [Message](#schema_message) to link the event to.
            required:
              - type
              - payload
            title: createEventBody
            additionalProperties: false
  responses:
    createEventResponse:
      description: >-
        Returns a [Event](#schema_event) object if creation succeeds. Returns
        [an error](#errors) otherwise
      content:
        application/json:
          schema:
            type: object
            properties:
              event:
                $ref: '#/components/schemas/Event'
            required:
              - event
            title: createEventResponse
            additionalProperties: false
  schemas:
    Event:
      type: object
      properties:
        id:
          type: string
          minLength: 28
          maxLength: 36
          description: Id of the [Event](#schema_event)
        createdAt:
          type: string
          format: date-time
          description: Creation date of the [Event](#schema_event) in ISO 8601 format
        type:
          type: string
          maxLength: 200
          description: Type of the [Event](#schema_event).
        payload:
          type: object
          additionalProperties: true
          description: >-
            Payload is the content of the event defined by the integration
            installed on your bot or one of the default events created by our
            api.
        conversationId:
          type: string
          minLength: 28
          maxLength: 36
          description: ID of the [Conversation](#schema_conversation) to link the event to.
        userId:
          type: string
          minLength: 28
          maxLength: 36
          description: ID of the [User](#schema_user) to link the event to.
        messageId:
          type: string
          minLength: 28
          maxLength: 36
          description: ID of the [Message](#schema_message) to link the event to.
        status:
          type: string
          enum:
            - pending
            - processed
            - ignored
            - failed
            - scheduled
            - canceled
        failureReason:
          type: string
          maxLength: 2000
          nullable: true
          description: Reason why the event failed to be processed
      required:
        - id
        - createdAt
        - type
        - payload
        - status
        - failureReason
      description: The event object represents an action or an occurrence.
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````