curl --request POST \
  --url https://api-prod.extend.app/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "url": "<string>"
}'
{
  "success": true,
  "file": {
    "object": "file",
    "id": "file_1234",
    "name": "example_file",
    "type": "PDF",
    "contents": {
      "rawText": "This is the raw text content of the file..."
    },
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
}

Creating a new File is a pre requesite for using that file with the evaluation sets API.

This endpoint will pre-process the contents of the file, and store it in the Extend platform for use in evaluation sets. If the file is not one of our supported types, the endpoint will throw an error. A small amount of latency (2-3 seconds) is expected for this endpoint as the file is processed and stored.

Body

name
string
required

The name of the file.

url
string
required

A pre signed URL for the file.

Response

success
boolean

A true or false value for whether the file was processed successfully or not.

file
File

A File object representing the newly created file. See the File object for more details.

{
  "success": true,
  "file": {
    "object": "file",
    "id": "file_1234",
    "name": "example_file",
    "type": "PDF",
    "contents": {
      "rawText": "This is the raw text content of the file..."
    },
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
}