Technical docs

API

Docs

Technical docs

Copy page

API

The Parahelp API connects any channel to your customer agents: your system sends what happens as events, and reads the replies back.

Use it to build a custom channel, such as a live chat, a Slack bot or an email inbox. Parahelp gives your developer or coding agent a working template and the full guide in a chat, so this page only covers the essentials. Read more in Customer agents.

The API is in beta. Contact Parahelp to enable it for your workspace.

Concepts

  • Sessions. A session is a list of events, and it’s what Parahelp shows as a ticket, for example one live chat conversation, Slack thread or email thread. Each session has an id, usually one you choose.

  • Events. An event is something that happened, such as a customer message or an order update. Your customer agents react to events.

  • Agent profiles. An agent profile defines a customer agent with its configurations. Parahelp creates them for you, and each session runs the customer agent of the agent profile it selects.

Authentication

Send your API key with every request:

Authorization: Bearer <API key>

Admins create and delete API keys in Settings → API keys. A key gives full access to your workspace’s Parahelp API, so keep it on your server, never in a browser or mobile app.

Flow

1. List your agent profiles

List your agent profiles to get their ids.

GET /api/v0/support/agent-profiles
curl https://external-api.parahelp.com/api/v0/support/agent-profiles \
  -H "Authorization: Bearer $PARAHELP_API_KEY"

2. Send events

Send what happens in a conversation as data events. The first event creates the session.

POST /api/v0/support/events/api/data
curl -X POST \
  https://external-api.parahelp.com/api/v0/support/events/api/data \
  -H "Authorization: Bearer $PARAHELP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10",
    "payload": {
      "type": "customer_message",
      "message": "My order has not arrived."
    }
  }'

3. Select the agent profile

Select the agent profile that handles the session, and set its environment variables.

POST /api/v0/support/events/api/session-updated
curl -X POST \
  https://external-api.parahelp.com/api/v0/support/events/api/session-updated \
  -H "Authorization: Bearer $PARAHELP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10",
    "agent_profile_id": "website-support",
    "environment_variables": {
      "USER_EMAIL": "jane@example.com"
    }
  }'

4. Read the replies

Read the session’s events back, and show your customer the replies.

GET /api/v0/support/events
curl -G https://external-api.parahelp.com/api/v0/support/events \
  --data-urlencode "session_id=8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10" \
  -H "Authorization: Bearer $PARAHELP_API_KEY"

Good to know

  • Replies come through scoped tools. A customer agent replies only through the scoped tools Parahelp builds for the channel, and each reply shows up as an event in the session.

  • Events are processed asynchronously. A 202 response means the event is recorded, not that a customer agent has run.

  • Environment variables aren’t secrets. Use them for values your scoped tools need, such as the customer’s email. Your customer agents can see them, so secrets go in Parahelp secrets.

  • Pausing. Send agent_profile_id: null to pause the customer agent on a session, for example when your team takes over. The session keeps recording events.

  • Live data. There’s no test environment, so a test conversation is a real ticket.

Reference

The reference is generated from the OpenAPI spec. The base URL is https://external-api.parahelp.com.

Send data event

POST /api/v0/support/events/api/data Beta

Send a data event: any JSON describing something that happened, such as a customer message, an order update, or a reply sent by one of your custom tools. The customer agent sees the JSON value you sent.

curl -X POST \
  https://external-api.parahelp.com/api/v0/support/events/api/data \
  -H "Authorization: Bearer $PARAHELP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10",
    "payload": {
      "type": "customer_message",
      "message": "My order has not arrived.",
      "user_identifier": "usr_18273",
      "user_name": "Jane",
      "user_email": "jane@example.com"
    }
  }'

Request body

  • session_id string or null · up to 140 characters

    Your id for the session, typically a UUID you generate, at most 128 characters.

  • event_id string or null · up to 138 characters

    Your id for the event, at most 128 characters, unique among your organization’s API events.

  • payload any JSON required

    What happened, as any JSON value: an object, array, string, number, boolean or null. The customer agent sees this JSON value.

