-
Notifications
You must be signed in to change notification settings - Fork 3
/
openapi.yml
137 lines (136 loc) · 4.25 KB
/
openapi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
openapi: 3.0.0
info:
title: Trigger.dev API
description: API for triggering events in Trigger.dev
version: 1.0.0
servers:
- url: https://api.trigger.dev
description: Trigger.dev API server
security:
- BearerAuth: []
paths:
/api/v1/events:
post:
operationId: sendEvent
externalDocs:
description: Find more info here
url: "https://trigger.dev/docs/api/events/send-event"
tags:
- Events
summary: Create an event
description: Send an event to Trigger.dev to trigger job runs through eventTrigger()
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EventRequest"
responses:
"200":
description: Event successfully sent
content:
application/json:
schema:
$ref: "#/components/schemas/EventResponse"
"400":
description: Invalid request
"401":
description: Unauthorized - API key is missing or invalid
"422":
description: Invalid request body
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Error:
type: object
properties:
message:
type: string
EventRequest:
type: object
properties:
event:
type: object
required:
- name
properties:
name:
type: string
description: The name of the event
payload:
type: object
additionalProperties: true
description: The payload of the event
context:
type: object
additionalProperties: true
description: An optional context object
id:
type: string
description: Unique identifier for the event. Auto-generated if not provided. If you provide an ID that already exists, the event will not be redelivered.
timestamp:
type: string
format: date-time
description: Event timestamp. Defaults to current timestamp if not provided.
source:
type: string
description: Event source, default is 'trigger.dev'.
options:
type: object
properties:
deliverAt:
type: string
format: date-time
description: Optional Date to deliver the event.
deliverAfter:
type: integer
description: Optional delay in seconds before delivering the event.
accountId:
type: string
description: Optional account ID to associate with the event.
EventResponse:
type: object
properties:
id:
type: string
description: The ID of the event that was sent.
name:
type: string
description: The name of the event that was sent.
payload:
$ref: "#/components/schemas/DeserializedJson"
context:
$ref: "#/components/schemas/DeserializedJson"
nullable: true
description: The context of the event that was sent. Null if no context was set.
timestamp:
type: string
format: date-time
description: The timestamp of the event that was sent.
deliverAt:
type: string
format: date-time
nullable: true
description: The timestamp when the event will be delivered. Null if not applicable.
deliveredAt:
type: string
format: date-time
nullable: true
description: The timestamp when the event was delivered. Null if not applicable.
cancelledAt:
type: string
format: date-time
nullable: true
description: The timestamp when the event was cancelled. Null if the event wasn't cancelled.
DeserializedJson:
type: object
additionalProperties: true
description: A JSON object that represents the deserialized payload or context.
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT