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

# Create Event

> Submit a custom event for an entry



## OpenAPI

````yaml POST /projects/{projectId}/events
openapi: 3.0.1
info:
  title: api
  version: 0.0.1
servers:
  - url: https://api.embeddables.com
    description: Production
security: []
paths:
  /projects/{projectId}/events:
    post:
      tags:
        - Events
      description: Submit a custom event for an entry
      operationId: events_createEvent
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ProjectId'
          examples:
            Example1:
              value: pr_myexampleproject
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: rk_myexampleapikey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntryEventRequest'
            examples:
              Example1:
                value:
                  embeddable_id: flow_myexampleflow
                  timestamp: '2022-01-01T00:00:00.000Z'
                  custom_event_name: my_custom_event
                  custom_event_props: '{ "my_prop": "my_val" }'
                  identifiers:
                    - key: email
                      value: '"test@test.com"'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
              examples:
                Example1:
                  value:
                    group_id: group_myexamplegroup
                    project_id: pr_myexampleproject
                    embeddable_id: flow_myexampleflow
                    embeddable_version_number: 1
                    contact_id: contact_myexamplecontact
                    entry_id: entry_myexampleentry
                    timestamp: '2022-01-01T00:00:00Z'
                    event_type: custom_event:triggered
                    custom_event_name: my_custom_event
                    custom_event_props: '{ "my_prop": "my_val" }'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorBody'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntryNotFoundErrorBody'
components:
  schemas:
    ProjectId:
      title: ProjectId
      type: string
      description: The unique identifier for a Project in the database
    EntryEventRequest:
      title: EntryEventRequest
      type: object
      properties:
        embeddable_id:
          $ref: '#/components/schemas/EmbeddableId'
        timestamp:
          $ref: '#/components/schemas/DateTime'
        custom_event_name:
          $ref: '#/components/schemas/CustomEventName'
        custom_event_props:
          $ref: '#/components/schemas/CustomEventProps'
        identifiers:
          $ref: '#/components/schemas/Identifiers'
      required:
        - embeddable_id
        - timestamp
        - custom_event_name
        - custom_event_props
        - identifiers
    Event:
      title: Event
      type: object
      properties:
        entry_id:
          $ref: '#/components/schemas/EntryId'
        contact_id:
          $ref: '#/components/schemas/ContactId'
        project_id:
          $ref: '#/components/schemas/ProjectId'
        group_id:
          $ref: '#/components/schemas/GroupId'
        embeddable_id:
          $ref: '#/components/schemas/EmbeddableId'
        embeddable_version_number:
          $ref: '#/components/schemas/EmbeddableVersionNumber'
          nullable: true
        timestamp:
          $ref: '#/components/schemas/DateTime'
        page_id:
          $ref: '#/components/schemas/PageId'
          nullable: true
        page_key:
          $ref: '#/components/schemas/PageKey'
          nullable: true
        page_index:
          $ref: '#/components/schemas/PageIndex'
          nullable: true
        max_page_id:
          $ref: '#/components/schemas/PageId'
          nullable: true
        max_page_key:
          $ref: '#/components/schemas/PageKey'
          nullable: true
        max_page_index:
          $ref: '#/components/schemas/PageIndex'
          nullable: true
        total_pages:
          type: integer
          nullable: true
        event_type:
          $ref: '#/components/schemas/EventType'
        view_type:
          $ref: '#/components/schemas/ViewType'
          nullable: true
        custom_event_name:
          type: string
          nullable: true
        custom_event_props:
          type: string
          nullable: true
      required:
        - entry_id
        - contact_id
        - project_id
        - group_id
        - embeddable_id
        - timestamp
        - event_type
    UnauthorizedErrorBody:
      title: UnauthorizedErrorBody
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
        projectId:
          $ref: '#/components/schemas/ProjectId'
      required:
        - error
        - projectId
    EntryNotFoundErrorBody:
      title: EntryNotFoundErrorBody
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
        entryId:
          $ref: '#/components/schemas/EntryId'
          nullable: true
      required:
        - error
    EmbeddableId:
      title: EmbeddableId
      type: string
      description: The unique identifier for a Embeddable in the database
    DateTime:
      title: DateTime
      type: string
      description: A Date + Time string in ISO format
    CustomEventName:
      title: CustomEventName
      type: string
      description: A name of your choosing for the custom event - must be snake_case
    CustomEventProps:
      title: CustomEventProps
      type: string
      description: >-
        Any custom properties you want to attach to the custom event - must be a
        valid JSON string
    Identifiers:
      title: Identifiers
      type: array
      items:
        $ref: '#/components/schemas/Identifier'
      description: >-
        A list of key-value pairs that uniquely identify the end-user that this
        event should be attached to. Currently supports one key-value pair. The
        value must be JSON-stringified, so strings must be wrapped in
        double-quotes.
    EntryId:
      title: EntryId
      type: string
      description: The unique identifier for an Entry in the database
    ContactId:
      title: ContactId
      type: string
      description: The unique identifier for a Contact in the database
    GroupId:
      title: GroupId
      type: string
      description: The unique identifier for a Group in the database
    EmbeddableVersionNumber:
      title: EmbeddableVersionNumber
      type: integer
      description: The version number of an embeddable
    PageId:
      title: PageId
      type: string
    PageKey:
      title: PageKey
      type: string
    PageIndex:
      title: PageIndex
      type: integer
    EventType:
      title: EventType
      type: string
    ViewType:
      title: ViewType
      type: string
    ErrorBody:
      title: ErrorBody
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
    Identifier:
      title: Identifier
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value

````