Projects API Overview
The Projects API allows you to organize your Markdown and MDX files into isolated workspaces. Each project has its own Google Cloud Storage bucket, statistics tracking, and independent file namespace.
What is a Project?
A project is a container for related files with the following characteristics:
- Unique Name: Each project must have a unique name within your account
- Isolated Storage: Each project gets its own GCS bucket for file storage
- Statistics Tracking: Automatic tracking of file count and total size
- Default Project: Every account has one default project created automatically
- Soft Deletion: Projects can be soft-deleted (marked inactive) or hard-deleted (permanently removed)
Project Lifecycle
Create → Active → [Update] → Delete → Removed
↓ ↓
Default Project Soft Delete (inactive)
(auto-created) Hard Delete (removed)Lifecycle States
- Creation: Projects are created with a unique name and optional description
- Active: Normal operational state - files can be uploaded and managed
- Updated: Name and description can be modified at any time
- Soft Deleted: Marked as inactive (
is_active=false) - can be reactivated - Hard Deleted: Permanently removed along with all files and GCS bucket
Project Properties
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the project |
name | string | Project name (max 255 chars, unique per user) |
description | string|null | Optional project description |
bucket_name | string | GCS bucket name (auto-generated, unique globally) |
is_default | boolean | Whether this is the default project |
is_active | boolean | Whether project is active (false if soft-deleted) |
file_count | integer | Number of files in the project |
total_size_bytes | integer | Total size of all files in bytes |
created_date | datetime | When project was created (UTC) |
updated_date | datetime | When project was last modified (UTC) |
Default Project
Every account automatically gets a default project on first login:
- Name:
"Default Project"or"default" is_default: true- Created automatically if no projects exist
- Cannot be deleted (returns error)
- Ideal for quick testing and single-project use cases
Storage Architecture
Each project uses a dedicated Google Cloud Storage bucket:
Bucket Naming:
markdown-api-{user_id}-{project_id}Benefits:
- Isolated storage per project
- Independent access control
- Easy project-level backups
- Simple cleanup on deletion
File Paths:
gs://markdown-api-user123-proj456/document.md
gs://markdown-api-user123-proj456/folder/article.mdxStatistics Tracking
Projects automatically track usage statistics:
- file_count: Incremented on upload, decremented on delete
- total_size_bytes: Updated on upload, update, and delete operations
- Real-time updates: Statistics updated immediately on file operations
Example:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "AI Articles",
"file_count": 42,
"total_size_bytes": 2097152 // 2 MB
}Naming Rules
Project names must follow these rules:
- Length: 1-255 characters
- Uniqueness: Must be unique within your account
- Characters: Any UTF-8 characters allowed
- Case-sensitive: “Project” and “project” are different
- Reserved names: Cannot use “default” if default project exists
Valid names:
"My Project"
"AI Articles 2025"
"项目一" (Chinese characters)
"Проект" (Cyrillic)Invalid operations:
- Creating duplicate names (409 Conflict)
- Empty names (400 Bad Request)
- Names over 255 characters (422 Validation Error)
Common Use Cases
1. Content Organization
Organize content by purpose or client:
Projects:
- "Blog Articles" → All blog posts
- "Documentation" → API/product docs
- "Client ABC" → Client-specific content
- "AI Agent Memory" → Agent conversation history2. Environment Separation
Separate development and production content:
Projects:
- "Development" → Test content
- "Staging" → Review content
- "Production" → Live content3. Temporal Organization
Organize by time period:
Projects:
- "Q1 2025 Content"
- "Q2 2025 Content"
- "Archive 2024"4. Agent Workspaces
Give each AI agent its own project:
Projects:
- "Agent-Writer" → Content generation agent
- "Agent-Summarizer" → Summary agent
- "Agent-Memory" → Long-term memory storagePerformance Considerations
Project Limits
- Projects per account: Unlimited (soft limit: 1000)
- Files per project: Unlimited (soft limit: 100,000)
- Total size per project: Unlimited (soft limit: 100 GB)
Exceeding soft limits may require account upgrade.
Operation Speed
| Operation | Typical Duration | Notes |
|---|---|---|
| Create project | 100-300ms | Includes GCS bucket creation |
| List projects | 50-100ms | Scales with project count |
| Get project | 20-50ms | Single record lookup |
| Update project | 50-100ms | Fast metadata update |
| Delete project | 500ms-5s | Depends on file count |
Optimization Tips
- Cache project lists: Projects change infrequently - cache for 5-10 minutes
- Reuse projects: Creating many projects is expensive - reuse when possible
- Batch operations: Group file operations within same project
- Monitor statistics: Use file_count and total_size_bytes for capacity planning
Best Practices
Naming Conventions
Use consistent, descriptive names:
# Good
"Blog Articles 2025"
"Client ABC - Marketing Content"
"Agent Memory - Production"
# Avoid
"Project 1"
"Test"
"asdf"Project Structure
Organize projects logically:
# By purpose (recommended)
- Content Generation
- Agent Memory
- Documentation
- Archive
# By environment
- Development
- Staging
- Production
# By client (for agencies)
- Client A
- Client B
- InternalCleanup Strategy
Regularly clean up unused projects:
- Identify inactive projects: No file uploads in 90+ days
- Archive if needed: Download files before deletion
- Soft delete first: Mark inactive to test impact
- Hard delete after confirmation: Permanent removal
Security Considerations
- Access control: Projects are user-scoped - no sharing (yet)
- Bucket isolation: Each project has isolated storage
- Soft delete: Use soft delete for recoverable deletion
- Audit trail: Track created_date and updated_date
API Endpoints
Available Operations
Quick Reference
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/projects | Create a new project |
| GET | /api/projects | List all projects |
| GET | /api/projects/{id} | Get specific project |
| PUT | /api/projects/{id} | Update project metadata |
| DELETE | /api/projects/{id} | Delete project and all files |
Error Scenarios
Common Errors
| Error | Status | Cause | Solution |
|---|---|---|---|
| Duplicate name | 409 | Project with name exists | Use unique name |
| Not found | 404 | Project doesn’t exist | Check project ID |
| Unauthorized | 401 | Invalid/missing auth | Check credentials |
| Forbidden | 403 | Not project owner | Verify ownership |
| Validation error | 422 | Invalid input data | Check request format |
Edge Cases
- Deleting default project: Returns 403 Forbidden
- Updating to duplicate name: Returns 409 Conflict
- Deleting project with files: All files deleted (use with caution)
- Creating while rate limited: Returns 429 - retry with backoff
Migration and Import
Moving Files Between Projects
Projects don’t support direct file moves. To move files:
- Download files from source project
- Upload files to destination project
- Verify upload succeeded
- Delete files from source project
Bulk Import
For bulk imports, use parallel uploads:
import asyncio
import httpx
async def bulk_upload(api_key, project_id, files):
async with httpx.AsyncClient() as client:
tasks = [
upload_file(client, api_key, project_id, file_path)
for file_path in files
]
results = await asyncio.gather(*tasks)
return resultsMonitoring and Observability
Key Metrics to Track
- Project count: Monitor growth over time
- Files per project: Identify large projects
- Storage per project: Track storage consumption
- Creation rate: Detect unusual activity
- Deletion rate: Monitor cleanup patterns
Alerting Recommendations
Set up alerts for:
- Projects approaching 100k files
- Projects approaching 100 GB
- Unusual creation/deletion patterns
- Failed operations (5xx errors)
Next Steps
- Create Project - Learn how to create projects
- Files API - Manage files within projects
- Quick Start Guide - Complete tutorial
- Core Concepts - Deep dive into project concepts