Skip to content

API Endpoints

Retrieving usage statistics

Use this endpoint to retrieve statistics about your account's usage.

Request

GET https://api.upscope.io/v1.2/usage

Response

HTTP 200

{
  "status": "ok",
  "usage": {
      "agents": {
          "last_30_days": 10,
          "today": 0
      },
      "session_counts": {
          "last_30_days": 20,
          "now": 0,
          "today": 0
      },
      "session_seconds": {
          "last_30_days": 5000,
          "today": 0
      },
      "visitors": {
          "last_24_hrs": 50000,
          "online_now": 400
      }
  }
}
Field Type Description
usage.agents.last_30_days Integer Number of Agents who used Upscope in the last 30 days.
usage.agents.today Integer Number of Agents who used Upscope in the last 24 hours.
usage.session_counts.last_30_days Integer Number of Sessions in the last 30 days.
usage.session_counts.now Integer Number of Sessions currently ongoing.
usage.session_counts.today Integer Number of Sessions in the last 24 hours.
usage.session_seconds.last_30_days Integer Number of Session seconds in the past 30 days.
usage.session_seconds.today Integer Number of Session seconds in the past 24 hours.
usage.visitors.last_24_hrs Integer Number of Visitors in the past 24 hours.
usage.visitors.online_now Integer Number of Visitors online now.

Searching for a Visitor or retrieving a list of Visitors

Use this endpoint to search for a particular Visitor or to show a list of recently online Visitors.

Know the Visitor's ID?

If you know the Visitor's ID, avoid using the search functionality and instead use the direct endpoint, which will be considerably faster.

Request

GET https://api.upscope.io/v1.2/list
Parameter Type Description
search String? The search query in this format. If left empty, the latest Visitors will be returned.

Response

HTTP 200

{
  "status": "ok",
  "visitors": [
    {
      "short_id": "1234",
      // ...
    }
  ]
}
Field Type Description
visitors Visitor[] List of Visitors matching the query.

Retrieving a Visitor

Use this endpoint to retrieve a particular Visitor.

Request

GET https://api.upscope.io/v1.2/visitors/{visitor_id}
Parameter Type Description
{visitor_id} String The short id of the Visitor.
with_history Boolean Whether to include Pageviews with the Visitor.1

Response

HTTP 200

{
  "status": "ok",
  "visitor": {
    "short_id": "1234",
    // ...
  }
}
Field Type Description
visitor Visitor The Visitor.

Errors

Code Description
404 The Visitor does not exist.

Use this endpoint to generate a Secure watch link that enables whoever opens it to start a co-browsing Session with the Visitor without needing to be logged into Upscope as an Agent.

The link doesn't last long

The link returned by this endpoint doesn't last long and it's not meant to be stored anywhere.

Ideally, the Agent will make a request to an endpoint on your server, which makes this request behind the scenes and redirects the Agent to the watch_url immediately.

Your integration should never rely on storing the Secure watch link anywhere for any length of time.

Learn more here.

Request

POST https://api.upscope.io/v1.2/visitors/{visitor_id}/watch_url

{
  "branding": {
    "naked": true,
  },
  "permissions": {},
  "agent": {
    "id": "123",
    "name": "Joe Smith"
  },
  "metadata": {}
}
Parameter Type Description
{visitor_id} String The short id of the Visitor.
agent.id String The ID of the Agent (required).
agent.name String The name of the Agent (required).
branding.naked false, true, or "page_only" If true , the Upscope logo will not be shown on the page. This is ideal if you want to display the page inside an iframe. Defaults to false. Can be set to page_only to remove everything, including the Agent's UI. You can then control the Session by post-messaging the iframe.
branding.on_end_url String If set, the agent will be redirected to this url after the Session ends. If not set, the window will be attempted to be closed. Defaults to null.
branding.retry_url String If set, the visitor will be able to click a "Retry now" link that redirects to this url if there are problems. When null, no button is displayed. Defaults to null.
initial_notes String The starting state of the Agent notes for the Session. You can use this to add a template of what they should fill out.
metadata Object A JSON-encodeable object of metadata to add to the Session object. This can be used when retrieving a list of Sessions to run your own analytics. The object should be flat, meaning values can only be strings, numbers, or booleans.
permissions.allow_agent_redirect Boolean Whether the agent should have access to remote agent redirect & reload features (defaults to true, unless disabled through the Javascript SDK).
permissions.allow_audio Boolean Whether the agent should have access to audio (defaults to true, unless disabled through the Javascript SDK).
permissions.allow_click Boolean Whether the agent should have access to remote click (defaults to true, unless disabled through the Javascript SDK).
permissions.allow_console Boolean Whether the agent should have access to remote console capabilities (defaults to false).
permissions.allow_draw Boolean Whether the agent should have access to drawing (defaults to true, unless disabled through the Javascript SDK).
permissions.allow_scroll Boolean Whether the agent should have access to remote scroll (defaults to true, unless disabled through the Javascript SDK).
permissions.allow_type Boolean Whether the agent should have access to remote type (defaults to true, unless disabled through the Javascript SDK).

Response

HTTP 200

{
    "status": "ok",
    "watch_url": "https://api.upscope.io/v1.2/visitors/VISITOR1234/session/a964e00a-c685-4d54-98d4-ea0bcb154d57"
}
Field Type Description
watch_url String The Secure watch url.

Errors

Code Description
404 The Visitor does not exist.
402 This Session would put you over your subscription limits.

Stopping an active Session

Use this endpoint to stop an active Session.

Request

DELETE https://api.upscope.io/v1.2/visitors/{visitor_id}/session
Parameter Type Description
{visitor_id} String The short id of the Visitor.

Response

HTTP 200

ok

Errors

Code Description
404 The Visitor does not exist.

Deleting a Visitor from Upscope

Use this endpoint to delete a Visitor from Upscope entirely.

You can only delete Visitors who are not currently online.

Request

DELETE https://api.upscope.io/v1.2/visitors/{visitor_id}
Parameter Type Description
{visitor_id} String The short id of the Visitor.

Response

HTTP 200

ok

Errors

Code Description
404 The Visitor does not exist.
409 The Visitor is online.

Deleting all visitor from Upscope

Use this endpoint to delete all Visitors from your Upscope account.

This will delete only Visitors that are offline.

Request

DELETE https://api.upscope.io/v1.2/visitors?all=true
Parameter Type Description
all Boolean Set to true to confirm deleting all Visitors.

Response

HTTP 200

ok

Creating a new Proxy session

Use this endpoint to create a new Proxy Session through the API.

The link doesn't last long

The link returned by this endpoint doesn't last long and it's not meant to be stored anywhere.

Your integration should never rely on storing the Proxy session link anywhere for any length of time.

Request

POST https://api.upscope.io/v1.2/proxy_sessions

{
  "initial_url": "https://test.com",
  "allowed_domains": ["test.com", "test-corp.com"],
  "branding": {
    "retry_url": null
  }
}
Parameter Type Description
branding.retry_url String If set, the visitor will be able to click a "Retry now" link that redirects to this url if there are problems. When null, no button is displayed. Defaults to null.
initial_url String The first URL to send the Visitor to. Defaults to https://google.com/.
allowed_domains String[] An array of domains that the visitor is allowed to go to. Defaults to ["*"], meaning all domains.2

Response

HTTP 200

{
    "status": "ok",
    "proxy_url": "https://api.upscope.io/v1.2/proxy_sessions/b850f0ba-bf6f-47ea-b4c5-48ec46f0abde"
}
Field Type Description
proxy_url String The url to start the Proxy session.

Errors

Code Description
402 Universal proxy is not enabled for your account.

Authorizing an on-premise Session

Use this endpoint to authorize an on-premise Session.

Using our Dashboard?

If you have integrated your on-premise version of Upscope to our dashboard, you don't need to use the API. It all just works.

Request

POST https://api.upscope.io/v1.2/onpremise/token

{
  "visitor_id": "VISITOR123",
  "agent": {
    "id": "123",
    "name": "Joe Smith"
  }
}
Parameter Type Description
agent.id String The ID of the Agent (required).
agent.name String The name of the Agent (required).
visitor_id String The ID of the Visitor you want to co-browse with.

Response

HTTP 200

{
    "authorized": true,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkw...."
}
Field Type Description
authorized Boolean true to indicate the Session was authorized.
token String The token to send to the on-premise version of Upscope.

Errors

Code Description
402 This session was not authorized.

  1. This will only work if history collection is enabled for your account. 

  2. Your account might have other limitations imposed account-wide as to which domains you can co-browse on. Get in touch if this is an issue.