{"components":{"schemas":{"DiscoveredRegionAccessToken":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"keyId":{"type":"string"},"keyVersion":{"minimum":1,"type":"integer"},"principalId":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"},"workspaceId":{"type":"string"}},"required":["id","accessToken","tokenType","expiresAt","scopes","keyId","principalId","keyVersion","region","workspaceId"],"type":"object"},"DiscoveredRegionToken":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"enrollmentExpiresAt":{"minimum":1,"type":"integer"},"enrollmentTicket":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"keyId":{"type":"string"},"keyVersion":{"minimum":1,"type":"integer"},"nonce":{"type":"string"},"principalId":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"},"workspaceId":{"type":"string"}},"required":["id","accessToken","tokenType","expiresAt","scopes","keyId","principalId","keyVersion","region","enrollmentTicket","enrollmentExpiresAt","nonce","workspaceId"],"type":"object"},"DiscoveredToken":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"},"workspaceId":{"type":"string"}},"required":["id","accessToken","tokenType","expiresAt","scopes","workspaceId"],"type":"object"},"Error":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message","requestId"],"type":"object"}},"required":["error"],"type":"object"},"Grants":{"additionalProperties":false,"properties":{"regionId":{"type":"string"},"resourceIds":{"items":{"type":"string"},"maxItems":1024,"type":"array"},"resourceTypes":{"description":"Selected types include current and future public resources in this Workspace.","items":{"enum":["database","filesystem"],"type":"string"},"maxItems":2,"type":"array","uniqueItems":true},"scopes":{"items":{"type":"string"},"maxItems":8,"minItems":1,"type":"array"}},"required":["scopes","resourceIds","regionId"],"type":"object"},"Issuance":{"additionalProperties":false,"properties":{"audience":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"keyId":{"type":"string"},"principalId":{"type":"string"},"status":{"const":"issued"}},"required":["id","keyId","principalId","expiresAt","audience","status"],"type":"object"},"Key":{"additionalProperties":false,"properties":{"createdAt":{"minimum":0,"type":"integer"},"expiresAt":{"minimum":1,"type":"integer"},"grantRef":{"type":"string"},"keyId":{"format":"uuid","type":"string"},"keyVersion":{"minimum":1,"type":"integer"},"name":{"maxLength":80,"minLength":1,"type":"string"},"principalId":{"type":"string"},"revoked":{"type":"boolean"},"workspaceId":{"type":"string"}},"required":["name","createdAt","workspaceId","keyId","principalId","keyVersion","grantRef","expiresAt","revoked"],"type":"object"},"RaftAuditEvent":{"additionalProperties":false,"properties":{"action":{"type":"string"},"actor":{"additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"enum":["human","agent"]},"serverId":{"type":"string"}},"required":["id","kind","serverId"],"type":"object"},"at":{"type":"string"},"details":{"type":"object"},"id":{"type":"string"},"outcome":{"enum":["recorded","denied","uncertain"]}},"required":["id","at","action","outcome","actor","details"],"type":"object"},"RaftCatalog":{"properties":{"capabilities":{"properties":{"filesystem":{"properties":{"provider":{"type":"string"},"regions":{"items":{"type":"string"},"type":"array"}},"required":["regions","provider"],"type":"object"},"postgresql":{"properties":{"available":{"type":"boolean"},"provider":{"type":"string"},"regions":{"items":{"type":"string"},"type":"array"}},"required":["regions","provider","available"],"type":"object"}},"required":["filesystem","postgresql"],"type":"object"},"data":{"items":{"$ref":"#/components/schemas/RaftResource"},"type":"array"},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor","capabilities"],"type":"object"},"RaftContext":{"properties":{"actor":{"additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"enum":["human","agent"]},"serverId":{"type":"string"}},"required":["id","kind","serverId"],"type":"object"},"enrollmentRequired":{"type":"boolean"},"expiresAt":{"type":"integer"},"nextCursor":{"type":["string","null"]},"resourceReady":{"description":"Null until list-resources has checked resource readiness.","type":["boolean","null"]},"workspaces":{"items":{"$ref":"#/components/schemas/RaftWorkspace"},"type":"array"}},"required":["actor","expiresAt","enrollmentRequired","resourceReady","workspaces","nextCursor"],"type":"object"},"RaftEnrollment":{"additionalProperties":false,"properties":{"principal":{"$ref":"#/components/schemas/RaftPrincipal"},"status":{"enum":["pending","approved","denied","removed"]}},"required":["principal","status"],"type":"object"},"RaftFile":{"properties":{"content":{"type":"string"},"encoding":{"const":"utf8"},"revision":{"type":"string"},"size":{"type":"integer"}},"required":["content","encoding","size"],"type":"object"},"RaftGrant":{"additionalProperties":false,"properties":{"actions":{"items":{"enum":["resources:read","files:read","files:write","queries:read","queries:execute","tags:write"],"type":"string"},"type":"array"},"expiresAt":{"type":"integer"},"id":{"type":"string"},"principalId":{"type":"string"},"resourceId":{"type":"string"},"revoked":{"type":"boolean"}},"required":["id","principalId","resourceId","actions","revoked"],"type":"object"},"RaftGrantInput":{"additionalProperties":false,"properties":{"actions":{"items":{"enum":["resources:read","files:read","files:write","queries:read","queries:execute","tags:write"],"type":"string"},"type":"array"},"expiresAt":{"type":"integer"},"principalId":{"type":"string"},"revoked":{"type":"boolean"}},"required":["principalId","actions"],"type":"object"},"RaftPrincipal":{"additionalProperties":false,"properties":{"id":{"type":"string"},"identity":{"additionalProperties":false,"properties":{"kind":{"enum":["human","agent"]},"provider":{"type":"string"},"serverId":{"type":"string"},"subject":{"type":"string"}},"required":["provider","serverId","subject","kind"],"type":"object"}},"required":["id","identity"],"type":"object"},"RaftQuery":{"additionalProperties":false,"properties":{"errorCode":{"type":["string","null"]},"operationId":{"type":"string"},"requestId":{"type":"string"},"result":{"type":["object","null"]},"status":{"enum":["running","succeeded","failed","outcomeUnknown"]}},"required":["requestId","operationId","status","result","errorCode"],"type":"object"},"RaftQueryInput":{"additionalProperties":false,"properties":{"requestId":{"format":"uuid","type":"string"},"resourceId":{"type":"string"},"sql":{"maxLength":65536,"minLength":1,"type":"string"},"workspaceId":{"type":"string"}},"required":["workspaceId","resourceId","requestId","sql"],"type":"object"},"RaftResource":{"properties":{"allowedActions":{"items":{"type":"string"},"type":"array"},"createdBy":{"type":"string"},"id":{"type":"string"},"kind":{"enum":["filesystem","postgresql"]},"name":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"status":{"type":"string"},"tags":{"$ref":"#/components/schemas/RaftTags"}},"required":["id","name","kind","region","status","provider","allowedActions"],"type":"object"},"RaftShareBatch":{"additionalProperties":false,"properties":{"requestId":{"type":"string"},"results":{"items":{"properties":{"errorCode":{"type":"string"},"grant":{"$ref":"#/components/schemas/RaftGrant"},"resourceId":{"type":"string"},"status":{"enum":["applied","pending","failed"]}},"required":["resourceId","status"],"type":"object"},"type":"array"}},"required":["requestId","results"],"type":"object"},"RaftShareBatchInput":{"additionalProperties":false,"properties":{"actions":{"items":{"enum":["resources:read","files:read","files:write","queries:read","queries:execute","tags:write"],"type":"string"},"type":"array"},"expiresAt":{"type":"integer"},"principalId":{"type":"string"},"requestId":{"type":"string"},"resourceIds":{"items":{"type":"string"},"maxItems":20,"minItems":1,"type":"array","uniqueItems":true}},"required":["requestId","expiresAt","principalId","resourceIds","actions"],"type":"object"},"RaftTags":{"additionalProperties":false,"properties":{"values":{"additionalProperties":{"maxLength":256,"type":"string"},"maxProperties":20,"type":"object"},"version":{"minimum":0,"type":"integer"}},"required":["version","values"],"type":"object"},"RaftWorkspace":{"additionalProperties":false,"properties":{"canManage":{"type":"boolean"},"generation":{"type":"integer"},"id":{"type":"string"},"name":{"type":"string"},"regionId":{"type":"string"},"serverId":{"type":"string"}},"required":["id","name","serverId","regionId","generation"],"type":"object"},"Region":{"additionalProperties":false,"properties":{"apiOrigin":{"format":"uri","type":"string"},"apiPathPrefix":{"type":"string"},"regionId":{"type":"string"}},"required":["regionId","apiOrigin","apiPathPrefix"],"type":"object"},"RegionAccessToken":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"keyId":{"type":"string"},"keyVersion":{"minimum":1,"type":"integer"},"principalId":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"}},"required":["id","accessToken","tokenType","expiresAt","scopes","keyId","principalId","keyVersion","region"],"type":"object"},"RegionToken":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"enrollmentExpiresAt":{"minimum":1,"type":"integer"},"enrollmentTicket":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"keyId":{"type":"string"},"keyVersion":{"minimum":1,"type":"integer"},"nonce":{"type":"string"},"principalId":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"}},"required":["id","accessToken","tokenType","expiresAt","scopes","keyId","principalId","keyVersion","region","enrollmentTicket","enrollmentExpiresAt","nonce"],"type":"object"},"Token":{"additionalProperties":false,"properties":{"accessToken":{"type":"string"},"expiresAt":{"minimum":1,"type":"integer"},"id":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"},"tokenType":{"const":"Bearer"}},"required":["id","accessToken","tokenType","expiresAt","scopes"],"type":"object"}},"securitySchemes":{"globalAccess":{"bearerFormat":"Global JWT","scheme":"bearer","type":"http"},"raftSession":{"description":"Encrypted service session; current external identity and exact local permissions are checked on every request.","in":"cookie","name":"aw_raft_session","type":"apiKey"},"workspaceKey":{"description":"Workspace Key is sent only to Global token issuance, never forwarded to Region.","scheme":"bearer","type":"http"}}},"info":{"description":"Independent Global management authority. Key and Global Token issuance are available. Regional data and refresh endpoints are served by Region directly. All expiry values use Unix seconds. Credentials must never be logged or stored in URLs.","title":"Workspace Global Public API","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/token-issuances":{"post":{"description":"The Key identifies its Workspace. Use audience global or region; region selects the Key-granted Region. Legacy Keys without a Workspace hint continue to use the Workspace-scoped issuance endpoint. Never forward the Workspace Key to a Region.","operationId":"createDiscoveredTokenIssuance","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"audience":{"enum":["global","region"]},"clientThumbprint":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"}},"required":["audience"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/DiscoveredToken"},{"$ref":"#/components/schemas/DiscoveredRegionAccessToken"},{"$ref":"#/components/schemas/DiscoveredRegionToken"}]}}},"description":"Successful response","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Successful response","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}}},"security":[{"workspaceKey":[]}],"summary":"Exchange a Workspace Key without configuring a Workspace or Region"}},"/v1/workspaces/{workspaceId}/issuances/{issuanceId}":{"get":{"operationId":"getGlobalTokenIssuance","parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"pattern":"^[A-Za-z0-9_.:-]{1,128}$","type":"string"}},{"in":"path","name":"issuanceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Issuance"}},"required":["data"],"type":"object"}}},"description":"Successful response","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Structured denial or unknown outcome; no credential is echoed.","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}}},"security":[{"globalAccess":[]}],"summary":"Get Global Token Issuance"}},"/v1/workspaces/{workspaceId}/region-route":{"get":{"description":"Send only a Global access Token. Inspect the redirect without automatic credential forwarding; validate the HTTPS target against authenticated Global discovery before using the Region Token. Do not send SQL or file content to this endpoint.","operationId":"getGlobalRegionRoute","parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"pattern":"^[A-Za-z0-9_.:-]{1,128}$","type":"string"}}],"responses":{"307":{"description":"Region API base URL. No data request has been sent to Global.","headers":{"Cache-Control":{"schema":{"const":"no-store"}},"Location":{"required":true,"schema":{"format":"uri","type":"string"}},"X-Region-Id":{"required":true,"schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Successful response","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}}},"security":[{"globalAccess":[]}],"summary":"Discover the Region through a bodyless redirect"}},"/v1/workspaces/{workspaceId}/regions":{"get":{"description":"Requires resources:read on a current Global Token. Only the Key-granted Region is returned. Data requests go directly to Region.","operationId":"listAuthorizedRegions","parameters":[{"in":"path","name":"workspaceId","required":true,"schema":{"pattern":"^[A-Za-z0-9_.:-]{1,128}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/Region"},"type":"array"},"nextCursor":{"type":"null"}},"required":["data","nextCursor"],"type":"object"}}},"description":"Successful response","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Structured denial or unknown outcome; no credential is echoed.","headers":{"Cache-Control":{"schema":{"const":"no-store"}}}}},"security":[{"globalAccess":[]}],"summary":"List Authorized Regions"}}},"servers":[{"url":"https://drive9.ai/studio/api"}]}