This API lets you manage the digital lines in your Zendesk voice account. See Managing Zendesk Talk lines in Zendesk help.

JSON format

Digital lines are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
brand_idintegerfalsefalseID of brand associated with the digital line
call_recording_consentstringfalsefalseWhat call recording consent is set to
categorised_greetings_with_sub_settingsobjecttruefalseThe id and any settings associated with each greeting category. If the category has no settings, it defaults to the category name. See Managing outgoing greetings in Zendesk help
created_atstringtruefalseThe date and time the digital line was created
default_greeting_idsarraytruefalseThe names of default system greetings associated with the phone number. See Managing outgoing greetings in Zendesk help
default_group_idintegerfalsefalseDefault group id. *Writeable on most of the plans.
greeting_idsarrayfalsefalseCustom greetings associated with the digital line. See Create Greetings in the Talk API docs and Managing outgoing greetings in Zendesk help
group_idsarrayfalsefalseAn array of associated groups. *Writeable on most plans. If omnichannel routing is enabled, only the first group_id provided is accepted for routing purposes
idintegertruefalseAutomatically assigned upon creation
line_idstringtruefalseAutomatically assigned upon creation. Use this id when integrating with the Web Widget to enable calling. See the Web Widget API Reference
line_typestringfalsefalseThe type line, either phone or digital
nicknamestringfalsefalseThe nickname of the digital line
outbound_numberstringfalsefalseThe outbound number phone number if outbound is to be enabled
priorityintegerfalsefalseLevel of priority associated with the digital line
recordedbooleanfalsefalseWhether calls for the line are recorded or not
schedule_idintegerfalsefalseID of schedule associated with the digital line
transcriptionbooleanfalsefalseWhether calls for the line are transcribed or not

Example

{  "brand_id": 1,  "categorised_greetings_with_sub_settings": {    "1": {      "voicemail_off_inside_business_hours": "voicemail_en_voicemail_config,",      "voicemail_off_outside_business_hours": "voicemail_en_voicemail_config",      "voicemail_on_inside_business_hours": "voicemail_en,"    },    "2": {      "voicemail_off": "available_en_voicemail_config",      "voicemail_on": "available_en,"    }  },  "created_at": "2013-04-13T16:02:33Z",  "default_greeting_ids": [    "voicemail_en",    "available_jp"  ],  "default_group_id": 1,  "greeting_ids": [    1,    2  ],  "group_ids": [    1,    2  ],  "id": 6,  "nickname": "Awesome Digital Line",  "recorded": true,  "transcription": false}

Show Digital Line

  • GET /api/v2/channels/voice/digital_lines/{digital_line_id}

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
digital_line_idintegerPathtrueID of a digital line

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/voice/digital_lines/{digital_line_id}.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/channels/voice/digital_lines/1',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "digital_line": {    "brand_id": 1,    "call_recording_consent": "always",    "categorised_greetings_with_sub_settings": {      "1": {        "voicemail_off_inside_business_hours": "voicemail_en_voicemail_config",        "voicemail_off_outside_business_hours": "voicemail_en_voicemail_config",        "voicemail_on_inside_business_hours": "voicemail_en"      },      "2": {        "voicemail_off": "available_en_voicemail_config",        "voicemail_on": "available_en,"      }    },    "created_at": "2013-04-13T16:02:33Z",    "default_greeting_ids": [      "voicemail_en",      "available_jp"    ],    "default_group_id": 1,    "greeting_ids": [      1,      2    ],    "group_ids": [      1,      2    ],    "id": 6,    "line_id": "56e4cf3a49112b3494b3b70f0506bdfa",    "line_type": "digital",    "nickname": "Awesome Support Line",    "recorded": true,    "transcription": false  }}

Create Digital Line

  • POST /api/v2/channels/voice/digital_lines

Creates a Talk digital line.

Allowed For

  • Agents

Example body

{  "digital_line": {    "group_ids": [      1    ],    "nickname": "Awesome Digital Line"  }}

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/voice/digital_lines.json \  -H "Content-Type: application/json" -X POST -d '{"digital_line" : {"nickname": "Awesome Digital Line", "group_ids": [1234] }}' \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://support.zendesk.com/api/v2/channels/voice/digital_lines"	method := "POST"	payload := strings.NewReader(`{  "digital_line": {    "group_ids": [      1    ],    "nickname": "Awesome Digital Line"  }}`)	req, err := http.NewRequest(method, url, payload)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/digital_lines")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"digital_line\": {    \"group_ids\": [      1    ],    \"nickname\": \"Awesome Digital Line\"  }}""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("POST", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({  "digital_line": {    "group_ids": [      1    ],    "nickname": "Awesome Digital Line"  }});
var config = {  method: 'POST',  url: 'https://support.zendesk.com/api/v2/channels/voice/digital_lines',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },  data : data,};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsimport jsonfrom requests.auth import HTTPBasicAuth
url = "https://support.zendesk.com/api/v2/channels/voice/digital_lines"
payload = json.loads("""{  "digital_line": {    "group_ids": [      1    ],    "nickname": "Awesome Digital Line"  }}""")headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"POST",	url,	auth=auth,	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://support.zendesk.com/api/v2/channels/voice/digital_lines")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({  "digital_line": {    "group_ids": [      1    ],    "nickname": "Awesome Digital Line"  }})email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

