REST Integration APIs
RESTful APIs for building custom integrations, automating workflows, and extending the ThreadSync platform with your own business logic.
Authentication
All API requests require authentication using OAuth 2.0 bearer tokens. Tokens are obtained by exchanging your client credentials for an access token.
Obtaining an Access Token
Using the Token
Include the access token in the Authorization header of all API requests:
🔐 Token Lifetime
Access tokens expire after 1 hour. Use the refresh token flow for long-running processes, or request a new token before expiration.
Base URL
All API endpoints use the following base URL:
The API uses HTTPS exclusively. HTTP requests will be rejected. All responses are JSON-encoded with Content-Type: application/json.
Rate Limits
API requests are rate-limited to ensure fair usage and platform stability:
| Plan | Requests/Minute | Requests/Day | Burst |
|---|---|---|---|
| Developer | 60 | 10,000 | 100 |
| Professional | 300 | 100,000 | 500 |
| Enterprise | 1,000 | Unlimited | 2,000 |
Rate limit headers are included in all responses:
Connections API
Manage connections to external systems. Connections store credentials and configuration for each integrated system.
List all connections in your organization.
Create a new connection to an external system.
Request Body
| Parameter | Type | Description |
|---|---|---|
provider required | string | The system to connect (e.g., "salesforce", "sap", "workday") |
name required | string | A friendly name for this connection |
config | object | Provider-specific configuration options |
credentials required | object | Authentication credentials for the provider |
Example: Create Salesforce Connection
Retrieve a specific connection by ID.
Update connection configuration or credentials.
Delete a connection. Active syncs using this connection will be stopped.
Syncs API
Configure and manage data synchronization between connected systems.
Create a new sync configuration.
Request Body
| Parameter | Type | Description |
|---|---|---|
name required | string | Friendly name for this sync |
source required | object | Source connection and object configuration |
destination required | object | Destination connection and object configuration |
schedule | string | "realtime", "hourly", "daily", or cron expression |
field_mappings | array | Custom field mapping rules |
filters | array | Filter conditions for source records |
Example: Real-time Contact Sync
Trigger an immediate sync run.
List sync run history with status and statistics.
Data Operations API
Perform direct data operations for custom integration logic.
Execute a read query against a connected system.
Write records to a connected system.
Example: Query Salesforce Accounts
Workflows API
Build automated workflows that orchestrate multiple actions across systems.
Create a new workflow with triggers and actions.
Example: Lead Routing Workflow
Webhooks
Receive real-time notifications when events occur in your integrations.
Register a webhook endpoint for event notifications.
Webhook Events
| Event | Description |
|---|---|
sync.completed | A sync run completed successfully |
sync.failed | A sync run encountered an error |
connection.health_changed | Connection health status changed |
workflow.triggered | A workflow was triggered |
record.created | A new record was synced |
record.updated | A record was updated |
Webhook Security
All webhook payloads include an HMAC signature in the X-ThreadSync-Signature header. Verify this signature using your webhook secret:
Triggers API
Configure event-based triggers for automation.
Create a new trigger configuration.
Trigger Types
| Type | Description |
|---|---|
record_created | Fires when a new record is created |
record_updated | Fires when a record is modified |
record_deleted | Fires when a record is deleted |
field_changed | Fires when a specific field value changes |
schedule | Fires on a time-based schedule |
api_call | Fires when called via API |
Custom Transforms
Apply custom transformation logic to data as it flows between systems.
Create a custom transform function.
Transform Functions
Transforms are defined using JavaScript or JSONata expressions:
Extensions API
Extend the platform with custom connectors and logic.
Register a custom extension.
🔧 Extension SDK
Use our Extension SDK to build custom connectors for systems we don't yet support. See the SDK documentation for details.
Error Handling
The API uses standard HTTP status codes and returns detailed error information in a consistent format.
Error Response Format
Common Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Request body or parameters are invalid |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
| 403 | FORBIDDEN | Insufficient permissions for this action |
| 404 | NOT_FOUND | Resource does not exist |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error (contact support) |
