API Reference
This reference documents the REST API endpoints for managing and executing workflows programmatically. All endpoints are available through the Borrower Central API.
Base URLs
| Environment | Base URL |
|---|---|
| Production | https://bc.altscore.ai |
| Sandbox | https://bc.sandbox.altscore.ai |
Authentication
All API requests require a valid JWT Bearer token. This section explains how to obtain and use tokens for API access.
Obtaining a Token
Tokens are obtained from the Frontegg authentication service using your client credentials.
Auth Base URLs:
| Environment | Auth URL |
|---|---|
| Production | https://auth.altscore.ai |
| Sandbox | https://auth.sandbox.altscore.ai |
Response:
Token Refresh
Access tokens expire after the time specified in expiresIn (typically 24 hours). Use the refresh token to obtain a new access token without re-authenticating:
The Python SDK (altscore package) handles token management automatically, including refresh. For most use cases, simply initialize the client and let it manage authentication.
Request Headers
Include the following headers in all API requests:
Example Authenticated Request
Workflow Management Endpoints
These endpoints use the V2 API for managing workflow definitions, including creation, updates, publishing, and archiving.
List Workflows
Retrieve a paginated list of all workflows in your tenant.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per-page | integer | Items per page (default: 20, max: 100) |
status | string | Filter by status: draft, active, archived |
search | string | Search by name or alias |
Response
Get Workflow by ID
Retrieve a specific workflow by its unique identifier.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Workflow unique identifier |
Response
Create Workflow
Create a new workflow definition.
Request Body
Response
Update Workflow
Update an existing workflow. Only draft workflows can be modified directly.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Workflow unique identifier |
Request Body
Delete Workflow
Permanently delete a workflow. Only draft workflows can be deleted.
This action cannot be undone. Active workflows must be archived first before deletion.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Workflow unique identifier |
Response
Publish Draft
Publish a draft workflow to make it active and executable.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Workflow unique identifier |
Response
Create Draft from Active
Create a new draft version from an active workflow for editing.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Active workflow identifier |
Response
Archive Workflow
Archive an active workflow. Archived workflows cannot be executed but are retained for audit purposes.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Workflow unique identifier |
Response
Execution Endpoints
These endpoints use the V1 API for executing workflows and retrieving execution results.
Execute Workflow
Execute a workflow synchronously or asynchronously.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
alias | string | Workflow alias |
version | string | Workflow version (e.g., v1, v2) |
Request Body
The request body must conform to the workflow's input schema.
Synchronous Response
For synchronous workflows, the response includes the complete execution result:
Asynchronous Response
For asynchronous workflows, the response returns immediately with an execution ID:
Get Execution Output
Retrieve the output of a completed execution.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
execution_id | string | Execution unique identifier |
Response
Get Execution Status
Check the current status of an execution.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
execution_id | string | Execution unique identifier |
Response
Execution Status Values
| Status | Description |
|---|---|
pending | Execution queued, not yet started |
running | Execution in progress |
completed | Execution finished successfully |
failed | Execution terminated with errors |
cancelled | Execution was manually cancelled |
timeout | Execution exceeded time limit |
Batch Execution Endpoints
Execute workflows for multiple subjects in a single batch operation.
Execute Batch
Start a batch execution for multiple items.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
alias | string | Workflow alias |
version | string | Workflow version |
Complete Batch Processing Walkthrough
This example demonstrates the full batch processing flow: generating a pre-signed URL, uploading your input file, executing the batch, polling for completion, and retrieving results.
Step 1: Generate Pre-Signed URL for File Upload
Response:
Step 2: Upload Your File
Step 3: Execute the Batch
Step 4: Poll for Completion
Step 5: Retrieve Results
Handling Partial Failures
If some items fail during processing, the batch still completes but reports failures:
Request Body Reference
Response
Get Batch Status
Retrieve the current status and progress of a batch execution.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
batch_id | string | Batch execution identifier |
Response
Batch Status Values
| Status | Description |
|---|---|
pending | Batch created, waiting to be processed |
pre_processing | Validating input data |
pre_processing_complete | Input validated, ready to execute |
pre_processing_failed | Input validation failed |
processing | Executing workflow for each item |
post_processing | Generating output files |
post_processing_failed | Output generation failed |
complete | Batch finished successfully |
paused | Batch execution paused |
cancelled | Batch execution cancelled |
Retry Failed Batch
Retry a failed batch phase or failed items.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
batch_id | string | Batch execution identifier |
Request Body
Retry Modes
| Mode | Description |
|---|---|
pre_processing | Retry input validation phase |
post_processing | Retry output generation phase |
failed_items | Retry only items that failed during processing |
unsuccessful_sources_items | Retry items with data source failures |
failed_and_unsuccessful_sources_items | Retry both failed and unsuccessful source items |
Scheduling Endpoints
Configure recurring workflow executions.
Configure Schedule
Set up a recurring schedule for workflow execution.
Request Body
| Field | Description |
|---|---|
schedule | Configuration for single-item execution schedule |
scheduleBatch | Configuration for batch execution schedule |
cron | Cron expression defining the schedule |
utcDeltaHours | Timezone offset from UTC |
The example configures single executions at 8:00 AM (UTC-5) on weekdays and batch executions at 6:00 AM (UTC-5) on Sundays.
Response
Delete Schedule
Remove a workflow's execution schedule.
Request Body
| Field | Type | Description |
|---|---|---|
schedule | boolean | Delete single-item schedule if true |
scheduleBatch | boolean | Delete batch schedule if true |
Response
Error Handling
All API errors follow a consistent response format.
Error Response Format
Common Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Request body or parameters are invalid |
| 401 | UNAUTHORIZED | Missing or invalid authentication token |
| 403 | FORBIDDEN | Insufficient permissions for the operation |
| 404 | NOT_FOUND | Requested resource does not exist |
| 409 | CONFLICT | Resource state conflict (e.g., publishing already active workflow) |
| 422 | UNPROCESSABLE_ENTITY | Request understood but cannot be processed |
| 429 | RATE_LIMITED | Too many requests, please retry later |
| 500 | INTERNAL_ERROR | Unexpected server error |
| 503 | SERVICE_UNAVAILABLE | Service temporarily unavailable |
Error Sub-Codes
| Sub-Code | Description |
|---|---|
MISSING_REQUIRED_FIELD | Required field not provided |
INVALID_FIELD_TYPE | Field value has incorrect type |
INVALID_WORKFLOW_STATUS | Operation not allowed for current workflow status |
EXECUTION_TIMEOUT | Workflow execution exceeded time limit |
EXTERNAL_SERVICE_ERROR | External service call failed |
INPUT_SCHEMA_MISMATCH | Execution input does not match workflow schema |
CIRCULAR_DEPENDENCY | Workflow contains circular task dependencies |
Handling Errors
Rate Limits
API requests are subject to rate limiting to ensure fair usage.
| Endpoint Category | Rate Limit |
|---|---|
| Workflow Management | 100 requests/minute |
| Single Execution | 50 requests/minute |
| Batch Execution | 10 requests/minute |
| Status Polling | 200 requests/minute |
When rate limited, the API returns a 429 status code with a Retry-After header indicating when to retry.