Lightfield Files API
The Files API from Lightfield — 5 operation(s) for files.
The Files API from Lightfield — 5 operation(s) for files.
openapi: 3.1.1
info:
title: API Reference Accounts Files API
version: 0.0.0
tags:
- name: Files
paths:
/v1/files:
post:
operationId: file.create
summary: Create a file upload session
description: 'Creates a new file upload session and returns an upload URL.
After uploading the file bytes to `uploadUrl`, call `POST /v1/files/{id}/complete` to finalize the upload. Optionally pass `purpose` to validate MIME type and size constraints at creation time. See <u>[File uploads](/using-the-api/file-uploads/)</u> for the full upload flow, supported purposes, and size limits. If you are uploading a meeting transcript, see <u>[Uploading meeting transcripts](/using-the-api/uploading-meeting-transcripts/)</u> for the follow-up meeting attachment flow.
**[Required scope](/using-the-api/scopes/):** `files:create`
**[Rate limit category](/using-the-api/rate-limits/):** Write'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
purpose:
enum:
- meeting_transcript
- knowledge_user
- knowledge_workspace
- email_attachment
description: Optional validation hint. When provided, the server enforces purpose-specific MIME type and file size constraints. Use `meeting_transcript` for files that will be attached to a meeting as its transcript. Use `knowledge_user` or `knowledge_workspace` to add the file to the authenticated user's or workspace's Knowledge, making it available to the AI assistant. Not persisted or returned in responses.
filename:
type: string
minLength: 1
maxLength: 255
description: Original filename.
mimeType:
type: string
description: MIME type of the file. Must be allowed for the given purpose (if specified).
sizeBytes:
type: integer
minimum: 1
maximum: 536870912
description: Expected file size in bytes. Maximum 512 MB.
required:
- filename
- mimeType
- sizeBytes
additionalProperties: false
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileCreateResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
get:
operationId: file.list
summary: List files
description: 'Returns a paginated list of files in your workspace. Use `offset` and `limit` to paginate through results. See <u>[List endpoints](/using-the-api/list-endpoints/)</u> for more information about pagination.
**[Required scope](/using-the-api/scopes/):** `files:read`
**[Rate limit category](/using-the-api/rate-limits/):** Search'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
- name: offset
in: query
schema:
type: integer
minimum: 0
maximum: 9007199254740991
description: Number of records to skip for pagination. Defaults to 0.
allowEmptyValue: true
allowReserved: true
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 9007199254740991
description: Maximum number of records to return. Defaults to 25, maximum 25.
allowEmptyValue: true
allowReserved: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileListResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
/v1/files/{id}/complete:
post:
operationId: file.complete
summary: Complete a file upload
description: 'Finalizes an upload after the file bytes have been uploaded.
If an optional `md5` hex digest is provided, the server validates the checksum before marking the file as completed.
**[Required scope](/using-the-api/scopes/):** `files:create`
**[Rate limit category](/using-the-api/rate-limits/):** Write'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
- name: id
in: path
required: true
schema:
type: string
description: Unique identifier of the file to complete.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
md5:
type: string
pattern: ^[a-f0-9]{32}$
description: Optional MD5 hex digest of the uploaded file for checksum verification.
additionalProperties: false
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileCompleteResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
/v1/files/{id}:
get:
operationId: file.retrieve
summary: Retrieve a file
description: 'Retrieves a single file by its ID.
**[Required scope](/using-the-api/scopes/):** `files:read`
**[Rate limit category](/using-the-api/rate-limits/):** Read'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
- name: id
in: path
required: true
schema:
type: string
description: Unique identifier of the file to retrieve.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileRetrieveResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
/v1/files/{id}/url:
get:
operationId: file.url
summary: Get a file download URL
description: 'Returns a temporary download URL for the file. Only available for files in `COMPLETED` status.
**[Required scope](/using-the-api/scopes/):** `files:read`
**[Rate limit category](/using-the-api/rate-limits/):** Read'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
- name: id
in: path
required: true
schema:
type: string
description: Unique identifier of the file to download.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileUrlResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
/v1/files/{id}/cancel:
post:
operationId: file.cancel
summary: Cancel a file upload
description: 'Cancels a pending upload by transitioning the file to `CANCELLED`. Only files in `PENDING` status can be cancelled. **[Required scope](/using-the-api/scopes/):** `files:create`
**[Rate limit category](/using-the-api/rate-limits/):** Write'
security:
- bearerAuth: []
parameters:
- name: Lightfield-Version
in: header
required: true
description: Required API version header. Requests may error without it.
schema:
type: string
enum:
- '2026-03-01'
default: '2026-03-01'
example: '2026-03-01'
- name: id
in: path
required: true
schema:
type: string
description: Unique identifier of the file to cancel.
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
x-stainless-empty-object: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FileCancelResponse'
'400':
description: '400'
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestError'
'401':
description: '401'
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: '403'
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: '404'
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
'409':
description: '409'
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictError'
'415':
description: '415'
content:
application/json:
schema:
$ref: '#/components/schemas/UnsupportedMediaTypeError'
'422':
description: '422'
content:
application/json:
schema:
$ref: '#/components/schemas/UnprocessableContentError'
'429':
description: '429'
content:
application/json:
schema:
$ref: '#/components/schemas/TooManyRequestsError'
'500':
description: '500'
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerError'
'503':
description: '503'
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceUnavailableError'
'504':
description: '504'
content:
application/json:
schema:
$ref: '#/components/schemas/GatewayTimeoutError'
tags:
- Files
components:
schemas:
FileCompleteResponse:
type: object
properties:
id:
type: string
description: Unique identifier for the file.
status:
enum:
- PENDING
- COMPLETED
- CANCELLED
- EXPIRED
description: Current upload status of the file.
filename:
type: string
description: Original filename.
mimeType:
type: string
description: MIME type of the file.
sizeBytes:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: File size in bytes.
createdAt:
type: string
description: When the file upload session was created.
completedAt:
anyOf:
- type: string
- type: 'null'
description: When the file upload was completed.
expiresAt:
anyOf:
- type: string
- type: 'null'
description: When the upload session expires. Null once completed, cancelled, or expired.
required:
- id
- status
- filename
- mimeType
- sizeBytes
- createdAt
- completedAt
- expiresAt
FileRetrieveResponse:
type: object
properties:
id:
type: string
description: Unique identifier for the file.
status:
enum:
- PENDING
- COMPLETED
- CANCELLED
- EXPIRED
description: Current upload status of the file.
filename:
type: string
description: Original filename.
mimeType:
type: string
description: MIME type of the file.
sizeBytes:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: File size in bytes.
createdAt:
type: string
description: When the file upload session was created.
completedAt:
anyOf:
- type: string
- type: 'null'
description: When the file upload was completed.
expiresAt:
anyOf:
- type: string
- type: 'null'
description: When the upload session expires. Null once completed, cancelled, or expired.
required:
- id
- status
- filename
- mimeType
- sizeBytes
- createdAt
- completedAt
- expiresAt
InternalServerError:
type: object
properties:
type:
const: internal_server_error
message:
type: string
default: Internal Server Error
required:
- type
- message
GatewayTimeoutError:
type: object
properties:
type:
const: gateway_timeout
message:
type: string
default: Gateway Timeout
required:
- type
- message
TooManyRequestsError:
type: object
properties:
type:
const: too_many_requests
message:
type: string
default: Too Many Requests
required:
- type
- message
UnsupportedMediaTypeError:
type: object
properties:
type:
const: unsupported_media_type
message:
type: string
default: Unsupported Media Type
required:
- type
- message
ForbiddenError:
type: object
properties:
type:
const: forbidden
message:
type: string
default: Forbidden
required:
- type
- message
UnauthorizedError:
type: object
properties:
type:
const: unauthorized
message:
type: string
default: Unauthorized
required:
- type
- message
ConflictError:
type: object
properties:
type:
const: conflict
message:
type: string
default: Conflict
required:
- type
- message
FileUrlResponse:
type: object
properties:
url:
type: string
description: Temporary download URL for the file.
expiresAt:
type: string
description: When the download URL expires.
required:
- url
- expiresAt
BadRequestError:
type: object
properties:
type:
const: bad_request
message:
type: string
default: Bad Request
code:
type: string
param:
type: string
required:
- type
- message
- code
ServiceUnavailableError:
type: object
properties:
type:
const: service_unavailable
message:
type: string
default: Service Unavailable
required:
- type
- message
NotFoundError:
type: object
properties:
type:
const: not_found
message:
type: string
default: Not Found
required:
- type
- message
FileCancelResponse:
type: object
properties:
id:
type: string
description: Unique identifier for the file.
status:
enum:
- PENDING
- COMPLETED
- CANCELLED
- EXPIRED
description: Current upload status of the file.
filename:
type: string
description: Original filename.
mimeType:
type: string
description: MIME type of the file.
sizeBytes:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: File size in bytes.
createdAt:
type: string
description: When the file upload session was created.
completedAt:
anyOf:
- type: string
- type: 'null'
description: When the file upload was completed.
expiresAt:
anyOf:
- type: string
- type: 'null'
description: When the upload session expires. Null once completed, cancelled, or expired.
required:
- id
- status
- filename
- mimeType
- sizeBytes
- createdAt
- completedAt
- expiresAt
FileCreateResponse:
type: object
properties:
id:
type: string
description: Unique identifier for the file.
status:
enum:
- PENDING
- COMPLETED
- CANCELLED
- EXPIRED
description: Current upload status of the file.
filename:
type: string
description: Original filename.
mimeType:
type: string
description: MIME type of the file.
sizeBytes:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: File size in bytes.
createdAt:
type: string
description: When the file upload session was created.
completedAt:
anyOf:
- type: string
- type: 'null'
description: When the file upload was completed.
expiresAt:
anyOf:
- type: string
- type: 'null'
description: When the upload session expires. Null once completed, cancelled, or expired.
uploadUrl:
type: string
description: Upload URL. Upload the file bytes directly to this URL.
uploadHeaders:
type: object
propertyNames:
type: string
additionalProperties:
type: string
description: Headers to include in the upload request.
required:
- id
- status
- filename
- mimeType
- sizeBytes
- createdAt
- completedAt
- expiresAt
- uploadUrl
- uploadHeaders
UnprocessableContentError:
type: object
properties:
type:
const: unprocessable_content
message:
type: string
default: Unprocessable Content
required:
- type
- message
FileListResponse:
type: object
properties:
object:
type: string
description: The object type, always `"list"`.
data:
type: array
items:
type: object
properties:
id:
type: string
description: Unique identifier for the file.
status:
enum:
- PENDING
- COMPLETED
- CANCELLED
- EXPIRED
description: Current upload status of the file.
filename:
type: string
description: Original filename.
mimeType:
type: string
description: MIME type of the file.
sizeBytes:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: File size in bytes.
createdAt:
type: string
description: When the file upload session was created.
completedAt:
anyOf:
- type: string
- type: 'null'
description: When the file upload was completed.
expiresAt:
anyOf:
- type: string
- type: 'null'
description: When the upload session expires. Null once completed, cancelled, or expired.
required:
- id
- status
- filename
- mimeType
- sizeBytes
- createdAt
- completedAt
- expiresAt
description: Array of file objects for the current page.
totalCount:
type: integer
minimum: 0
maximum: 9007199254740991
description: Total number of matching files.
required:
- object
- data
- totalCount
securitySchemes:
bearerAuth:
type: http
scheme: bearer