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

# Projects

> Create, read, update, and delete PRD projects

# Projects API

## List Projects

```http theme={null}
GET /api/projects
```

**Query Parameters:**

| Parameter      | Type    | Description                                  |
| -------------- | ------- | -------------------------------------------- |
| `search`       | string  | Filter by project name                       |
| `status`       | string  | Filter by status (DRAFT, IN\_PROGRESS, etc.) |
| `templateId`   | string  | Filter by template                           |
| `priority`     | string  | Filter by priority                           |
| `sortBy`       | string  | Sort field                                   |
| `sortOrder`    | string  | `asc` or `desc`                              |
| `assignedToMe` | boolean | Only show assigned projects                  |

<CodeGroup>
  ```bash curl theme={null}
  curl -G https://app.thig.ai/api/projects \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d "status=IN_PROGRESS" \
    -d "sortBy=updatedAt" \
    -d "sortOrder=desc"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects?status=IN_PROGRESS&sortBy=updatedAt&sortOrder=desc', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  const data = await res.json();
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "projects": [
    {
      "id": "proj_123",
      "name": "Mobile App PRD",
      "description": "PRD for our iOS application",
      "status": "IN_REVIEW",
      "priority": "high",
      "templateId": "tmpl_456",
      "assignedToId": "user_789",
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-20T14:00:00Z"
    }
  ],
  "total": 42
}
```

## Create Project

```http theme={null}
POST /api/projects
```

**Body:**

| Field         | Type   | Required | Description                     |
| ------------- | ------ | -------- | ------------------------------- |
| `name`        | string | Yes      | Project name                    |
| `description` | string | No       | Project description             |
| `templateId`  | string | No       | Template to use                 |
| `status`      | string | No       | Initial status (default: DRAFT) |
| `priority`    | string | No       | Priority level                  |

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://app.thig.ai/api/projects \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name": "Mobile App PRD", "templateId": "tmpl_456", "priority": "high"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Mobile App PRD',
      templateId: 'tmpl_456',
      priority: 'high'
    })
  });
  const data = await res.json();
  ```
</CodeGroup>

## Get Project

```http theme={null}
GET /api/projects/{projectId}
```

Returns full project details with template and assignee data. Supports share token authentication via `x-share-token` header.

<CodeGroup>
  ```bash curl theme={null}
  curl https://app.thig.ai/api/projects/proj_123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  const project = await res.json();
  ```
</CodeGroup>

## Update Project

```http theme={null}
PATCH /api/projects/{projectId}
```

**Body:** Any project fields to update (name, description, status, priority, assignedToId, templateId).

<CodeGroup>
  ```bash curl theme={null}
  curl -X PATCH https://app.thig.ai/api/projects/proj_123 \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"status": "IN_REVIEW", "priority": "high"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ status: 'IN_REVIEW', priority: 'high' })
  });
  const data = await res.json();
  ```
</CodeGroup>

## Delete Project

```http theme={null}
DELETE /api/projects/{projectId}
```

<CodeGroup>
  ```bash curl theme={null}
  curl -X DELETE https://app.thig.ai/api/projects/proj_123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123', {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  ```
</CodeGroup>

## Quick Start Project

```http theme={null}
POST /api/projects/quick-start
```

Create a project from the quick-start flow.

**Body:**

| Field        | Type   | Required | Description          |
| ------------ | ------ | -------- | -------------------- |
| `name`       | string | Yes      | Project name         |
| `templateId` | string | No       | Template to use      |
| `useCase`    | string | No       | Use case description |

## Project from Marketplace

```http theme={null}
POST /api/projects/from-marketplace
```

**Body:**

| Field        | Type   | Required | Description             |
| ------------ | ------ | -------- | ----------------------- |
| `templateId` | string | Yes      | Marketplace template ID |
| `name`       | string | No       | Custom project name     |

***

## PRD Documents

### Get PRD

```http theme={null}
GET /api/projects/{projectId}/prd
```

### Create/Replace PRD

```http theme={null}
POST /api/projects/{projectId}/prd
```

**Body:**

