Skip to main content

API Keys

API keys enable programmatic access to Scriptix services. This guide covers creating, managing, and using API tokens.

Understanding API Keys

What Are API Keys:

  • Authentication tokens for API access
  • Allow applications to use Scriptix programmatically
  • Alternative to user login

API Token Types:

  • Batch: Store data then process it
  • Realtime: Process data as it comes

Accessing API Key Management

Navigation:

  1. Log in to Scriptix
  2. Navigate to API Keys page from menu
  3. API Keys page opens

What You'll See:

  • List of existing API tokens in data grid
  • "Add Token" button (Plus icon) in header
  • Token details grid
  • Delete action for each token (if you have permission)

Permission Required:

  • Page requires DEVELOPER role
  • 403 error redirects to home if no access

Creating API Tokens

Step 1: Click Create Button

  1. Click "Add Token" button (Plus icon)
  2. Create modal opens

Step 2: Configure Token

Token Name (Required):

  • Text input field
  • Descriptive identifier for token
  • Example: "Production Integration", "Testing Environment"
  • Required field validation

Token Type (Required):

Batch:

  • Radio button option
  • Description: "Store the data then process it"
  • Best for: Upload files first, process later

Realtime:

  • Radio button option
  • Description: "Process data as it comes"
  • Info banner shown when selected
  • Best for: Process audio streams live

Expiration Period (Required):

  • Radio group with 3 options
  • 1 Year - Shows "recommended" label
  • 2 Years
  • 5 Years

Step 3: Create Token

  1. Fill in token name
  2. Select type (batch or realtime)
  3. Select expiration period
  4. Click "Create" button
  5. Token created immediately
  6. Creation modal closes
  7. Success token modal opens

Step 4: Copy Token

Token Display Modal:

After creation, modal shows:

  • Success message
  • Token name
  • Token type badge (color-coded)
  • Token value (full token string)
  • Warning message about copying
  • Copy button
  • Close button

Token Value Display:

  • Full token string shown in code block
  • Background: gray/dark gray (theme-aware)
  • Border styling
  • Monospace font

Copy Button:

  • Click to copy token to clipboard
  • Toast: "Token copied to clipboard"
  • Check icon appears when copied
  • Clipboard icon when not copied
  • 3-second timeout for check icon

Important Warning:

  • "This is the only time you will be able to see this token"
  • "Copy and store it securely"
  • Warning icon and red background box
  • Token cannot be retrieved later

Realtime Token Info:

  • Additional info banner for realtime tokens
  • Shows usage information
  • Authorization header example
  • Code example displayed

Storage Recommendations

Critical:

  • Save token immediately
  • Cannot retrieve after modal closes
  • Must create new token if lost

Managing API Tokens

View All Tokens

Token List Data Grid:

ColumnInformation
IDToken ID number
NameToken name you provided
KeyShortened token key (not full value)
TypeBatch or Realtime badge
ExpiresExpiration date

Token Key Column:

  • Shows shortened key (not full token)
  • Code styling (gray background, border)
  • Copy icon next to key
  • Click copy icon to copy full token value
  • Toast notification on copy

Type Badge:

  • Realtime: Blue badge
  • Batch: Green badge
  • Uppercase text

Grid Features:

  • No sorting
  • No filtering
  • No pagination (shows all)
  • Copy icon for token values

Token Details

Information Shown:

  • Token ID
  • Token name
  • Token key (shortened)
  • Token type (badge)
  • Expiration date

Cannot View:

  • Full token value (only available at creation)
  • Cannot retrieve lost tokens

Cannot Edit:

  • Token name after creation
  • Token type
  • Expiration period
  • Token key

Delete Tokens

Who Can Delete:

  • Users with ADMIN role
  • Users with DEVELOPER role
  • Delete action hidden for other roles

Delete Process:

  1. Click Delete action (trash icon)
  2. Confirmation modal appears
  3. Title: "Delete token"
  4. Caption: "Are you sure you want to delete token "[name]"?"
  5. Click "Delete" to confirm
  6. Loading toast: "Deleting token..."
  7. Success toast: "Token deleted successfully"
  8. Modal closes
  9. Token immediately revoked

Confirmation Modal:

  • Size: small
  • Destructive: true (red delete button)
  • Auto-focus on confirm
  • Cancel button available

Effect of Deletion:

  • Token stops working immediately
  • API requests with token fail
  • Cannot be undone
  • Must create new token if needed

Token Creation Details

Create Token API

Endpoint: POST /api/v3/tokens

Payload:

{
"name": "string",
"type": "batch" | "realtime",
"years_valid": 1 | 2 | 5
}

Response:

  • Returns created token object
  • Includes full token value
  • Only time full value is available

Token Properties

ResellerToken Type:

  • id: number
  • key: string (shortened)
  • token_value: string (full token)
  • name: string
  • type: "batch" | "realtime"
  • expires: string (date)

Using API Tokens

API Authentication

Authorization Header:

Authorization: Bearer YOUR_TOKEN_HERE

Example Usage:

  • Include in all API requests
  • Bearer token authentication
  • Full token value required

Realtime Token Information

When creating realtime token, info banner shows:

  • Special information about realtime usage
  • Authorization header format
  • Code example with placeholder

Access Control

Page Access:

  • Requires DEVELOPER role
  • 403 error if unauthorized
  • Redirects to home page

Delete Permission:

  • Requires ADMIN or DEVELOPER role
  • Delete action only shown if authorized
  • Based on user roles array

Role Check:

const roleValues = (user?.result?.roles ?? []).map(role => role.value);
const canDeleteToken =
roleValues.includes('admin') || roleValues.includes('developer');

Token Display

Create Modal

Modal Properties:

  • Size: medium
  • Close on outside click: false
  • Title: "Create API Key"
  • Theme-aware colors

Form Layout:

  • Token name input
  • Token type radio group
  • Years valid radio group
  • Info banner for realtime (conditional)
  • Cancel and Create buttons

Create Button:

  • Disabled while creating
  • Shows loading state
  • Label: "Create"
  • Variant: primary

Success Modal

Modal Properties:

  • Shown after successful creation
  • Contains full token value
  • Cannot close until user copies
  • Theme-aware styling

Content:

  • Success title
  • Token details
  • Copy button
  • Warning box
  • Close button

Error Handling

Creation Errors

Toast Messages:

  • "Token name required" - Empty name
  • "Token created successfully" - Success
  • "An error occurred while creating the token" - Fallback
  • Specific validation errors from API

Error Format:

  • Array of detail errors parsed
  • Or message field
  • Or error_description field
  • Joined with newlines

Delete Errors

Toast Messages:

  • "Deleting token..." - Loading
  • "Token deleted successfully" - Success
  • "An error has occurred" - Fallback
  • Specific errors from API response

Page Features

Title: "API keys"

Caption: "Create and manage API keys for programmatic access"

Actions:

  • Add Token button (Plus icon)
  • Only shown if user has access

Data Grid

Configuration:

  • Enable row selection: false
  • Enable pagination: false
  • Enable sorting: false
  • Enable filtering: false
  • Height: 79vh
  • Dense: false
  • Grid mode: false
  • Striped: true

Loading States

Initial Load:

  • Shows loader while fetching tokens
  • Centers loader on page
  • Height 10, width 3

Creating Token:

  • Button disabled
  • isCreating state
  • Loading feedback

Deleting Token:

  • Loading toast displayed
  • Button disabled during delete

Integrate securely! Create API tokens to build powerful integrations while maintaining security best practices.

Next Steps

Complete your integration: