NAV Navbar
Logo
shell

Introduction

For the command line, make sure you have curl available!

Howdy partners! Welcome to the Tenfold API.

You can use our APIs to:

You can navigate to specific topics in the left hand menu and then choose the corresponding programming language on the right. If we’re missing your favorite or required language, let us know. Our goal is to get you rolling as quickly and easily as possible.

Glossary

Organization - A customer entity in Tenfold. Each organization has Users and its own separate CRM and phone configurations.

Admin - A user instde an Organization with overall provisioning, configuration, and access rights.

Partner - A type of Organization which can create child organizations. The Admin of partner organization can manage child organizations and act on behalf of any user.

Which API version should I use?

The latest one having endpoint that you need to use. API v1 is deprecated and will be discontinued in the future, with v2 planned to eventually have all of its features, in more standarized and modern way.

Some endpoints and/or features are marked as (BETA). What does it mean?

It means that they’re not deployed to production environment yet. Example request URLs reflect that.

It also means that they can still change in significant ways, not necessarily maintaining backwards compatibility. They shouldn’t be depended on in production applications.

V1

Authentication

To authorize, use this code:

curl -X POST "https://api.tenfold.com/api/v1/oauth/token" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d 'grant_type=password' \
    -d 'client_id=CLIENTID&client_secret=SECRET' \
    -d 'username=USERNAME&password=PASSWORD'

Make sure to replace CLIENTID, SECRET, USERNAME, and PASSWORD with your client id, client secret, account username, and account password respectively.

{
  "token_type": "bearer",
  "access_token": "myaccesstokenthatdoesimportantstuff",
  "expires_in": 3600,
  "refresh_token": "myrefreshtokenthatletsmegetanewaccesstoken"
}

The Tenfold API uses Bearer tokens retrieved via either an OAuth v2.0 Resource Owner Password Grant Type or an OAuth Client Credential Grant Type. The particular grant type used depends on your use case.

Either way, the Tenfold API expects for the Bearer token to be included in all API requests in an Authorization header as follows:

Authorization: Bearer myaccesstokenthatdoesimportantstuff

It’s also possible to use alternative authentication mechanism based on JSON Web Tokens (JWT):

Authorization: Bearer JWT myJWTaccesstoken

JWT is the primary authentication mechanism used by API v2. Use API v2 login endpoint to retrieve JWT authentication token based on user credentials.

Handling Refresh Tokens

To exchange your refresh token, use this code:

curl -X POST "https://api.tenfold.com/api/v1/oauth/token" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d 'grant_type=refresh_token' \
    -d 'client_id=CLIENTID&client_secret=SECRET' \
    -d 'refresh_token=REFRESHTOKEN'

Make sure to replace CLIENTID, SECRET, and REFRESHTOKEN with your client id, client secret, and refresh token respectively.

{
  "token_type": "bearer",
  "access_token": "mybrandnewaccesstoken",
  "expires_in": 3600,
  "refresh_token": "mybrandnewrefreshtoken"
}

As seen above, access tokens expire automatically. To get a new one, you don’t have to re-authorize, instead you can use the refresh token grant type.

Once you have a new access token, you can use it the same as the access token you originally obtained. Further, you can use the new refresh token to get a new access token next time.

Authenticating as Other Users

curl -X POST "https://api.tenfold.com/api/v1/oauth/token/create" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d 'client_id=CLIENTID&client_secret=SECRET' \
    -d 'userId=USERID'

Make sure to replace CLIENTID, SECRET, and USERID with your client id, client secret, and your target user.

{
  "token_type": "bearer",
  "access_token": "myaccesstokenforanotheruser",
  "expires_in": 3600,
  "refresh_token": "myrefreshtokenforanotheruser"
}

As an administrator, once you have an access token, you can act as another user simply by requesting an access token on their behalf. From there, you can exchange the corresponding refresh token just as you would any other refresh token.

Retrieving a Users’ Dashboard

curl -X GET "https://api.tenfold.com/api/v1/users/login" \
    -d 'access_token=myaccesstokenthatdoesimportantstuff&target_path=%2F"

This is used to initiate a new web session with the required cookies from a valid Access Token. This will redirect the user’s browser to their Tenfold Dashboard.

Users

Get All Users

curl -X GET https://api.tenfold.com/api/v1/users \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

The above command returns JSON structured like this:

{
    "users": [
        {
            "_id": "abcdef123456",
            "invitedAt": "2017-06-24T05:59:19.544Z",
            "username": "first.last@example.com",
            "name": "First Last",
            "features": {
                "next": {
                    "signatures": []
                }
            },
            "deleted": false,
            "crmId": "",
            "extensions": [],
            "analytics": {
                "visible": true
            },
            "inboundEnabled": true,
            "organizationId": "bcdefa234561",
            "rolesId": [
                "593975741f9aa7d640a8b78f"
            ]
        },
        {
            "_id": "654321fedcba",
            "invitedAt": "2017-07-04T04:30:05.116Z",
            "name": "Another Name",
            "username": "another.name@example.com",
            "features": {
                "next": {
                    "signatures": []
                }
            },
            "deleted": false,
            "crmId": "NON_CRM_USER",
            "extensions": [],
            "analytics": {
                "visible": true
            },
            "inboundEnabled": true,
            "organizationId": "bcdefa234561"
        }
    ]
}

This endpoint retrieves all of the Users but can be filtered by any of the parameters below.

Query Parameters

Parameter Default Description
filter[name] none If included, the result will be filtered for users with matching first or last names.
filter[username] none If included, the results will be filtered for users with matching usernames.
page 0 This retrieves a given page of results, useful for list screens or large scale processing.
pageSize 100 This defines how many results are on a given page, useful for list screens or large scale processing.

Calls

Starting a new Call

The call.id field can be used to query the call with call querying endpoint. When call changes status an event is sent via the events webhook.

curl -X POST "https://api.tenfold.com/api/v1/calls/originate" \ 
    -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \
    -d 'phoneNumber=15125551212'

The above command returns JSON structured like this:

{
  "call": {
    "status": "queued",
    "organizationId": "bcdefa234561",
    "userId": "abcdef123456",
    "id": "36a0a670-8dfc-407b-a855-7a26cc9cf562",
    "phoneNumberCalled": "5125551212"
  }
}
Parameter Description
phoneNumber The number to dial to

Receiving Call Events

This is a sample Call event generated by Tenfold.

{
  "type": "call-update",
  "call": {
    "status": "completed",
    "phoneNumber": "15125551212",
    "direction": "Outbound",
    "startTime": "2017-07-21T21:27:43.014Z",
    "endTime": "2017-07-21T21:27:51.430Z",
    "duration": 8416,
    "createdDate": "2017-07-21T21:27:43.078Z",
    "id": "cdefab345612",
    "organizationId": "bcdefa234561",
    "userId": "abcdef123456",
    "extension": "1234",
    "phoneSystemCallId": "1500441358436"
  },
  "timestamp": "2017-07-21T21:27:51.430Z"
}

Once a call is initiated, Tenfold will generate a series of events documenting its status changes. These statuses include queued, ringing, in-progress, finished.

Each Call Event has the same structure regardless of the type of event. The structure is a simple nested JSON structure with the following fields:

Parameter Description
type Event type. Can be only call-update for now
callId The id of the call
phoneSystemCallId The id of the call in the phone system
userId The id of the user associated with the call
organizationId The id of the organization associated with the call
timestamp ISO date of the event. Generated when the event is processed by Tenfold Event Processor
extension The user extension associated with the call
status Type of the event. Can be either queued, ringing, in-progress, finished
duration Call duration in milliseconds. Available only for the Hangup event
recordingLink The url where the call recording is stored, if it is available

Start Call Recording

curl -X POST https://api.tenfold.com/api/v1/calls/{callId}/startRecording \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

This API request turns on recording for an active call. If the call is not active or the phone system does not support recording, the response will return a 400 Bad Request.

URL Parameters