| Field     | Type   | Required | Description                 |
| --------- | ------ | -------- | --------------------------- |
| `content` | string | Yes      | PRD content (markdown/HTML) |
| `style`   | string | No       | PRD style                   |

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://app.thig.ai/api/projects/proj_123/prd \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"content": "# Executive Summary\n\nThis PRD outlines...", "style": "comprehensive"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123/prd', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      content: '# Executive Summary\n\nThis PRD outlines...',
      style: 'comprehensive'
    })
  });
  const data = await res.json();
  ```
</CodeGroup>

### Update PRD

```http theme={null}
PATCH /api/projects/{projectId}/prd
```

### PRD Versions

```http theme={null}
GET /api/projects/{projectId}/prd/versions
POST /api/projects/{projectId}/prd/versions
GET /api/projects/{projectId}/prd/versions/{versionId}
```

***

## Files

### List Files

```http theme={null}
GET /api/projects/{projectId}/files
```

### Upload File

```http theme={null}
POST /api/projects/{projectId}/files
```

Send as `multipart/form-data` with `file` field. Max 10MB.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://app.thig.ai/api/projects/proj_123/files \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "file=@./requirements.pdf"
  ```

  ```javascript JavaScript theme={null}
  const formData = new FormData();
  formData.append('file', fileInput.files[0]);

  const res = await fetch('https://app.thig.ai/api/projects/proj_123/files', {
    method: 'POST',
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
    body: formData
  });
  const data = await res.json();
  ```
</CodeGroup>

### Delete File

```http theme={null}
DELETE /api/projects/{projectId}/files/{fileId}
```

***

## Folders

```http theme={null}
GET    /api/projects/{projectId}/folders
POST   /api/projects/{projectId}/folders
PATCH  /api/projects/{projectId}/folders/{folderId}
DELETE /api/projects/{projectId}/folders/{folderId}
```

***

## Comments

### List Comments

```http theme={null}
GET /api/projects/{projectId}/comments
```

Returns threaded comments with user data.

### Create Comment

```http theme={null}
POST /api/projects/{projectId}/comments
```

**Body:**

| Field      | Type   | Required | Description              |
| ---------- | ------ | -------- | ------------------------ |
| `content`  | string | Yes      | Comment text             |
| `parentId` | string | No       | Reply to this comment    |
| `section`  | string | No       | Anchor to PRD section    |
| `blockId`  | string | No       | Anchor to specific block |

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://app.thig.ai/api/projects/proj_123/comments \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"content": "Should we add offline support?", "section": "Features"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123/comments', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      content: 'Should we add offline support?',
      section: 'Features'
    })
  });
  const data = await res.json();
  ```
</CodeGroup>

### Update Comment

```http theme={null}
PATCH /api/projects/{projectId}/comments/{commentId}
```

### Delete Comment

```http theme={null}
DELETE /api/projects/{projectId}/comments/{commentId}
```

***

## Status & Activity

### Update Status

```http theme={null}
PATCH /api/projects/{projectId}/status
```

**Body:** `{ "status": "IN_REVIEW" }`

### Status History

```http theme={null}
GET /api/projects/{projectId}/status-history
```

### Activity Feed

```http theme={null}
GET /api/projects/{projectId}/activity
```

***

## Sharing & Collaboration

### Get Share Settings

```http theme={null}
GET /api/projects/{projectId}/share
```

### Enable Sharing

```http theme={null}
POST /api/projects/{projectId}/share
```

**Body:**

| Field       | Type   | Description                  |
| ----------- | ------ | ---------------------------- |
| `password`  | string | Optional password protection |
| `expiresAt` | string | Optional expiration date     |

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://app.thig.ai/api/projects/proj_123/share \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"expiresAt": "2026-06-01T00:00:00Z"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://app.thig.ai/api/projects/proj_123/share', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ expiresAt: '2026-06-01T00:00:00Z' })
  });
  const { shareToken, shareUrl } = await res.json();
  ```
</CodeGroup>

### Revoke Share

```http theme={null}
DELETE /api/projects/{projectId}/share
```

### Collaborators

```http theme={null}
GET    /api/projects/{projectId}/collaborators
POST   /api/projects/{projectId}/collaborators
DELETE /api/projects/{projectId}/collaborators/{collaboratorId}
```

***

## Stakeholder Views

```http theme={null}
GET    /api/projects/{projectId}/stakeholder-views
POST   /api/projects/{projectId}/stakeholder-views
DELETE /api/projects/{projectId}/stakeholder-views/{viewId}
```

***

## Project Links

```http theme={null}
GET    /api/projects/{projectId}/links
POST   /api/projects/{projectId}/links
DELETE /api/projects/{projectId}/links/{linkId}
```

***

## PRD Score

```http theme={null}
GET  /api/projects/{projectId}/score
POST /api/projects/{projectId}/score
```

Returns AI-generated quality score with breakdown across clarity, completeness, user focus, technical feasibility, metrics, and risk assessment.

***

## Assignment

```http theme={null}
PATCH /api/projects/{projectId}/assign
```

**Body:** `{ "assignedToId": "user_123" }`
