# Org configuration API

#### Update

**`POST - /api/orgs/{orgId}/config`**

* Creates new form
* Requires apiKey header of an adviser with `admin` permission
* Requires body with org configuration (example below):

<details>

<summary>Click here to see request example</summary>

```
Example
curl 'https://spinner.stage.closer.app/api/orgs/{orgID}/config' \
  -X 'PUT' \
  -H 'authority: spinner.closer.app' \
  -H 'accept: */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: https://closer.app' \
  -H 'sec-ch-ua: "Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36' \
  -H 'x-api-key: bf4dd784-1277-4e32-b60e-a86a82623147' \
  --data-raw $'org configuration object (JSON, see example below)' \
  --compressed
```

</details>

<details>

<summary>Click here to see org configuration example</summary>

<pre class="language-json"><code class="lang-json">{
    "profanitiesCheckingEnabled": true,
    "showAdviserLastNameEnabled": false,
    "cobrowseEnabled": true,
    "forgetMeEnabled": true,
    "continueConversationOnMobileEnabled": true,
    "typingPreviewEnabled": false,
    "callsDisabled": false,
    "defaultAgentAvatarUrl": "https://wheelhouse.stage.closer.app:443/api/resources/files/a6c50667558f457eaead583ccee2671c",
    "color": "#fe7f00",
    "agreement": "aaatreść klauzuli RODO?",
    "name": "Wody Aqua Polska",
    "allowedAttachmentExtensions": [
        ".jpg",
        ".jpeg",
        ".gif",
        ".png",
        ".pdf",
        ".txt",
        ".doc",
        ".docx",
        ".csv",
        ".xls",
        ".xlsx",
        ".ppt",
        ".pptx",
        ".key",
        ".odt",
        ".ods",
        ".odp"
    ],
    "maximumAttachmentSizeBytes": 20000000,
    "messageMaxAllowedCharactersForClient": 1000,
    "phonePrefix": "PL",
    "webSpeechApiEnabled": true,
    "origin": [
        "*"
    ],
    "welcomeMessagePl": "Dzień dobry, witamy w Tutum Insurance!",
    "welcomeMessageEn": "Dzień dobry, witamy w Tutum Insurance!",
    "headerWelcomeMessagePl": "Wody Aqua Polska",
    "headerWelcomeMessageEn": "Wody Aqua Polska",
    "agreementEnabled": false,
    "baseUrl": "https://piotr-dziedziczs-five-star-project.webflow.io/insurance-plans/life-insurance/",
    "autoAssignedLimit": 4,
    "workingHours": [
        {
            "offsetSeconds": -7200,
            "durationSeconds": 900
        },
        {
            "offsetSeconds": 108000,
            "durationSeconds": 8100
        },
        {
            "offsetSeconds": 165600,
            "durationSeconds": 0
        },
        {
            "offsetSeconds": 252000,
            "durationSeconds": 900
        },
        {
            "offsetSeconds": 338400,
            "durationSeconds": 0
        },
        {
            "offsetSeconds": 490500,
            "durationSeconds": 20640
        },
        {
            "offsetSeconds": 511200,
            "durationSeconds": 0
        }
    ],
    "openedConversationsMetricEnabled": false,
    "waitingConversationsMetricEnabled": false,
    "averageResponseTimeMetricEnabled": true,
    "openedConversationsSlaEnabled": true,
    "waitingConversationsSlaEnabled": true,
    "averageResponseTimeSlaEnabled": true,
    "openedConversationsSlaRangeLowerBound": 1,
    "waitingConversationsSlaRangeLowerBound": 10,
    "averageResponseTimeSlaRangeLowerBound": 60000,
    "openedConversationsSlaRangeUpperBound": 3,
    "waitingConversationsSlaRangeUpperBound": 30,
    "averageResponseTimeSlaRangeUpperBound": 300000,
    "autoreassignEnabled": true,
    "reportsEnabled": true,
    "oauthEnabled": false,
    "autoFollowOnUnassign": true,
    "reassignOnLogoutEnabled": true,
    "statusChangeOnCloseEnabled": false,
    "snoozeOnRoomChange": false,
    "autoCloseTimeoutSeconds": 120,
    "autoSnoozeTimeoutSeconds": 120,
    "messageMaxAllowedCharactersForAgent": 1000,
    "contactEnquiryActionEnabled": true,
    "meetingActionEnabled": true,
    "defaultStatusAfterLogin": "unready",
    "autoReassignOnWebsocketUnavailable": true
<strong>}
</strong></code></pre>

</details>

#### Read

**`GET - /api/orgs/{orgId}/config`**

* Gets org config
* Requires apiKey header of an adviser

<details>

<summary>Click here to see request example</summary>

```
Example
curl --location --request GET 'https://spinner.stage.closer.app/api/orgs/{orgId}/config' \
--header 'x-api-key: your-api-key-here'
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.closer.app/guide/getting-deeper/org-configuration-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
