Reseller API
Zendesk partners can use the Reseller API to create Zendesk Support trial accounts. Partners can also configure the provisioned accounts with certain settings.
Create Trial Account
POST /api/v2/accounts
Creates a trial account.
A valid token is required to access this endpoint. Tokens are reseller-specific. Please contact Zendesk Customer Support to get a token.
To manage the account, set the name
and url
properties of the partner
object.
To enable SAML on the account, set all the properties of the remote_authentication
object in the account
object.
You can create trial accounts without these options but you always need a token.
Request Format
The request takes a JSON object with the following properties:
Name | Type | Required | Comment |
---|---|---|---|
account | object | yes | The Zendesk account. See account |
owner | object | yes | The account owner. See owner |
address | object | yes | The account owner's phone number. See address |
partner | object | no | The partner reseller. See partner |
language | string | no | Language of the trial account in ISO-639 format. Default is English (US). Example: “en-us”. See Supported Languages |
utc_offset | integer | no | Example: "-9". Default is "-8", or UTC-8 (PST). |
account
The account
object consists of the following properties:
Name | Type | Required | Comment |
---|---|---|---|
name | string | yes | Name of company |
subdomain | string | yes | Desired subdomain. Example: "mydomain". Must be at least 3 characters and cannot contain underscores, hyphens, periods, or spaces |
help_desk_size | string | yes | Size of help desk. Partners should always specify "Large group" |
zendesk_suite_trial | boolean | no | If true, creates a zendesk_suite trial account |
owner
The owner
object consists of the following properties:
Name | Type | Required | Comment |
---|---|---|---|
name | string | yes | Full name of account owner |
string | yes | Email of account owner | |
password | string | yes | Password of account owner |
address
The address
object consists of the following property:
Name | Type | Required | Comment |
---|---|---|---|
phone | string | yes | Phone number of account owner |
partner
The partner
object consists of the following properties:
Name | Type | Required | Comment |
---|---|---|---|
name | string | no | Name of partner reseller. Example: "BCSG". Field is required if provisioned by reseller |
url | string | no | URL customers should access to manage their account. Field is required if provisioned by reseller |
Example
{
"account": {
"name": "Sample Partner Account",
"subdomain": "partner12345",
"help_desk_size": "Large group",
"remote_authentication": {
"type": "saml",
"remote_login_url": "https://saml.example.com/login",
"remote_logout_url": "https://saml.example.com/logout",
"fingerprint": "0123456789ABCDEF0123456789ABCDEF00000000"
}
},
"owner": {
"name": "Bob Owner",
"email": "[email protected]",
"password": "12345"
},
"address": {
"phone": "123-456-7890"
},
"partner": {
"name": "BCSG",
"url": "https://partner.example.com"
}
}
Rate limiting
Only 5 trial accounts can be created every 1 minute per IP address.
Supported languages
Zendesk Support supports the following languages: English, English (Canada), English (GB), French, French (Canada), Spanish, Japanese, Portuguese (Brazil), German, Latin American Spanish, Italian, Dutch, Russian, Traditional Chinese, Simplified Chinese, Korean, Danish, Norwegian, Turkish, Swedish, Polish, Arabic, Hebrew, Indonesian, Thai, Finnish.
See Language codes for supported languages.
Code Samples
curl
curl -v https://zendeskaccounts.zendesk.com/api/v2/accounts.json \
-H "Authorization: Bearer <RESELLER_TOKEN>" \
-d "owner[name]=Bob Owner" \
-d "owner[email][email protected]" \
-d "owner[password]=12345" \
-d "address[phone]=123-456-7890" \
-d "account[name]=Sample Partner Account" \
-d "account[subdomain]=partner12345" \
-d "account[help_desk_size]=Large group" \
-d "account[remote_authentication][type]=saml" \
-d "account[remote_authentication][remote_login_url]=https://saml.example.com/login" \
-d "account[remote_authentication][remote_logout_url]=https://saml.example.com/logout" \
-d "account[remote_authentication][fingerprint]=0123456789ABCDEF0123456789ABCDEF00000000" \
-d "partner[name]=BCSG" \
-d "partner[url]=https://partner.example.com"
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/accounts"
method := "POST"
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://example.zendesk.com/api/v2/accounts")
.newBuilder();
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
"""
""");
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 config = {
method: 'POST',
url: 'https://example.zendesk.com/api/v2/accounts',
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 requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/accounts"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"POST",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/accounts")
request = Net::HTTP::Post.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)
201 Created
// Status 201 Created
{
"account": {
"name": "Sample Partner Account",
"subdomain": "partner12345",
"url": "https://partner12345.zendesk.com"
}
}
Verify Subdomain Availability
GET /api/v2/accounts/available?subdomain={subdomain}
Zendesk Support credentials are not required to access this endpoint. You can use any Zendesk Support subdomain.
Returns "true" if the subdomain is available.
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
subdomain | string | Query | true | Specify the name of the subdomain you want to verify. The name can't contain underscores, hyphens, or spaces. |
Code Samples
curl
curl https://zendeskaccounts.zendesk.com/api/v2/accounts/available.json?subdomain={name}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/accounts/available?subdomain=z3ndesk"
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://example.zendesk.com/api/v2/accounts/available")
.newBuilder()
.addQueryParameter("subdomain", "z3ndesk");
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://example.zendesk.com/api/v2/accounts/available',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
params: {
'subdomain': 'z3ndesk',
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/accounts/available?subdomain=z3ndesk"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = 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://example.zendesk.com/api/v2/accounts/available")
uri.query = URI.encode_www_form("subdomain": "z3ndesk")
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
{
"success": true
}