import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const _export = await client.team.exports.retrieve('exportId');
console.log(_export.id);{
"id": "<string>",
"status": "PENDING",
"format": "CSV",
"logType": "<string>",
"rowCount": 123,
"fileSizeBytes": 123,
"downloadUrl": "<string>",
"errorMessage": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Poll the status of a log export. When status is COMPLETED, the response includes a presigned S3 download URL valid for 24 hours.
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const _export = await client.team.exports.retrieve('exportId');
console.log(_export.id);{
"id": "<string>",
"status": "PENDING",
"format": "CSV",
"logType": "<string>",
"rowCount": 123,
"fileSizeBytes": 123,
"downloadUrl": "<string>",
"errorMessage": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}API key authentication
The export ID returned from POST /api/team/exports
Export details
PENDING, PROCESSING, COMPLETED, FAILED, EXPIRED CSV, JSON Presigned S3 download URL (24h TTL), present when status is COMPLETED