Parameter Description
callId The ID of the Call to start recording

Stop Call Recording

curl -X POST https://api.tenfold.com/api/v1/calls/{callId}/stopRecording \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

This API request turns on recording for an active call. If the call is not active or the phone system does not support recording, the response will return a 400 Bad Request.

Hang Up Call

curl -X POST https://api.tenfold.com/api/v1/calls/{callId}/hangup \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

This API request hangs up an active call. If the call is not active or the phone system does not support hanging up, the response will return a 400 Bad Request.

URL Parameters

Parameter Description
callId The ID of the Call to stop recording

Get All Calls

curl -X GET https://api.tenfold.com/api/v1/calls \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

The above command returns JSON structured like this:

{
    "calls": [
        {
            "id": "cdefab345612",
            "phoneNumber": "15125551234",
            "startTime": "2017-06-06T23:24:04.863Z",
            "phoneSystemCallId": "1234",
            "direction": "Outbound",
            "endTime": "2017-06-06T23:24:52.860Z",
            "recordingLink": "https://example.org/recording.url.mp3",
            "createdDate": "2017-06-06T23:24:04.932Z",
            "duration": 47997,
            "organizationId": "bcdefa234561",
            "userId": "abcdef123456",
            "extension": "1001"
        },
        {
            "id": "defabc456123",
            "phoneNumber": "15125551234",
            "startTime": "2017-06-10T23:22:59.222Z",
            "phoneSystemCallId": "23445",
            "direction": "Outbound",
            "endTime": "2017-06-10T23:23:23.908Z",
            "createdDate": "2017-06-10T23:22:59.290Z",
            "duration": 24686,
            "organizationId": "bcdefa234561",
            "userId": "abcdef123456",
            "extension": "1001"
        }
    ]
}

This endpoint retrieves all the Calls but can be filtered by any of the parameters below.

Query Parameters

Parameter Default Description
fromDate none Find calls with createdDate greater than the specified parameter
toDate none Find calls with createdDate less than the specified parameter
direction none Filter calls that have the provided direction
phoneNumber none Filter calls that matches the given phoneNumber
page 0 This retrieves a given page of results, useful for list screens or large scale processing.
pageSize 100 This defines how many results are on a given page, useful for list screens or large scale processing.

Get a Specific Call

curl -X GET https://api.tenfold.com/api/v1/calls/{callId} \
  -H 'Authorization: Bearer myaccesstokenthatdoesimportantstuff' \

The above command returns JSON structured like this:

{
    "call": {
        "status": "completed",
        "phoneNumber": "12106397516",
        "direction": "Outbound",
        "startTime": "2017-07-21T21:23:07.876Z",
        "duration": 0,
        "createdDate": "2017-07-21T21:23:07.939Z",
        "id": "350beb96-fed3-496a-b9cb-045107dbbf0d",
        "organizationId": "58ffa2b444a589070009b05d",
        "userId": "58ffa2b444a589070009b05c",
        "extension": "3363",
        "phoneSystemCallId": "1500441358178"
    }
}

This endpoint retrieves the details of a specific Call.

URL Parameters

Parameter Description
callId The ID of the Call to retrieve

CRM Records

Edit CRM Record

curl -X PUT https://api.tenfold.com/v1/crm/record \
    -H 'content-type: application/json' \
    -d '{
        "token": "User Auth Token",
        "id": "CRM id of the record to update",
        "module": "Record Module",
        "update": {
            "name": "Some Full Name",
            "number": "Primary phone number",
            "email": "primary email",
            "AnyField1": "fieldValue1",
            "AnyField2": "fieldValue2"
        }
    }'

The above request returns JSON structured like this:

{
    "success": { }
}

At least one field must be provided in update.

name, number, and “email” are standard update fields. The handling of these will vary between individual CRM integrations. These aim to update primary name, phone number, and email of the record. All other fields in update must literally match the field name in the CRM.

Special note for organizations with a Professional Services customization:

The editRecord feature must be set to active and Organization.features.editRecord.preferences.professionalServicesCustomization must be set to true to use the customization. You must send those values in the custom parameter as before. You may also send update with other fields to update in the same request.

Errors

The Tenfold API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request failed
401 Unauthorized – Your OAuth token is incorrect
404 Not Found – The specified path or resource does not exist
405 Method Not Allowed – The specified resource does not support this HTTP method
418 I’m a teapot
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.

V2

Pagination query parameters for listing endpoints

Same format of pagination-related query parameters is applied to every endpoint returning list of results.

Parameter Default Description
page 0 Retrieves specific page of results.
pageSize 50 Number of results to return per page. Cannot be larger than 500.

Authentication

Primary authentication mechanism for API v2 endpoints are JWT tokens passed in Authorization request header, in the following format:

Authorization: Bearer JWT myJWTaccessToken

Use login endpoint to generate JWT token based on user’s username and password.

Alternative way to authenticate is using OAuth access tokens, broadly described in API v1 authentication section. See API v2 OAuth endpoints to obtain and/or refresh OAuth authentication tokens.

They can be passed as part of Authorization header, in the following format:

Authorization: Bearer myoauthaccesstoken

Calls

Get list of calls

curl -X GET https://api.tenfold.com/v2/calls \
    -H 'content-type: application/json' \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": [{
        "id": "59f45488fdab0d070011beaa",
        "userId": "5addb08fc157cc9d7804b274",
        "organizationId": "5addb099c157cc9d7804b275",
        "startTime": 1509180552900,
        "phoneNumber": "01189998819991197253",
        "extension": "example-extension",
        "duration": 200,
        "hasCrmErrors": false,
        "matchedCrmRecordsLength": 1,
        "matchedCrmRecords": [{
            "description": "Example description",
            "editLink": "http://example.edit.link",
            "email": "someemail@tenfold.com",
            "id": "someRecordId",
            "link": "http://example.link",
            "module": "exampleModule",
            "name": "exampleName",
            "ownerId": "exampleOwnerId",
            "parentName": "exampleParentName"
        }],
        "isTransfer": false,
        "recordingLink": "http://example.recording.link/recording.mp3",
        "description": "Some description",
        "direction": "Inbound",
        "hasTranscript": true,
        "listeningScore": null,
        "isMobile": false
    }, {
        ...
    }]
}

Fetch list of calls.

Query Parameters

Parameter Default Description
crmRecordId none Related CRM record ID to filter calls by.
userId none Return only calls of specified user.

Get call by Id

curl -X GET https://api.tenfold.com/v2/calls/CALL_ID \
    -H 'content-type: application/json' \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "id": "579a5baf31137b9712270789",
        "userId": "579a5baf83137b97002981ab",
        "organizationId": "579a5baf83137b9700274389",
        "pbxCallId": "ac6a5640da2a911818ef44df8a89558e1234567890",
        "callerIdName": "Tenfold",
        "startTime": 1510652233600,
        "phoneNumber": "12345678901",
        "extension": "1234",
        "duration": 350123,
        "crmRecordId": "1234567890abcdefgh",       
        "status": "Hangup",
        "hasCrmErrors": true,
        "matchedCrmRecordsLength": 1,
        "matchedCrmRecords": [{
            "id": "12345678-1234-1234-1234-1234567890ab",
            "name": "John Doe",
            "link": "http://demo.tenfold.com/index.php?module=Lead&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "editLink": "http://demo.tenfold.com/index.php?module=Lead&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "email": "johndoe@tenfold.com",
            "description": "Lorem ipsum sit amet",
            "module": "Lead",
            "parentId": "12345678-1234-1234-1234-1234567890bc",
            "parentName": "Tenfold",
            "parentModule": "Account",
            "parentLink": "http://demo.tenfold.com/index.php?module=Account&action=EditView&record=12345678-1234-1234-1234-1234567890bc",
            "ownerId": "1234567890abcdef12"
        }],
        "isTransfer": false,
        "recordingLink": "https://api.tenfold.com/v2/recodings",
        "description": "Lorem ipsum sit amet",
        "direction": "Outbound",
        "isMobile": false,
        "hasTranscript": false,
        "listeningScore": 43
    }
}

