> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Project

> Create a new project

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Project name
</ParamField>

<ParamField body="slug" type="string" required>
  URL-friendly project identifier (must be unique within organization)
</ParamField>

<ParamField body="description" type="string">
  Project description
</ParamField>

<ParamField body="settings" type="object">
  Project settings
</ParamField>

<ParamField body="settings.defaultLocale" type="string">
  Default content locale
</ParamField>

<ParamField body="settings.supportedLocales" type="string[]">
  Available locales
</ParamField>

<ParamField body="settings.defaultPlatform" type="string">
  Default platform for CMS preview: `mobile`, `tablet`, or `desktop`
</ParamField>

<ParamField body="settings.supportedPlatforms" type="string[]">
  Available platforms for content preview
</ParamField>

<ParamField body="settings.thumbnailUrl" type="string">
  Project thumbnail image URL
</ParamField>

### Example Request

```json theme={null}
{
  "name": "Product Documentation",
  "slug": "product-docs",
  "description": "Documentation site for products",
  "settings": {
    "defaultLocale": "en-US",
    "supportedLocales": ["en-US", "es-ES"],
    "defaultPlatform": "desktop",
    "supportedPlatforms": ["desktop", "mobile", "tablet"],
    "thumbnailUrl": "https://cdn.acme.com/thumbnails/product-docs.png"
  }
}
```

## Response

Returns the created Project object.

```json theme={null}
{
  "id": "proj789",
  "organizationId": "org123",
  "name": "Product Documentation",
  "slug": "product-docs",
  "description": "Documentation site for products",
  "status": "active",
  "environment": "development",
  "settings": {
    "defaultLocale": "en-US",
    "supportedLocales": ["en-US", "es-ES"],
    "defaultPlatform": "desktop",
    "supportedPlatforms": ["desktop", "mobile", "tablet"],
    "thumbnailUrl": "https://cdn.acme.com/thumbnails/product-docs.png"
  },
  "dependencies": [],
  "permissions": {
    "public": false
  },
  "metadata": {
    "createdBy": "user123"
  },
  "createdAt": "2024-03-22T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}
```

## Error Responses

### Slug Already Exists

```json theme={null}
{
  "error": {
    "code": "SLUG_ALREADY_EXISTS",
    "message": "A project with this slug already exists",
    "details": {
      "slug": "product-docs"
    }
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Product Documentation",
      "slug": "product-docs",
      "description": "Documentation site for products",
      "settings": {
        "defaultLocale": "en-US",
        "supportedLocales": ["en-US", "es-ES"]
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Product Documentation',
        slug: 'product-docs',
        description: 'Documentation site for products',
        settings: {
          defaultLocale: 'en-US',
          supportedLocales: ['en-US', 'es-ES']
        }
      })
    }
  );

  const project = await response.json();
  console.log(`Created project: ${project.id}`);
  ```

  ```swift Swift theme={null}
  struct CreateProjectRequest: Encodable {
      let name: String
      let slug: String
      let description: String
      let settings: ProjectSettings
  }

  let request = CreateProjectRequest(
      name: "Product Documentation",
      slug: "product-docs",
      description: "Documentation site for products",
      settings: ProjectSettings(defaultLocale: "en-US")
  )

  // Make POST request with encoded body
  ```

  ```kotlin Kotlin theme={null}
  val response = client.post("https://api.metabind.ai/app/v1/organizations/org123/projects") {
      header("Authorization", "Bearer YOUR_JWT")
      contentType(ContentType.Application.Json)
      setBody(CreateProjectRequest(
          name = "Product Documentation",
          slug = "product-docs",
          description = "Documentation site for products"
      ))
  }
  ```
</CodeGroup>
