Skip to main content
POST
/
api
/
customer-sessions
Create Customer Session
curl --request POST \
  --url https://api.rapidly.tech/api/customer-sessions/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "<string>",
  "return_url": "https://example.com/account",
  "member_id": "<string>",
  "external_member_id": "<string>"
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "token": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "return_url": "<string>",
  "customer_portal_url": "<string>",
  "customer_id": "<string>",
  "customer": {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "metadata": {},
    "external_id": "usr_1337",
    "email": "<string>",
    "email_verified": true,
    "name": "John Doe",
    "billing_address": {
      "country": "AD",
      "line1": "<string>",
      "line2": "<string>",
      "postal_code": "<string>",
      "city": "<string>",
      "state": "<string>"
    },
    "workspace_id": "<string>",
    "deleted_at": "2023-11-07T05:31:56Z",
    "avatar_url": "<string>",
    "type": "individual"
  }
}

Authorizations

Authorization
string
header
required

Create an Workspace Access Token in your workspace's settings page.

Body

application/json

Create session using a customer ID.

customer_id
string<uuid4>
required

ID of the customer to create a session for.

return_url
string<uri> | null

When set, a back button will be shown in the customer portal to return to this URL.

Required string length: 1 - 2083
Example:

"https://example.com/account"

member_id
string<uuid4> | null

ID of the member to create a session for. Only applicable when member_model_enabled is True.

external_member_id
string | null

External ID of the member to create a session for. Only applicable when member_model_enabled is True.

Response

Customer session created.

An authenticated customer session with portal access.

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

id
string<uuid4>
required

The ID of the object.

token
string
required
expires_at
string<date-time>
required
return_url
string | null
required
customer_portal_url
string
required
customer_id
string<uuid4>
required
customer
Customer · object
required

A customer in an workspace.