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

# Create a beacon

Creates a floating contact beacon linked to a form.

` POST /projects/{projectId}/beacons `

Create a beacon

Creates a floating contact beacon linked to a form.

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

## Request body (required)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` form_id `

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

  - ` greeting_title `: type ` string `

  - ` greeting_text `: type ` string `

  - ` allowed_origins `: type ` array `

    - ` array item `: type ` string `

## Responses

### ` 201 ` — Created 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 POST 'https://api.rogeriq.com/api/v1/projects/string/beacons' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "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"
  ]
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.rogeriq.com/api/v1/projects/string/beacons', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "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"
    ]
  })
});

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

### Python

```python
import requests

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

response = requests.post('https://api.rogeriq.com/api/v1/projects/string/beacons', headers=headers, json={
  "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"
  ]
})
print(response.json())
```