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

# Consent

> Connect route where the user grants data-sharing and control consent to a VPP operator.

The user consents to share device data and control with a VPP operator. Connect returns this route in the VPP flow and in sessions a VPP operator starts, but never in the tariff flow. If you implement the VPP flow, support this route.

> [tab] Preview
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/consent-oem.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=ef88d407e5ad7b561fd953b72d0fd56a)

> [tab] Code
>
> ```json Connect response theme={"system"}
> {
>   "connect_session": "cos_6587fa4362341be5b524de3b",
>   "route": "consent",
>   "live_mode": false,
>   "actions": [
>     "ALLOW",
>     "DENY",
>     "BACK",
>     "CLOSE"
>   ],
>   "data": {
>     "device_type": "BATTERY_STORAGE",
>     "location": {
>       "timezone": "Europe/London",
>       "currency_code": "GBP"
>     },
>     "operator": {
>       "id": "opr_65de3024be51ded101a3a555",
>       "display_name": "EDF",
>       "logo_url": "https://s.flatpeak.com/1ded101a3a555.png"
>     },
>     "account": {
>       "id": "acc_661677911f2197045e6cf1b1",
>       "display_name": "Nova Inc"
>     },
>     "required_scopes":
>     [ 
>       "TELEMETRY", 
>       "CONTROL", 
>       "LOCATION"
>     ]
>   }
> }
> ```
>
> ```bash Your POST to Connect (action) theme={"system"}
> curl --request POST \
>   --url https://connect.flatpeak.com \
>   --header 'Content-Type: application/json' \
>   --data '{
>   "connect_session": "cos_6587fa4362341be5b524de3b",
>   "route": "consent",
>   "action": "ALLOW"
> }'
> ```
>
> #### Actions
>
> | Action | Result |
> | :- | :- |
> | `ALLOW` | Accepts the required scopes. |
> | `DENY` | Declines the required scopes. |
> | `BACK` | Returns the previous page. |
> | `CLOSE` | Returns the `callback_url` set on the Connect session. |
>
> #### Consent display
>
> Show each scope in `required_scopes` with the name and description below, word for word unless your legal team advises otherwise.
>
> | Scope | Display name | Description |
> | :- | :- | :- |
> | `TELEMETRY` | Device information | Allow access to your devices' information, such as their configuration, capacity, performance, and charge levels. |
> | `CONTROL` | Device management | Allow access to your devices' operating settings and plans for charging and dispatch. |
> | `LOCATION` | Location | Allow access to your devices' precise and approximate location data for location-based services. |
> | `SETTINGS` | Device settings | Allow reading and updating your devices' operating settings. |
>
> #### Errors
>
> | Error code | Description |
> | :- | :- |
> | `action_invalid` | The selected action is not valid. |
> | `data_json_invalid` | Data does not conform to the JSON schema. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.