curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-ci-token",
"userEmail": "alice@example.com",
"expirationDate": "2026-09-01T12:00",
"teamName": "ml-platform"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user"
payload = {
"name": "my-ci-token",
"userEmail": "alice@example.com",
"expirationDate": "2026-09-01T12:00",
"teamName": "ml-platform"
}
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: 'my-ci-token',
userEmail: 'alice@example.com',
expirationDate: '2026-09-01T12:00',
teamName: 'ml-platform'
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user', 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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user",
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' => 'my-ci-token',
'userEmail' => 'alice@example.com',
'expirationDate' => '2026-09-01T12:00',
'teamName' => 'ml-platform'
]),
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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user"
payload := strings.NewReader("{\n \"name\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user")
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\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Create a personal access token for another user
Create a personal access token owned by another user in the current tenant. Requires tenant admin.
curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-ci-token",
"userEmail": "alice@example.com",
"expirationDate": "2026-09-01T12:00",
"teamName": "ml-platform"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user"
payload = {
"name": "my-ci-token",
"userEmail": "alice@example.com",
"expirationDate": "2026-09-01T12:00",
"teamName": "ml-platform"
}
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: 'my-ci-token',
userEmail: 'alice@example.com',
expirationDate: '2026-09-01T12:00',
teamName: 'ml-platform'
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user', 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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user",
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' => 'my-ci-token',
'userEmail' => 'alice@example.com',
'expirationDate' => '2026-09-01T12:00',
'teamName' => 'ml-platform'
]),
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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user"
payload := strings.NewReader("{\n \"name\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\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://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/personal-access-tokens/for-user")
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\": \"my-ci-token\",\n \"userEmail\": \"alice@example.com\",\n \"expirationDate\": \"2026-09-01T12:00\",\n \"teamName\": \"ml-platform\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Name for the personal access token. Must be 3-36 characters, start with a lowercase letter, end with a lowercase alphanumeric character, and contain only lowercase letters, numbers, and hyphens.
"my-ci-token"
Email of the user in the current tenant who will own the personal access token.
"alice@example.com"
Expiration date in ISO format. The token becomes invalid after this date.
"2026-09-01T12:00"
Team to attribute this token cost to. The token owner must be a member of this team.
"ml-platform"
Response
The newly created personal access token owned by the target user.
The generated authentication token. Store this securely — it cannot be retrieved later.
Was this page helpful?