Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
folders
Create Folder
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/folders \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "<string>",
  "parentId": "<string>",
  "order": 123
}
'

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

name
string
required
Display name for the folder
type
string
required
Folder type: content or asset
parentId
string
Parent folder ID (null for root level)
order
number
Order position among siblings (defaults to end)

Example Request

{
  "name": "Content Search Templates",
  "parentId": null,
  "type": "content",
  "order": 2.0
}

Response

Returns the created Folder object.
{
  "id": "folder789",
  "name": "Content Search Templates",
  "parentId": null,
  "type": "content",
  "order": 2.0,
  "createdAt": "2024-03-22T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}

Error Responses

Invalid Parent

{
  "error": {
    "code": "INVALID_PARENT",
    "message": "Parent folder not found or type mismatch",
    "details": {
      "parentId": "folder123"
    }
  }
}

Type Mismatch with Parent

{
  "error": {
    "code": "TYPE_MISMATCH",
    "message": "Folder type must match parent folder type",
    "details": {
      "parentType": "asset",
      "providedType": "content"
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/folders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Content Search Templates",
    "type": "content",
    "order": 2.0
  }'