Skip to main content

Sessions and conversations

Create session

Creates a new conversation session.

POST /v1/custom/:integration_id/sessions

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.

Request body

{
"external_session_id": "order-12345",
"channel_user_id": "user-67890",
"context": {
"user": {
"display_name": "John Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"language": "en"
},
"tags": ["vip", "returning-customer"],
"global": {
"client_url": "https://example.com/support"
},
"order_id": "ORD-12345",
"subscription_tier": "premium"
}
}
FieldTypeRequiredDescription
external_session_idstringNoYour system's unique identifier for this session. Stored in context.channels.custom.external_session_id.
channel_user_idstringNoUnique identifier for the user in your system. Stored in context.user.custom_psid.
contextobjectNoSession context with user information and custom variables. See context object.

Response201 Created

{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"session_id": "660e8400-e29b-41d4-a716-446655440001",
"context": {
"user": { ... },
"tags": [...],
"global": { ... }
}
}
FieldTypeDescription
request_idstringUnique identifier for this request.
session_idUUIDThe created session ID. Use this for all subsequent API calls.
contextobjectThe session context, which may include default values.

Example

curl -X POST "https://channels.moveo.ai/v1/custom/YOUR_INTEGRATION_ID/sessions" \
-H "Authorization: apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_session_id": "order-12345",
"channel_user_id": "user-67890",
"context": {
"user": {
"display_name": "John Doe",
"email": "john.doe@example.com",
"language": "en"
},
"tags": ["vip"],
"order_id": "ORD-12345"
}
}'

Update session context

Updates the context variables for an existing session without sending a message. Only the fields you include are updated.

PATCH /v1/custom/:integration_id/sessions/:session_id/context

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.
session_idUUIDYesThe session ID.

Request body

Same structure as the context object in create session. Only included fields are updated.

{
"user": {
"email": "john.updated@example.com"
},
"tags": ["verified-user", "premium"],
"account_status": "verified"
}

Response200 OK

{
"request_id": "550e8400-e29b-41d4-a716-446655440004",
"context": { ... }
}

Example

curl -X PATCH "https://channels.moveo.ai/v1/custom/YOUR_INTEGRATION_ID/sessions/SESSION_ID/context" \
-H "Authorization: apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": {
"email": "john.updated@example.com",
"verified": true
},
"account_status": "verified",
"tags": ["verified-user", "premium"]
}'

Close session

Closes an existing session. This ends the session and triggers a session:closed webhook event.

POST /v1/custom/:integration_id/sessions/:session_id/close

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.
session_idUUIDYesThe session ID.

Request body — None required.

Response200 OK

{
"request_id": "550e8400-e29b-41d4-a716-446655440005"
}

Context object

The context object is used when creating sessions, sending messages, and updating context. It supports the following fields:

FieldTypeDescription
userobjectUser profile information. See user object.
tagsarrayArray of string tags to apply to the session.
channelsobjectChannel-specific context data.
globalobjectGlobal variables that persist across dialog execution.
custom_variableanyAny additional custom context variables.

User object

FieldTypeDescription
user_idstringInternal user identifier.
display_namestringUser's display name.
avatarstringURL to user's avatar image.
external_idstringExternal system user ID.
contact_idstringContact management system ID.
emailstringUser's email address.
phonestringUser's phone number.
languagestringUser's preferred language (ISO 639-1 code).
timezonestringUser's timezone (IANA format, e.g., America/New_York).
genderstringUser's gender.
addressstringUser's address.
locationobjectUser's location with city, country, region, latitude, longitude.
localesarrayArray of locale strings.
browserstringUser's browser information.
platformstringUser's platform (e.g., web, mobile).
devicestringUser's device type.
ipstringUser's IP address.

Global object

FieldTypeDescription
disclaimer_acceptedbooleanWhether user accepted disclaimer.
visitor_form_completedbooleanWhether visitor form was completed.
client_urlstringClient's current URL.
refstringReferral parameter.
custom_variableanyAny additional global variables.

Close conversation

Marks the current conversation as resolved. The session remains active and can receive new messages, which start a new conversation.

POST /v1/custom/:integration_id/sessions/:session_id/conversation/close

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.
session_idUUIDYesThe session ID.

Request body — None required.

Response200 OK

{
"request_id": "550e8400-e29b-41d4-a716-446655440006"
}

Reopen conversation

Reopens a previously resolved conversation within the same session.

POST /v1/custom/:integration_id/sessions/:session_id/conversation/reopen

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.
session_idUUIDYesThe session ID.

Request body — None required.

Response200 OK

{
"request_id": "550e8400-e29b-41d4-a716-446655440007"
}

Handover

Transfers the conversation to a human agent through Moveo's live chat system.

POST /v1/custom/:integration_id/sessions/:session_id/handover

Path parameters

ParameterTypeRequiredDescription
integration_idUUIDYesYour custom integration ID.
session_idUUIDYesThe session ID.

Request body — None required.

Response200 OK

{
"request_id": "550e8400-e29b-41d4-a716-446655440008"
}