REST API Reference (2.0)
Download OpenAPI specification:Download
By using the REST API, you can integrate our Co-browsing technology into your own application or build a thin layer around our technology. You can completely customize Surfly and automate the management of client and agent creation through the REST API.
The Surfly REST API allows you to integrate the functionality of our dashboard in a programmatic manner. With our API you can do the following things:
- Agents - Manage your agents
- Sessions - Get an overview of all your sessions
- Screenshots - Create screenshots of your co-browsing sessions
- Clients - Create new clients (reseller only)
- Servers - Get a list of all available Surfly public cloud servers
- History - Get an overview of sessions history
- Webhooks - Manage your webhooks
Below you can find detailed code examples illustrating how to make the REST calls. You will need your REST API key (which can be found in the integration panel, just below the widget code).
The rate limit for making REST API calls is 100 req/min/IP address
List
List all agents
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
free | boolean Example: free=true Agents that are ready to take a call. Depends on |
Responses
Response samples
- 200
[- {
- "agent_id": 1,
- "agent_name": "Peter Pan",
- "agent_email": "peter@neverland.net",
- "last_login": "2020-02-03T11:03:39.323310Z",
- "role": "agent",
- "available": true
}
]
Create
Create a new AGENT
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 Your rest API key |
Request Body schema: application/jsonrequired
username required | string Username of the agent |
agent_email required | string E-mail address of the agent |
password required | string Password of the agent |
role required | string Default: "agent" Enum: "admin" "manager" "agent" Role of the agent |
Responses
Request samples
- Payload
{- "username": "Peter Pan",
- "agent_email": "peter@neverland.net",
- "password": "Pass@123",
- "role": "admin"
}
Response samples
- 200
{- "agent_id": "1"
}
Get by id
Get information about a certain AGENT by AGENT_ID
path Parameters
API_KEY required | string Example: 3b57bd2db21c46d2875508b982968d26 |
AGENT_ID required | string Example: 2 |
Responses
Response samples
- 200
{- "agent_id": 2,
- "agent_name": "John Doe",
- "agent_email": "john.doe@example.com",
- "last_login": "2020-02-03T11:03:39.323310Z",
- "role": "agent",
- "available": true
}
Update
Update an AGENT by AGENT_ID
path Parameters
AGENT_ID required | string Example: 2 Id of the agent to update |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
username required | string Username of the agent |
role | string Default: "agent" Enum: "admin" "manager" "agent" Agent's role. |
available required | boolean Agent availability status |
Responses
Request samples
- Payload
{- "username": "Peter",
- "available": true
}
Response samples
- 200
{- "agent_name": "Peter",
- "agent_id": 2,
- "agent_email": "peter@neverland.com",
- "available": true
}
Generate an access token
Generate a temporary access token for a given agent.
Surfly generates a unique access token for the specified user and returns it in a response. The token expires automatically 24 hours after it is first created. Within that period, it can be used to construct Embed API links, but after that a new token has to be generated. Note that unless force_new
parameter is set, Surfly will try to return an existing token. If the existing token is due to expire in less than 5 minutes, the new token will be generated even if force_new
is set to false.
Note that 24 hours expiration time is mainly for performance optimization: the integrating app doesn't have to generate a token on each page load. Instead, it can generate it (for example) when user logs in, and cache it for a day.
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
agent_id required | integer <int32> Id of the agent |
email required | string Agent email. Required when |
name required | string Agent name. Required when |
role | string Enum: "admin" "manager" "agent" User role |
force_new | boolean Force generating a new token, even if the old one is not yet expired. Note that a user can only have one active access token at a time, previous token associated with the user will be invalidated |
Responses
Request samples
- Payload
{- "email": "agent@neverland.net",
- "name": "Ethan Hunt",
- "role": "agent"
}
Response samples
- 200
- 404
{- "user_created": true,
- "agent_token": "t0aae2b2454c64b9a87b83ec09647dd9e",
- "expires_in": 86400,
- "agent_id": 1337,
- "agent_role": "agent"
}
List
List all sessions
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
[- {
- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": null,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": null,
- "participant_num": 0,
- "end_time": null,
- "successful_start": null,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "opentok_archive_id": null,
- "space": null,
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
]
Create
Create a new session
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
url required | string Url to co-browse |
tags | Array of strings Tag associated to this session |
agent_id | integer <int32> Id of the agent |
skip_queue | boolean Default: false Prevents queueing the session when using a widget key |
hide_session_ui | boolean Note that |
Responses
Request samples
- Payload
{- "tags": [
- "tag1",
- "tag2"
]
}
Response samples
- 200
{- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": null,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": null,
- "end_time": null,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
Filter
Filter session. For example, list all active sessions
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 |
active_session required | boolean Example: active_session=true Filter active or inactive sessions |
agent_id required | number <double> Example: agent_id=1 Filter by ID of the agent who joined/started a session |
year required | number <double> Example: year=2020 Filter by year |
month required | number <double> Example: month=10 Filter by month |
pin required | number <double> Example: pin=1234 Filter by PIN number (useful in combination with |
tags required | string Example: tags=tag1,tag2 Filter by tag. Supports multiple comma separated tags at once |
Responses
Response samples
- 200
[- {
- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": null,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": null,
- "participant_num": 0,
- "end_time": null,
- "successful_start": null,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "opentok_archive_id": null,
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
]
Get by id
Get information about a session by ID
.
path Parameters
ID required | string Example: fuSHr0sRQ1usugvheahwQ Id of the session. Can be a formatted ID (e.g. 123-123-123), or an unformatted ID (e.g. fuSHr0sRQ1usugvheahwQ) |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": 1,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": null,
- "participant_num": 3,
- "end_time": null,
- "successful_start": null,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "opentok_archive_id": null,
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
End
End a session by Id
path Parameters
ID required | string Example: fuSHr0sRQ1usugvheahwQ |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": 1,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": 10,
- "participant_num": 3,
- "end_time": "2017-04-21T13:55:18.251918Z",
- "successful_start": false,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "opentok_archive_id": null,
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "native_dialogs_enabled": 0,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "session_start_confirmation": 0,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
Get default options
Get company options. A list of all available options is available here. Returns an object with default session options. Plan limitations are taken into account
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]"
}
Post options
List of all available options is available here. Sets new default options. If any option is missing in the request body, its value is reset to default. If you need to update only certain options and leave the other intact, consider the PATCH
method instead.
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]"
}
Update default options
List of all available options is available here. Updates values of options specified in the request body. Other options are left intact
curl -X PATCH --header "Content-Type: application/json" -d '{"start_with_chat_open": true}' 'https://surfly.com/v2/company/options/?api_key=API_KEY'
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]"
}
Reset default options
List of all available options is available here. Resets all session options to their default values
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 |
Responses
Create Screenshot
Start generation of screenshots. The screenshots will be created as long as you keep getting the latest screenshots using the get latest screenshot API, that is to stop the creation of screenshot you just have to stop requesting the latest screenshot. There will be a new screenshot after a set interval second. The interval will be adjusted if the given value is lower than 5 secs. The max size of the screenshot will be adjusted in case the requested size is more than the window size.
path Parameters
ID required | string Example: fEapBPiwxSouiLcAgb2OXQ1 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
size required | integer <int32> Width of the screenshot in pixels |
interval required | integer <int32> Rate in seconds, at which screenshot will be generated |
Responses
Request samples
- Payload
{- "size": 1024,
- "interval": 30
}
Response samples
- 200
"GENERATION-STARTED"
(2018-03-19)
RESELLER_KEY
is deprecated. In order to make old API calls compatible, we replaced the placeholder with the keywordall
List
Return all clients of a reseller account
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
[- {
- "company_name": "Neverland",
- "company_plan_name": "pro",
- "client_key": "AOEUaoeuntsPDe",
- "agent_count": 15,
- "widget_key": "24d1414c71a94cbf9f205ed4fc4999b5",
- "rest_key": "3b57bd2db21c46d2875508b982968d26",
- "domains": "example.com, *.example.com"
}, - {
- "company_name": "DefaultCompany",
- "company_plan_name": "free",
- "client_key": "b05b45b8d4df42ba96",
- "agent_count": 2,
- "widget_key": "c6a1333308a843cc9fb6aee2e42941d6",
- "rest_key": "767dd31a038c4ee798c72abb4b568ade",
- "domains": "*"
}
]
Create
Add a new client
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
company_name required | string Name of the company |
company_plan_name | string Default: "client_enterprise" Name of the plan |
domains | string Comma-separated list of domains |
agent_email | string Email of the agent |
agent_name | string Username of the agent |
agent_password | string Password of the agent |
Responses
Request samples
- Payload
{- "company_name": "Neverland",
- "domains": "*",
- "agent_email": "peter@mail.com",
- "agent_name": "Peter Pan"
}
Response samples
- 200
{- "company_name": "Neverland",
- "client_key": "fOBg4dXAPTHSoil6LywgfYA",
- "rest_key": "22c0f77e5ca54d8fa6748f7cec4732c5",
- "widget_key": "92cdd920f4e345768f6717b02f15dae8"
}
Get by Id
Get information about a specific client by CLIENT_KEY
path Parameters
CLIENT_KEY required | string Example: 63668234b4aa19dd436e6a76ab8ae000 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "company_name": "Neverland",
- "company_plan_name": "pro",
- "client_key": "AOEUaoeuntsPDe",
- "agent_count": 15,
- "widget_key": "24d1414c71a94cbf9f205ed4fc4999b5",
- "rest_key": "3b57bd2db21c46d2875508b982968d26",
- "domains": "example.com, *.example.com"
}
Set Client Domain List
Set Client Domain List
path Parameters
CLIENT_KEY required | string Example: 63668234b4aa19dd436e6a76ab8ae000 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
domains required | string Comma-separated list of domains |
Responses
Request samples
- Payload
{- "domains": "example.com, *.example.com"
}
Response samples
- 200
{- "domains": "example.com, *.example.com"
}
Update
Update a client
path Parameters
CLIENT_KEY required | string Example: 63668234b4aa19dd436e6a76ab8ae000 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
company_name required | string Name of the company |
company_plan_name | string Default: "client_enterprise" Name of the plan |
domains | string Comma-separated list of domains |
agent_email | string Email of the agent |
agent_name | string Username of the agent |
agent_password | string Password of the agent |
Responses
Request samples
- Payload
{- "company_name": "Peter Pan"
}
Response samples
- 200
{- "agent_count": 15,
- "company_name": "Peter Pan",
- "client_key": "AOEUaoeuntsPDe"
}
Delete
Delete a Client
path Parameters
CLIENT_KEY required | string Example: 63668234b4aa19dd436e6a76ab8ae000 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "response": "Client has been removed Successfully"
}
List Active Sessions for Reseller's Client
List all ACTIVE sessions for a certain CLIENT
, year
, month
query Parameters
CLIENT_KEY required | string Example: CLIENT_KEY=00063668234b4aa19dd436e6a76ab8ae |
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
active_session | boolean Default: false |
year | integer <int32> |
month | integer <int32> |
Responses
Response samples
- 200
[- {
- "session_id": "fOBg4dXAPTHSoil6LywgfYA",
- "agent_id": 2,
- "start_time": "2016-08-11T13:44:58.025358Z",
- "duration": 123
}
]
List
List history of all sessions
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "next": "string",
- "previous": "string",
- "results": [
- {
- "id": "fvFkrL4saf52nuFh4GP9oQw",
- "session_id": "fvFkrL4saf52nuFh4GP9oQw",
- "formatted_id": "123-123-123",
- "agent_id": null,
- "cobro_server_name": "session.surfly.com",
- "start_time": "2017-04-21T13:55:08.251918Z",
- "duration": null,
- "participant_num": 0,
- "end_time": null,
- "successful_start": null,
- "queue_id": 0,
- "pin": null,
- "queued": false,
- "waiting_time": null,
- "meta": "{}",
- "tags": [ ],
- "opentok_archive_id": null,
- "space": null,
- "options": {
- "sounds_enabled": true,
- "videochat": true,
- "allowlist": "[]",
- "anyone_can_deactivate_space": false,
- "session_autorestore_enabled": true,
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "widget_key": 0,
- "cookie_transfer_proxying": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "start_muted": false,
- "format_session_id": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_invite_modal": true,
- "theme_font_size": 14,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "new_urls_allowed": true,
- "end_of_session_popup_url": "",
- "start_with_chat_open": false,
- "hide_support_button_when_unavailable": false,
- "white_label": false,
- "blocklist": "[]",
- "support_button_position": "bottomleft",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "hidden": false,
- "original_file_download_allowed": false,
- "hide_session_ui": false,
- "invitations_allowed": true,
- "auto_start": false,
- "theme_font_background": "#cc0000",
- "block_until_agent_joins": false,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "leader_redirect_url": ""
}
}
]
}
Filter session history
Filter session history results with query params. All filters are stackable like this:
https://app.surfly.com/v2/history/?api_key=3b57bd2db21c46d2875508b982968d26&&tags=tag1&tags=null
When filtering by pin, you might want to filter on active sessions by adding &active_session=true
.
Pins are generated to be unique for active sessions, so in case you are looking for a running session via pin, please use active_session
filter as well:
https://app.surfly.com/v2/history/?api_key=3b57bd2db21c46d2875508b982968d26&pin=1234&active_session=true
Range of min_date and max_date is [min, max)
. So to get results from 2020-04-21:
https://app.surfly.com/v2/history/?api_key=3b57bd2db21c46d2875508b982968d26&min_date=2020-04-21T12:30-02:00&max_date=2020-04-22T12:30-02:00
cURL example:
curl --include \
'https://surfly.com/v2/history/?api_key=3b57bd2db21c46d2875508b982968d26&tags=tag1'
query Parameters
api_key required | string Example: api_key=3b57bd2db21c46d2875508b982968d26 REST API key of a company |
active_session required | boolean Example: active_session=false Filter active or inactive sessions. Takes |
agent_id required | string Example: agent_id=null Filter by ID of the agent who joined/started a session. Can take |
pin required | string Example: pin=1234 Filter by session pin. Can take |
tags required | string Example: tags=tag1 Filter by session tag. Can take |
min_duration required | number <double> Example: min_duration=120 Filter by minimum duration of a session. |
max_duration required | number <double> Example: max_duration=120 Filter by maximum duration of a session. |
min_date required | string Example: min_date=2020-05-06T00:00:00.000000Z Filter by earlist start date/time. Accepts a timestamp in iso8601 format. Make sure to take the timezone into account |
max_date required | string Example: max_date=2020-05-06T00:00:00.000000Z Filter by latest start date/time. Accepts a timestamp in iso8601 format. Make sure to take the timezone into account |
Responses
Response samples
- 200
{- "next": null,
- "previous": null,
- "results": [
- {
- "id": "fuSHr0sRQ1usugvheahwQ",
- "session_id": "fuSHr0sRQ1usugvheahwQ",
- "formatted_id": "737-464-923",
- "cobro_server_name": "session.sitesupport.net",
- "agent_id": null,
- "start_time": "2020-05-06T10:42:44.940708Z",
- "duration": 120,
- "end_time": null,
- "successful_start": false,
- "queue_id": 8359,
- "pin": "8359",
- "queued": false,
- "meta": "{}",
- "tags": [
- "tag1"
], - "participant_num": 0,
- "options": {
- "sounds_enabled": true,
- "audit_logs_enabled": false,
- "password_required": false,
- "videochat": true,
- "download_trigger_enabled": true,
- "allowlist": "[]",
- "orphan_redirect_url": "",
- "support_button_position": "bottomleft",
- "follower_drawing_selector": "",
- "hide_element_by_selector": "",
- "session_autorestore_enabled": true,
- "branding_primary_color": "#e54747",
- "cookie_transfer_enabled": true,
- "cookie_transfer_scopes": [ ],
- "pause_enabled": false,
- "widget_key": "",
- "branding_primary_text_color": "#ffffff",
- "start_with_loading_screen": true,
- "hide_cursors": false,
- "chat_logs_enabled": false,
- "host_switching_allowed": true,
- "branding_logo_url": "",
- "start_muted": false,
- "format_session_id": false,
- "private_session": false,
- "soft_end_filter": [ ],
- "start_with_invite_modal": false,
- "theme_font_size": 14,
- "branding_logo_link": "",
- "chat_integration": "disabled",
- "hidden": false,
- "cookie_transfer_proxying": false,
- "theme_font_color": "#FFFFFF",
- "verbose_console": false,
- "end_of_session_popup_url": "",
- "new_urls_allowed": true,
- "end_redirect_enabled": false,
- "cookie_transfer_urls": [ ],
- "start_with_chat_open": true,
- "hide_support_button_when_unavailable": false,
- "anyone_can_deactivate_space": false,
- "white_label": false,
- "blocklist": "[]",
- "branding_secondary_text_color": "#ffffff",
- "dashboard_background_url": "",
- "filesharing_enabled": true,
- "hide_until_agent_joins": false,
- "soft_session_end": false,
- "auto_start": false,
- "original_file_download_allowed": false,
- "language": "en",
- "session_start_confirmation": false,
- "branding_secondary_color": "#6e2222",
- "theme_font_background": "#cc0000",
- "hide_session_ui": false,
- "url_mangling": false,
- "shake_to_start": false,
- "native_dialogs_enabled": false,
- "invitations_allowed": true,
- "start_with_videochat_on": false,
- "regions": [ ],
- "block_until_agent_joins": true,
- "follower_redirect_url": "",
- "embedded_sessions_only": false,
- "key_combo_to_start": true,
- "native_selects": true,
- "leader_redirect_url": ""
}
}
]
}
List
List all Webhooks
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "count": 2,
- "next": null,
- "previous": null,
- "results": [
- {
- "id": 538,
- "category": "session.started",
- "enabled": true,
- "ssl_verification": true,
- "company_id": 94906
}, - {
- "id": 537,
- "category": "session.started",
- "enabled": true,
- "ssl_verification": true,
- "company_id": 94906
}
]
}
Create
Create an Webhook
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
url required | string Webhook URL |
category required | string Webhook category |
enabled required | boolean Whether the webhook is enabled or not |
ssl_verification required | boolean Whether to verify the server's TLS certificate or not |
Responses
Request samples
- Payload
{- "category": "session.started",
- "enabled": true,
- "ssl_verification": true
}
Response samples
- 201
{- "id": 539,
- "category": "session.started",
- "enabled": true,
- "ssl_verification": true,
- "company_id": 94906
}
Get by Id
Get Webhook Information
path Parameters
WEBHOOK_ID required | string Example: 1 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Responses
Response samples
- 200
{- "id": 539,
- "category": "session.started",
- "enabled": true,
- "ssl_verification": true,
- "company_id": 94906
}
Update
Update a Webhook
path Parameters
WEBHOOK_ID required | string Example: 1 |
query Parameters
API_KEY required | string Example: API_KEY=3b57bd2db21c46d2875508b982968d26 |
Request Body schema: application/jsonrequired
url required | string Webook URL |
category required | string Webhook category |
enabled required | boolean Whether the webhook is enabled or not |
ssl_verification required | boolean Whether to verify the server's TLS certificate or not |
Responses
Request samples
- Payload
{- "category": "session.started",
- "enabled": true,
- "ssl_verification": true
}
Response samples
- 200
{- "id": 539,
- "category": "session.started",
- "enabled": true,
- "ssl_verification": true,
- "company_id": 94906
}