curl --request POST \
--url "https://api.nixflex.com/v1/keys/rotate" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--output "$NXF_SECRET_RESPONSE_FILE"
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.keys.rotate();
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.keys.rotate()
# AsyncNixflex supports the same calls with await (and async with).
nixflex keys rotate --confirm --base-url https://api.nixflex.com --json > "$NXF_SECRET_RESPONSE_FILE"
{
"message": "API key secret rotated. Save your new key_secret - it will not be shown again. Update your applications immediately.",
"key_id": "nxf_EXAMPLE",
"key_secret": "nxfs_NEW_SECRET_EXAMPLE"
}
Account and usage
Rotate the API key
Rotate the Nixflex account’s API secret immediately while keeping its key ID. Plan the change because the old secret stops working.
POST
/
keys
/
rotate
curl --request POST \
--url "https://api.nixflex.com/v1/keys/rotate" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--output "$NXF_SECRET_RESPONSE_FILE"
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.keys.rotate();
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.keys.rotate()
# AsyncNixflex supports the same calls with await (and async with).
nixflex keys rotate --confirm --base-url https://api.nixflex.com --json > "$NXF_SECRET_RESPONSE_FILE"
{
"message": "API key secret rotated. Save your new key_secret - it will not be shown again. Update your applications immediately.",
"key_id": "nxf_EXAMPLE",
"key_secret": "nxfs_NEW_SECRET_EXAMPLE"
}
FIXED · platform Raw HTTP base URL:
https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Keep the credential on your server.
NOT OFFERED → do this instead · platform There is one public API: https://api.nixflex.com/v1. There is no sandbox. Test with your own number on production. Use local fixtures when you do not need a real call or text.
YOU CAN CHANGE · account Rotate the credential and update its callers together.
SCOPE · account A platform uses one Nixflex account for all its businesses, with one agent per business or a shared agent. Separate accounts only when businesses sign up themselves. No platform account-creation loop. Sub-accounts are not offered. Authorise each tenant on your server.
In Help choose New request for a capacity review, complaint or problem, abuse report, or other issue. Follow Your open chats. Owners and Admins see organisation tickets. Members see their own while authorised. Close chat removes it from the open list. A staff-closed chat can surface until its final reply is read. POST /v1/support/tickets/chat-summary is a read. Use watch_ticket to check a displayed ticket outside the current page.
Use /v1/support/tickets. A personal session sends X-Nixflex-Expected-Account with the original workspace’s public key_id for list, detail, chat-summary, writes and receipt lookup. Organisation keys select their own account. On 409 account_changed, discard the stale draft and refresh Help in the intended workspace.
Create, reply and solve each need an Idempotency-Key. Reply uses X-Expected-Revision. Solve sends version in JSON. Lost response? The original person can GET /v1/support/tickets/requests/{request_key} with the original account header. A 200 returns the current ticket and original receipt. 404 means missing or inaccessible. Never resend in a different workspace. Organisation keys can replay only the identical write with its key, body and revision.
Read the compact AI rules
Replace the current account secret immediately. The key ID remains the same; the old secret stops working when rotation succeeds. The organisation signing secret is separate and does not rotate here.
Method: POST ·
Success: 200 ·
Scope: Owning account
The important part
- Rotation changes the credential used by your applications.
- Save and deploy the new secret safely; never repeat rotation merely to check progress.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential.
Request fields
No request body or query fields are required. No path, query or body fields are required. Use the current account credential. Coordinate application secret replacement and a possible interruption; this endpoint provides no overlap window for old and new secrets.Response fields
200 OK returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.
| Field | Type | Meaning |
|---|---|---|
message | string | Save the returned credential securely; the secret is returned only by creation or rotation. |
key_id | string | Stable API account identifier. |
key_secret | string | Sensitive secret. Never log, share or commit it. |
Example request
Raw HTTP base URL:https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Keep NIXFLEX_API_KEY in your private process environment. The shell examples use Bash syntax. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later. Set NXF_SECRET_RESPONSE_FILE to a new file in a private, access-restricted location before using cURL or CLI. Save the returned secret in your secret store; do not log or commit the response.
curl --request POST \
--url "https://api.nixflex.com/v1/keys/rotate" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--output "$NXF_SECRET_RESPONSE_FILE"
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.keys.rotate();
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.keys.rotate()
# AsyncNixflex supports the same calls with await (and async with).
nixflex keys rotate --confirm --base-url https://api.nixflex.com --json > "$NXF_SECRET_RESPONSE_FILE"
Example response
Illustrative200 response. Identifiers and values are examples; some optional or compatibility fields are omitted.
{
"message": "API key secret rotated. Save your new key_secret - it will not be shown again. Update your applications immediately.",
"key_id": "nxf_EXAMPLE",
"key_secret": "nxfs_NEW_SECRET_EXAMPLE"
}
Errors
Failures return anerror object with code, message, doc_url and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 500 | server_error | The rotation result could not be confirmed. | Do not rotate again blindly. Check which credential still authenticates and use the account recovery process if the new secret was lost. |
| 401 | unauthorized | The credential is missing or invalid. | Check the full account credential. |
| 429 | rate_limit_exceeded | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |