Create Token
curl --request POST \
--url https://client-backend.oktivo.com/api/v1/crm/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiresInDays": 123
}
'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/tokens"
payload = {
"name": "<string>",
"expiresInDays": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', expiresInDays: 123})
};
fetch('https://client-backend.oktivo.com/api/v1/crm/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://client-backend.oktivo.com/api/v1/crm/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'expiresInDays' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://client-backend.oktivo.com/api/v1/crm/tokens"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://client-backend.oktivo.com/api/v1/crm/tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"tokenId": "tok_abc123def456",
"name": "salesforce-integration",
"prefix": "okt_a1b2",
"plainToken": "okt_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"expiresAt": "2025-04-15T00:00:00.000Z"
}
}
{
"success": false,
"message": "expiresInDays must be an integer between 1 and 365"
}
Authentication
Create Token
Create a new API token. Returns the plaintext token exactly once.
POST
/
api
/
v1
/
crm
/
tokens
Create Token
curl --request POST \
--url https://client-backend.oktivo.com/api/v1/crm/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiresInDays": 123
}
'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/tokens"
payload = {
"name": "<string>",
"expiresInDays": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', expiresInDays: 123})
};
fetch('https://client-backend.oktivo.com/api/v1/crm/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://client-backend.oktivo.com/api/v1/crm/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'expiresInDays' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://client-backend.oktivo.com/api/v1/crm/tokens"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://client-backend.oktivo.com/api/v1/crm/tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expiresInDays\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"tokenId": "tok_abc123def456",
"name": "salesforce-integration",
"prefix": "okt_a1b2",
"plainToken": "okt_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"expiresAt": "2025-04-15T00:00:00.000Z"
}
}
{
"success": false,
"message": "expiresInDays must be an integer between 1 and 365"
}
Request Body
string
required
A descriptive name for the token. Must be 1–128 characters.
integer
required
Number of days until the token expires. Must be between 1 and 365.
Response
boolean
Indicates if the request was successful.
object
Show data properties
Show data properties
string
Unique identifier for the token (used for deletion and rotation).
string
The name you provided.
string
The first 8 characters of the token (e.g.,
okt_a1b2). Used for identification without exposing the full value.string
The full plaintext API token. This is only returned once store it securely.
string
ISO 8601 timestamp of when the token expires.
{
"success": true,
"data": {
"tokenId": "tok_abc123def456",
"name": "salesforce-integration",
"prefix": "okt_a1b2",
"plainToken": "okt_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"expiresAt": "2025-04-15T00:00:00.000Z"
}
}
{
"success": false,
"message": "expiresInDays must be an integer between 1 and 365"
}
This endpoint requires JWT authentication (logged-in dashboard session). API tokens cannot create other API tokens.