Create API key
curl --request POST \
--url https://api.nexspace365.com/api/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CI deploy key",
"scopes": [
"shifts:read",
"facilities:read"
],
"expiresAt": "2026-08-09T00:00:00Z",
"rateLimitPerMin": 120
}
'import requests
url = "https://api.nexspace365.com/api/api-keys"
payload = {
"name": "CI deploy key",
"scopes": ["shifts:read", "facilities:read"],
"expiresAt": "2026-08-09T00:00:00Z",
"rateLimitPerMin": 120
}
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: 'CI deploy key',
scopes: ['shifts:read', 'facilities:read'],
expiresAt: '2026-08-09T00:00:00Z',
rateLimitPerMin: 120
})
};
fetch('https://api.nexspace365.com/api/api-keys', 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",
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' => 'CI deploy key',
'scopes' => [
'shifts:read',
'facilities:read'
],
'expiresAt' => '2026-08-09T00:00:00Z',
'rateLimitPerMin' => 120
]),
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://api.nexspace365.com/api/api-keys"
payload := strings.NewReader("{\n \"name\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\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://api.nexspace365.com/api/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/api-keys")
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\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\n}"
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
Create API key
Mint a new API key. The plaintext token is returned exactly once in this response — store it securely. Subsequent reads expose only the prefix and last four characters.
POST
/
api
/
api-keys
Create API key
curl --request POST \
--url https://api.nexspace365.com/api/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CI deploy key",
"scopes": [
"shifts:read",
"facilities:read"
],
"expiresAt": "2026-08-09T00:00:00Z",
"rateLimitPerMin": 120
}
'import requests
url = "https://api.nexspace365.com/api/api-keys"
payload = {
"name": "CI deploy key",
"scopes": ["shifts:read", "facilities:read"],
"expiresAt": "2026-08-09T00:00:00Z",
"rateLimitPerMin": 120
}
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: 'CI deploy key',
scopes: ['shifts:read', 'facilities:read'],
expiresAt: '2026-08-09T00:00:00Z',
rateLimitPerMin: 120
})
};
fetch('https://api.nexspace365.com/api/api-keys', 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",
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' => 'CI deploy key',
'scopes' => [
'shifts:read',
'facilities:read'
],
'expiresAt' => '2026-08-09T00:00:00Z',
'rateLimitPerMin' => 120
]),
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://api.nexspace365.com/api/api-keys"
payload := strings.NewReader("{\n \"name\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\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://api.nexspace365.com/api/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/api-keys")
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\": \"CI deploy key\",\n \"scopes\": [\n \"shifts:read\",\n \"facilities:read\"\n ],\n \"expiresAt\": \"2026-08-09T00:00:00Z\",\n \"rateLimitPerMin\": 120\n}"
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
Body
application/json
Human-readable key name
Required string length:
1 - 120Permission scopes (e.g. ['shifts:read', 'staff:*'])
Minimum array length:
1Pattern:
^[a-z_]+:[a-z*]+$Optional expiry timestamp
Optional IPv4/IPv6 CIDR allowlist
Required range:
1 <= x <= 6000Mint as personal access token (nex_pat_ prefix)
Response
API key created (plaintext token in key field — display once)
Token prefix (e.g. nex_live_, nex_test_, nex_pat_)
Last 4 characters of the token
Plaintext token — store securely, never shown again
⌘I

