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

# Send new event

> Report referral-related events such as signups, purchases, and refunds.



## OpenAPI

````yaml POST /events
openapi: 3.1.0
info:
  title: Cello API
  description: API for Cello referral platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.cello.so
  - url: https://api.sandbox.cello.so
security:
  - bearerAuth: []
paths:
  /events:
    post:
      description: Report referral-related events such as signups, purchases, and refunds.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventEnvelope'
            examples:
              new-signup:
                value:
                  eventName: ReferralUpdated
                  payload:
                    ucc: cello-ucc
                    newUserId: new-user-product-id
                    price: 0
                    currency: ''
                  context:
                    newUser:
                      id: new-user-id
                      email: new_user@gmail.com
                      name: New user name
                      organizationId: org-123
                    event:
                      trigger: new-signup
                      timestamp: '2022-10-05T14:14:34Z'
              invoice-paid:
                value:
                  eventName: ReferralUpdated
                  payload:
                    ucc: cello-ucc
                    newUserId: new-user-id
                    price: 100
                    currency: EUR
                  context:
                    newUser:
                      id: new-user-id
                      email: new_user@gmail.com
                      organizationId: org-123
                    event:
                      trigger: invoice-paid
                      timestamp: '2022-10-05T14:14:34Z'
                    subscription:
                      id: sub-xyz
                      invoiceId: inv-abc
                      interval: monthly
                      seatsUsed: 1
                      productKey: Pro Plan
              charge-refunded:
                value:
                  eventName: ReferralUpdated
                  payload:
                    ucc: cello-ucc
                    newUserId: new-user-product-user-id
                    price: 1000
                    currency: EUR
                  context:
                    newUser:
                      id: new-user-product-user-id
                      email: new-user@gmail.com
                      organizationId: new-user-organization-id
                    event:
                      trigger: charge-refunded
                      timestamp: '2022-10-05 14:14:34'
                    subscription:
                      id: 845739hjsd8342i34
                      invoiceId: 34hsjdh34jfksd
              demo-call-attended:
                value:
                  eventName: ReferralUpdated
                  payload:
                    ucc: cello-ucc
                    newUserId: product-user-id
                  context:
                    newUser:
                      id: new-user-product-user-id
                      email: new_user@gmail.com
                      name: New user name
                      organizationId: new-user-organization-id
                    event:
                      trigger: demo-call-attended
                      timestamp: '2022-10-05 14:14:34'
      responses:
        '200':
          description: Event accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                example:
                  success: true
        '400':
          description: Malformed or invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    EventEnvelope:
      type: object
      required:
        - eventName
        - payload
        - context
      properties:
        eventName:
          type: string
          enum:
            - ReferralUpdated
        payload:
          $ref: '#/components/schemas/EventPayload'
        context:
          $ref: '#/components/schemas/EventContext'
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    EventPayload:
      type: object
      required:
        - ucc
        - newUserId
      properties:
        ucc:
          type: string
        newUserId:
          type: string
        price:
          type: number
        currency:
          type: string
    EventContext:
      type: object
      properties:
        event:
          type: object
          properties:
            trigger:
              type: string
              enum:
                - new-signup
                - demo-call-attended
                - invoice-paid
                - charge-refunded
            timestamp:
              type: string
              format: date-time
          required:
            - trigger
            - timestamp
        newUser:
          type: object
          properties:
            id:
              type: string
            email:
              type: string
              format: email
            name:
              type: string
            organizationId:
              type: string
        subscription:
          type: object
          properties:
            id:
              type: string
            invoiceId:
              type: string
            interval:
              type: string
              enum:
                - one-time
                - weekly
                - bi-weekly
                - monthly
                - quarterly
                - semi-annual
                - yearly
                - biennial
                - triennial
                - lifetime
            seatsUsed:
              type: integer
            productKey:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````