-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yml
205 lines (204 loc) · 5.66 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
openapi: "3.0.0"
info:
title: Shortlink API
description: API for creating and visiting shortlinks for n8n workflows and URLs
version: 1.0.0
servers:
- url: https://n8n.to
paths:
/shortlink:
post:
summary: Create a new shortlink
description: Creates a new shortlink for an n8n workflow or URL
operationId: createShortlink
tags:
- Shortlinks
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ShortlinkCreationRequest'
responses:
'201':
description: Shortlink created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ShortlinkCreationResponse'
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/InternalServerError'
/{slug}:
get:
summary: Resolve a shortlink
description: Returns a workflow JSON and redirects to a URL. Basic auth required for password-protected shortlinks.
operationId: resolveShortlink
tags:
- Shortlinks
parameters:
- name: slug
in: path
required: true
schema:
type: string
- name: Authorization
in: header
description: Base64-encoded password for protected shortlinks (Basic Auth)
schema:
type: string
responses:
'200':
description: Successful response for workflow shortlink
content:
application/json:
schema:
type: object
'301':
description: Redirect for URL shortlink
headers:
Location:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
/spec:
get:
summary: OpenAPI specification
description: Returns the OpenAPI specification in YAML format.
operationId: getApiSpec
tags:
- System
responses:
'200':
description: Successful response
content:
application/yaml:
schema:
type: string
/health:
get:
summary: Get API health status
description: Returns the current API health status.
operationId: getHealth
tags:
- System
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
environment:
type: string
enum: [development, production, testing]
example: production
version:
type: string
example: f0f13a2
description: Git commit SHA
/metrics:
get:
summary: Get API metrics
description: Returns Prometheus-formatted metrics about API performance.
operationId: getMetrics
tags:
- System
responses:
'200':
description: Successful response
content:
text/plain:
schema:
type: string
components:
schemas:
ShortlinkCreationRequest:
type: object
required:
- content
properties:
content:
type: string
description: Workflow JSON or URL to shorten
slug:
type: string
description: Custom slug for the shortlink (optional). If not provided, a random slug will be generated.
password:
type: string
description: Password to protect the shortlink with (optional)
ShortlinkCreationResponse:
type: object
properties:
slug:
type: string
description: Generated or custom slug for the shortlink
kind:
type: string
enum: [url, workflow]
description: Kind of content that was shortened
content:
type: string
description: Workflow JSON or URL that was shortened
creatorIP:
type: string
description: IP address of the shortlink creator
ErrorResponse:
type: object
properties:
error:
type: object
properties:
message:
type: string
code:
type: string
doc:
type: string
trace:
type: string
responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
NotFound:
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
InternalServerError:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'