openapi: 3.1.0 info: title: Loops OpenAPI Spec API key Events API description: This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api). version: 1.8.0 servers: - url: https://app.loops.so/api/v1 tags: - name: Events description: Trigger email sending with events paths: /events/send: post: tags: - Events summary: Send an event description: Send events to trigger emails in Loops. requestBody: description: Provide either `email` or `userId` to identify the contact ([read more](https://loops.so/docs/api-reference/send-event#body)).
You can add event properties, which will be available in emails sent by this event. Values can be of type string, number, boolean or date ([see allowed date formats](https://loops.so/docs/events/properties#important-information-about-event-properties)).
Make sure to create the properties in Loops before using them in API calls.
You can add contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates))). content: application/json: schema: $ref: '#/components/schemas/EventRequest' required: true parameters: - in: header name: Idempotency-Key description: Include a unique ID for this request (maximum 100 characters) to avoid duplicate events. [More info](https://loops.so/docs/api-reference/send-event#param-idempotency-key) schema: type: string maxLength: 100 responses: '200': description: Successful send. content: application/json: schema: $ref: '#/components/schemas/EventSuccessResponse' '400': description: Bad request (e.g. `eventName` is missing). content: application/json: schema: $ref: '#/components/schemas/EventFailureResponse' '405': description: Wrong HTTP request method. '409': description: Idempotency key has been used. content: application/json: schema: $ref: '#/components/schemas/IdempotencyKeyFailureResponse' security: - apiKey: [] components: schemas: EventRequest: type: object required: - eventName properties: email: type: string userId: type: string eventName: type: string eventProperties: type: object description: An object containing event property data for the event, available in emails sent by the event. mailingLists: type: object description: An object of mailing list IDs and boolean subscription statuses. examples: - list_123: true additionalProperties: oneOf: - type: string - type: number - type: boolean EventFailureResponse: type: object properties: success: type: boolean examples: - false message: type: string required: - success - message EventSuccessResponse: type: object properties: success: type: boolean examples: - true required: - success IdempotencyKeyFailureResponse: type: object properties: success: type: boolean examples: - false message: type: string required: - success - message securitySchemes: apiKey: type: http scheme: bearer