Update Project

Update project with specified id.

Update Project

PATCH https://environment.monterosa.cloud/api/v2/projects/:project_id

Path Parameters

NameTypeDescription

project_id

string

Project ID.

Headers

NameTypeDescription

Authorization

string

Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb

Content-Type

string

application/vnd.api+json

Request Body

NameTypeDescription

presence_counter[min_threshold]

integer

Minimal threshold. Can be greater or equal to 0. Default value can be set via App Spec.

presence_counter[enabled]

boolean

Switch on/off presence counter.

presence_counter

object

Presence counter on client application setup. Available if it is enabled on App Spec level only.

name

string

Project's name.

hidden_elements

array

Project's elements visibility settings.

audio_sync_default_delay

integer

Project's audio sync default delay.

audio_sync_max_delay

integer

Project's audio sync max delay.

certification_enabled

boolean

Defines if Certification is enabled for a project.

locales

array

List of project locales.

settings

array

App Setup settings.

archived

boolean

Marks project as archtived.

Users with at least the Admin role can change this attribute.

environment

string

Sets environment of the project. Allowed values: "staging" (default), "production". Users with at least the Admin role can change this attribute.

// No content

Example

// PATCH /api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "projects",
    "id": "951a951e-07de-457f-99c8-f1307fad4eeb",
    "attributes": {
      "name": "NEW Project Name"
    }
  }
}

App Setup settings

List of fields of App Setup. Each field is updated separately and if present its content is rewritten completely.

curl --request PATCH \
  --url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
  --header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
    "data": {
      "type": "projects",
      "id": "951a951e-07de-457f-99c8-f1307fad4eeb",
      "attributes": {
        "settings": [
          {
            "key": "logo",
            "values": {
              "all": "https://monterosa.com/img/logo.png"
            }
          },
          {
            "key": "language_selector_position",
            "values": {
              "all": "left"
            }
          },
          {
            "key": "text",
            "values": {
              "en": "Lorem ipsum dolor"
            }
          },
          {
            "key": "number",
            "values": {
              "all": 42
            }
          }
        ]
      }
    }  
  }'

Hidden elements

Elements visibility settings are updated by providing hidden_elements attribute and only for provided element types.

curl --request PATCH \
  --url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
  --header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
    "data": {
      "type": "projects",
      "id": "951a951e-07de-457f-99c8-f1307fad4eeb",
      "attributes": {
        "hidden_elements": [
          {
            "type": "vote",
            "hidden": true
          },
          {
            "type": "emote",
            "hidden": false
          }
        ]
      }
    }  
  }'

In the example above elements of "vote" type is set to be invisible on UI and "emote" is set to be visible. Settings for other element types not changed since hidden_elements attribute contains settings only for "vote" and "emote". It is similar to check "Emote" and uncheck "Vote" on Elements tab on Project Settings page.

Migrate a Project to a new App

A Project can be switched to another App by updating the App ID in the relationships object.

curl -X PATCH https://environment.monterosa.cloud/api/v2/projects/a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d \
  -d '{
  "data": {
    "type": "projects",
    "id": "a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d",
    "relationships": {
      "app": {
        "data": { "type": "apps", "id": "b9e22wd3-b8b1-4fe2-a08a-4ge5ba39df7d" }
      }
    }
  }
}
'