{"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,"minItems":1,"type":"array"},"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"},"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"},"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"}]}