Skip to main content
POST
Criar envio de arquivo

Autorizações

Authorization
string
header
obrigatório

OAuth2 Authorization Code flow

Corpo

application/json
filename
string
obrigatório

Original filename with extension (max 900 bytes)

Exemplo:

"Annual Report 2024.pdf"

content_type
string
obrigatório

MIME content type

Exemplo:

"application/pdf"

purpose
enum<string>
obrigatório

Purpose of the upload

Opções disponíveis:
agent,
knowledge,
skill,
metadata,
dataset,
company,
page,
session,
page_run_output,
export,
whatsapp,
fiscal_document
Exemplo:

"company"

size_bytes
number

File size in bytes (optional, for validation)

Exemplo:

1048576

entity_type
string

Entity type to link this file to (e.g. "company", "person", "lawsuit")

Exemplo:

"company"

entity_id
string

Entity ID to link this file to

Exemplo:

"cmp_abc123"

content_hash
string

SHA-256 hex hash of the file content for deduplication

Exemplo:

"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

source_url
string

Source URL (for files downloaded from external sources). Used for deduplication - prevents downloading the same file multiple times

Exemplo:

"https://example.com/certificate.pdf"

page_id
string

Page ID to associate this file with (optional)

Exemplo:

"page_abc123"

public
boolean

Whether this file can be fetched without authentication through its public URL

Exemplo:

false

agent_id
string

Agent ID for agent uploads (required when purpose=agent)

Exemplo:

"agt_abc123"

agent_version
string

Agent version name for agent uploads (required when purpose=agent)

Exemplo:

"2026-02-08-10-00-00"

Resposta

201 - application/json
object
string
obrigatório

Object type

Exemplo:

"page"

id
string
obrigatório

Unique identifier

Exemplo:

"p_abc123"

createdAt
string<date-time>
obrigatório

Creation timestamp

Exemplo:

"2024-01-15T10:30:00.000Z"

updatedAt
string<date-time>
obrigatório

Last update timestamp

Exemplo:

"2024-01-15T14:45:00.000Z"

status
enum<string>
obrigatório

Upload status

  • pending: Waiting for client upload
  • uploaded: Successfully uploaded
  • failed: Upload failed or expired
Opções disponíveis:
pending,
uploaded,
failed
Exemplo:

"uploaded"

filename
string
obrigatório

Original filename

Exemplo:

"report.pdf"

content_type
string
obrigatório

MIME content type

Exemplo:

"application/pdf"

size_bytes
number | null
obrigatório

File size in bytes (null if not yet uploaded)

Exemplo:

1048576

metadata
object | null
obrigatório

File metadata. PDF page count is stored at metadata.page_count when available.

Exemplo:
uploaded_time
string<date-time> | null
obrigatório

When the file was successfully uploaded (null if pending)

Exemplo:

"2024-11-14T10:31:23.456Z"

expires_at
string
obrigatório

When the upload URL expires (ISO 8601 string for API response)

Exemplo:

"2024-11-14T11:30:00.000Z"

public
boolean
obrigatório

Whether this file can be fetched without authentication through public_url.

Exemplo:

false

classification
object
obrigatório

Document classification stage - determines document type and next stages

parse
object
obrigatório

Parse stage - converts OCR output to markdown

index
object
obrigatório

Index stage - vector embedding for semantic search

insights
object
obrigatório

Insights stage - skill-based analysis generating claims/issues/checks

createdBy
Created by · object

Principal who created this object

Exemplo:
updatedBy
Updated by · object

Principal who last updated this object

Exemplo:
reused
boolean

Whether this response reuses an existing file (content-based dedup)

Exemplo:

false

upload_url
string

Presigned S3 upload URL (only present when status is 'pending' and reused is false) Client should PUT file contents to this URL Expires after 1 hour

Exemplo:

"https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."

upload_headers
object

Extra headers required for uploading to the presigned URL (only present when status is pending).

url
string

Authenticated files URL (CloudFront signed cookies) Only present when the file has an S3 key

Exemplo:

"https://files.base39.cloud/uploads/org_abc/fl_abc123/report.pdf"

preview_url
string

Authenticated preview URL for the first generated thumbnail page. Only present when a preview image exists.

Exemplo:

"https://files.base39.cloud/uploads/org_abc/fl_abc123/preview/page-01.png"

download_url
string

Presigned S3 download URL. Only returned when explicitly requested via ?fields=downloadUrl and status is 'uploaded'. Expires after 1 hour.

Exemplo:

"https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."

page_id
string

Page ID associated with this file upload (optional)

Exemplo:

"page_abc123"

purpose
enum<string> | null

Upload purpose

Opções disponíveis:
agent,
knowledge,
skill,
metadata,
dataset,
company,
page,
session,
page_run_output,
export,
whatsapp,
fiscal_document
public_url
string

Direct files URL. Only present when public is true.

Exemplo:

"https://files.base39.com.br/uploads/org_abc/fl_abc123/report.pdf"

resources
object[] | null

Provider-specific file resources attached to this upload.