Skip to main content
POST
/
connect
Create a Connect session
curl --request POST \
  --url https://api.flatpeak.com/connect \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "connect_url": "myapp://nova/flatpeak/connect",
  "callback_url": "myapp://nova/flatpeak/complete",
  "device_id": "dev_63a6087272941ef077a8fd3e",
  "provider_id": "prv_6a2be12ecf43cb7e3d6cefcd"
}
'
{
  "id": "cot_6587fa4362341be5b524de3b",
  "location_id": "loc_641b90b758fb8e6293716e40",
  "object": "connect_session",
  "live_mode": true,
  "data_available": true,
  "time_created": "2023-05-05T18:37:27Z",
  "time_expiry": "2023-12-28T03:00:00Z",
  "device_id": "dev_63a6087272941ef077a8fd3e",
  "provider_id": "prv_6a2b2460ba2259a0c4980afb",
  "connect_url": "myapp://nova/flatpeak/connect",
  "callback_url": "myapp://nova/flatpeak/complete"
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Body

application/json

Connect init session data.

location_id
string
required

Flatpeak Locaiton ID

Example:

"loc_641b90b758fb8e6293716e40"

connect_url
string
required

URL the customer is redirected to during the Handling Callback step of the Provider Login Redirect. Specify either the URL where your Connect web app is hosted or a deep link into your native app.

Example:

"myapp://nova/flatpeak/connect"

callback_url
string
required

URL where the customer is redirected after they complete or exit their Connect session.

Example:

"myapp://nova/flatpeak/complete"

device_id
string

Flatpeak Device ID

Example:

"dev_63a6087272941ef077a8fd3e"

provider_id
string

Flatpeak Provider ID

Example:

"prv_6a2be12ecf43cb7e3d6cefcd"

Response

Response example

id
string
required

Flatpeak connect_token id.

Example:

"cot_6587fa4362341be5b524de3b"

location_id
string
required

Flatpeak location id.

Example:

"loc_641b90b758fb8e6293716e40"

object
string
required

Flatpeak object name, i.e. connect_token.

Example:

"connect_session"

live_mode
boolean
required

Set to true when object is in live mode.

Example:

true

data_available
boolean
required

Set to true when data is available to fetch.

time_created
string
required

Time when the object was created, in UTC.

Example:

"2023-05-05T18:37:27Z"

time_expiry
string
required

Time when the token will expire. Expired tokens cannot be claimed.

Example:

"2023-12-28T03:00:00Z"

device_id
string

Flatpeak Device ID

Example:

"dev_63a6087272941ef077a8fd3e"

provider_id
string

Flatpeak Provider ID

Example:

"prv_6a2b2460ba2259a0c4980afb"

connect_url
string
Example:

"myapp://nova/flatpeak/connect"

callback_url
string
Example:

"myapp://nova/flatpeak/complete"