Stores and manages bearer token credentials for an integration. See Understanding connections.

JSON format

Bearer Token Connections are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
allowed_domainstringfalsetrueHostname the connection can be used on. See Allowed domain
created_atstringtruefalseWhen the connection was created
namestringfalsetrueName used to uniquely identify the connection. See Connection names
tokenstringfalsetrueBearer token. For security purposes, this value is redacted in responses
updated_atstringtruefalseWhen the connection was last updated

Create Bearer Token Connection

  • POST /api/services/zis/integrations/{integration}/connections/bearer_token

Creates a bearer token connection for the integration.

Authentication

You can authorize requests using a ZIS OAuth access token. A Zendesk app can also authorize requests to this endpoint using an admin's browser session. See Making API requests from a Zendesk app.

Parameters

NameTypeInRequiredDescription
integrationstringPathtrueName of the integration

Example body

{  "allowed_domain": "api.example.com",  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN"}

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/services/zis/integrations/{integration}/connections/bearer_token \-H "Authorization: Bearer {access_token}" \-X POST \-H 'content-type: application/json' \-d '{  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN",  "allowed_domain": "api.example.com"  }'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token"	method := "POST"	payload := strings.NewReader(`{  "allowed_domain": "api.example.com",  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN"}`)	req, err := http.NewRequest(method, url, payload)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	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/services/zis/integrations/my_integration/connections/bearer_token")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"allowed_domain\": \"api.example.com\",  \"name\": \"my_bearer_token_connection\",  \"token\": \"MY_BEARER_TOKEN\"}""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("POST", body)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({  "allowed_domain": "api.example.com",  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN"});
var config = {  method: 'POST',  url: 'https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token',  headers: {	'Content-Type': 'application/json',  },  data : data,};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsimport json
url = "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token"
payload = json.loads("""{  "allowed_domain": "api.example.com",  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN"}""")headers = {	"Content-Type": "application/json",}
response = requests.request(	"POST",	url,	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({  "allowed_domain": "api.example.com",  "name": "my_bearer_token_connection",  "token": "MY_BEARER_TOKEN"})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
{  "bearer_token": {    "allowed_domain": "api.example.com",    "created_at": "1985-04-12T23:20:50.52Z",    "name": "my_bearer_token_connection",    "token": "*****",    "updated_at": "1985-04-12T23:20:50.52Z"  }}
400 Bad Request
// Status 400 Bad Request
{  "errors": [    {      "code": "InvalidIntegration",      "title": "Specified integration is not valid"    }  ]}
401 Unauthorized
// Status 401 Unauthorized
{  "errors": [    {      "code": "InvalidCredentials",      "title": "Token length is invalid"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "Forbidden",      "title": "Cannot access this resource. Missing scope write"    }  ]}
409 Conflict
// Status 409 Conflict
{  "errors": [    {      "code": "Conflict",      "title": "Resource conflict"    }  ]}
429 Too Many Requests
// Status 429 Too Many Requests
{  "errors": [    {      "code": "TooManyRequests",      "title": "Too many requests"    }  ]}

Show Bearer Token Connection

  • GET /api/services/zis/integrations/{integration}/connections/bearer_token/{name}

Returns the details of a bearer token connection.

Authentication

You can authorize requests using a ZIS OAuth access token. A Zendesk app can also authorize requests to this endpoint using an admin's browser session. See Making API requests from a Zendesk app.

Parameters

NameTypeInRequiredDescription
integrationstringPathtrueName of the integration
namestringPathtrueName of the bearer token connection

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/services/zis/integrations/{integration}/connections/bearer_token/{name} \-H "Authorization: Bearer {access_token}"
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	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/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection',  headers: {	'Content-Type': 'application/json',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")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
{  "bearer_token": {    "allowed_domain": "api.example.com",    "created_at": "1985-04-12T23:20:50.52Z",    "name": "my_bearer_token_connection",    "token": "*****",    "updated_at": "1985-04-12T23:20:50.52Z"  }}
401 Unauthorized
// Status 401 Unauthorized
{  "errors": [    {      "code": "InvalidCredentials",      "title": "Token length is invalid"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "Forbidden",      "title": "Cannot access this resource. Missing scope write"    }  ]}
404 Not Found
// Status 404 Not Found
{  "errors": [    {      "code": "NotFound",      "title": "Connection does not exist"    }  ]}
429 Too Many Requests
// Status 429 Too Many Requests
{  "errors": [    {      "code": "TooManyRequests",      "title": "Too many requests"    }  ]}

Update Bearer Token Connection

  • PATCH /api/services/zis/integrations/{integration}/connections/bearer_token/{name}

Updates the details of a bearer token connection.

Authentication

You can authorize requests using a ZIS OAuth access token. A Zendesk app can also authorize requests to this endpoint using an admin's browser session. See Making API requests from a Zendesk app.

Parameters

NameTypeInRequiredDescription
integrationstringPathtrueName of the integration
namestringPathtrueName of the bearer token connection

Example body

{  "token": "MY_BEARER_TOKEN"}

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/services/zis/integrations/{integration}/connections/bearer_token/{name} \-H "Authorization: Bearer {access_token}" \-X PATCH \-H 'content-type: application/json' \-d '{  "token": "MY_BEARER_TOKEN"  }'
Go
import (	"fmt"	"io"	"net/http"	"strings")
func main() {	url := "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"	method := "PATCH"	payload := strings.NewReader(`{  "token": "MY_BEARER_TOKEN"}`)	req, err := http.NewRequest(method, url, payload)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	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/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""{  \"token\": \"MY_BEARER_TOKEN\"}""");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("PATCH", body)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({  "token": "MY_BEARER_TOKEN"});
var config = {  method: 'PATCH',  url: 'https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection',  headers: {	'Content-Type': 'application/json',  },  data : data,};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsimport json
url = "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"
payload = json.loads("""{  "token": "MY_BEARER_TOKEN"}""")headers = {	"Content-Type": "application/json",}
response = requests.request(	"PATCH",	url,	headers=headers,	json=payload)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")request = Net::HTTP::Patch.new(uri, "Content-Type": "application/json")request.body = %q({  "token": "MY_BEARER_TOKEN"})response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

204 No Content
// Status 204 No Content
null
400 Bad Request
// Status 400 Bad Request
{  "errors": [    {      "code": "InvalidIntegration",      "title": "Specified integration is not valid"    }  ]}
401 Unauthorized
// Status 401 Unauthorized
{  "errors": [    {      "code": "InvalidCredentials",      "title": "Token length is invalid"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "Forbidden",      "title": "Cannot access this resource. Missing scope write"    }  ]}
404 Not Found
// Status 404 Not Found
{  "errors": [    {      "code": "NotFound",      "title": "Connection does not exist"    }  ]}
429 Too Many Requests
// Status 429 Too Many Requests
{  "errors": [    {      "code": "TooManyRequests",      "title": "Too many requests"    }  ]}

Delete Bearer Token Connection

  • DELETE /api/services/zis/integrations/{integration}/connections/bearer_token/{name}

Deletes a bearer token connection.

Authentication

You can authorize requests using a ZIS OAuth access token. A Zendesk app can also authorize requests to this endpoint using an admin's browser session. See Making API requests from a Zendesk app.

Parameters

NameTypeInRequiredDescription
integrationstringPathtrueName of the integration
namestringPathtrueName of the bearer token connection

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/services/zis/integrations/{integration}/connections/bearer_token/{name} \-H "Authorization: Bearer {access_token}" \-X DELETE
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"	method := "DELETE"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	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/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("DELETE", null)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'DELETE',  url: 'https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection',  headers: {	'Content-Type': 'application/json',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection"headers = {	"Content-Type": "application/json",}
response = requests.request(	"DELETE",	url,	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/services/zis/integrations/my_integration/connections/bearer_token/my_bearer_token_connection")request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

204 No Content
// Status 204 No Content
null
401 Unauthorized
// Status 401 Unauthorized
{  "errors": [    {      "code": "InvalidCredentials",      "title": "Token length is invalid"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "Forbidden",      "title": "Cannot access this resource. Missing scope write"    }  ]}
404 Not Found
// Status 404 Not Found
{  "errors": [    {      "code": "NotFound",      "title": "Connection does not exist"    }  ]}
429 Too Many Requests
// Status 429 Too Many Requests
{  "errors": [    {      "code": "TooManyRequests",      "title": "Too many requests"    }  ]}