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

# Create project

> Create a new project in draft status

The project is created with `status: "draft"`. It can be promoted to
`deploying` via [Deploy project](/api-reference/projects/deploy).

## Headers

<ParamField header="api-token" type="string" required />

## Body

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

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

<ParamField body="politicsId" type="string" required>
  24-character hex ObjectId of a politics owned by the same user.
</ParamField>

<ParamField body="files" type="File[]">
  Optional list of input files to analyze.

  <Expandable title="File">
    <ParamField body="name" type="string" required />

    <ParamField body="type" type="string" required>
      One of `video`, `document`, `url`, `photo`, `audio`, `text`.
    </ParamField>

    <ParamField body="url" type="string">
      Required for all types **except** `text`. Must be `http(s)`.
    </ParamField>

    <ParamField body="content" type="string">
      Required when `type` is `text`. The content is uploaded to the
      `dabarai-assets` S3 bucket and stored as a `document` file with the
      resulting public URL.
    </ParamField>
  </Expandable>
</ParamField>

## Response — `201 Created`

<ResponseField name="success" type="boolean" />

<ResponseField name="message" type="string" />

<ResponseField name="data" type="Project">
  Full inserted document including `_id`, `userId`, `status: "draft"`,
  `createdAt`, `updatedAt`.
</ResponseField>

## Errors

| Status | Reason                                              |
| ------ | --------------------------------------------------- |
| `400`  | Missing fields or invalid `politicsId` / file shape |
| `404`  | `politicsId` does not exist for this user           |
| `500`  | S3 upload failure for a `text` file                 |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.dabarai.com/v1/projects" \
    -H "api-token: YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Sugar Mill Analysis",
      "description": "Quarterly compliance run",
      "politicsId": "69aa51d188c08a82d22fb2d8",
      "files": [
        { "name": "report.pdf", "type": "document", "url": "https://cdn.example.com/report.pdf" },
        { "name": "notes.txt", "type": "text", "content": "Raw notes here..." }
      ]
    }'
  ```
</RequestExample>
