Rotate API key
curl --request POST \
--url https://api.nexspace365.com/api/api-keys/{id}/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nexspace365.com/api/api-keys/{id}/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nexspace365.com/api/api-keys/{id}/rotate', 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://api.nexspace365.com/api/api-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nexspace365.com/api/api-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nexspace365.com/api/api-keys/{id}/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/api-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 15,
"name": "CI deploy key",
"prefix": "nex_live_",
"lastFour": "8f2a",
"scopes": [
"shifts:read",
"facilities:read"
],
"facilityId": null,
"ipAllowlist": [],
"rateLimitPerMin": 120,
"lastUsedAt": "2026-05-11T07:59:00Z",
"expiresAt": "2026-08-09T00:00:00Z",
"revokedAt": null,
"rotationGraceUntil": null,
"createdAt": "2026-05-11T07:00:00Z"
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {},
"suggestion": "<string>",
"retryable": true
},
"requestId": "<string>"
}API Keys
Rotate API key
Generate a new secret for an existing key. The old key remains valid for 24 hours (grace period) to allow zero-downtime rotation.
POST
/
api
/
api-keys
/
{id}
/
rotate
Rotate API key
curl --request POST \
--url https://api.nexspace365.com/api/api-keys/{id}/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nexspace365.com/api/api-keys/{id}/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nexspace365.com/api/api-keys/{id}/rotate', 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://api.nexspace365.com/api/api-keys/{id}/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nexspace365.com/api/api-keys/{id}/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nexspace365.com/api/api-keys/{id}/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/api-keys/{id}/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 15,
"name": "CI deploy key",
"prefix": "nex_live_",
"lastFour": "8f2a",
"scopes": [
"shifts:read",
"facilities:read"
],
"facilityId": null,
"ipAllowlist": [],
"rateLimitPerMin": 120,
"lastUsedAt": "2026-05-11T07:59:00Z",
"expiresAt": "2026-08-09T00:00:00Z",
"revokedAt": null,
"rotationGraceUntil": null,
"createdAt": "2026-05-11T07:00:00Z"
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {},
"suggestion": "<string>",
"retryable": true
},
"requestId": "<string>"
}Authorizations
JWT token authentication
Path Parameters
Response
New key issued (old key valid for 24h grace period)
Token prefix (e.g. nex_live_, nex_test_, nex_pat_)
Last 4 characters of the token
Show child attributes
Show child attributes
⌘I

