{"components":{"responses":{"Error":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"schemas":{"AgentKey":{"properties":{"agent_type":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"grants":{"items":{"properties":{"permission":{"enum":["read","write"],"type":"string"},"root_path":{"type":"string"},"workspace_id":{"type":["integer","null"]}},"required":[],"type":"object"},"type":"array"},"id":{"type":"integer"},"ip_allowlist":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"prefix":{"type":"string"},"rate_limit_per_min":{"type":["integer","null"]}},"required":[],"type":"object"},"Error":{"properties":{"docs":{"type":"string"},"error":{"type":"string"},"hint":{"type":"string"},"message":{"type":"string"},"ok":{"const":false,"type":"boolean"}},"required":[],"type":"object"},"Node":{"properties":{"content_type":{"type":["string","null"]},"created_at":{"format":"date-time","type":"string"},"created_by":{"type":["string","null"]},"id":{"type":"integer"},"kind":{"enum":["file","folder"],"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"sha256":{"type":["string","null"]},"size":{"type":"integer"},"updated_at":{"format":"date-time","type":"string"},"updated_by":{"type":["string","null"]},"version":{"type":"integer"}},"required":[],"type":"object"},"Workspace":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"org_id":{"type":"integer"},"role":{"type":"string"}},"required":[],"type":"object"}},"securitySchemes":{"bearer":{"description":"DriveBot API key (adk_…) or session token (ads_…)","scheme":"bearer","type":"http"}}},"info":{"contact":{"name":"DriveBot support","url":"https://drivebot.in/support"},"description":"Every successful response includes `ok: true` and a plain-language `message`; every error includes `ok: false`, `error`, `message`, `hint` and `docs`. Full guide: https://drivebot.in/llms.txt. MCP server: https://drivebot.in/mcp.","summary":"Versioned file storage for AI agents and teams","termsOfService":"https://drivebot.in/terms","title":"DriveBot API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/auth/logout":{"post":{"operationId":"logout","responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"End the session"}},"/auth/otp/send":{"post":{"operationId":"sendOtp","requestBody":{"content":{"application/json":{"schema":{"properties":{"phone":{"type":"string"}},"required":["phone"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"security":[],"summary":"Send a one-time sign-in code by SMS"}},"/auth/otp/verify":{"post":{"operationId":"verifyOtp","requestBody":{"content":{"application/json":{"schema":{"properties":{"agent":{"properties":{"all":{"type":"boolean"},"name":{"type":"string"},"permission":{"enum":["read","write"],"type":"string"},"root_path":{"type":"string"},"type":{"type":"string"},"workspace":{"type":"string"},"workspace_id":{"type":"integer"}},"required":[],"type":"object"},"code":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"}},"required":["phone","code"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"security":[],"summary":"Verify the code; creates the account on first use and optionally mints an agent API key"}},"/me":{"get":{"operationId":"me","responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Who am I: user + orgs, or agent + reachable workspaces"},"patch":{"operationId":"updateMe","requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Change display name"}},"/orgs":{"get":{"operationId":"listOrgs","responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Organizations you belong to"},"post":{"operationId":"createOrg","requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create an organization"}},"/orgs/{org}/audit":{"get":{"operationId":"audit","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}},{"in":"query","name":"actor","schema":{"type":"string"}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"workspace_id","schema":{"type":"integer"}},{"in":"query","name":"since","schema":{"type":"integer"}},{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"format","schema":{"type":"string"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Org-wide audit log (add format=csv to export)"}},"/orgs/{org}/keys":{"get":{"operationId":"listOrgKeys","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Org-level agent keys"},"post":{"operationId":"createOrgKey","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"agent_type":{"type":"string"},"expires_in_days":{"type":"integer"},"grants":{"items":{"properties":{"permission":{"type":"string"},"root_path":{"type":"string"},"workspace_id":{"type":["integer","string","null"]}},"required":[],"type":"object"},"type":"array"},"ip_allowlist":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"rate_limit_per_min":{"type":"integer"}},"required":["name","grants"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create an agent key with per-workspace grants and policies"}},"/orgs/{org}/members":{"get":{"operationId":"listOrgMembers","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Org members and invites"},"post":{"operationId":"addOrgMember","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"phone":{"type":"string"},"role":{"enum":["owner","admin","member","billing"],"type":"string"}},"required":["phone"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Add or invite a member"}},"/orgs/{org}/teams":{"get":{"operationId":"listTeams","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Teams"},"post":{"operationId":"createTeam","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a team"}},"/orgs/{org}/workspaces":{"get":{"operationId":"listOrgWorkspaces","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Workspaces in the org"},"post":{"operationId":"createOrgWorkspace","parameters":[{"description":"Organization id","in":"path","name":"org","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a workspace in the org"}},"/support":{"post":{"operationId":"createSupportRequest","requestBody":{"content":{"application/json":{"schema":{"properties":{"contact":{"type":"string"},"message":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"}},"required":["contact","subject","message"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"security":[],"summary":"File a support request (no auth needed)"}},"/workspaces":{"get":{"operationId":"listWorkspaces","responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Workspaces the caller can reach"},"post":{"operationId":"createWorkspace","requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"},"org_id":{"type":"integer"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a workspace"}},"/workspaces/{ws}":{"get":{"operationId":"getWorkspace","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Workspace, your role and permissions"},"patch":{"operationId":"renameWorkspace","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Rename"}},"/workspaces/{ws}/copy":{"post":{"operationId":"copy","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Copy"}},"/workspaces/{ws}/delete":{"post":{"operationId":"delete","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Move to trash"}},"/workspaces/{ws}/download":{"get":{"operationId":"downloadFile","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"type":"string"}},{"in":"query","name":"version","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Raw bytes of a file"}},"/workspaces/{ws}/events":{"get":{"operationId":"listEvents","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"since","schema":{"type":"integer"}},{"in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Activity log for the workspace"}},"/workspaces/{ws}/keys":{"get":{"operationId":"listWorkspaceKeys","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Agent keys that reach this workspace"},"post":{"operationId":"createWorkspaceKey","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"agent_type":{"type":"string"},"expires_in_days":{"type":"integer"},"name":{"type":"string"},"permission":{"enum":["read","write"],"type":"string"},"root_path":{"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a single-workspace agent key"}},"/workspaces/{ws}/ls":{"get":{"operationId":"listFiles","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"default":"/","type":"string"}},{"in":"query","name":"recursive","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"List a folder"}},"/workspaces/{ws}/members":{"get":{"operationId":"listMembers","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Members, team grants and pending invites"},"post":{"operationId":"addMember","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"phone":{"type":"string"},"role":{"enum":["admin","editor","viewer"],"type":"string"}},"required":["phone"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Add a member by phone (unknown numbers get an invite)"}},"/workspaces/{ws}/mkdir":{"post":{"operationId":"mkdir","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a folder"}},"/workspaces/{ws}/move":{"post":{"operationId":"move","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Move or rename"}},"/workspaces/{ws}/read":{"get":{"operationId":"readFile","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"type":"string"}},{"in":"query","name":"offset","schema":{"type":"integer"}},{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"version","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Extracted text of a file (text, code, PDF, DOCX), paginated by characters"}},"/workspaces/{ws}/search":{"get":{"operationId":"search","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"mode","schema":{"type":"string"}},{"in":"query","name":"path","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Search names and contents (hybrid keyword + semantic)"}},"/workspaces/{ws}/shares":{"get":{"operationId":"listShares","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Share links"},"post":{"operationId":"createShare","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"expires_in_hours":{"type":"integer"},"path":{"type":"string"},"permission":{"enum":["view","edit"],"type":"string"}},"required":["path"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create a public share link"}},"/workspaces/{ws}/stat":{"get":{"operationId":"stat","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"File or folder metadata"}},"/workspaces/{ws}/trash":{"get":{"operationId":"listTrash","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Trashed items"}},"/workspaces/{ws}/upload":{"put":{"operationId":"uploadFile","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"type":"string"}},{"in":"query","name":"message","schema":{"type":"string"}},{"in":"query","name":"if_version","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Upload raw bytes as the request body"}},"/workspaces/{ws}/versions":{"get":{"operationId":"listVersions","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}},{"in":"query","name":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Version history"}},"/workspaces/{ws}/versions/restore":{"post":{"operationId":"restoreVersion","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"path":{"type":"string"},"version":{"type":"integer"}},"required":["path","version"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Restore an older version as a new version"}},"/workspaces/{ws}/write":{"post":{"operationId":"writeFile","parameters":[{"description":"Workspace id","in":"path","name":"ws","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content":{"type":"string"},"content_type":{"type":"string"},"encoding":{"enum":["utf8","base64"],"type":"string"},"if_version":{"type":"integer"},"message":{"type":"string"},"path":{"type":"string"}},"required":["path","content"],"type":"object"}}},"required":true},"responses":{"200":{"description":"OK (includes ok: true and message)"},"4XX":{"$ref":"#/components/responses/Error"}},"summary":"Create or update a file from JSON content"}}},"security":[{"bearer":[]}],"servers":[{"url":"https://drivebot.in/api/v1"}]}