-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathadmin-openapi.json
More file actions
605 lines (605 loc) · 22.1 KB
/
admin-openapi.json
File metadata and controls
605 lines (605 loc) · 22.1 KB
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
{
"openapi": "3.0.1",
"info": {
"title": "Mintlify Admin API",
"description": "An API for administrative operations including documentation updates and agent management.",
"version": "2.0.0"
},
"servers": [
{
"url": "https://api.mintlify.com"
}
],
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/v1/agent/{projectId}/job": {
"post": {
"summary": "Create agent job (v1)",
"deprecated": true,
"description": "Deprecated: use [v2 create agent job](/api/agent/v2/create-agent-job) instead. Creates a new agent job that can generate and edit documentation based on provided messages and branch information.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"messages"
],
"properties": {
"branch": {
"type": "string",
"description": "The name of the Git branch that the agent should work on. If omitted, the agent generates a branch name based on the message content."
},
"messages": {
"type": "array",
"description": "A list of messages to provide to the agent. A default system prompt is always prepended automatically, so you typically only need to include user messages.",
"items": {
"type": "object",
"required": [
"role",
"content"
],
"properties": {
"role": {
"type": "string",
"enum": ["system", "user", "assistant"],
"description": "The role of the message sender. Use `user` for task instructions. Use `system` to add supplementary instructions that are appended after the default system prompt (does not replace it). Use `assistant` to provide example assistant responses for few-shot prompting."
},
"content": {
"type": "string",
"description": "The content of the message."
}
}
}
},
"asDraft": {
"type": "boolean",
"default": false,
"description": "Control whether the pull request is created in draft or non-draft mode. When true, creates a draft pull request. When false (default), creates a regular pull request ready for review."
},
"model": {
"type": "string",
"enum": ["sonnet", "opus"],
"default": "sonnet",
"description": "The AI model to use for the agent job. Use `sonnet` for faster, cost-effective processing. Use `opus` for more capable, but slower processing."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Agent job created successfully (streaming response). X-Session-Id Header is sent back in the response",
"headers": {
"X-Message-Id": {
"schema": {
"type": "string"
},
"description": "Message identifier for the created job"
}
},
"content": {
"text/plain": {
"schema": {
"type": "string",
"description": "Streaming response containing the agent job execution details and results."
}
}
}
}
}
}
},
"/v1/agent/{projectId}/job/{id}": {
"get": {
"summary": "Get agent job by ID (v1)",
"deprecated": true,
"description": "Deprecated: use [v2 get agent job](/api/agent/v2/get-agent-job) instead. Retrieves the details and status of a specific agent job by its ID.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
},
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "The unique identifier of the agent job to retrieve."
}
],
"responses": {
"200": {
"description": "Agent job details retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sessionId": {
"type": "string",
"description": "The subdomain this session belongs to."
},
"subdomain": {
"type": "string",
"description": "The subdomain this session belongs to."
},
"branch": {
"type": "string",
"description": "Git branch name where changes were made.",
"nullable": true
},
"haulted": {
"type": "boolean",
"description": "Whether the session execution was halted."
},
"haultReason": {
"type": "string",
"enum": ["completed", "github_missconfigured", "error"],
"description": "Reason for session halt."
},
"pullRequestLink": {
"type": "string",
"description": "Link to the created pull request."
},
"messageToUser": {
"type": "string",
"description": "Message for the user about the session outcome."
},
"todos": {
"type": "array",
"description": "List of todo items from the session.",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Brief description of the task."
},
"status": {
"type": "string",
"enum": ["pending", "in_progress", "completed", "cancelled"],
"description": "Current status of the task."
},
"priority": {
"type": "string",
"enum": ["high", "medium", "low"],
"description": "Priority level of the task."
},
"id": {
"type": "string",
"description": "Unique identifier for the todo item."
}
}
}
},
"userId": {
"type": "string",
"description": "The ID of the user who created this session, if available."
},
"title": {
"type": "string",
"description": "A generated title summarizing the agent job."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the session was created."
}
}
}
}
}
}
}
}
},
"/v1/agent/{projectId}/jobs": {
"get": {
"summary": "Get all agent jobs (v1)",
"deprecated": true,
"description": "Deprecated: use [v2 get agent job](/api/agent/v2/get-agent-job) instead. Retrieves all agent jobs for the specified domain, including their status and details.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
}
],
"responses": {
"200": {
"description": "All agent jobs retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"allSessions": {
"type": "array",
"description": "Array of all agent sessions for the domain.",
"items": {
"type": "object",
"properties": {
"sessionId": {
"type": "string",
"description": "The subdomain this session belongs to."
},
"subdomain": {
"type": "string",
"description": "The subdomain this session belongs to."
},
"branch": {
"type": "string",
"description": "Git branch name where changes were made.",
"nullable": true
},
"haulted": {
"type": "boolean",
"description": "Whether the session execution was halted."
},
"haultReason": {
"type": "string",
"enum": ["completed", "github_missconfigured", "error"],
"description": "Reason for session halt."
},
"pullRequestLink": {
"type": "string",
"description": "Link to the created pull request."
},
"messageToUser": {
"type": "string",
"description": "Message for the user about the session outcome."
},
"todos": {
"type": "array",
"description": "List of todo items from the session.",
"items": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Brief description of the task."
},
"status": {
"type": "string",
"enum": ["pending", "in_progress", "completed", "cancelled"],
"description": "Current status of the task."
},
"priority": {
"type": "string",
"enum": ["high", "medium", "low"],
"description": "Priority level of the task."
},
"id": {
"type": "string",
"description": "Unique identifier for the todo item."
}
}
}
},
"userId": {
"type": "string",
"description": "The ID of the user who created this session, if available."
},
"title": {
"type": "string",
"description": "A generated title summarizing the agent job."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the session was created."
}
}
}
}
}
}
}
}
}
}
}
},
"/v2/agent/{projectId}/job": {
"post": {
"summary": "Create agent job",
"description": "Creates a new agent job that runs in the background. The job processes the prompt asynchronously — poll the get job endpoint to track progress. If the agent edits files successfully, a pull request is automatically created.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"description": "The instruction for the agent to execute."
}
}
}
}
}
},
"responses": {
"201": {
"description": "Agent job created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJob"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/v2/agent/{projectId}/job/{id}": {
"get": {
"summary": "Get agent job",
"description": "Retrieves the current status and details of an agent job. Poll this endpoint to track job progress.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
},
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "The unique identifier of the agent job."
}
],
"responses": {
"200": {
"description": "Agent job details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJob"
}
}
}
},
"404": {
"description": "Job not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/v2/agent/{projectId}/job/{id}/message": {
"post": {
"summary": "Send follow-up message",
"description": "Sends a follow-up message to an existing agent job. The message is processed asynchronously — poll the get job endpoint to track progress.",
"parameters": [
{
"name": "projectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard."
},
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "The unique identifier of the agent job to send a message to."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"description": "The follow-up instruction for the agent."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Message sent successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJob"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Job not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"AgentJob": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the agent job."
},
"status": {
"type": "string",
"enum": ["active", "completed", "failed"],
"description": "Current status of the job. `active` — the agent is currently processing the prompt. `completed` — the agent finished successfully and a PR may have been created (check `prLink`). `failed` — the agent encountered an unrecoverable error. Poll until status is `completed` or `failed`."
},
"source": {
"type": "object",
"description": "Source repository information.",
"properties": {
"repository": {
"type": "string",
"description": "Full URL of the GitHub repository."
},
"ref": {
"type": "string",
"description": "Git branch the agent is working on.",
"nullable": true
}
}
},
"model": {
"type": "string",
"description": "The AI model used for this job."
},
"prLink": {
"type": "string",
"format": "uri",
"example": "https://github.com/org/repo/pull/123",
"description": "GitHub pull request URL created by the agent. `null` while the job is still `active` or if no files were changed. Populated once the agent successfully creates a PR.",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the job was created."
},
"archivedAt": {
"type": "string",
"format": "date-time",
"description": "Timestamp when the job was archived.",
"nullable": true
}
}
},
"Error": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message."
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "The Authorization header expects a Bearer token. Use an admin API key (prefixed with `mint_`). This is a server-side secret key. Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard."
}
}
}
}