POST
/
api
/
workers
/
{workerId}
/
resources
/
file
JavaScript
import BrainbaseLabs from 'brainbase-labs';

const client = new BrainbaseLabs({
  apiKey: 'My API Key',
});

const resource = await client.workers.resources.file.create('workerId', {
  fileName: 'fileName',
  mimeType: 'mimeType',
  name: 'name',
  s3FilePath: 's3FilePath',
  size: 0,
});

console.log(resource.id);
{
  "id": "<string>",
  "ragType": "FILE",
  "lastUpdated": "2023-11-07T05:31:56Z",
  "updateFrequency": "<string>",
  "rawLink": "<string>",
  "key": "<string>",
  "s3FilePath": "<string>",
  "imageS3FilePath": "<string>",
  "signedS3FilePath": "<string>",
  "numScrolls": 123,
  "fileName": "<string>",
  "mimeType": "<string>",
  "status": "STARTED",
  "processingError": "<string>",
  "graphStatus": {},
  "size": 123,
  "uploadedAt": "2023-11-07T05:31:56Z",
  "folderId": "<string>"
}

Authorizations

x-api-key
string
header
required

API key authentication

Path Parameters

workerId
string
required

Body

application/json
name
string
required
s3FilePath
string
required
fileName
string
required
mimeType
string
required
size
number
required
folderId
string

Response

File resource created

id
string
required
ragType
enum<string>
required
Available options:
FILE,
WEBPAGE,
SITEMAP
lastUpdated
string<date-time> | null
updateFrequency
string | null
key
string | null
s3FilePath
string | null
imageS3FilePath
string | null
signedS3FilePath
string | null
numScrolls
integer | null
fileName
string | null
mimeType
string | null
status
enum<string>
Available options:
STARTED,
PROCESSING,
FAILED,
AVAILABLE,
DELETED
processingError
string | null
graphStatus
object | null
size
integer | null
uploadedAt
string<date-time> | null
folderId
string | null