-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopenapi.yaml
More file actions
4643 lines (4415 loc) · 120 KB
/
Copy pathopenapi.yaml
File metadata and controls
4643 lines (4415 loc) · 120 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
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Spooled Cloud API
description: |
Production-ready webhook queue service API.
Spooled Cloud provides a reliable, multi-tenant job queue system with:
- Custom webhook ingestion (receive events from any source)
- Job queue with retry logic and dead-letter queue
- Worker coordination with heartbeat and lease management
- Real-time job status updates via WebSocket/SSE
- Workflow orchestration with job dependencies
- Cron-based job scheduling
- Stripe billing integration for subscription management
## Authentication
All API endpoints (except health checks) require authentication via API key.
Include your API key in the `Authorization` header:
```
Authorization: Bearer sp_live_your_api_key_here
```
## Security
- **Multi-tenant isolation**: All operations are scoped to your organization
- **API key verification**: Keys verified using bcrypt with caching
- **Webhook signatures**: HMAC-SHA256 with constant-time comparison
- **Rate limiting**: Per-key limits with graceful degradation
- **Input validation**: All inputs sanitized and size-limited
- **SSRF protection**: Webhook URLs validated in production
## Rate Limiting
Rate limits are applied per API key based on plan tier:
- Free tier: 5 requests/second (burst: 10)
- Starter tier: 25 requests/second (burst: 50)
- Pro tier: 100 requests/second (burst: 200)
- Enterprise: 500 requests/second (burst: 1000)
Rate limit headers included in all responses:
- `X-RateLimit-Limit`: Maximum requests per window
- `X-RateLimit-Remaining`: Remaining requests in current window
- `X-RateLimit-Reset`: Unix timestamp when the window resets
## Plan Limits
Each plan tier has resource limits:
- Jobs per day: Free (1,000), Starter (10,000), Pro (100,000), Enterprise (unlimited)
- Active jobs: Free (10), Starter (500), Pro (5,000), Enterprise (unlimited)
- Queues: Free (2), Starter (10), Pro (50), Enterprise (unlimited)
- Workers: Free (1), Starter (5), Pro (25), Enterprise (unlimited)
- Workflows: Free (disabled), Starter (5), Pro (50), Enterprise (unlimited)
version: 1.0.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
contact:
name: Spooled Cloud Support
url: https://spooled.cloud/support
email: support@spooled.cloud
servers:
- url: https://api.spooled.cloud
description: Production API
- url: https://api.staging.spooled.cloud
description: Staging API
- url: http://localhost:8080
description: Local development
tags:
- name: Health
description: Health check endpoints
- name: Authentication
description: JWT authentication and token management
- name: Organizations
description: Organization management
- name: Jobs
description: Job queue operations
- name: Queues
description: Queue configuration and statistics
- name: Workers
description: Worker registration and management
- name: API Keys
description: API key management
- name: Webhooks
description: Webhook ingestion endpoints
- name: Workflows
description: Workflow and job dependency management
- name: Schedules
description: Cron-based recurring job schedules
- name: Outgoing Webhooks
description: Configure webhooks for receiving notifications when events occur
- name: Real-time
description: WebSocket and Server-Sent Events for real-time updates
- name: Billing
description: Subscription and billing management via Stripe
- name: Admin
description: Platform administration (requires X-Admin-Key header)
paths:
/health:
get:
tags: [Health]
summary: Health check
description: Returns the health status of the service and its dependencies
operationId: healthCheck
security: []
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
example:
status: healthy
version: '1.0.0'
database: true
cache: true
/health/live:
get:
tags: [Health]
summary: Liveness probe
description: Kubernetes liveness probe - returns 200 if the service is running
operationId: liveness
security: []
responses:
'200':
description: Service is alive
/health/ready:
get:
tags: [Health]
summary: Readiness probe
description: Kubernetes readiness probe - returns 200 if the service can accept traffic
operationId: readiness
security: []
responses:
'200':
description: Service is ready
'503':
description: Service is not ready
/api/v1/dashboard:
get:
tags: [Dashboard]
summary: Dashboard data
description: |
Returns comprehensive dashboard data including system info, job statistics,
queue summaries, worker status, and recent activity.
Requires authentication. Data is scoped to the authenticated organization.
operationId: dashboardData
security:
- BearerAuth: []
- ApiKeyAuth: []
responses:
'200':
description: Dashboard data retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DashboardData'
/metrics:
get:
tags: [Health]
summary: Prometheus metrics
description: |
Returns application metrics in Prometheus text format.
Metrics include:
- `spooled_jobs_enqueued_total`: Total jobs enqueued
- `spooled_jobs_completed_total`: Total jobs completed
- `spooled_jobs_failed_total`: Total jobs failed
- `spooled_jobs_pending`: Current pending jobs
- `spooled_jobs_processing`: Current processing jobs
- `spooled_job_duration_seconds`: Job processing duration histogram
- `spooled_workers_active`: Active workers
- `spooled_api_requests_total`: Total API requests
operationId: prometheusMetrics
security: []
responses:
'200':
description: Prometheus metrics
content:
text/plain:
schema:
type: string
example: |
# HELP spooled_jobs_enqueued_total Total jobs enqueued
# TYPE spooled_jobs_enqueued_total counter
spooled_jobs_enqueued_total 1234
# HELP spooled_jobs_pending Number of pending jobs
# TYPE spooled_jobs_pending gauge
spooled_jobs_pending 42
# Authentication Endpoints
/api/v1/auth/login:
post:
tags: [Authentication]
summary: Login with API key
description: Exchange an API key for JWT access and refresh tokens
operationId: login
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
responses:
'200':
description: Login successful
content:
application/json:
schema:
$ref: '#/components/schemas/LoginResponse'
'401':
description: Invalid credentials
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/auth/refresh:
post:
tags: [Authentication]
summary: Refresh access token
description: Exchange a valid refresh token for a new access token
operationId: refreshToken
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RefreshTokenRequest'
responses:
'200':
description: Token refreshed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/RefreshTokenResponse'
'401':
description: Invalid or expired refresh token
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/auth/logout:
post:
tags: [Authentication]
summary: Logout
description: Invalidate the current access token
operationId: logout
responses:
'204':
description: Logged out successfully
'401':
description: Not authenticated
/api/v1/auth/me:
get:
tags: [Authentication]
summary: Get current user info
description: Returns information about the authenticated user from the JWT token
operationId: getCurrentUser
responses:
'200':
description: Current user info
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentUserResponse'
'401':
description: Not authenticated
/api/v1/auth/validate:
post:
tags: [Authentication]
summary: Validate a token
description: Check if a JWT token is valid and not blacklisted
operationId: validateToken
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateTokenRequest'
responses:
'200':
description: Token validation result
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateTokenResponse'
# Email-based Authentication
/api/v1/auth/check-email:
get:
tags: [Authentication]
summary: Check email availability
description: Check if an email is already registered
operationId: checkEmail
security: []
parameters:
- name: email
in: query
required: true
schema:
type: string
format: email
description: Email address to check
responses:
'200':
description: Email check result
content:
application/json:
schema:
$ref: '#/components/schemas/CheckEmailResponse'
/api/v1/auth/email/start:
post:
tags: [Authentication]
summary: Start email login
description: |
Start the email-based login flow. Sends a verification code to the provided email.
If the email is not associated with an existing organization, verification will
return a short-lived signup token to complete registration.
operationId: startEmailLogin
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/StartEmailLoginRequest'
responses:
'200':
description: Verification code sent
content:
application/json:
schema:
$ref: '#/components/schemas/StartEmailLoginResponse'
'429':
description: Too many requests - rate limited
/api/v1/auth/email/verify:
post:
tags: [Authentication]
summary: Verify email code
description: Verify the code sent to the user's email and complete login
operationId: verifyEmailCode
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/VerifyEmailRequest'
responses:
'200':
description: Login successful
content:
application/json:
schema:
$ref: '#/components/schemas/VerifyEmailResponse'
'400':
description: Invalid or expired code
'404':
description: No pending verification found
/api/v1/auth/signup/complete:
post:
tags: [Authentication]
summary: Complete signup
description: Complete the signup process by creating an organization
operationId: completeSignup
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompleteSignupRequest'
responses:
'201':
description: Signup completed
content:
application/json:
schema:
$ref: '#/components/schemas/CompleteSignupResponse'
'400':
description: Invalid token or organization name
# Billing Endpoints
/api/v1/billing/status:
get:
tags: [Billing]
summary: Get billing status
description: Get the current billing status for the organization
operationId: getBillingStatus
responses:
'200':
description: Billing status
content:
application/json:
schema:
$ref: '#/components/schemas/BillingStatus'
/api/v1/billing/portal:
post:
tags: [Billing]
summary: Create portal session
description: Create a Stripe Customer Portal session for managing subscriptions
operationId: createBillingPortal
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePortalRequest'
responses:
'200':
description: Portal session URL
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePortalResponse'
/api/v1/billing/webhook:
post:
tags: [Billing]
summary: Stripe webhook
description: |
Webhook endpoint for Stripe events. Secured with STRIPE_BILLING_WEBHOOK_SECRET.
Handles subscription lifecycle events.
operationId: stripeWebhook
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
responses:
'200':
description: Webhook processed
'400':
description: Invalid webhook signature
/api/v1/organizations/check-slug:
get:
tags: [Organizations]
summary: Check slug availability
description: Check if an organization slug is available
operationId: checkSlug
security: []
parameters:
- name: slug
in: query
required: true
schema:
type: string
description: Slug to check
responses:
'200':
description: Slug availability
content:
application/json:
schema:
$ref: '#/components/schemas/CheckSlugResponse'
/api/v1/organizations/generate-slug:
post:
tags: [Organizations]
summary: Generate unique slug
description: Generate a unique slug from an organization name
operationId: generateSlug
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateSlugRequest'
responses:
'200':
description: Generated slug
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateSlugResponse'
/api/v1/organizations:
get:
tags: [Organizations]
summary: List organizations
description: List all organizations accessible to the authenticated user
operationId: listOrganizations
responses:
'200':
description: List of organizations
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OrganizationSummary'
post:
tags: [Organizations]
summary: Create organization
description: Create a new organization
operationId: createOrganization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrganizationRequest'
responses:
'201':
description: Organization created
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
'409':
description: Organization with this slug already exists
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/organizations/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
description: Organization ID
get:
tags: [Organizations]
summary: Get organization
operationId: getOrganization
responses:
'200':
description: Organization details
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
'404':
description: Organization not found
put:
tags: [Organizations]
summary: Update organization
operationId: updateOrganization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateOrganizationRequest'
responses:
'200':
description: Organization updated
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
'404':
description: Organization not found
delete:
tags: [Organizations]
summary: Delete organization
operationId: deleteOrganization
responses:
'204':
description: Organization deleted
'404':
description: Organization not found
/api/v1/organizations/usage:
get:
tags: [Organizations]
summary: Get organization usage
description: |
Returns current resource usage and plan limits for the authenticated organization.
Includes daily job counts, resource counts, and warnings for approaching limits.
operationId: getOrganizationUsage
responses:
'200':
description: Usage information
content:
application/json:
schema:
$ref: '#/components/schemas/UsageInfo'
/api/v1/organizations/webhook-token:
get:
tags: [Organizations]
summary: Get webhook token
description: |
Get the current webhook token and URL for receiving incoming webhooks.
The token is automatically generated when the organization is created.
operationId: getWebhookToken
responses:
'200':
description: Webhook token information
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookTokenResponse'
example:
webhook_token: 'whk_abc123...'
webhook_url: 'https://api.spooled.cloud/api/v1/webhooks/org-id/custom'
/api/v1/organizations/webhook-token/regenerate:
post:
tags: [Organizations]
summary: Regenerate webhook token
description: |
Generate a new webhook token, invalidating the old one.
Update your external services with the new token after regenerating.
operationId: regenerateWebhookToken
responses:
'200':
description: New webhook token
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookTokenResponse'
/api/v1/organizations/webhook-token/clear:
post:
tags: [Organizations]
summary: Clear webhook token (disabled)
description: |
This endpoint is **disabled**.
Spooled Cloud no longer supports unauthenticated incoming webhook ingestion.
Use `/api/v1/organizations/webhook-token/regenerate` to rotate the token instead.
operationId: clearWebhookToken
deprecated: true
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [confirm]
properties:
confirm:
type: boolean
description: Must be true to confirm clearing the token
example:
confirm: true
responses:
'400':
description: Not allowed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
code: validation_error
message: Clearing the webhook token is not allowed. Use /organizations/webhook-token/regenerate to rotate it.
# Admin Endpoints
/api/v1/admin/organizations:
get:
tags: [Admin]
summary: List all organizations
description: |
List all organizations on the platform. Requires admin authentication via X-Admin-Key header.
operationId: adminListOrganizations
security:
- AdminKeyAuth: []
parameters:
- name: plan_tier
in: query
schema:
type: string
enum: [free, starter, pro, enterprise]
description: Filter by plan tier
- name: search
in: query
schema:
type: string
description: Search by name or slug
- name: limit
in: query
schema:
type: integer
default: 50
- name: offset
in: query
schema:
type: integer
default: 0
responses:
'200':
description: List of organizations
content:
application/json:
schema:
$ref: '#/components/schemas/AdminOrganizationList'
'401':
description: Invalid or missing admin key
post:
tags: [Admin]
summary: Create organization (admin)
description: Create a new organization with specified plan
operationId: adminCreateOrganization
security:
- AdminKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AdminCreateOrganizationRequest'
responses:
'201':
description: Organization created
content:
application/json:
schema:
$ref: '#/components/schemas/AdminCreateOrganizationResponse'
/api/v1/admin/organizations/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
description: Organization ID
get:
tags: [Admin]
summary: Get organization details
description: Get detailed information about an organization including usage statistics
operationId: adminGetOrganization
security:
- AdminKeyAuth: []
responses:
'200':
description: Organization details
content:
application/json:
schema:
$ref: '#/components/schemas/AdminOrganizationDetail'
'404':
description: Organization not found
patch:
tags: [Admin]
summary: Update organization
description: Update organization settings including plan tier
operationId: adminUpdateOrganization
security:
- AdminKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AdminUpdateOrganizationRequest'
responses:
'200':
description: Organization updated
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
delete:
tags: [Admin]
summary: Delete organization
description: |
Delete an organization and all its data.
- **Soft delete** (default): Marks organization as deleted.
- **Hard delete** (`hard_delete=true`): Permanently removes organization and all related data (jobs, workflows, workers, etc.).
operationId: adminDeleteOrganization
security:
- AdminKeyAuth: []
parameters:
- name: hard_delete
in: query
schema:
type: boolean
default: false
description: Permanent deletion (cannot be undone)
responses:
'204':
description: Organization deleted
'404':
description: Organization not found
/api/v1/admin/stats:
get:
tags: [Admin]
summary: Get platform statistics
description: Get platform-wide statistics
operationId: adminGetStats
security:
- AdminKeyAuth: []
responses:
'200':
description: Platform statistics
content:
application/json:
schema:
$ref: '#/components/schemas/PlatformStats'
/api/v1/admin/plans:
get:
tags: [Admin]
summary: List available plans
description: Get all available plan tiers with their limits
operationId: adminListPlans
security:
- AdminKeyAuth: []
responses:
'200':
description: List of plans
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PlanLimits'
/api/v1/admin/organizations/{id}/api-keys:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
tags: [Admin]
summary: Create API key for organization
description: Create an API key for a specific organization
operationId: adminCreateApiKey
security:
- AdminKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateApiKeyRequest'
responses:
'201':
description: API key created
content:
application/json:
schema:
$ref: '#/components/schemas/CreateApiKeyResponse'
/api/v1/admin/organizations/{id}/reset-usage:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
tags: [Admin]
summary: Reset organization usage
description: Reset daily usage counters for an organization
operationId: adminResetUsage
security:
- AdminKeyAuth: []
responses:
'200':
description: Usage reset
content:
application/json:
schema:
type: object
properties:
reset:
type: boolean
organization_id:
type: string
/api/v1/jobs:
get:
tags: [Jobs]
summary: List jobs
description: List jobs with optional filtering
operationId: listJobs
parameters:
- name: queue_name
in: query
schema:
type: string
description: Filter by queue name
- name: status
in: query
schema:
type: string
enum: [pending, scheduled, processing, completed, failed, deadletter, cancelled]
description: Filter by status
- name: tag
in: query
schema:
type: string
maxLength: 64
description: Filter jobs by a single tag (matches Postgres `tags ? tag` semantics)
- name: limit
in: query
schema:
type: integer
default: 50
maximum: 100
description: Maximum number of results
- name: offset
in: query
schema:
type: integer
default: 0
description: Offset for pagination
responses:
'200':
description: List of jobs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/JobSummary'
post:
tags: [Jobs]
summary: Create job
description: |
Create a new job in the specified queue.
If an `idempotency_key` is provided and a job with the same key exists,
the existing job ID is returned (idempotent behavior).
operationId: createJob
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateJobRequest'
responses:
'201':
description: Job created
content:
application/json:
schema:
$ref: '#/components/schemas/CreateJobResponse'
'200':
description: Existing job returned (idempotent)
content:
application/json:
schema:
$ref: '#/components/schemas/CreateJobResponse'
/api/v1/jobs/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
description: Job ID
get:
tags: [Jobs]
summary: Get job
operationId: getJob
responses:
'200':
description: Job details
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'404':
description: Job not found
delete:
tags: [Jobs]
summary: Cancel job
description: Cancel a pending or scheduled job
operationId: cancelJob
responses: