curl --request POST \
--url https://core.cyberun.cloud/api/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Team-ID: <x-team-id>' \
--data '
{
"kind": "integration",
"display_name": "CI bot",
"expires_in_days": 90
}
'import requests
url = "https://core.cyberun.cloud/api/v1/credentials"
payload = {
"kind": "integration",
"display_name": "CI bot",
"expires_in_days": 90
}
headers = {
"X-Team-ID": "<x-team-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Team-ID': '<x-team-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({kind: 'integration', display_name: 'CI bot', expires_in_days: 90})
};
fetch('https://core.cyberun.cloud/api/v1/credentials', 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://core.cyberun.cloud/api/v1/credentials",
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([
'kind' => 'integration',
'display_name' => 'CI bot',
'expires_in_days' => 90
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Team-ID: <x-team-id>"
],
]);
$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://core.cyberun.cloud/api/v1/credentials"
payload := strings.NewReader("{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ID", "<x-team-id>")
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://core.cyberun.cloud/api/v1/credentials")
.header("X-Team-ID", "<x-team-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cyberun.cloud/api/v1/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ID"] = '<x-team-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "integration",
"key_prefix": "sk-abcd1234",
"raw_key": "sk-abcdefghijklmnop..."
}{
"error_message": "resource not found"
}{
"error_message": "resource not found"
}{
"error_message": "resource not found"
}Create a credential
Issues a new credential for the team. The raw secret is returned only once in the response — store it securely; subsequent list responses only show the prefix.
The kind field selects the credential shape:
integration(sk-) authenticates programmatic API calls.agent(ak-) authenticates headless agents to the platform.device(dk-) is reserved for the desktop device-pairing flow and is normally created by that flow, not directly via this endpoint.
Auth: JWT only. dk- is rejected on this endpoint so a stolen
desktop credential cannot bootstrap long-lived sk-/ak- credentials
that would survive a subsequent device revoke.
curl --request POST \
--url https://core.cyberun.cloud/api/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Team-ID: <x-team-id>' \
--data '
{
"kind": "integration",
"display_name": "CI bot",
"expires_in_days": 90
}
'import requests
url = "https://core.cyberun.cloud/api/v1/credentials"
payload = {
"kind": "integration",
"display_name": "CI bot",
"expires_in_days": 90
}
headers = {
"X-Team-ID": "<x-team-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Team-ID': '<x-team-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({kind: 'integration', display_name: 'CI bot', expires_in_days: 90})
};
fetch('https://core.cyberun.cloud/api/v1/credentials', 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://core.cyberun.cloud/api/v1/credentials",
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([
'kind' => 'integration',
'display_name' => 'CI bot',
'expires_in_days' => 90
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Team-ID: <x-team-id>"
],
]);
$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://core.cyberun.cloud/api/v1/credentials"
payload := strings.NewReader("{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ID", "<x-team-id>")
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://core.cyberun.cloud/api/v1/credentials")
.header("X-Team-ID", "<x-team-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cyberun.cloud/api/v1/credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ID"] = '<x-team-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"integration\",\n \"display_name\": \"CI bot\",\n \"expires_in_days\": 90\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "integration",
"key_prefix": "sk-abcd1234",
"raw_key": "sk-abcdefghijklmnop..."
}{
"error_message": "resource not found"
}{
"error_message": "resource not found"
}{
"error_message": "resource not found"
}Authorizations
User session JWT (Bearer ). Must be paired with the X-Team-ID
request header on team-scoped endpoints so the server knows which
team's resources to operate on.
Headers
UUID of the team to scope the request to. Required on all team-scoped JWT endpoints because a user may belong to multiple teams.
"019abc12-4567-7890-abcd-ef1234567891"
Body
Subset of CredentialKind permitted in POST /credentials. Excludes
device because dk- credentials must come from /desktop/pair/confirm
(which binds the credential to the confirming user's JWT). Direct
POST /credentials { kind: "device" } is rejected by the service layer
even if a client sends it.
integration, agent "integration"
Human-readable label for the credential (shown back in the list view).
1 - 100"CI bot"
Optional expiry, in days from creation. Integer between 1 and 365 inclusive. If omitted, the credential never expires until manually revoked.
1 <= x <= 36590
Response
Credential created
UUID of the credential row.
Type of credential. Each kind shares the same storage shape but has different behaviour:
integration(sk-...): team-scoped programmatic key. Carries no user identity; used by CI bots, third-party integrations, scripts.agent(ak-...): team-scoped agent key. Used by headless workers connecting to the platform's WebSocket. Rejected by the REST surface — see the carrier table at the top of the spec.device(dk-...): per-user, team-scoped key issued by the desktop device-pairing flow (POST /desktop/pair/confirm). Carriesuser_idso the authorization layer can run against the actual user. Cannot be issued viaPOST /credentials— use the pairing flow.
integration, agent, device "integration"
The first 12 characters of the raw key, e.g. "sk-abcd1234..".
"sk-abcd1234"
The full secret. Shown only once — store it securely; subsequent list responses only show the prefix.
"sk-abcdefghijklmnop..."