Responses

  • 202 The recorded event’s identifiers.
  • Errors 400 401 403 409 415 422 500

Send session updated event

POST /api/v0/support/events/api/session-updated Beta

All environment-variable names and values are visible to the customer agent and stored in session event history. Do not include passwords, API keys, access tokens, or other secrets; give custom tools secrets as Parahelp secrets. Updating or clearing variables does not erase earlier values from event history.

Send a session updated event: it changes the session’s agent profile and environment variables together. Omitted settings stay unchanged. New sessions start without an agent profile or variables.

Select an agent profile and set variables
curl -X POST \
  https://external-api.parahelp.com/api/v0/support/events/api/session-updated \
  -H "Authorization: Bearer $PARAHELP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10",
    "agent_profile_id": "website-support",
    "environment_variables": {
      "USER_EMAIL": "jane@example.com"
    }
  }'

Request body

  • agent_profile_id string or null · up to 128 characters

    The agent profile to select, matching a configured API agent profile id exactly, or null to remove the session’s agent profile so its events no longer run the customer agent.

  • environment_variables object

    All names and values are visible to the customer agent and stored in session event history.

  • session_id string or null · up to 140 characters

    Your id for the session, typically a UUID you generate, at most 128 characters.

  • event_id string or null · up to 138 characters

    Your id for the event, at most 128 characters, unique among your organization’s API events.

Responses

  • 202 The recorded event’s identifiers.
  • Errors 400 401 403 404 409 415 422 500

List support events

GET /api/v0/support/events Beta

List a support session’s events in recorded order. Only data events are listed by default.

Example request
curl -G https://external-api.parahelp.com/api/v0/support/events \
  --data-urlencode "session_id=8e2d7a36-3a1c-4a6e-9f21-9d1b8c5e4f10" \
  -H "Authorization: Bearer $PARAHELP_API_KEY"

Query parameters

  • session_id string · up to 140 characters required

    The session whose events to list: your session id or the session_id returned by this API, without surrounding whitespace.

  • type array of strings · default api_data

    An event type to list. Repeat it to list several types. Defaults to api_data.

    One of api_data, api_session_updated, support_agent_run_started, support_agent_run_finished, error, internal_agent_message_received, member_message_received, tool_called, tool_finished, session_sync_requested

  • limit integer · default 100 · 1 to 200

    Maximum number of events to return per page.

  • cursor string or null

    The next_cursor from a previous response, unchanged. Omit to fetch the first page.

Responses

  • 200 One page of the session’s events, in recorded order.
  • Errors 401 403 422 500

List support sessions

GET /api/v0/support/sessions Beta

Pass type=api to list your organization’s API sessions with their current agent profile and environment variables, newest first by first event. Only API sessions are listed.

Example request
curl -G https://external-api.parahelp.com/api/v0/support/sessions \
  --data-urlencode "type=api" \
  -H "Authorization: Bearer $PARAHELP_API_KEY"

Query parameters

  • type string · always api required

    Required session type. Currently only api is supported.

  • environment_variable string or null · up to 1000 characters

    Only sessions whose current environment variable NAME equals VALUE, given as NAME:VALUE and split at the first colon.

  • limit integer · default 100 · 1 to 200

    Maximum number of sessions to return per page.

  • cursor string or null

    The next_cursor from a previous response, unchanged. Omit to fetch the first page.

Responses

  • 200 One page of support sessions, newest first.
  • Errors 401 403 422 500 503

List agent profiles

GET /api/v0/support/agent-profiles Beta

List your organization’s API agent profiles: the agent profiles that run on sessions from this API. Agent profiles are created through Parahelp; ask it for one that runs on API sessions.

Example request
curl https://external-api.parahelp.com/api/v0/support/agent-profiles \
  -H "Authorization: Bearer $PARAHELP_API_KEY"

Responses

  • 200 Up to 1,000 of the organization’s API agent profiles.
  • Errors 401 403 500

Generated from the OpenAPI spec, version 0.2.0.