> ## 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 webhook configuration

` PUT /api/projects/{id}/webhooks `

Update webhook configuration

## 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 `

  - Required fields: ` webhook_url `, ` webhook_events `, ` webhooks_enabled `

  - ` webhook_url `: type ` string `; nullable; format ` uri `

  - ` webhook_events `: type ` array `

    - ` array item `: type ` string `

      - enum: ` ["asset.queued","asset.stage_completed","asset.completed","asset.failed","asset.retry_scheduled"] `

  - ` webhooks_enabled `: type ` boolean `

## Responses

### ` 200 ` — Webhook config saved

Content type: ` application/json `

- ` value `: type ` unknown `

  - ` allOf constraint 1 `: type ` object `

    - Required fields: ` webhook_url `, ` webhook_events `, ` webhooks_enabled `

    - ` webhook_url `: type ` string `; nullable; format ` uri `

    - ` webhook_events `: type ` array `

      - ` array item `: type ` string `

        - enum: ` ["asset.queued","asset.stage_completed","asset.completed","asset.failed","asset.retry_scheduled"] `

    - ` webhooks_enabled `: type ` boolean `

  - ` allOf constraint 2 `: type ` object `

    - Required fields: ` webhook_secret_preview `

    - ` webhook_secret_preview `: type ` string `; nullable

### ` 401 ` — Unauthenticated

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 PUT 'https://motioness.com/api/projects/abc123/webhooks' \
  -H 'Content-Type: application/json' \
  -d '{
  "webhook_url": "https://example.com",
  "webhook_events": [
    "asset.queued"
  ],
  "webhooks_enabled": true
}'
```

### JavaScript

```javascript
const response = await fetch('https://motioness.com/api/projects/abc123/webhooks', {
  method: 'PUT',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "webhook_url": "https://example.com",
    "webhook_events": [
      "asset.queued"
    ],
    "webhooks_enabled": true
  })
});

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

### Python

```python
import requests

response = requests.put('https://motioness.com/api/projects/abc123/webhooks', json={
  "webhook_url": "https://example.com",
  "webhook_events": [
    "asset.queued"
  ],
  "webhooks_enabled": true
})
print(response.json())
```