Skip to main content

REST API Reference

Bossa exposes a REST API for all filesystem operations. Use it when MCP isn’t available or when building custom integrations. Base URL: https://bossamemory.com/api/v1 Authentication: Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY

Endpoints

Create or Overwrite a File

Body:
Response: 200{"path": "/docs/readme.md", "content": "..."}

Bulk Create/Overwrite Files

Body:
  • Max 100 files per request.
  • Parent folders are created automatically.
Response: 200{"created": 2, "updated": 0, "failed": []}

Read a File

Response: 200{"path": "/docs/readme.md", "content": "..."} Errors: 404 if file not found

List Directory

Query: Response: 200 — Without metadata: {"items": ["customers/", "docs/", "readme.txt"]}. With metadata=true: {"items": [{"name": "docs/", "type": "directory"}, {"name": "readme.txt", "type": "file", "size": 1024, "modified": "2026-03-06T10:00:00Z"}]}. Directories end with /.

Stat (File Metadata)

Response: 200{"path": "/docs/readme.md", "size": 1024, "modified": "2026-03-06T10:00:00Z", "created": "2026-03-01T08:00:00Z"}. 404 if not found.

Tree

Query: path (default /), depth (optional, limits recursion). Response: 200{"tree": " a/\n b/\n file.txt"}

Disk Usage

Response: 200{"usage": [{"path": "/", "size": 4096}, {"path": "/docs", "size": 2048}]}

Batch Operations

Body:
Max 100 ops per request. Response: 200{"results": [{"op": "read", "path": "...", "content": "..."}, ...]}

Search (Grep)

Body:
At least one of pattern, all_of, any_of, or none_of is required. Response: 200 — Depends on output_mode:
  • matches: {matches: [{path, line_number, line, context_before, context_after}], has_more, next_offset}
  • files_with_matches: {files: ["/path/a.md", "/path/b.md"]}
  • count: {count: 42, total_matches: 42}

Query: Response: 200{"paths": ["/docs/a.md", "/docs/b.md"]}

Edit a File

Body:
Replaces the first occurrence of old_string with new_string. Response: 200{"path": "/config.json", "edited": true} Errors: 404 if file not found or old_string not in file

Delete a File

Response: 200{"path": "/docs/old.txt", "deleted": true} Errors: 404 if file not found

Usage

Returns current usage and limits for the account associated with the API key. Response: 200{"storage_mb": 12.5, "files_count": 42, "requests_today": 156, "tier": "free", "limits": {"storage_mb": 100, "files": 500, "requests_per_day": 1000}} See Pricing & Limits for tier details.

Billing

Create Checkout Session

Creates a Stripe Checkout session for Pro subscription. Requires JWT (from bossa login), not API key. Query: intervalmonth (default) or year Response: 200{"checkout_url": "https://checkout.stripe.com/..."} Redirect the user to checkout_url to complete payment. See Pricing & Limits.

Create Portal Session

Creates a Stripe Customer Portal session for managing subscription (update payment, view invoices, cancel). Requires JWT (from bossa login), not API key. Response: 200{"url": "https://billing.stripe.com/..."} Redirect the user to url to manage their subscription. Returns 400 with "No billing account. Run 'bossa billing upgrade' first." if the user has no Stripe customer. Returns 503 if billing is not configured.

Public Endpoint

Health Check

No authentication required. Returns 200 with {"status": "ok"}.

Error Responses

Last modified on March 13, 2026