{"components":{"responses":{},"schemas":{"Asset":{"properties":{"byte_size":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"filename":{"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"purpose":{"nullable":true,"type":"string"},"status":{"enum":["pending","uploaded","expired"],"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"},"uploaded_at":{"format":"date-time","nullable":true,"type":"string"}},"title":"Asset","type":"object"},"Checkpoint":{"properties":{"callback_url":{"nullable":true,"type":"string"},"decided_at":{"format":"date-time","nullable":true,"type":"string"},"decision_comment":{"nullable":true,"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"instructions":{"nullable":true,"type":"string"},"items":{"items":{"properties":{"access_url":{"description":"Presigned URL (asset items only)","nullable":true,"type":"string"},"access_url_expires_at":{"format":"date-time","nullable":true,"type":"string"},"asset_id":{"format":"uuid","nullable":true,"type":"string"},"content_json":{"nullable":true,"type":"object"},"content_text":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"}},"title":"ReviewItem","type":"object"},"type":"array"},"metadata":{"nullable":true,"type":"object"},"public_id":{"type":"string"},"review_type":{"type":"string"},"status":{"enum":["pending","approved","rejected","needs_changes","expired","cancelled"],"type":"string"},"submitted_by":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"title":{"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"Checkpoint","type":"object"},"QuotaExceeded":{"properties":{"error":{"example":"quota_exceeded","type":"string"},"limit":{"type":"integer"},"message":{"type":"string"},"plan":{"type":"string"},"resource":{"type":"string"},"upgrade_url":{"type":"string"},"used":{"type":"integer"}},"title":"QuotaExceeded","type":"object"},"ReviewItem":{"properties":{"access_url":{"description":"Presigned URL (asset items only)","nullable":true,"type":"string"},"access_url_expires_at":{"format":"date-time","nullable":true,"type":"string"},"asset_id":{"format":"uuid","nullable":true,"type":"string"},"content_json":{"nullable":true,"type":"object"},"content_text":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"}},"title":"ReviewItem","type":"object"},"ReviewLink":{"properties":{"expires_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"status":{"enum":["active","revoked","expired"],"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"ReviewLink","type":"object"}},"securitySchemes":{"bearerAuth":{"description":"API key from your Relayna dashboard","scheme":"bearer","type":"http"}}},"info":{"description":"REST API for Relayna — AI-powered human review platform.\n\nAuthenticate all requests using your API key as a Bearer token:\n\n`Authorization: Bearer <your-api-key>`\n\nAPI keys can be created from your [dashboard](/dashboard/api-keys).\n","title":"Relayna API","version":"1.0"},"openapi":"3.0.0","paths":{"/api/assets/upload":{"post":{"callbacks":{},"description":"Uploads a file to storage and creates an asset record in one step.","operationId":"RelaynaWeb.Api.AssetController.upload","parameters":[],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"File to upload (required)","format":"binary","type":"string"},"purpose":{"description":"Optional label, e.g. \"invoice\"","type":"string"},"ttl_seconds":{"description":"Seconds until the asset expires (default: 86400)","type":"integer"}},"required":["file"],"type":"object"}}},"description":"Multipart upload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"access_url":{"description":"Presigned download URL","type":"string"},"access_url_expires_at":{"format":"date-time","type":"string"},"asset":{"properties":{"byte_size":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"filename":{"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"purpose":{"nullable":true,"type":"string"},"status":{"enum":["pending","uploaded","expired"],"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"},"uploaded_at":{"format":"date-time","nullable":true,"type":"string"}},"title":"Asset","type":"object"}},"type":"object"}}},"description":"Asset uploaded"},"402":{"content":{"application/json":{"schema":{"properties":{"error":{"example":"quota_exceeded","type":"string"},"limit":{"type":"integer"},"message":{"type":"string"},"plan":{"type":"string"},"resource":{"type":"string"},"upgrade_url":{"type":"string"},"used":{"type":"integer"}},"title":"QuotaExceeded","type":"object"}}},"description":"Quota exceeded"},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"errors":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"description":"Validation failed"}},"summary":"Upload an asset","tags":["Assets"]}},"/api/assets/{id}/download-request":{"post":{"callbacks":{},"description":"Generates a short-lived presigned GET URL for downloading or previewing the asset.","operationId":"RelaynaWeb.Api.AssetController.download_request","parameters":[{"description":"Asset ID","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"asset":{"properties":{"byte_size":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"filename":{"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"purpose":{"nullable":true,"type":"string"},"status":{"enum":["pending","uploaded","expired"],"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"},"uploaded_at":{"format":"date-time","nullable":true,"type":"string"}},"title":"Asset","type":"object"},"download_url":{"description":"Presigned GET URL (1 hour TTL)","type":"string"},"expires_in_seconds":{"example":3600,"type":"integer"}},"type":"object"}}},"description":"Download URL generated"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Asset not found"},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"status":{"type":"string"}},"type":"object"}}},"description":"Asset not uploaded"}},"summary":"Request a download URL","tags":["Assets"]}},"/api/checkpoints":{"post":{"callbacks":{},"description":"Creates a review checkpoint with attached items and a magic review link.","operationId":"RelaynaWeb.Api.CheckpointController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"callback_headers":{"additionalProperties":{"type":"string"},"description":"Extra headers sent with the webhook","type":"object"},"callback_url":{"description":"Webhook URL called on decision","type":"string"},"external_ref":{"description":"Your workflow run ID","type":"string"},"instructions":{"description":"Instructions for the reviewer","type":"string"},"items":{"description":"Items to attach to this checkpoint","items":{"properties":{"asset_id":{"description":"Required for item_type=asset","format":"uuid","type":"string"},"content_json":{"description":"Required for item_type=json","type":"object"},"content_text":{"description":"Required for item_type=text","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"}},"required":["item_type"],"type":"object"},"type":"array"},"metadata":{"description":"Arbitrary key-value metadata","type":"object"},"submitted_by":{"description":"Label for the submitting agent","type":"string"},"summary":{"description":"Optional content summary","type":"string"},"title":{"description":"Checkpoint title","type":"string"},"ttl_seconds":{"description":"Seconds until expiry","type":"integer"}},"required":["title"],"type":"object"}}},"description":"Checkpoint creation request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"checkpoint":{"properties":{"callback_url":{"nullable":true,"type":"string"},"decided_at":{"format":"date-time","nullable":true,"type":"string"},"decision_comment":{"nullable":true,"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"instructions":{"nullable":true,"type":"string"},"items":{"items":{"properties":{"access_url":{"description":"Presigned URL (asset items only)","nullable":true,"type":"string"},"access_url_expires_at":{"format":"date-time","nullable":true,"type":"string"},"asset_id":{"format":"uuid","nullable":true,"type":"string"},"content_json":{"nullable":true,"type":"object"},"content_text":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"}},"title":"ReviewItem","type":"object"},"type":"array"},"metadata":{"nullable":true,"type":"object"},"public_id":{"type":"string"},"review_type":{"type":"string"},"status":{"enum":["pending","approved","rejected","needs_changes","expired","cancelled"],"type":"string"},"submitted_by":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"title":{"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"Checkpoint","type":"object"},"link":{"properties":{"expires_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"status":{"enum":["active","revoked","expired"],"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"ReviewLink","type":"object"},"review_url":{"description":"Shareable review page URL","type":"string"}},"type":"object"}}},"description":"Checkpoint created"},"402":{"content":{"application/json":{"schema":{"properties":{"error":{"example":"quota_exceeded","type":"string"},"limit":{"type":"integer"},"message":{"type":"string"},"plan":{"type":"string"},"resource":{"type":"string"},"upgrade_url":{"type":"string"},"used":{"type":"integer"}},"title":"QuotaExceeded","type":"object"}}},"description":"Quota exceeded"},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"errors":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"description":"Validation failed"}},"summary":"Create a review checkpoint","tags":["Checkpoints"]}},"/api/checkpoints/{id}":{"get":{"callbacks":{},"description":"Returns the full checkpoint including all attached items.","operationId":"RelaynaWeb.Api.CheckpointController.show","parameters":[{"description":"Checkpoint ID","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"checkpoint":{"properties":{"callback_url":{"nullable":true,"type":"string"},"decided_at":{"format":"date-time","nullable":true,"type":"string"},"decision_comment":{"nullable":true,"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"instructions":{"nullable":true,"type":"string"},"items":{"items":{"properties":{"access_url":{"description":"Presigned URL (asset items only)","nullable":true,"type":"string"},"access_url_expires_at":{"format":"date-time","nullable":true,"type":"string"},"asset_id":{"format":"uuid","nullable":true,"type":"string"},"content_json":{"nullable":true,"type":"object"},"content_text":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"}},"title":"ReviewItem","type":"object"},"type":"array"},"metadata":{"nullable":true,"type":"object"},"public_id":{"type":"string"},"review_type":{"type":"string"},"status":{"enum":["pending","approved","rejected","needs_changes","expired","cancelled"],"type":"string"},"submitted_by":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"title":{"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"Checkpoint","type":"object"}},"type":"object"}}},"description":"Checkpoint details"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"}},"summary":"Get a checkpoint","tags":["Checkpoints"]}},"/api/checkpoints/{id}/cancel":{"post":{"callbacks":{},"description":"Cancels a pending checkpoint so it can no longer be reviewed.","operationId":"RelaynaWeb.Api.CheckpointController.cancel","parameters":[{"description":"Checkpoint ID","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"checkpoint":{"properties":{"callback_url":{"nullable":true,"type":"string"},"decided_at":{"format":"date-time","nullable":true,"type":"string"},"decision_comment":{"nullable":true,"type":"string"},"expires_at":{"format":"date-time","nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"instructions":{"nullable":true,"type":"string"},"items":{"items":{"properties":{"access_url":{"description":"Presigned URL (asset items only)","nullable":true,"type":"string"},"access_url_expires_at":{"format":"date-time","nullable":true,"type":"string"},"asset_id":{"format":"uuid","nullable":true,"type":"string"},"content_json":{"nullable":true,"type":"object"},"content_text":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"item_type":{"enum":["asset","json","text"],"type":"string"},"label":{"nullable":true,"type":"string"},"position":{"type":"integer"}},"title":"ReviewItem","type":"object"},"type":"array"},"metadata":{"nullable":true,"type":"object"},"public_id":{"type":"string"},"review_type":{"type":"string"},"status":{"enum":["pending","approved","rejected","needs_changes","expired","cancelled"],"type":"string"},"submitted_by":{"nullable":true,"type":"string"},"summary":{"nullable":true,"type":"string"},"title":{"type":"string"},"ttl_seconds":{"nullable":true,"type":"integer"}},"title":"Checkpoint","type":"object"}},"type":"object"}}},"description":"Checkpoint cancelled"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"errors":{"items":{"type":"string"},"type":"array"}},"type":"object"}}},"description":"Cannot cancel"}},"summary":"Cancel a checkpoint","tags":["Checkpoints"]}},"/api/checkpoints/{id}/status":{"get":{"callbacks":{},"description":"Lightweight status endpoint for workflow polling.","operationId":"RelaynaWeb.Api.CheckpointController.status","parameters":[{"description":"Checkpoint ID","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"decided_at":{"format":"date-time","nullable":true,"type":"string"},"decision_comment":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"},"public_id":{"type":"string"},"status":{"enum":["pending","approved","rejected","needs_changes","expired","cancelled"],"type":"string"}},"type":"object"}}},"description":"Checkpoint status"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"}},"summary":"Poll checkpoint status","tags":["Checkpoints"]}},"/api/review-links/{id}/revoke":{"post":{"callbacks":{},"description":"Revokes a review link so it can no longer be used to access the review page.","operationId":"RelaynaWeb.Api.ReviewLinkController.revoke","parameters":[{"description":"Review link ID","in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"link":{"properties":{"id":{"format":"uuid","type":"string"},"status":{"enum":["revoked"],"type":"string"}},"type":"object"}},"type":"object"}}},"description":"Link revoked"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"}},"summary":"Revoke a review link","tags":["Review Links"]}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"https://relayna.app","variables":{}}],"tags":[]}