# Project handshake

## Project handshake

<mark style="color:green;">`POST`</mark> `https://example-extension.mic.io/lvis/:lvis_instance_id/projects`

#### Path Parameters

| Name               | Type   | Description                                                  |
| ------------------ | ------ | ------------------------------------------------------------ |
| lvis\_instance\_id | string | Unique identifier across all M/IC instances, in UUID format. |

#### Request Body

| Name             | Type   | Description                                                                           |
| ---------------- | ------ | ------------------------------------------------------------------------------------- |
| project\_id      | string | Project ID.                                                                           |
| project\_name    | string | Human-readable project name.                                                          |
| config           | object | Configuration object as specified in application spec.                                |
| api\_key         | string | Bearer token that is required to send Control API requests.                           |
| extension\_setup | object | Configuration object with data specified for the extension in create project request. |

{% tabs %}
{% tab title="200 Response on the project handshake request. Empty JSON object as response body is required." %}

```javascript
{}
```

{% endtab %}
{% endtabs %}

This endpoint is called when project and Extension association has changed, which could happen when:

* New Project is created
* New Extension is added to existing Project
* An Extension configuration in the app spec is updated
* An Extension is manually reloaded for the Project in Studio&#x20;

It's up to the Extension to decide if it needs to create a new Project within the Extension database or update existing Project based on provided Project UUID. In case of an update all body parameters may have changed values.

If `api_key` has been changed, the previous key has been revoked and is made invalid.

## Example

```bash
curl --request POST \
  --url https://example-extension.mic.io/lvis/c068dd33-46c3-4789-a619-b14e4bcbe990/projects \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
    "project_id": "da34516f-00af-435e-bd03-ab1720755dda",
    "project_name": "Project X",
    "config": {},
    "api_key": "td18FzQxQ8ZgCAc9oHpQis8WJqkEn5B9",
    "extension_setup": {
      "key": "value"
    }
  }'
```