Returns the call object referenced by CALL_ID

Update call

curl -X PUT https://api.tenfold.com/v2/calls/CALL_ID \
    -H 'content-type: application/json' \
    -H 'Authorization: Bearer myaccesstoken'
    -d '{
        ... // See the Body parameters for the accepted values
    }'

The above request returns JSON structured like this:

{
    "data": {
        "id": "579a5baf31137b9712270789",
        "userId": "579a5baf83137b97002981ab",
        "organizationId": "579a5baf83137b9700274389",
        "pbxCallId": "ac6a5640da2a911818ef44df8a89558e1234567890",
        "callerIdName": "Tenfold",
        "startTime": 1510652233600,
        "phoneNumber": "12345678901",
        "extension": "1234",
        "duration": 350123,
        "crmRecordId": "1234567890abcdefgh",       
        "status": "Hangup",
        "hasCrmErrors": true,
        "matchedCrmRecordsLength": 1,
        "matchedCrmRecords": [{
            "id": "12345678-1234-1234-1234-1234567890ab",
            "name": "John Doe",
            "link": "http://demo.tenfold.com/index.php?module=Lead&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "editLink": "http://demo.tenfold.com/index.php?module=Lead&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "email": "johndoe@tenfold.com",
            "description": "Lorem ipsum sit amet",
            "module": "Lead",
            "parentId": "12345678-1234-1234-1234-1234567890bc",
            "parentName": "Tenfold",
            "parentModule": "Account",
            "parentLink": "http://demo.tenfold.com/index.php?module=Account&action=EditView&record=12345678-1234-1234-1234-1234567890bc",
            "ownerId": "1234567890abcdef12"
        }],
        "isTransfer": false,
        "recordingLink": "https://api.tenfold.com/v2/recodings",
        "description": "Lorem ipsum sit amet",
        "direction": "Outbound",
        "isMobile": false,
        "hasTranscript": false,
        "listeningScore": 43
    }
}

Updates the call referenced by CALL_ID. Right now the properties that can be updated are

Body Parameters

Parameter Default Description
crmRecordId none The id of the call in your system of record
description none The notes to be saved in the call
subject none Title of the notes

Set the matched record to a call

curl -X PUT https://api.tenfold.com/v2/calls/CALL_ID/set-matching-record \
    -H 'content-type: application/json' \
    -H 'Authorization: Bearer myaccesstoken'
    -d '{
        recordId: "1234ABCDEF",
        module: "Contact"
    }'

The above request returns JSON structured like this:

{
    "success": true
}

Sets the record identified by recordId and module as the matched record for the call identified by CALL_ID. This endpoint is useful for solving no-matches and multi-matches scenarios

Body Parameters

Parameter Default Description
recordId none The id of the record in your system of record
module none The module of the record in your system of record

Get transfer history for a call

curl -X GET https://api.tenfold.com/v2/calls/59f45488fdab0d070011beaa/transfer-history \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": [{
        "id": "5addb25a170a1d9504a29461",
        "extension": "extension-name",
        "callId": "59f45488fdab0d070011beaa",
        "callUserId": "5addb2b7170a1d9504a29462",
        "callUserExtension": "extension-name",
        "callDuration": 515156,
        "callSubject": "call subject",
        "callDescription": "call description"
    }, {
        ...
    }]
}

Get history of transfers for a given call.

Users

Update user settings

curl -X PUT https://api.tenfold.com/v2/users/me/settings \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \
    -d '{
        "primaryExtension": "abcdef",
        "timezone": "US/Central",
        "dateFormat": "YYYY-MM-DD",
        "timeFormat": "hh",
        "locale": "en-US",
        "temperatureUnit": "celsius"
    }'

The above request returns JSON structured like this:

{
    "settings": {
        "primaryExtension": "abcdef",
        "timezone": "US/Central",
        "dateFormat": "YYYY-MM-DD",
        "timeFormat": "hh",
        "locale": "en-US",
        "temperatureUnit": "celsius"
    }
}

Update current user settings.

Setting property Description
primaryExtension Primary extension of current user, as name string. Omitted from the response if not present.
timezone Timezone string, in format of IANA time zone database entrier. Fallback value is user’s organization timezone.
dateFormat Date format to use, as defined by moment.js string format. Defaults to ‘YYYY-MM-DD’.
timeFormat Time format to use, as defined by moment.js string format. Defaults to ‘hh’.
locale User IETF language tag, as defined in BCP 47. Fallback value is user’s organization locale. Note: underscores instead of dashes in locale strings are allowed and can be returned, i.e. “en_US”.
temperatureUnit Temperature unit to use, one of “celsius” or “fahrenheit”. Defaults to “celsius”.

Get user settings

curl -X GET https://api.tenfold.com/v2/users/me/settings \
    -H 'Authorization: Bearer myaccesstoken' \

The above request returns JSON structured like this:

{
    "settings": {
        "primaryExtension": "abcdef",
        "timezone": "US/Central",
        "dateFormat": "YYYY-MM-DD",
        "timeFormat": "hh",
        "locale": "en-US",
        "temperatureUnit": "celsius"
    }
}

Get current user settings.

Set user profile picture

curl -X POST https://api.tenfold.com/v2/users/me/profile-picture \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: multipart/form-data' \
    -F image=@FILENAME.jpg

The above request returns JSON structured like this:

{
    "url": "https://.../FILENAME.jpg"
}

Sets new user profile picture. Profile picture must be smaller than 2MB and be either JPEG or PNG image.

Remove user profile picture

curl -X DELETE https://api.tenfold.com/v2/users/me/profile-picture \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns empty success response (HTTP status code 200).

Removes current user profile picture.

Login into user account

curl -X POST https://api.tenfold.com/v2/users/login \
    -H 'content-type: application/json' \
    -d '{
        "username": "john.doe@tenfold.com",
        "password": "..."
    }'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a4656511b43af426a897031",
        "organizationId": "5ab356111b43af326a837024",
        "primaryTeamId": "5ab354121b4aaf3f6a817031",
        "username": "john.doe@tenfold.com",
        "name": "John Doe",
        "pictureUrl": "https://....png",
        "inboundEnabled": true,
        "extensions": ["extension1", "extension2"],
        "createdAt": "1970-02-24T14:50:57.603Z",
        "isAdmin": false,
        "agentStatus": null
    },
    "accessToken": "ACCESS_TOKEN"
}

Login into existing user account using combination of username and password.

Received token can be used for authorization in subsequent requests, included as part of Authorization header: Authorization: Bearer JWT ACCESS_TOKEN.

Get users

curl -X GET https://api.tenfold.com/v2/users \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": [{
        "id": "5a4656511b43af426a897031",
        "organizationId": "5ab356111b43af326a837024",
        "primaryTeamId": "5ab354121b4aaf3f6a817031",
        "username": "john.doe@tenfold.com",
        "name": "John Doe",
        "pictureUrl": "https://....png",
        "inboundEnabled": true,
        "extensions": ["extension1", "extension2"],
        "phoneNumbers": [
            {
              "number": "(123) 123 123",
              "type": "mobile"
            }
        ],
        "did": true,
        "createdAt": "1970-02-24T14:50:57.603Z",
        "isAdmin": false,
        "agentStatus": null
    }]
}

Get users from current organization.

Query Parameters

Parameter Default Description
name none Filter users by their full name. Case-insensitive partial match is performed.

Get user account data

curl -X GET https://api.tenfold.com/v2/users/5a65c42646041d602b4b333a \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a4656511b43af426a897031",
        "organizationId": "5ab356111b43af326a837024",
        "primaryTeamId": "5ab354121b4aaf3f6a817031",
        "username": "john.doe@tenfold.com",
        "name": "John Doe",
        "pictureUrl": "https://....png",
        "inboundEnabled": true,
        "extensions": ["extension1", "extension2"],
        "phoneNumbers": [
            {
              "number": "(123) 123 123",
              "type": "mobile"
            }
        ],
        "did": true,
        "createdAt": "1970-02-24T14:50:57.603Z",
        "isAdmin": false,
        "agentStatus": null
    }
}

