{"openapi":"3.1.0","info":{"title":"Swyftstack API","version":"1.0.0","description":"Manage PostgreSQL databases, object storage, and backups programmatically. Authenticate with an API key (Authorization: Bearer sk_live_…) or connect an AI client with the browser device-login flow. All requests are org-scoped and every action is audited.","contact":{"name":"Swyftstack support","url":"https://swyftstack.com/support"}},"servers":[{"url":"https://swyftstack.com/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Device","description":"Device Authorization Grant (RFC 8628) — connect without pasting a key."},{"name":"Databases","description":"PostgreSQL databases."},{"name":"Network & security","description":"IP allow-list, Row-Level Security, SSL."},{"name":"Backups","description":"Manual + automatic backups."},{"name":"Recovery","description":"PITR, WAL archiving, recovery timeline."},{"name":"Imports","description":"Import an external database."},{"name":"Storage","description":"Object-storage buckets + files."},{"name":"Account","description":"Usage, limits, billing, API keys, audit logs."},{"name":"Agent","description":"AI-optimized status + recommendations."}],"paths":{"/device/authorize":{"post":{"tags":["Device"],"summary":"Start a device login","security":[],"description":"Begin a Device Authorization Grant. Returns a device_code (poll with it) and a user_code (the human enters it at /device).","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"client_name":{"type":"string"},"scope_preset":{"type":"string","enum":["read_only","developer","full_access"]}}}}}},"responses":{"200":{"description":"Device + user codes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}}}}},"/device/token":{"post":{"tags":["Device"],"summary":"Poll for the device login result","security":[],"description":"Poll with the device_code. Returns authorization_pending / slow_down / access_denied / expired_token until approved, then the minted api_key exactly once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_code"],"properties":{"device_code":{"type":"string"}}}}}},"responses":{"200":{"description":"The minted API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"400":{"description":"Still pending / denied / expired"}}}},"/databases":{"get":{"tags":["Databases"],"summary":"List databases","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Databases"],"summary":"Create a database","description":"Requires an API key with scope(s): database:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["project","name"],"properties":{"project":{"type":"string"},"name":{"type":"string"},"db_user":{"type":"string"},"password":{"type":"string"}}}}}}}},"/databases/{id}":{"get":{"tags":["Databases"],"summary":"Get a database","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]},"delete":{"tags":["Databases"],"summary":"Delete a database (destructive)","description":"Requires an API key with scope(s): database:delete.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/restart":{"post":{"tags":["Databases"],"summary":"Restart a database","description":"Requires an API key with scope(s): database:update.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/rotate-password":{"post":{"tags":["Databases"],"summary":"Rotate the password","description":"Requires an API key with scope(s): database:update.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/connection":{"get":{"tags":["Databases"],"summary":"Get connection details","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/ssl":{"get":{"tags":["Network & security"],"summary":"Get SSL/TLS status","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/allowlist":{"get":{"tags":["Network & security"],"summary":"Get the IP allow-list","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]},"put":{"tags":["Network & security"],"summary":"Replace the IP allow-list","description":"Requires an API key with scope(s): database:update.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"string"}}}}}}}}},"/databases/{id}/rls":{"get":{"tags":["Network & security"],"summary":"Row-Level Security overview","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]},"post":{"tags":["Network & security"],"summary":"Enable/disable RLS on a table","description":"Requires an API key with scope(s): database:update.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["table","enabled"],"properties":{"table":{"type":"string"},"schema":{"type":"string"},"enabled":{"type":"boolean"},"force":{"type":"boolean"}}}}}}}},"/databases/{id}/backups":{"get":{"tags":["Backups"],"summary":"List backups","description":"Requires an API key with scope(s): backup:list.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]},"post":{"tags":["Backups"],"summary":"Trigger a manual backup","description":"Requires an API key with scope(s): backup:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/backups/{backupId}":{"get":{"tags":["Backups"],"summary":"Get a backup","description":"Requires an API key with scope(s): backup:list.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"tags":["Backups"],"summary":"Delete a backup (destructive)","description":"Requires an API key with scope(s): backup:delete.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}]}},"/databases/{id}/backups/{backupId}/restore":{"post":{"tags":["Backups"],"summary":"Restore from a backup","description":"Requires an API key with scope(s): backup:restore.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}]}},"/databases/{id}/backups/{backupId}/pin":{"post":{"tags":["Backups"],"summary":"Pin/unpin a backup","description":"Requires an API key with scope(s): backup:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}]}},"/databases/{id}/recovery":{"get":{"tags":["Recovery"],"summary":"Recovery status (PITR, WAL, timeline)","description":"Requires an API key with scope(s): backup:list.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/recovery/restore-request":{"post":{"tags":["Recovery"],"summary":"Request a point-in-time restore","description":"Requires an API key with scope(s): backup:restore.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/databases/{id}/export":{"get":{"tags":["Backups"],"summary":"Latest downloadable export","description":"Requires an API key with scope(s): backup:download.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Database id (e.g. db_…).","schema":{"type":"string"}}]}},"/imports":{"get":{"tags":["Imports"],"summary":"List imports","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Imports"],"summary":"Import an external database","description":"Requires an API key with scope(s): database:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["project","name","source_url"],"properties":{"project":{"type":"string"},"name":{"type":"string"},"source_url":{"type":"string"},"same_credentials":{"type":"boolean"},"username":{"type":"string"},"password":{"type":"string"}}}}}}}},"/imports/{importId}":{"get":{"tags":["Imports"],"summary":"Get import status","description":"Requires an API key with scope(s): database:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"importId","in":"path","required":true,"schema":{"type":"string"}}]}},"/buckets":{"get":{"tags":["Storage"],"summary":"List buckets","description":"Requires an API key with scope(s): storage:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Storage"],"summary":"Create a bucket","description":"Requires an API key with scope(s): storage:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["project","name"],"properties":{"project":{"type":"string"},"name":{"type":"string"},"public":{"type":"boolean"}}}}}}}},"/buckets/{id}":{"delete":{"tags":["Storage"],"summary":"Delete a bucket (destructive)","description":"Requires an API key with scope(s): storage:delete.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/buckets/{id}/objects":{"get":{"tags":["Storage"],"summary":"List objects","description":"Requires an API key with scope(s): storage:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"prefix","in":"query","schema":{"type":"string"}}]},"post":{"tags":["Storage"],"summary":"Upload an object","description":"Requires an API key with scope(s): storage:create.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"query","required":true,"schema":{"type":"string"}}]}},"/account/usage":{"get":{"tags":["Account"],"summary":"Usage vs plan limits","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/account/limits":{"get":{"tags":["Account"],"summary":"Plan limits + features","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/account/billing":{"get":{"tags":["Account"],"summary":"Billing + trial state","description":"Requires an API key with scope(s): billing:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/account/api-keys":{"get":{"tags":["Account"],"summary":"List API keys","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/account/audit-logs":{"get":{"tags":["Account"],"summary":"API + agent activity log","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/agent/status":{"get":{"tags":["Agent"],"summary":"AI-optimized account snapshot","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/agent/recommendations":{"get":{"tags":["Agent"],"summary":"Actionable recommendations","description":"Requires an API key with scope(s): account:read.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_…","description":"Your Swyftstack API key. Create one under Settings → API keys, or connect an AI client with device login (no key to paste)."}},"schemas":{"DataEnvelope":{"type":"object","properties":{"data":{},"meta":{"type":"object"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Scopes":{"type":"string","enum":["database:create","database:read","database:update","database:delete","storage:create","storage:read","storage:update","storage:delete","backup:create","backup:restore","backup:delete","backup:download","backup:list","account:read","billing:read","team:read"]}},"responses":{"Unauthorized":{"description":"Missing/invalid/expired/revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Key lacks the scope, or a destructive op without dangerous enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource absent or not in the key's org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}