Projects API
Projects help you organize materials into campaigns or collections. Use these endpoints to create and manage projects.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/project/create | Create project |
| PUT | /api/project/{id} | Update project |
| POST | /api/project/{id}/copy | Copy project |
| GET | /api/projects | List all projects |
| GET | /api/projects/{id}/materials | Get project materials |
| POST | /api/projects/{id}/materials | Add material to project |
| DELETE | /api/projects/{id} | Delete project |
Create Project
POST /api/project/create Create a new project to organize your materials.
Request Body
{
"name": "Summer 2024 Campaign",
"description": "All materials for the summer sale campaign",
"metadata": {
"client": "Acme Corp",
"budget": "10000",
"startDate": "2024-06-01"
}
}
Response
{
"success": true,
"data": {
"id": "proj_abc123",
"name": "Summer 2024 Campaign",
"description": "All materials for the summer sale campaign",
"metadata": {
"client": "Acme Corp",
"budget": "10000",
"startDate": "2024-06-01"
},
"materialsCount": 0,
"createdAt": "2024-01-15T10:30:00Z"
}
}
Update Project
PUT /api/project/{projectId} Update an existing project's details.
Request Body
{
"name": "Summer 2024 Campaign - Extended",
"description": "Updated description with extended timeline",
"metadata": {
"client": "Acme Corp",
"budget": "15000",
"startDate": "2024-06-01",
"endDate": "2024-09-30"
}
}
Response
{
"success": true,
"data": {
"id": "proj_abc123",
"name": "Summer 2024 Campaign - Extended",
"description": "Updated description with extended timeline",
"metadata": {
"client": "Acme Corp",
"budget": "15000",
"startDate": "2024-06-01",
"endDate": "2024-09-30"
},
"materialsCount": 15,
"updatedAt": "2024-01-20T14:00:00Z"
}
}
Copy Project
POST /api/project/{projectId}/copy Duplicate a project and optionally its materials.
Request Body
{
"name": "Fall 2024 Campaign",
"copyMaterials": true,
"copyAssets": false
}
Parameters
Parameter Type Description name string Name for the new project copyMaterials boolean Whether to copy all materials (default: false) copyAssets boolean Whether to copy associated assets (default: false)
Response
{
"success": true,
"data": {
"id": "proj_def456",
"name": "Fall 2024 Campaign",
"copiedFrom": "proj_abc123",
"materialsCount": 15,
"createdAt": "2024-01-15T10:30:00Z"
}
}
List Projects
GET /api/projects List all projects in your account.
Query Parameters
Parameter Type Description limit integer Number of projects to return (default: 20) offset integer Offset for pagination search string Search in project names
Response
{
"success": true,
"data": [
{
"id": "proj_abc123",
"name": "Summer 2024 Campaign",
"materialsCount": 15,
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "proj_def456",
"name": "Spring Collection",
"materialsCount": 8,
"createdAt": "2024-02-01T09:00:00Z"
}
],
"pagination": {
"total": 12,
"limit": 20,
"offset": 0
}
}
Get Project Materials
GET /api/projects/{projectId}/materials List all materials in a specific project.
Response
{
"success": true,
"data": {
"project": {
"id": "proj_abc123",
"name": "Summer 2024 Campaign"
},
"materials": [
{
"id": "mat_xyz789",
"name": "Summer Sale Video - Product A",
"status": "ready",
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "mat_xyz790",
"name": "Summer Sale Video - Product B",
"status": "ready",
"createdAt": "2024-01-15T10:35:00Z"
}
]
}
}
Add Material to Project
POST /api/projects/{projectId}/materials Add an existing material to a project.
Request Body
{
"materialId": "mat_xyz789"
}
Response
{
"success": true,
"message": "Material added to project"
}
Delete Project
DELETE /api/projects/{projectId} Delete a project. Materials are not deleted but will be unassigned from the project.
Response
{
"success": true,
"message": "Project deleted successfully"
}
Note: Deleting a project does not delete its materials. To delete materials, use the Materials API.