Get data of specific user account.

Regular users are permitted only to fetch their own account. Organization administrators can fetch data of any user in the organization.

Alias me can be used to fetch own user account: GET /v2/users/me.

Organizations

Get organization

curl -X GET https://api.tenfold.com/v2/organizations/5a65d64679ee1d8f4761bddf \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a65d64679ee1d8f4761bddf",
        "company": "Example Organization",
        "abbr": "EXAMPLE_ORG",
        "status": "Active",
        "adminId": "5a65d64679ee1d8f4761bde3",
        "phoneSystem": "examplephonesystemname",
        "crmProvider": "examplecrmprovidername",
        "plan": "pro",
        "timezone": "America/Los_Angeles",
        "locale": "en_US"
    }
}

Get data of specified organization. Only data of current user’s organization can be fetched.

Integration health check for organization

curl -X GET https://api.tenfold.com/v2/organizations/health-check \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": [{
        "type": "crm",
        "name": "salesforce",
        "status": "connected"
    }, {
        "type": "phone",
        "name": "asterisk",
        "status": "disconnected"
    }]
}

Perform integrations health check for current user’s organization.

CRM and Phone System integration health check results are returned. One or both of the results can be omitted from the response, if configuration for them is not present at all.

CRM Records

Create CRM record

curl -X POST https://api.tenfold.com/v2/crm/records \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \
    -d '{
        "formId":"formID",
        "fields":{
            "key1":"value1",
            "key2":"value2"
        }
    }'

The above request returns JSON structured like this:

{
    "record": {
        "bean_id": "12345678-1234-1234-1234-1234567890ab",
        "bean_name": "John Doe",
        "bean_edit_link": "http://demo.callinize.com/index.php?module=Leads&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
        "bean_link": "http://demo.callinize.com/index.php?module=Leads&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
        "bean_module": "Leads"
    }
}

Create new CRM record for specified form.

Edit CRM Record

curl -X PUT https://api.tenfold.com/v2/crm/records/RECORD_ID \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \
    -d '{
        "formId": "formID",
        "update": {
            "fieldKey1": "fieldValue1",
            "fieldKey2": "fieldValue2"
        }
    }'

The above request returns JSON structured like this:

{
    "data": {
        "record": {
            "bean_id": "12345678-1234-1234-1234-1234567890ab",
            "bean_name": "John Doe",
            "bean_edit_link": "http://demo.callinize.com/index.php?module=Leads&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_link": "http://demo.callinize.com/index.php?module=Leads&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_module": "Leads"
        }
    }
}

Edit existing CRM record for specified form.

Remove number from CRM record

curl -X DELETE https://api.tenfold.com/v2/crm/records/RECORD_ID/remove-number \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \
    -d '{
        "number":"123123123",
        "callId":"CALL_ID",
        "module":"Leads"
    }'

The above request returns empty success response (200 HTTP status code)

Remove specified phone number from CRM record. If call ID is supplied, remove phone number also from specified call.

Get last interaction

curl -X GET https://api.tenfold.com/v2/crm/records/RECORD_ID/last-interaction?module=MODULE_NAME \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": {
        "pbxCallId": "ac6a5640da2a911818ef44df8a89558e1234567890.1234",
        "status": "Hangup",
        "crmRecordId": "1234567890abcdefgh",
        "direction": "Outbound",
        "startTime": "1510652233600",
        "phoneNumber": "12345678901",
        "matchedCrmRecords": [{
            "bean_id": "12345678-1234-1234-1234-1234567890ab",
            "bean_name": "John Doe",
            "bean_edit_link": "http://demo.callinize.com/index.php?module=Leads&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_link": "http://demo.callinize.com/index.php?module=Leads&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_module": "Leads"
        }],
        "provider": "providername",
        "isQueue": false,
        "queue": "",
        "extension": "1234",
        "deleted": false,
    }
}

Get last interaction with specified CRM record ID.

Get active interaction

curl -X GET https://api.tenfold.com/v2/crm/records/RECORD_ID/active-interaction?module=MODULE_NAME \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json'

The above request returns JSON structured like this:

{
    "data": {
        "id": "579a5baf31137b9712270789",
        "userId": "579a5baf83137b97002981ab",
        "organizationId": "579a5baf83137b9700274389",
        "pbxCallId": "ac6a5640da2a911818ef44df8a89558e1234567890",
        "callerIdName": "Tenfold",
        "startTime": 1510652233600,
        "phoneNumber": "12345678901",
        "extension": "1234",
        "duration": 350123,
        "crmRecordId": "1234567890abcdefgh",       
        "status": "Hangup",
        "hasCrmErrors": true,
        "matchedCrmRecordsLength": 1,
        "matchedCrmRecords": [{
            "id": "12345678-1234-1234-1234-1234567890ab",
            "name": "John Doe",
            "link": "http://demo.tenfold.com/index.php?module=Lead&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "editLink": "http://demo.tenfold.com/index.php?module=Lead&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "email": "johndoe@tenfold.com",
            "description": "Lorem ipsum sit amet",
            "module": "Lead",
            "parentId": "12345678-1234-1234-1234-1234567890bc",
            "parentName": "Tenfold",
            "parentModule": "Account",
            "parentLink": "http://demo.tenfold.com/index.php?module=Account&action=EditView&record=12345678-1234-1234-1234-1234567890bc",
            "ownerId": "1234567890abcdef12"
        }],
        "isTransfer": false,
        "recordingLink": "https://api.tenfold.com/v2/recodings",
        "description": "Lorem ipsum sit amet",
        "direction": "Outbound",
        "isMobile": false,
        "hasTranscript": false,
        "listeningScore": 43
    }
}

This endpoint fetches the most recent interaction made on the current day for a record identified by RECORD_ID. It differs from the last-interaction endpoint in the sense that this one includes interactions that might still be happening.

Tracking

Track event

curl -X POST https://api.tenfold.com/v2/tracking \
  -H 'Authorization: Bearer myaccesstoken' \
  -H 'content-type: application/json' \
  -d '{
    "event":"name_of_event_to_track",
    "data":{
      "event_property_1":"...",
      "event_property_2":"..."
    }
  }'

The above request returns JSON structured like this:

{
    "success": true
}

Track event using integration set for current user account.

Analytics

Analytics permissions

Analytics data across all endpoints, as well as some specific endpoints, are subject to being limited based on permissions granted to current user.

General rules that are enforced:

Visibility of teams is defined as:

Search for calls

curl -X GET https://api.tenfold.com/v2/analytics/search?q=term1%20term2\
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \

The above request returns JSON structured like this:

{
    "data": [{
        "id": "59f45488fdab0d070011beaa",
        "userId": "5addb08fc157cc9d7804b274",
        "organizationId": "5addb099c157cc9d7804b275",
        "startTime": 1509180552900,
        "phoneNumber": "01189998819991197253",
        "extension": "example-extension",
        "duration": 200,
        "hasCrmErrors": false,
        "matchedCrmRecordsLength": 1,
        "matchedCrmRecords": [{
            "description": "Example description",
            "editLink": "http://example.edit.link",
            "email": "someemail@tenfold.com",
            "id": "someRecordId",
            "link": "http://example.link",
            "module": "exampleModule",
            "name": "exampleName",
            "ownerId": "exampleOwnerId",
            "parentName": "exampleParentName"
        }],
        "isTransfer": false,
        "recordingLink": "http://example.recording.link/recording.mp3",
        "description": "Some description",
        "direction": "Inbound",
        "hasTranscript": true,
        "listeningScore": 0.3,
        "isMobile": false
    }, {
        ...
    }]
}

Search for calls based on search query, consisting of space-separated words or expressions (double-quoted strings).

