Create Session
Opens a new chat session for a customer with the specified agent. Any existing active session for the same customer + agent is closed first, so there is at most one active session per customer per agent.
Returns the full session object, including its id — use that id for the support and inject-context endpoints. Sending messages, however, does not require the session id: the Send Message endpoint resolves the active session automatically.
Authorizations
16-character API token associated with your OSVI account. Find it in your dashboard under Settings → API.
Body
Unique identifier of the OSVI agent to chat with. Must be an active, non-archived agent belonging to the account that owns the API token.
"agent_IsZ3Q6Sf_60Eh26XQMGbz-R_og"
Your identifier for the customer on the other side of the conversation — typically a phone number, but any stable string works. Used to resolve the active session on subsequent messages.
"+15551112222"
Arbitrary key-value object describing the customer, made available to the agent at runtime (e.g. name, account tier).
{ "first_name": "Alex" }Initial free-text context entries for the session. Only the most recent 5 non-empty strings are retained (FIFO). Append more later with the inject-context endpoint.
["Initial context for this chat"]