API Credentials Guide
Overview
API credentials (a Client ID and Client Secret) allow external systems to authenticate with the tieback platform programmatically. This guide covers how to create, rotate, revoke, and use them.
Creating a credential
- Navigate to Settings → API Credentials.
- Click Create Credential.
- Fill in a descriptive Name (e.g., “ERP Sync — Production”).
- Set Scopes to the permissions required (e.g.,
products:read). - Optionally add a Metadata tag and an Expiry date.
- Click Create.
One-time secret rule
After creation, your Client Secret is displayed exactly once in a secure modal:
- Copy both the Client ID and Client Secret using the copy buttons.
- Download as
.envorJSONfor safe storage. - Check both acknowledgement boxes to confirm you have stored the secret.
- Once you close the modal, the secret cannot be viewed again.
If you lose the secret, you must rotate the credential to generate a new one. There is no way to recover the original secret.
Copying and downloading credentials
The one-time secret modal provides:
.env format
JSON format
Editing credential expiry
You can change or remove the expiry date for an active credential, subject to a 72-hour lock window:
To edit expiry:
- In the credentials table, click Expiry next to the credential.
- Pick a new date (must be in the future) or clear the field to remove expiry.
- Optionally enter a Reason.
- Click Save Expiry.
Expiry is stored in UTC. The lock window is computed server-side — if your browser clock is slightly ahead, the server may still reject the edit. If this happens, the page will automatically refresh to show the current state.
There is no way to extend an expired credential. You must create a new one.
Rotating a credential
Rotation replaces the secret without changing the Client ID:
- In the credentials table, click Rotate next to the active credential.
- Optionally enter a Reason (e.g., “Scheduled quarterly rotation”).
- Click Rotate Secret.
- A new one-time secret modal appears — copy and store the new secret immediately.
- The old secret stops working immediately. There is no grace period.
Rotation does not extend the expiry date. If the credential is close to expiry, edit the expiry first (if outside the lock window) or create a new credential.
Expired credentials cannot be rotated. If a credential has expired, you must create a new one.
There is no auto-rotation in Phase 3. All rotations are manual. If you lose the new secret, you must rotate again.
Revoking a credential
Revocation is permanent and cannot be undone.
You may revoke a credential even if it has expired. Revocation creates an explicit administrative audit record, distinct from time-based expiry. The UI will display “Revoked” even if the expiry date is in the past.
- Click Revoke next to the credential.
- Enter a reason.
- Click Revoke.
- The credential is marked as
revokedand can no longer authenticate.
Expiry and revocation are distinct lifecycle events. A credential can expire (time-based) without being revoked. Revoking an expired credential formally records administrative intent in the audit trail.
Expired credentials cannot be rotated. If a credential has expired and you still need access, create a new credential. You may optionally revoke the expired credential for a clean audit trail.
If you need access again, create a new credential.
Using credentials in API calls
Use supabase.functions.invoke to call tieback API endpoints. The SDK automatically attaches the required headers.
Do not use raw fetch — the gateway requires both Authorization and apikey headers, which the SDK attaches automatically.
Finding your Brand ID
Your Brand ID is shown on the Settings → Brand Settings page as a read-only field. Click the copy icon to copy it to your clipboard.
Security best practices
- Never commit secrets to git. Add
.envto your.gitignore. - Use a secrets vault (e.g., 1Password, AWS Secrets Manager, Doppler) for production credentials.
- Rotate regularly — at least quarterly for production credentials.
- Use least-privilege scopes — only request the permissions your integration needs.
- Revoke immediately if a secret is compromised or no longer needed.
- One credential per integration — don’t share credentials across systems.
FAQ
Can I see the secret after closing the modal? No. The secret is shown only once. If lost, rotate to generate a new one.
Can I reactivate a revoked credential? No. Revocation is permanent. Create a new credential instead.
What happens when a credential expires? Expired credentials are treated as inactive and can no longer authenticate. Create a new one or remove the expiry before it lapses.