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

# Update project

` PATCH /api/v1/projects/{id} `

Update project

## Servers

- ` https://littledemo.com ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` bearerAuth `: ` http `

  - HTTP scheme: ` bearer `

  - Live API key, for example `Authorization: Bearer ld_live_...`.

### Alternative 2

- ` cookieAuth `: ` apiKey `

  - Credential: ` better-auth.session_token ` in ` cookie `

  - Dashboard session cookie.

## Parameters

### ` id ` (path, required)

- ` value `: type ` string `

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` name `: type ` string `

    - minLength: ` 1 `

    - maxLength: ` 100 `

  - ` url `: type ` string `; format ` uri `

  - ` viewport `: type ` string `

    - enum: ` ["desktop","mobile","tablet"] `

    - default: ` "desktop" `

  - ` refresh_schedule `: type ` string `

    - enum: ` ["manual","daily","weekly","on-deploy"] `

    - default: ` "manual" `

## Responses

### ` 200 ` — Project updated

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` id `, ` user_id `, ` name `, ` url `, ` viewport `, ` refresh_schedule `, ` webhook_secret `, ` created_at `, ` updated_at `

  - ` id `: type ` string `

  - ` user_id `: type ` string `

  - ` name `: type ` string `

  - ` url `: type ` string `

  - ` viewport `: type ` string `

  - ` refresh_schedule `: type ` string `

  - ` webhook_secret `: type ` string `; nullable

  - ` signing_secret `: type ` string ` — Returned only on project creation. Store it server-side and rotate if exposed.

  - ` created_at `: type ` string `

  - ` updated_at `: type ` string `

  - ` demo_count `: type ` number `

### ` 400 ` — Validation error

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 404 ` — Not found

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X PATCH 'https://littledemo.com/api/v1/projects/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "url": "https://example.com",
  "viewport": "desktop",
  "refresh_schedule": "manual"
}'
```

### JavaScript

```javascript
const response = await fetch('https://littledemo.com/api/v1/projects/string', {
  method: 'PATCH',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "name": "string",
    "url": "https://example.com",
    "viewport": "desktop",
    "refresh_schedule": "manual"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.patch('https://littledemo.com/api/v1/projects/string', headers=headers, json={
  "name": "string",
  "url": "https://example.com",
  "viewport": "desktop",
  "refresh_schedule": "manual"
})
print(response.json())
```