201 Created
// Status 201 Created
{  "digital_line": {    "brand_id": 1,    "call_recording_consent": "always",    "categorised_greetings_with_sub_settings": {      "1": {        "voicemail_off_inside_business_hours": "voicemail_en_voicemail_config",        "voicemail_off_outside_business_hours": "voicemail_en_voicemail_config",        "voicemail_on_inside_business_hours": "voicemail_en"      },      "2": {        "voicemail_off": "available_en_voicemail_config",        "voicemail_on": "available_en,"      }    },    "created_at": "2013-04-13T16:02:33Z",    "default_greeting_ids": [      "voicemail_en",      "available_jp"    ],    "default_group_id": 1,    "greeting_ids": [      1,      2    ],    "group_ids": [      1,      2    ],    "id": 6,    "line_id": "56e4cf3a49112b3494b3b70f0506bdfa",    "line_type": "digital",    "nickname": "Awesome Support Line",    "recorded": true,    "transcription": false  }}

Update Digital Line

  • PUT /api/v2/channels/voice/digital_lines/{digital_line_id}

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
digital_line_idintegerPathtrueID of a digital line

Example body

{  "digital_line": {    "nickname": "Awesome Digital Line"  }}

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/voice/digital_lines/{digital_line_id}.json \  -H "Content-Type: application/json" -d '{"digital_line": {"nickname": "Awesome Digital Line"}}' \  -v -u {email_address}/token:{api_token} -X PUT
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"	method := "PUT"	payload := strings.NewReader(`{  "digital_line": {    "nickname": "Awesome Digital Line"  }}`)	req, err := http.NewRequest(method, url, payload)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"digital_line\": {    \"nickname\": \"Awesome Digital Line\"  }}""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PUT", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({  "digital_line": {    "nickname": "Awesome Digital Line"  }});
var config = {  method: 'PUT',  url: 'https://support.zendesk.com/api/v2/channels/voice/digital_lines/1',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },  data : data,};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsimport jsonfrom requests.auth import HTTPBasicAuth
url = "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"
payload = json.loads("""{  "digital_line": {    "nickname": "Awesome Digital Line"  }}""")headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"PUT",	url,	auth=auth,	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")request = Net::HTTP::Put.new(uri, "Content-Type": "application/json")request.body = %q({  "digital_line": {    "nickname": "Awesome Digital Line"  }})email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "digital_line": {    "brand_id": 1,    "call_recording_consent": "always",    "categorised_greetings_with_sub_settings": {      "1": {        "voicemail_off_inside_business_hours": "voicemail_en_voicemail_config",        "voicemail_off_outside_business_hours": "voicemail_en_voicemail_config",        "voicemail_on_inside_business_hours": "voicemail_en"      },      "2": {        "voicemail_off": "available_en_voicemail_config",        "voicemail_on": "available_en,"      }    },    "created_at": "2013-04-13T16:02:33Z",    "default_greeting_ids": [      "voicemail_en",      "available_jp"    ],    "default_group_id": 1,    "greeting_ids": [      1,      2    ],    "group_ids": [      1,      2    ],    "id": 6,    "line_id": "56e4cf3a49112b3494b3b70f0506bdfa",    "line_type": "digital",    "nickname": "Awesome Support Line",    "recorded": true,    "transcription": false  }}

Delete Digital Line

  • DELETE /api/v2/channels/voice/digital_lines/{digital_line_id}

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
digital_line_idintegerPathtrueID of a digital line

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/voice/digital_lines/{digital_line_id}.json \  -H "Content-Type: application/json" -X DELETE -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"	method := "DELETE"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("DELETE", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'DELETE',  url: 'https://support.zendesk.com/api/v2/channels/voice/digital_lines/1',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://support.zendesk.com/api/v2/channels/voice/digital_lines/1"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"DELETE",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://support.zendesk.com/api/v2/channels/voice/digital_lines/1")request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "status": "ok"}