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

# Update project

` PUT /api/projects/{id} `

Update project

## Servers

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

## Authentication

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

### Alternative 1

- ` sessionCookie `: ` apiKey `

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

  - Session cookie set by /api/user/signin, /api/user/signup, or the OAuth callback. Required for all authenticated endpoints.

## Parameters

### ` id ` (path, required)

- ` value `: type ` string `

  - example: ` "abc123" `

  - minLength: ` 1 `

Example:

```json
"abc123"
```

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` name `: type ` string `

    - minLength: ` 1 `

    - maxLength: ` 255 `

  - ` domains `: type ` array `

    - ` array item `: type ` string `

      - maxLength: ` 255 `

  - ` brandConfig `: type ` object `

    - ` colors `: type ` object `

      - Required fields: ` primary `, ` secondary `, ` accent `, ` background `, ` foreground `

      - ` primary `: type ` string `

      - ` secondary `: type ` string `

      - ` accent `: type ` string `

      - ` background `: type ` string `

      - ` foreground `: type ` string `

    - ` fonts `: type ` object `

      - Required fields: ` heading `, ` body `

      - ` heading `: type ` string `

      - ` body `: type ` string `

    - ` brandName `: type ` string `

    - ` logoUrl `: type ` string `

  - ` isDefault `: type ` boolean `

## Responses

### ` 200 ` — Project updated

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` ok `

  - ` ok `: type ` boolean `

### ` 401 ` — Authentication required

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

### ` 404 ` — Project not found

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X PUT 'https://motioness.com/api/projects/abc123' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "domains": [
    "string"
  ],
  "brandConfig": {
    "colors": {
      "primary": "string",
      "secondary": "string",
      "accent": "string",
      "background": "string",
      "foreground": "string"
    },
    "fonts": {
      "heading": "string",
      "body": "string"
    },
    "brandName": "string",
    "logoUrl": "string"
  },
  "isDefault": true
}'
```

### JavaScript

```javascript
const response = await fetch('https://motioness.com/api/projects/abc123', {
  method: 'PUT',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "name": "string",
    "domains": [
      "string"
    ],
    "brandConfig": {
      "colors": {
        "primary": "string",
        "secondary": "string",
        "accent": "string",
        "background": "string",
        "foreground": "string"
      },
      "fonts": {
        "heading": "string",
        "body": "string"
      },
      "brandName": "string",
      "logoUrl": "string"
    },
    "isDefault": true
  })
});

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

### Python

```python
import requests

response = requests.put('https://motioness.com/api/projects/abc123', json={
  "name": "string",
  "domains": [
    "string"
  ],
  "brandConfig": {
    "colors": {
      "primary": "string",
      "secondary": "string",
      "accent": "string",
      "background": "string",
      "foreground": "string"
    },
    "fonts": {
      "heading": "string",
      "body": "string"
    },
    "brandName": "string",
    "logoUrl": "string"
  },
  "isDefault": true
})
print(response.json())
```