Official TypeScript SDK for interacting with the Captain Data API.
CaptainData
class. It simplifies authentication and gives access to the core
api and multiple integrations such as linkedin
, and salesnavigator
.
CaptainData
interfacecore
, linkedin
, salesnavigator
, etc.typescript-fetch
generator and custom templatespackage.json
. (Reference)Property | Description |
---|---|
raw | The native fetch Response object, with full access if needed |
status | HTTP status code (e.g., 200 , 404 ) |
statusText | HTTP status text (e.g., "OK" , "Not Found" ) |
ok | Boolean indicating if status is in the range 200β299 |
headers | The native Response.headers object β use .get() to retrieve header values |
previousPage | The value of the X-Pagination-Previous header, or null if not present |
nextPage | The value of the X-Pagination-Next header, or null if not present |
data | The parsed body of the response (lazily evaluated on first access) |
ok
flag to easily gate logic on successful requests:
ResponseError
, which extends the native Error
object and adds:
response
: the raw Fetch Response objectbody
: the decoded API error body (already parsed from JSON)body
follows the API error definition. For more details, check about errors in the API doc.
Each error response includes:
error_label
: A machine-readable identifier for the error typeerror_scope
: Indicates which part of the request caused the error (e.g., βinputβ, βauthβ, βserverβ)error_ref
: A unique reference code for tracking and debuggingmessage
: A human-readable description of the errorstatus_code
: The HTTP status codeparams
: Additional error parameters (if any)200
: The request was successful (some API calls may return 201 instead)400
: Bad Request - Invalid input or parameters401
: Unauthorized - Invalid or missing API key403
: Forbidden - Insufficient permissions404
: Not Found - Resource doesnβt exist500
: Internal Server Error - Server-side issueAlways check theerror_label
anderror_scope
fields to programmatically handle different types of errors in your application.
If you encounter an unusual error, such as a 500 or 503, feel free to reach out! These are internal errors on our end, and weβre happy to help resolve them.
inputs
: you can now pass an array of input
to batch fetch the resultscallback
:
url
: the url, on your side, where we will stream you the resultsheaders
: an array of { name: string, value: string}
headerβs definitions we will include on each call of your urlasync
call:
input
match the input of the corresponding live actionerror
match the error format (see βError handlingβ)results
is an array of results that match the response format of the corresponding live actionparameters.max_results
param on actions
that need it.
schedule_at
: ISO 8601 datetime. It will define the next execution date (defaults to UTC). If you use a cron
expression the recurrence will start at the first occurence after this datetimecron
: a * * * * *
cron format expression to schedule repeated executions. By default it will be UTC based and start to evaluate immediately (use schedule_at
if you want to delay).timezone
: IANA timezone to evaluate the cron
expression. Note that it is not compatible with schedule_at
that will always use the timezone of the datetime expressionschedule
call:
identity_ids
body param is an array of identity uids that allows you to better control the identities used to execute your call. You can
then dedicate some identities and their integration accounts to specific tasks.
CaptainData.core
) provides methods to manage operationnal entities used by the Captain Data platform.
For example, you can find methods to:
docs/
if needed.