Organization administrators can see all calls in the organization. Other users can see calls made by users belonging to one of teams visible by them. See analytics permissions for more information about team visibility.

Query Parameters

Parameter Default Description
q none Query string to filter returned calls by. In format of space-separated expressions, with parts surrounded by double-quotes understood as single expression (even when containing spaces). Example: ?q=word1 word2 "expression 1" word3 "expression two".

Get calls for user

curl -X GET https://api.tenfold.com/v2/analytics/users/USER_ID/calls \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": [{
        "id": "59f45488fdab0d070011bf1f",
        "startTime": 1509180552900,
        "phoneNumber": "123412341234",
        "extension": "someExtension",
        "duration": 234,
        "hasCrmErrors": false,
        "matchedCrmRecordsLength": 0,
        "matchedCrmRecords": [{
            "bean_id": "12345678-1234-1234-1234-1234567890ab",
            "bean_name": "John Doe",
            "bean_edit_link": "http://demo.callinize.com/index.php?module=Leads&action=EditView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_link": "http://demo.callinize.com/index.php?module=Leads&action=DetailView&record=12345678-1234-1234-1234-1234567890ab",
            "bean_module": "Leads"
        }],
        "description": "Call description",
        "hasTranscript": false,
        "listeningScore": 0.3,
        "isMobile": false
    }, {
        ...
    }]
}

Get calls associated with specified user.

Organization administrators can see calls of any user in the organization. Other users can see only their own calls. See analytics permissions for more information about analytics permissions.

Get transcript for call

curl -X GET https://api.tenfold.com/v2/analytics/calls/CALL_ID/transcript \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a0acf447d73e1f30259e21e",
        "callId": "5a0acf447d73e1f30259e1f0",
        "organizationId": "5a0acf447d73e1f30259e1f5",
        "participants": [
            {
                "transcript": {
                    "segments": [
                        {
                            "language": "en",
                            "terms": [
                                {
                                    "term": "Ten",
                                    "start": 703.66,
                                    "energy": 9.949,
                                    "dur": 0.19
                                },
                                {
                                    "term": "Fold",
                                    "start": 705.02,
                                    "energy": 12.742,
                                    "dur": 0.20
                                },
                            ]
                        }
                    ]
                },
                "name": "agent"
            }, {
                "transcript": {
                    "segments": [
                        {
                            "language": "en",
                            "terms": [
                                {
                                    "term": "rocks!",
                                    "start": 706.11,
                                    "energy": 13.43,
                                    "dur": 0.23
                                }
                            ]
                        }
                    ]
                },
                "name": "client"
            }
        ]
}

Get transcript for given call.

Get keywords for call

curl -X GET https://api.tenfold.com/v2/analytics/calls/CALL_ID/keywords \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a0acf447d73e1f30259e21e",
        "callId": "5a0acf447d73e1f30259e1f0",
        "organizationId": "5a0acf447d73e1f30259e1f5",
        "participants": [
            {
                "name": "agent",
                "keywords": [
                    {
                        "weight": 1,
                        "term": "Ten",
                        "count": 8
                    },
                    {
                        "weight": 1,
                        "term": "Fold",
                        "count": 11
                    },
                ],
            }, {
                "name": "client",
                "keywords": [
                    {
                        "weight": 2,
                        "term": "great",
                        "count": 23
                    },
                ],
            }
        ]
    }
}

Get keywords instance for given call.

Get conversation for call

curl -X GET https://api.tenfold.com/v2/analytics/calls/CALL_ID/conversation \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a0ad09a1e7387bf0e88b6d7",
        "callId": "5a0ad0991e7387bf0e88b6a9",
        "organizationId": "5a0ad0991e7387bf0e88b6ae",
        "participants": [
            {
                "name": "agent",
                "spokenDurationPercent": 29.64,
                "wordsPerMinute": 141.45,
                "interruptPercent": 0,
                "listeningScore": 71.24,
                "interruptDuration": 0,
                "spokenDuration": 999.32,
                "wordCount": 2535,
                "interruptCount": 0,
                "spokenPercent": 33.44,
                "interrupts": [],
                "speechSegments": [
                    {
                        "wordCount": 6,
                        "wordsPerMinute": 279.07,
                        "start": 693.66,
                        "end": "694.95"
                    },
                    {
                        "wordCount": 54,
                        "wordsPerMinute": 143.05,
                        "start": 1356.54,
                        "end": "1379.19"
                    },
                ],
            }, {
                "name": "client",
                "spokenDurationPercent": 45.03,
                "wordsPerMinute": 153.2,
                "interruptPercent": 0,
                "listeningScore": 49.76,
                "interruptDuration": 0,
                "spokenDuration": 1827.84,
                "wordCount": 4667,
                "interruptCount": 0,
                "spokenPercent": 64.76,
                "interrupts": [],
                "speechSegments": [
                    {
                        "wordCount": 9,
                        "wordsPerMinute": 204.55,
                        "start": 2.49,
                        "end": "5.13"
                    },
                    {
                        "wordCount": 3,
                        "wordsPerMinute": 72.29,
                        "start": 25.62,
                        "end": "28.11"
                    },
                ]
            }
        ],
        "conversation": {
            "spokenDurationPercent": 69.54,
            "wordsPerMinute": 152.89,
            "interaction": "conversation",
            "crosstalkPercent": 0,
            "crosstalkSegments": [],
            "spokenDuration": 2822.49,
            "wordCount": 7192,
            "crosstalkDurationPercent": 0,
            "crosstalkDuration": 0
        },
    }
}

Get conversation instance for given call.

Get CRM errors for call

curl -X GET https://api.tenfold.com/v2/analytics/calls/CALL_ID/errors \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \

The above request returns JSON structured like this:

{
    "data": [{
        "method": "createCall",
        "message": "Missing required parameters",
    }, {
        ...
    }]
}

Get list of CRM errors associated with given call.

Get analytics data for user

curl -X GET https://api.tenfold.com/v2/analytics/users/USER_ID \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "overview": {
            "calls": 0,
            "notes": 0,
            "crmMatch": 0,
            "crmMatchRate": 0,
            "duration": 0,
            "avgListeningScore": null,
            "inbound": {
                "calls": 0,
                "longCalls": 0,
                "duration": 0,
                "avgDuration": 0,
                "missed": 0,
                "answered": 0
            },
            "outbound": {
                "calls": 0,
                "longCalls": 0,
                "duration": 0,
                "avgDuration": 0,
                "connects": 0,
                "connectRate": 0
            },
            "avgDuration": 0
        },
        "graphs": {
            "hour": {
                "series": {
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "connects": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "connectRate": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ],
                    "notes": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    ]
                },
                "labels": [
                    "2017-11-17T00:00:12-08:00",
                    "2017-11-17T01:00:12-08:00",
                    "2017-11-17T02:00:12-08:00",
                    "2017-11-17T03:00:12-08:00",
                    "2017-11-17T04:00:12-08:00",
                    "2017-11-17T05:00:12-08:00",
                    "2017-11-17T06:00:12-08:00",
                    "2017-11-17T07:00:12-08:00",
                    "2017-11-17T08:00:12-08:00",
                    "2017-11-17T09:00:12-08:00",
                    "2017-11-17T10:00:12-08:00",
                    "2017-11-17T11:00:12-08:00",
                    "2017-11-17T12:00:12-08:00",
                    "2017-11-17T13:00:12-08:00",
                    "2017-11-17T14:00:12-08:00",
                    "2017-11-17T15:00:12-08:00",
                    "2017-11-16T16:00:12-08:00",
                    "2017-11-16T17:00:12-08:00",
                    "2017-11-16T18:00:12-08:00",
                    "2017-11-16T19:00:12-08:00",
                    "2017-11-16T20:00:12-08:00",
                    "2017-11-16T21:00:12-08:00",
                    "2017-11-16T22:00:12-08:00",
                    "2017-11-16T23:00:12-08:00"
                ],
                "userSeries": []
            },
            "user": {
                "labels": [
                    "Test Admin"
                ],
                "series": {
                    "inbound": [
                        0
                    ],
                    "outbound": [
                        0
                    ],
                    "totalCalls": [
                        0
                    ],
                    "talkTimeInbound": [
                        0
                    ],
                    "talkTimeOutbound": [
                        0
                    ],
                    "totalTime": [
                        0
                    ],
                    "connects": [
                        0
                    ],
                    "connectRate": [
                        0
                    ],
                    "notes": [
                        0
                    ],
                    "outboundCallTarget": [
                        0
                    ],
                    "inboundCallTarget": [
                        0
                    ],
                    "outboundTimeTarget": [
                        0
                    ],
                    "inboundTimeTarget": [
                        0
                    ]
                }
            }
        },
        "members": [
            {
                "id": "59af577f5a76c5fa4d12df09",
                "name": "Test user",
                "inbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "missed": 0,
                    "answered": 0
                },
                "outbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "connects": 0,
                    "connectRate": 0
                },
                "listeningScore": null,
                "calls": 0,
                "duration": 0,
                "avgDuration": 0,
                "notes": 0,
                "crmMatch": 0,
                "crmMatchRate": 0,
                "emails": 0,
                "avgResponseTime": 0
            }
        ]
    }
}

