Connect a data source
POST
/v1/sources
const url = 'https://api.pensievelabs.co/v1/sources';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"CI runs","kind":"webhook","models":["grade-audit"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pensievelabs.co/v1/sources \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "CI runs", "kind": "webhook", "models": [ "grade-audit" ] }'Pensieve’s reader runs where your data is; credentials are set in the app, never sent here.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
Any unique string. Sending it again within 24 hours returns the first response.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
kind
required
string
via
string
models
Array<string>
Example
{ "name": "CI runs", "kind": "webhook", "models": [ "grade-audit" ]}Responses
Section titled “Responses”The source, connecting.
Media typeapplication/json
object
id
required
string
object
required
name
required
string
kind
required
string
via
required
string
state
required
string
volume
required
string | null
held_out
required
What is kept out of every training set, such as the last 60 days, or the cases set aside as your test.
string | null
models
required
Array<string>
last_read_at
required
string | null format: date-time
created_at
required
string format: date-time
Example
{ "id": "src_agent_trials", "object": "source", "kind": "stream", "via": "Kafka", "state": "connecting", "volume": "240k a day", "held_out": "Last 60 days held out"}default
Section titled “default”Something went wrong; error.type says what.
Media typeapplication/json
object
error
required
object
type
required
string
message
required
string
param
The request field the error is about.
string | null
request_id
required
string
Example
{ "error": { "type": "invalid_request" }}