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

# Update a beacon

` PATCH /projects/{projectId}/beacons/{beaconId} `

Update a beacon

## Servers

- ` https://api.rogeriq.com/api/v1 `

## Authentication

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

### Alternative 1

- ` apiKey `: ` apiKey `

  - Credential: ` X-API-Key ` in ` header `

  - API key with `riq_` prefix

## Parameters

### ` projectId ` (path, required)

- ` value `: type ` string `

### ` beaconId ` (path, required)

- ` value `: type ` string `

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` id `: type ` string `

  - ` project_id `: type ` string `

  - ` form_id `: type ` string `

  - ` position `: type ` string `

    - enum: ` ["bottom-right","bottom-left"] `

  - ` primary_color `: type ` string `

  - ` button_label `: type ` string `

  - ` button_icon `: type ` string `

    - enum: ` ["chat","mail","help","custom_svg"] `

  - ` custom_svg `: type ` string `; nullable

  - ` greeting_title `: type ` string `

  - ` greeting_text `: type ` string `

  - ` allowed_origins `: type ` array `

    - ` array item `: type ` string `

  - ` archived_at `: type ` string `; nullable; format ` date-time `

  - ` created_at `: type ` string `; format ` date-time `

## Responses

### ` 200 ` — Updated beacon

Content type: ` application/json `

- ` value `: type ` object `

  - ` data `: type ` object `

    - ` id `: type ` string `

    - ` project_id `: type ` string `

    - ` form_id `: type ` string `

    - ` position `: type ` string `

      - enum: ` ["bottom-right","bottom-left"] `

    - ` primary_color `: type ` string `

    - ` button_label `: type ` string `

    - ` button_icon `: type ` string `

      - enum: ` ["chat","mail","help","custom_svg"] `

    - ` custom_svg `: type ` string `; nullable

    - ` greeting_title `: type ` string `

    - ` greeting_text `: type ` string `

    - ` allowed_origins `: type ` array `

      - ` array item `: type ` string `

    - ` archived_at `: type ` string `; nullable; format ` date-time `

    - ` created_at `: type ` string `; format ` date-time `

## Request examples

### cURL

```curl
curl -X PATCH 'https://api.rogeriq.com/api/v1/projects/string/beacons/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "string",
  "project_id": "string",
  "form_id": "string",
  "position": "bottom-right",
  "primary_color": "string",
  "button_label": "string",
  "button_icon": "chat",
  "custom_svg": "string",
  "greeting_title": "string",
  "greeting_text": "string",
  "allowed_origins": [
    "string"
  ],
  "archived_at": "2024-01-01T00:00:00Z",
  "created_at": "2024-01-01T00:00:00Z"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.rogeriq.com/api/v1/projects/string/beacons/string', {
  method: 'PATCH',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "id": "string",
    "project_id": "string",
    "form_id": "string",
    "position": "bottom-right",
    "primary_color": "string",
    "button_label": "string",
    "button_icon": "chat",
    "custom_svg": "string",
    "greeting_title": "string",
    "greeting_text": "string",
    "allowed_origins": [
      "string"
    ],
    "archived_at": "2024-01-01T00:00:00Z",
    "created_at": "2024-01-01T00:00:00Z"
  })
});

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

### Python

```python
import requests

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

response = requests.patch('https://api.rogeriq.com/api/v1/projects/string/beacons/string', headers=headers, json={
  "id": "string",
  "project_id": "string",
  "form_id": "string",
  "position": "bottom-right",
  "primary_color": "string",
  "button_label": "string",
  "button_icon": "chat",
  "custom_svg": "string",
  "greeting_title": "string",
  "greeting_text": "string",
  "allowed_origins": [
    "string"
  ],
  "archived_at": "2024-01-01T00:00:00Z",
  "created_at": "2024-01-01T00:00:00Z"
})
print(response.json())
```