Overview
The Shieldbase External API provides a comprehensive set of endpoints for integrating AI capabilities into your applications. This API supports:- Models Management - List available AI models
- File Upload & Indexing - Upload documents for semantic search
- Library Management - Browse and manage uploaded files
- Semantic Search - Hybrid BM25 + vector search across your content
- Workflow Execution - Queue published workflows for background execution
- Chat Streaming - Real-time AI conversations via SSE
- Headless Agents - Blocking agentic task execution
API endpoints use the
/external/* path. Interactive documentation is available
at /external-docs/docs (Scalar UI).Authentication
All API endpoints (except/external/keys/*) require three headers:
X-Tenant-ID header to select the tenant
whose workflows, library, and data the request should use. The API key owner must
have access to the selected tenant. The examples below include a tenant ID; omit
that header if you do not need to select a tenant.
Getting API Keys
- Login to your Shieldbase account at https://app.sbai.cloud/
- Navigate to Settings → API
- Click “Generate” to create your API credentials
- Save them securely - the API key is only shown once!
Base URLs
Quick Start
1. Set Environment Variables
2. Test Connection
Endpoints
Models
List Available Models
GET /external/models Returns all AI models available in the system with real-time availability status. Example Request:Upload
Upload Files to Library
POST /external/upload Upload files asynchronously. Files are queued for indexing and become searchable once processing completes. Supported file types:pdf, doc, docx, xls, xlsx, csv, json, txt, html, ppt, pptx, zip, md, sql, yml, yaml, png, jpg, jpeg, gif, webp
Max file size: 1 GB per file
Example Request:
Libraries
List Library Files
GET /external/libraries Retrieve paginated list of library files with advanced filtering options. Query Parameters:
Example Request:
Search
Semantic + Keyword Search
POST /external/search Combine keyword matching (BM25) with semantic similarity (vector search) for best results. Payload Fields:
Example Request:
Workflows (Background Execution)
The workflow endpoints let you find published workflows available to the API key owner, inspect their current input steps, queue a run, and check its progress. A queued workflow continues in the background after the trigger request returns.Find a Workflow
GET /external/workflows Returns the latest published version of each workflow group the API key owner can access. Usegroup_id as the workflow path parameter in the active-workflow and
run endpoints. The workflow_id in this response identifies a particular
published version and is not used in those paths.
Query parameters: page (default 1), page_size (default 20, maximum
100), and optional search (matches workflow title or description).
Inspect Workflow Inputs
GET /external/workflows//active Returns the latest published workflow, including its steps and connectors. Use each step’sid or workflow_step_group_id as a key when sending form or file
inputs. This lets integrations keep using the same step key when a workflow is
republished with new version-specific step IDs.
Queue a Workflow Run
POST /external/workflows//runs Queues the latest published version for background execution.inputs is
optional when the workflow does not need external form or file values.
File URLs must be reachable by the workflow runtime. Use signed URLs when the
file source requires access credentials.
run_id, the selected
version-specific workflow_id, and the initial queue status:
Check Run Status
GET /external/workflows/runs/ Poll this endpoint using therun_id returned by the trigger request. The
response’s data.run contains the workflow run and step details; data.queue
contains the latest queue item’s status. Requests must use the same API
credentials and tenant selection as the trigger request.
Chat (Streaming)
Create New Conversation
POST /external/conversations Create a new conversation and receive real-time AI responses via SSE streaming. Payload Fields:additional_metadata Options:
Example Request:
Continue Existing Conversation
POST /external/conversations/ Send a follow-up message to an existing conversation and stream the AI reply. Example Request:Use the
conversation_id from the conversation_created event to continue the thread.Agents (Headless Execution)
Run Agentic Task
POST /external/agents/run Headless agentic execution - perfect for automation, scripts, and webhooks. Payload Fields:
Example Request:
/external/agents/run vs /external/conversations:
Privacy & Data Redaction
Redacting Sensitive Information
To protect sensitive data in prompts and responses, you can enable automatic redaction of:- PII (Personally Identifiable Information): Names, emails, phone numbers, addresses
- Financial Data: Credit card numbers, bank account numbers
- Credentials: API keys, passwords, tokens
- Custom Patterns: Define your own regex patterns for domain-specific data
- Input:
"John Doe, john@example.com, 555-1234" - Processed:
"[REDACTED_NAME], [REDACTED_EMAIL], [REDACTED_PHONE]"
Rate Limits
100 requests per minute per API key
X-RateLimit-Limit: Total requests allowed per minuteX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
Error Handling
All errors follow this format:Testing Script
Save this astest-external-api.sh:
Additional Resources
- Interactive API Docs - Explore the API with Scalar UI (dark mode, modern layout)
- OpenAPI Spec - Download the OpenAPI specification
- Support - Contact our support team
- Status Page - Check API status and uptime
Coming Soon
- Python SDK
- JavaScript/TypeScript SDK
- Go SDK
- Webhook support for async notifications
- GraphQL endpoint
- Batch processing API