Get analytics data for specific user.

Organization admins can access analytics data for all users in the organization. Other users can only access their own analytics data. See analytics permissions.

Query Parameters

Parameter Default Description
startTime 12:00:00.000 AM today Unix timestamp specifying start of timeframe that analytics data should be generated for. Defaults to start of current day.
endTime 11:59:59.999 PM today Unix timestamp specifying end of timeframe that analytics data should be generated for. Defaults to end of current day.
memberCount 1 Number of top entries included in leaderboard response object.
timezone Organization timezone Timezone to use when querying for analytics data, one of TZ database time zones.

Get analytics data for all teams

curl -X GET https://api.tenfold.com/v2/analytics/teams \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "overview": {
            "calls": 48,
            "notes": 48,
            "crmMatch": 0,
            "crmMatchRate": 0,
            "duration": 2205493,
            "avgListeningScore": null,
            "inbound": {
                "calls": 5,
                "longCalls": 5,
                "duration": 365217,
                "avgDuration": 73043.4,
                "missed": 3,
                "answered": 2
            },
            "outbound": {
                "calls": 43,
                "longCalls": 43,
                "duration": 1840276,
                "avgDuration": 42797.11627906977,
                "connects": 6,
                "connectRate": 13.953488372093023
            },
            "avgDuration": 45947.770833333336
        },
        "leaderboard": [
            {
                "metric": "ear",
                "label": "Sound quality",
                "description": "Best quality",
                "values": []
            },
            {
                "metric": "workhorse",
                "label": "dedicated",
                "description": "Most time spent on calls",
                "values": [
                    {
                        "name": "AB",
                        "score": 2076651
                    }
                ]
            },
        ],
        "graphs": {
            "hour": {
                "series": {
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 2, 14, 1, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "connects": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "connectRate": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "notes": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ]
                },
                "labels": [
                    "2017-11-17T00:00:42-06:00",
                    "2017-11-17T01:00:42-06:00",
                    "2017-11-17T02:00:42-06:00",
                    "2017-11-17T03:00:42-06:00",
                    "2017-11-17T04:00:42-06:00",
                    "2017-11-17T05:00:42-06:00",
                    "2017-11-17T06:00:42-06:00",
                    "2017-11-17T07:00:42-06:00",
                    "2017-11-17T08:00:42-06:00",
                    "2017-11-17T09:00:42-06:00",
                    "2017-11-17T10:00:42-06:00",
                    "2017-11-17T11:00:42-06:00",
                    "2017-11-17T12:00:42-06:00",
                    "2017-11-17T13:00:42-06:00",
                    "2017-11-17T14:00:42-06:00",
                    "2017-11-17T15:00:42-06:00",
                    "2017-11-17T16:00:42-06:00",
                    "2017-11-17T17:00:42-06:00",
                    "2017-11-16T18:00:42-06:00",
                    "2017-11-16T19:00:42-06:00",
                    "2017-11-16T20:00:42-06:00",
                    "2017-11-16T21:00:42-06:00",
                    "2017-11-16T22:00:42-06:00",
                    "2017-11-16T23:00:42-06:00"
                ],
                "userSeries": [{
                    "id": "59811c75ff32cc0700740969",
                    "name": "John Doe",
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ]
                }]
            },
            "user": {
                "labels": [
                    "admin",
                    "TG",
                    "TA"
                ],
                "series": {
                    "inbound": [
                        0,
                        0,
                        5
                    ],
                    "outbound": [
                        0,
                        0,
                        41
                    ],
                    "totalCalls": [
                        0,
                        0,
                        46
                    ],
                    "talkTimeInbound": [
                        0,
                        0,
                        6.08695
                    ],
                    "talkTimeOutbound": [
                        0,
                        0,
                        28.5239
                    ],
                    "totalTime": [
                        0,
                        0,
                        34.61085
                    ],
                    "connects": [
                        0,
                        0,
                        5
                    ],
                    "connectRate": [
                        0,
                        0,
                        12.2
                    ],
                    "notes": [
                        0,
                        0,
                        46
                    ],
                    "outboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "outboundTimeTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundTimeTarget": [
                        0,
                        0,
                        0
                    ]
                }
            }
        },
        "members": [
            {
                "id": "55cfd26b319414c423f1a5d8",
                "name": "admin",
                "calls": 0,
                "crmMatch": 0,
                "duration": 0,
                "notes": 0,
                "inbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "missed": 0,
                    "answered": 0
                },
                "outbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "connects": 0,
                    "connectRate": 0
                },
                "listeningScore": null,
                "avgDuration": 0,
                "crmMatchRate": 0
            },
        ]
    }
}

Get analytics data for all teams visible to current user. See analytics permissions for more information about team visibility rules.

Query Parameters

Parameter Default Description
startTime 12:00:00.000 AM today Unix timestamp specifying start of timeframe that analytics data should be generated for. Defaults to start of current day.
endTime 11:59:59.999 PM today Unix timestamp specifying end of timeframe that analytics data should be generated for. Defaults to end of current day.
memberCount 1 Number of top entries included in leaderboard response object.
timezone Organization timezone Timezone to use when querying for analytics data, one of TZ database time zones.

Get analytics data for team

curl -X GET https://api.tenfold.com/v2/analytics/teams/TEAM_ID \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "overview": {
            "calls": 48,
            "notes": 48,
            "crmMatch": 0,
            "crmMatchRate": 0,
            "duration": 2205493,
            "avgListeningScore": null,
            "inbound": {
                "calls": 5,
                "longCalls": 5,
                "duration": 365217,
                "avgDuration": 73043.4,
                "missed": 3,
                "answered": 2
            },
            "outbound": {
                "calls": 43,
                "longCalls": 43,
                "duration": 1840276,
                "avgDuration": 42797.11627906977,
                "connects": 6,
                "connectRate": 13.953488372093023
            },
            "avgDuration": 45947.770833333336
        },
        "leaderboard": [
            {
                "metric": "ear",
                "label": "Sound quality",
                "description": "Best quality",
                "values": []
            },
            {
                "metric": "workhorse",
                "label": "dedicated",
                "description": "Most time spent on calls",
                "values": [
                    {
                        "name": "AB",
                        "score": 2076651
                    }
                ]
            },
        ],
        "graphs": {
            "hour": {
                "series": {
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 2, 14, 1, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "connects": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "connectRate": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "notes": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ]
                },
                "labels": [
                    "2017-11-17T00:00:42-06:00",
                    "2017-11-17T01:00:42-06:00",
                    "2017-11-17T02:00:42-06:00",
                    "2017-11-17T03:00:42-06:00",
                    "2017-11-17T04:00:42-06:00",
                    "2017-11-17T05:00:42-06:00",
                    "2017-11-17T06:00:42-06:00",
                    "2017-11-17T07:00:42-06:00",
                    "2017-11-17T08:00:42-06:00",
                    "2017-11-17T09:00:42-06:00",
                    "2017-11-17T10:00:42-06:00",
                    "2017-11-17T11:00:42-06:00",
                    "2017-11-17T12:00:42-06:00",
                    "2017-11-17T13:00:42-06:00",
                    "2017-11-17T14:00:42-06:00",
                    "2017-11-17T15:00:42-06:00",
                    "2017-11-17T16:00:42-06:00",
                    "2017-11-17T17:00:42-06:00",
                    "2017-11-16T18:00:42-06:00",
                    "2017-11-16T19:00:42-06:00",
                    "2017-11-16T20:00:42-06:00",
                    "2017-11-16T21:00:42-06:00",
                    "2017-11-16T22:00:42-06:00",
                    "2017-11-16T23:00:42-06:00"
                ],
                "userSeries": [{
                    "id": "59811c75ff32cc0700740969",
                    "name": "John Doe",
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ]
                }]
            },
            "user": {
                "labels": [
                    "admin",
                    "TG",
                    "TA"
                ],
                "series": {
                    "inbound": [
                        0,
                        0,
                        5
                    ],
                    "outbound": [
                        0,
                        0,
                        41
                    ],
                    "totalCalls": [
                        0,
                        0,
                        46
                    ],
                    "talkTimeInbound": [
                        0,
                        0,
                        6.08695
                    ],
                    "talkTimeOutbound": [
                        0,
                        0,
                        28.5239
                    ],
                    "totalTime": [
                        0,
                        0,
                        34.61085
                    ],
                    "connects": [
                        0,
                        0,
                        5
                    ],
                    "connectRate": [
                        0,
                        0,
                        12.2
                    ],
                    "notes": [
                        0,
                        0,
                        46
                    ],
                    "outboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "outboundTimeTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundTimeTarget": [
                        0,
                        0,
                        0
                    ]
                }
            }
        },
        "members": [
            {
                "id": "55cfd26b319414c423f1a5d8",
                "name": "admin",
                "calls": 0,
                "crmMatch": 0,
                "duration": 0,
                "notes": 0,
                "inbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "missed": 0,
                    "answered": 0
                },
                "outbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "connects": 0,
                    "connectRate": 0
                },
                "listeningScore": null,
                "avgDuration": 0,
                "crmMatchRate": 0
            },
        ]
    }
}

Get analytics data for specific team. Specified team must be visible to current user. See analytics permissions for more information about team visibility rules.

Query Parameters

Parameter Default Description
startTime 12:00:00.000 AM today Unix timestamp specifying start of timeframe that analytics data should be generated for. Defaults to start of current day.
endTime 11:59:59.999 PM today Unix timestamp specifying end of timeframe that analytics data should be generated for. Defaults to end of current day.
memberCount 1 Number of top entries included in leaderboard response object.
timezone Organization timezone Timezone to use when querying for analytics data, one of TZ database time zones.

Get analytics data for company

curl -X GET https://api.tenfold.com/v2/analytics/company \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "overview": {
            "calls": 48,
            "notes": 48,
            "crmMatch": 0,
            "crmMatchRate": 0,
            "duration": 2205493,
            "avgListeningScore": null,
            "inbound": {
                "calls": 5,
                "longCalls": 5,
                "duration": 365217,
                "avgDuration": 73043.4,
                "missed": 3,
                "answered": 2
            },
            "outbound": {
                "calls": 43,
                "longCalls": 43,
                "duration": 1840276,
                "avgDuration": 42797.11627906977,
                "connects": 6,
                "connectRate": 13.953488372093023
            },
            "avgDuration": 45947.770833333336
        },
        "leaderboard": [
            {
                "metric": "ear",
                "label": "Sound quality",
                "description": "Best quality",
                "values": []
            },
            {
                "metric": "workhorse",
                "label": "dedicated",
                "description": "Most time spent on calls",
                "values": [
                    {
                        "name": "AB",
                        "score": 2076651
                    }
                ]
            },
        ],
        "graphs": {
            "hour": {
                "series": {
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 2, 14, 1, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "connects": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "connectRate": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.13, 2.01, 14.1, 1.11, 0, 0, 0
                    ],
                    "notes": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ]
                },
                "labels": [
                    "2017-11-17T00:00:42-06:00",
                    "2017-11-17T01:00:42-06:00",
                    "2017-11-17T02:00:42-06:00",
                    "2017-11-17T03:00:42-06:00",
                    "2017-11-17T04:00:42-06:00",
                    "2017-11-17T05:00:42-06:00",
                    "2017-11-17T06:00:42-06:00",
                    "2017-11-17T07:00:42-06:00",
                    "2017-11-17T08:00:42-06:00",
                    "2017-11-17T09:00:42-06:00",
                    "2017-11-17T10:00:42-06:00",
                    "2017-11-17T11:00:42-06:00",
                    "2017-11-17T12:00:42-06:00",
                    "2017-11-17T13:00:42-06:00",
                    "2017-11-17T14:00:42-06:00",
                    "2017-11-17T15:00:42-06:00",
                    "2017-11-17T16:00:42-06:00",
                    "2017-11-17T17:00:42-06:00",
                    "2017-11-16T18:00:42-06:00",
                    "2017-11-16T19:00:42-06:00",
                    "2017-11-16T20:00:42-06:00",
                    "2017-11-16T21:00:42-06:00",
                    "2017-11-16T22:00:42-06:00",
                    "2017-11-16T23:00:42-06:00"
                ],
                "userSeries": [{
                    "id": "59811c75ff32cc0700740969",
                    "name": "John Doe",
                    "inbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "outbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "totalCalls": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 1, 13, 0, 0, 0, 0
                    ],
                    "talkTimeInbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "talkTimeOutbound": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ],
                    "totalTime": [
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.34, 1, 13.31, 0, 0, 0, 0
                    ]
                }]
            },
            "user": {
                "labels": [
                    "admin",
                    "TG",
                    "TA"
                ],
                "series": {
                    "inbound": [
                        0,
                        0,
                        5
                    ],
                    "outbound": [
                        0,
                        0,
                        41
                    ],
                    "totalCalls": [
                        0,
                        0,
                        46
                    ],
                    "talkTimeInbound": [
                        0,
                        0,
                        6.08695
                    ],
                    "talkTimeOutbound": [
                        0,
                        0,
                        28.5239
                    ],
                    "totalTime": [
                        0,
                        0,
                        34.61085
                    ],
                    "connects": [
                        0,
                        0,
                        5
                    ],
                    "connectRate": [
                        0,
                        0,
                        12.2
                    ],
                    "notes": [
                        0,
                        0,
                        46
                    ],
                    "outboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundCallTarget": [
                        0,
                        0,
                        0
                    ],
                    "outboundTimeTarget": [
                        0,
                        0,
                        0
                    ],
                    "inboundTimeTarget": [
                        0,
                        0,
                        0
                    ]
                }
            }
        },
        "members": [
            {
                "id": "55cfd26b319414c423f1a5d8",
                "name": "admin",
                "calls": 0,
                "crmMatch": 0,
                "duration": 0,
                "notes": 0,
                "inbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "missed": 0,
                    "answered": 0
                },
                "outbound": {
                    "calls": 0,
                    "longCalls": 0,
                    "duration": 0,
                    "avgDuration": 0,
                    "connects": 0,
                    "connectRate": 0
                },
                "listeningScore": null,
                "avgDuration": 0,
                "crmMatchRate": 0
            },
        ]
    }
}

Get analytics data for company.

Depending on organization setting, either only admin or all organization users can access this endpoint. See analytics permissions for more information about analytics permissions.

Query Parameters

Parameter Default Description
startTime 12:00:00.000 AM today Unix timestamp specifying start of timeframe that analytics data should be generated for. Defaults to start of current day.
endTime 11:59:59.999 PM today Unix timestamp specifying end of timeframe that analytics data should be generated for. Defaults to end of current day.
memberCount 1 Number of top entries included in leaderboard response object.
timezone Organization timezone Timezone to use when querying for analytics data, one of TZ database time zones.

Send analytics report

curl -X POST https://api.tenfold.com/v2/analytics/reports/punch-card \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "timezone": "America/Chicago"
        "startTime": 1,
        "endTime": 10000,
        "userIds": ["5a60b8b4387e26efd7c4465d"]
    }'
curl -X POST https://api.tenfold.com/v2/analytics/reports/all-calls \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "timezone": "America/Chicago"
        "startTime": 1,
        "endTime": 10000,
        "userIds": ["5a60b8b4387e26efd7c4465d"]
    }'
curl -X POST https://api.tenfold.com/v2/analytics/reports/user-table \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "timezone": "America/Chicago"
        "startTime": 1,
        "endTime": 10000,
        "userIds": ["5a60b8b4387e26efd7c4465d"]
    }'
curl -X POST https://api.tenfold.com/v2/analytics/reports/call-history \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "timezone": "America/Chicago"
        "startTime": 1,
        "endTime": 10000,
        "user": "5a60b8b4387e26efd7c4465d",
        "name": "John Doe"
    }'

The above requests return empty success response (HTTP status 200).

Create and send analytics report e-mail to current user’s e-mail address. Four report types are available and can be specified in last part of the request URL address:

Available body parameters

All body parameters are optional, with several of them only taken into account when generating reports of specific type.

Parameter Default Description
timezone Organization timezone Timezone string, in format of IANA time zone database entry. Fallback value is user’s organization timezone.
startTime 12:00:00.000 AM today Unix timestamp specifying start of timeframe that analytics data should be generated for. Defaults to start of current day.
endTime 11:59:59.999 PM today Unix timestamp specifying end of timeframe that analytics data should be generated for. Defaults to end of current day.
userIds requesting user ID Array of user IDs that report should be generated for. Used only when generating punch-card, all-calls, user-table reports.
groupByTeams false When true, generated user-table report will have results grouped by user teams. Not used by other reports.
name current user’s name Full name of the user that report will be generated for. Used only in call-history report e-mail message body.
user current user ID ID of user to generate report for. Used only by call-history report.

OAuth2

Server-side apps authorization

curl -X PUT https://api.tenfold.com/v2/oauth/authorize \
    -H 'Authorization: Bearer myaccesstoken' \
    -H 'content-type: application/json' \
    -d '{
        "response_type": "code",
        "redirect_uri": "https://.../",
        "client_id": "5a4cff2d5d132c3914395b3a",
        "allow": "yes"
    }'

The above request returns 302 Found response with Location header containing redirect URI with authorization code added as query parameter:

Location: 'https://.../?code=AUTHORIZATION_CODE'

Granting authorization token

# Using authorization code
curl -X PUT https://api.tenfold.com/v2/oauth/token \
    -H 'content-type: application/json' \
    -d '{
        "grant_type": "authorization_code",
        "client_id": "5a4cff2d5d132c3914395b3a",
        "client_secret": "abc123456",
        "code": "689849a4e374b6156732d90f997ade1b044ef685"
    }'
# Using previously obtained refresh token
curl -X PUT https://api.tenfold.com/v2/oauth/token \
    -H 'content-type: application/json' \
    -d '{
        "grant_type": "authorization_code",
        "client_id": "5a4cff2d5d132c3914395b3a",
        "client_secret": "abc123456",
        "refresh_token": "3d21ef81e7c7194a951422aef028a84715762473"
    }'

The above request returns JSON structured like this:

{
    "token_type": "bearer",
    "access_token": "855c4ae7365709415373413538acadd37d9457df",
    "expires_in": "3600",
    "refresh_token": "21a662fbf794057c77032ae1f12ae523dcc31fea"
}

Obtained access token can be used for request authorization in subsequent API requests, included as request Authorization header: Authorization: Bearer 855c4ae7365709415373413538acadd37d9457df

Contact lists (BETA)

Get contact lists for current user (BETA)

curl -X GET https://api-canary.tenfold.com/v2/contact-lists \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": [{
        "id": "5a65bab75030129d1d7146af",
        "organizationId": "5a65bbb75030129d1d71467a",
        "userId": "5a65bab75130129d1d71427e",
        "name": "Example contact list",
        "contacts": [{
            "id": "5a65bbab74e94d5c1fad63c8",
            "name": "John Doe",
            "phoneNumbers": ["4155991160"]
        }],
        "type": "untracked"
    }, {
        ...
    }]
}

Get existing contact lists for current user.

Get single contact list (BETA)

curl -X GET https://api-canary.tenfold.com/v2/contact-lists/5a65bab75030129d1d7146af \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a65bab75030129d1d7146af",
        "organizationId": "5a65bbb75030129d1d71467a",
        "userId": "5a65bab75130129d1d71427e",
        "name": "Example contact list",
        "contacts": [{
            "id": "5a65bbab74e94d5c1fad63c8",
            "name": "John Doe",
            "phoneNumbers": ["4155991160"]
        }],
        "type": "untracked"
    }
}

Get single contact list, specified by its ID.

Create new contact list (BETA)

curl -X POST https://api-canary.tenfold.com/v2/contact-lists \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "name": "Example new contact list",
        "contacts": [{
            "name": "John Doe",
            "phoneNumbers": ["4155991160"]
        }]
    }'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a65bab75030129d1d7146af",
        "organizationId": "5a65bbb75030129d1d71467a",
        "userId": "5a65bab75130129d1d71427e",
        "name": "Example new contact list",
        "contacts": [{
            "id": "5a65bbab74e94d5c1fad63c8",
            "name": "John Doe",
            "phoneNumbers": ["4155991160"]
        }],
        "type": "untracked"
    }
}

Create new contact list, along with specified contacts.

Update existing contact list (BETA)

curl -X PUT https://api-canary.tenfold.com/v2/contact-lists/5a65bab75030129d1d7146af \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "name": "Updated contact list name",
        "contacts": [{
            "name": "Suzie Doe",
            "phoneNumbers": ["4145911961"]
        }]
    }'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a65bab75030129d1d7146af",
        "organizationId": "5a65bbb75030129d1d71467a",
        "userId": "5a65bab75130129d1d71427e",
        "name": "Updated contact list name",
        "contacts": [{
            "id": "5a65bbab74e94d5c1fad63c8",
            "name": "John Doe",
            "phoneNumbers": ["4155991160"]
          }, {
            "id": "5a65bbab74e94d5c1fad63c9",
            "name": "Suzie Doe",
            "phoneNumbers": ["4145911961"]
        }],
        "type": "untracked"
    }
}

Update existing contact list.

contacts supplied in request body are merged with existing contact list contents - not overwriting it.

Delete existing contact list (BETA)

curl -X DELETE https://api-canary.tenfold.com/v2/contact-lists/5a65bab75030129d1d7146af \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns empty success response (HTTP status 200).

Delete existing contact list.

Add new contact to contact list (BETA)

curl -X POST https://api-canary.tenfold.com/v2/contact-lists/5a65bab75030129d1d7146af/contacts \
    -H 'Authorization: Bearer myaccesstoken' \
    -d '{
        "name": "Suzie Doe",
        "phoneNumbers": ["4145911961"]
    }'

The above request returns JSON structured like this:

{
    "data": {
        "id": "5a65bbab74e94d5c1fad63c9",
        "name": "Suzie Doe",
        "phoneNumbers": ["4145911961"]
    }
}

Add new contact to existing contact list.

Remove contact from contact list (BETA)

curl -X DELETE https://api-canary.tenfold.com/v2/contact-lists/5a65bab75030129d1d7146af/contacts/5a65bbab74e94d5c1fad63c9 \
    -H 'Authorization: Bearer myaccesstoken'

The above request returns empty success response (HTTP status 200).

Remove specific contact from existing contact list.