Files
sim/apps/docs/openapi-v2-files-audit.json
T
Waleed 6fdb1459c4 fix(v2-api): standardization (#6542)
* fix(v2-api): stop leaking resolved secrets in logs and serving doc source

Two regressions shipped with the v2 API (#5273) where v2 diverged from the
v1 path it replaced, plus the hardening that fell out of auditing them.

**v2 logs bypassed secret redaction.** `getPublicLog` and `listPublicLogs`
called raw `materializeExecutionData`, while every other reader — v1 list and
detail, CSV export, `fetch-log-detail`, both data-drain sources — calls
`materializeExecutionDataForDisplay`, which applies the resolved-secret
provenance projection. Both v2 routes then serialize `traceSpans` and
`finalOutput` straight onto the wire, so unredacted secrets could reach the
public API. Swapped to the display projection and threaded the principal's
subject user into the read context.

**v2 file download served generation source.** `GET /api/v2/files/{fileId}`
streamed `file.key` raw. AI-generated docs store their generation source as
the primary file, so a raw download yields source text under a `.pdf` name —
a file the recipient cannot open. Generated docs now resolve to their compiled
artifact; ordinary uploads still stream and are never materialized, gated on
the recorded generation-source type rather than the extension. The resolve is
capped at MAX_RENDERED_DOCUMENT_BYTES, and a still-compiling artifact returns
a retryable 409 rather than a 500.

Also in this change:

- Reconcile the two v2 verbs that used PUT for PATCH semantics:
  `PUT /v2/knowledge/{id}` and `PUT /v2/tables/{tableId}/rows` are both
  all-optional partial updates. Breaking for API-key clients, but the surface
  is dark-launched behind the `v2-api` gate and no in-repo caller issues PUT.
- Close the OpenAPI coverage blind spot that hid two routes: contract
  discovery was a non-recursive read of the flat `contracts/v2/` directory,
  so a contract in a subdirectory — or beside its non-v2 siblings, which is
  where the uploads contracts live — escaped the gate. The sweep is now
  recursive over the whole contracts tree, and the two upload data-plane
  routes are named in an explicit allowlist with reasons and staleness guards.
- Extract `needsRenderedArtifact` so the "recorded type is authoritative,
  extension is fallback" rule has one home instead of being duplicated.
- Extract `DocCompileUserError` into a leaf module so recognizing it no longer
  drags `app/api/**` and `next/server` into application modules.
- Correct the stale pagination docstring in `contracts/v2/shared.ts` and pin
  the paged/full-set split in a test so it cannot drift again.

* fix(v2-api): absolute imports for the extracted doc-compile error

Review follow-up.

- Use the `@/lib/...` alias for `doc-compile-error` in the three modules that
  imported it relatively. The repo requires absolute imports, and having all
  four consumers share one specifier also removes any chance of two module
  instances resolving apart and breaking `instanceof`.
- Memoize the v2 list-pagination sweep. It re-imported the whole contracts
  tree once per test and timed out against the default 10s limit under load;
  it now sweeps once and declares an explicit timeout. Its failure message
  also still pointed at an enumeration in `v2/shared.ts` that this branch
  replaced with a pointer to the test itself.

* fix(v2-api): correct three inaccurate claims found in verification

None of these change behavior; each is a comment or test-config assertion that
was not true as written.

- The artifact resolver's TSDoc implied the byte cap prevents an oversized
  artifact being materialized. It does not: the artifact-store fetch is not
  streaming-bounded, so the bytes are resident before the ceiling rejects
  them. Say what it actually guarantees.
- `v2/shared.ts` pointed at per-contract documentation for the two lists that
  still filter in memory. Neither contract documents it, so name the two lists
  and what they do inline instead of pointing at a page that does not exist.
- The knowledge update contract said "every field of the body is optional";
  `workspaceId` is required. Narrow the claim to mutable fields.
- Scope the pagination sweep's extended timeout to the one test that pays for
  it, so a genuine hang in the other two surfaces in 10s rather than 60s.
2026-08-11 10:24:55 -07:00

3553 lines
111 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"openapi": "3.1.0",
"info": {
"title": "Sim API v2 — Files & Audit Logs",
"description": "Version 2 of the Sim REST API for workspace files and organization audit logs. Every endpoint uses the canonical v2 data, cursor-list, and error envelopes. Lists use opaque cursors, and rate-limit state is returned in response headers.",
"version": "2.0.0",
"contact": {
"name": "Sim Support",
"email": "help@sim.ai",
"url": "https://www.sim.ai"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"servers": [
{
"url": "https://www.sim.ai",
"description": "Production"
}
],
"tags": [
{
"name": "Files",
"description": "Create, upload, download, organize, share, and delete workspace files."
},
{
"name": "Audit Logs",
"description": "Query the organization audit trail with Enterprise authorization."
}
],
"security": [
{
"apiKey": []
}
],
"paths": {
"/api/v2/files": {
"get": {
"operationId": "listFiles",
"summary": "List Files",
"description": "List workspace files with search, sorting, folder filtering, and opaque cursor pagination.",
"tags": ["Files"],
"parameters": [
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace whose files should be listed.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace whose files should be listed."
}
},
{
"name": "folderPath",
"in": "query",
"required": false,
"description": "Restrict results to files directly inside this folder.",
"schema": {
"description": "Restrict results to files directly inside this folder.",
"type": "string"
}
},
{
"name": "search",
"in": "query",
"required": false,
"description": "Case-insensitive substring match against the file name.",
"schema": {
"description": "Case-insensitive substring match against the file name.",
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
{
"name": "sortBy",
"in": "query",
"required": false,
"description": "Field used to sort the result.",
"schema": {
"default": "uploadedAt",
"description": "Field used to sort the result.",
"type": "string",
"enum": ["name", "size", "uploadedAt", "updatedAt"]
}
},
{
"name": "sortOrder",
"in": "query",
"required": false,
"description": "Sort direction.",
"schema": {
"default": "asc",
"description": "Sort direction.",
"type": "string",
"enum": ["asc", "desc"]
}
},
{
"name": "limit",
"in": "query",
"required": false,
"description": "Maximum files per page, clamped to 1–1000.",
"schema": {
"description": "Maximum files per page, clamped to 1–1000.",
"default": 100,
"type": "number"
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"description": "Opaque cursor returned by the previous page.",
"schema": {
"description": "Opaque cursor returned by the previous page.",
"type": "string",
"minLength": 1
}
}
],
"responses": {
"200": {
"description": "A page of workspace files.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2FileListResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"post": {
"operationId": "createFile",
"summary": "Create File",
"description": "Create a workspace file from inline UTF-8 or base64 content. Use an upload session for streamed or larger files.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "Inline content and placement for a new workspace file.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileRequest"
}
}
}
},
"responses": {
"201": {
"description": "The created file.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2FileResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/uploads": {
"post": {
"operationId": "createFileUpload",
"summary": "Create File Upload",
"description": "Create a resumable upload session and receive either a signed PUT URL or multipart instructions.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "File metadata required to create an upload session.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileUploadRequest"
}
}
}
},
"responses": {
"201": {
"description": "The created upload session and transfer instructions.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileUploadResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/uploads/{uploadId}": {
"delete": {
"operationId": "abortFileUpload",
"summary": "Abort File Upload",
"description": "Abort an active upload session and release provider-side multipart state.",
"tags": ["Files"],
"parameters": [
{
"name": "uploadId",
"in": "path",
"required": true,
"description": "Upload session identifier.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Upload session identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the upload session.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the upload session."
}
},
{
"name": "upload-token",
"in": "header",
"required": true,
"description": "Signed upload control token returned when the upload session was created.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Signed upload control token returned when the upload session was created."
}
}
],
"responses": {
"200": {
"description": "The aborted upload session.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileUploadResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/uploads/{uploadId}/parts": {
"post": {
"operationId": "createFileUploadPartUrls",
"summary": "Create File Upload Part URLs",
"description": "Create signed URLs for a bounded set of multipart upload part numbers.",
"tags": ["Files"],
"parameters": [
{
"name": "uploadId",
"in": "path",
"required": true,
"description": "Upload session identifier.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Upload session identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the upload session.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the upload session."
}
},
{
"name": "upload-token",
"in": "header",
"required": true,
"description": "Signed upload control token returned when the upload session was created.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Signed upload control token returned when the upload session was created."
}
}
],
"requestBody": {
"required": true,
"description": "Multipart part numbers requiring signed URLs.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileUploadPartUrlsRequest"
}
}
}
},
"responses": {
"200": {
"description": "Signed URLs for the requested upload parts.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileUploadPartUrlsResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/uploads/{uploadId}/complete": {
"post": {
"operationId": "completeFileUpload",
"summary": "Complete File Upload",
"description": "Finalize uploaded bytes, verify provider state, and begin atomic workspace-file registration.",
"tags": ["Files"],
"parameters": [
{
"name": "uploadId",
"in": "path",
"required": true,
"description": "Upload session identifier.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Upload session identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the upload session.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the upload session."
}
},
{
"name": "upload-token",
"in": "header",
"required": true,
"description": "Signed upload control token returned when the upload session was created.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Signed upload control token returned when the upload session was created."
}
}
],
"responses": {
"200": {
"description": "The completed or finalizing upload session.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileUploadResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/{fileId}": {
"get": {
"operationId": "downloadFile",
"summary": "Download File",
"description": "Download the current file bytes from a workspace. A generated document is served as its compiled artifact, so it returns `409` while that artifact is still compiling and `413` if it renders past the size ceiling.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the file.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
}
}
],
"responses": {
"200": {
"description": "The file bytes.",
"headers": {
"Content-Type": {
"$ref": "#/components/headers/Content-Type"
},
"Content-Disposition": {
"$ref": "#/components/headers/Content-Disposition"
},
"Content-Length": {
"$ref": "#/components/headers/Content-Length"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"delete": {
"operationId": "deleteFile",
"summary": "Delete File",
"description": "Delete a workspace file and its stored bytes.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the file.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
}
}
],
"responses": {
"200": {
"description": "Deletion confirmation.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2DeleteFileResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"patch": {
"operationId": "renameFile",
"summary": "Rename File",
"description": "Rename a workspace file without changing its containing folder.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
}
],
"requestBody": {
"required": true,
"description": "Workspace scope and new file name.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RenameFileRequest"
}
}
}
},
"responses": {
"200": {
"description": "The renamed file.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2FileResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/{fileId}/metadata": {
"get": {
"operationId": "getFile",
"summary": "Get File Metadata",
"description": "Return file metadata together with the nullable current public-share state.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the file.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
}
}
],
"responses": {
"200": {
"description": "File metadata and public-share state.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2FileMetadataResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/audit-logs": {
"get": {
"operationId": "listAuditLogs",
"summary": "List Audit Logs",
"description": "List an organization audit trail with filters and opaque cursor pagination. Requires an Enterprise subscription and organization admin or owner access.",
"tags": ["Audit Logs"],
"parameters": [
{
"name": "action",
"in": "query",
"required": false,
"description": "Filter by exact action name.",
"schema": {
"description": "Filter by exact action name.",
"type": "string"
}
},
{
"name": "resourceType",
"in": "query",
"required": false,
"description": "Filter by exact resource type.",
"schema": {
"description": "Filter by exact resource type.",
"type": "string"
}
},
{
"name": "resourceId",
"in": "query",
"required": false,
"description": "Filter by exact resource identifier.",
"schema": {
"description": "Filter by exact resource identifier.",
"type": "string"
}
},
{
"name": "workspaceId",
"in": "query",
"required": false,
"description": "Filter to actions in one workspace.",
"schema": {
"description": "Filter to actions in one workspace.",
"type": "string"
}
},
{
"name": "startDate",
"in": "query",
"required": false,
"description": "Inclusive ISO 8601 start timestamp.",
"schema": {
"description": "Inclusive ISO 8601 start timestamp.",
"type": "string"
}
},
{
"name": "endDate",
"in": "query",
"required": false,
"description": "Inclusive ISO 8601 end timestamp.",
"schema": {
"description": "Inclusive ISO 8601 end timestamp.",
"type": "string"
}
},
{
"name": "includeDeparted",
"in": "query",
"required": false,
"description": "Include actions by users who have left the organization.",
"schema": {
"description": "Include actions by users who have left the organization.",
"default": "false",
"type": "string",
"enum": ["true", "false"]
}
},
{
"name": "limit",
"in": "query",
"required": false,
"description": "Maximum entries per page, from 1 to 100.",
"schema": {
"default": 50,
"description": "Maximum entries per page, from 1 to 100.",
"type": "number",
"minimum": 1,
"maximum": 100
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"description": "Opaque cursor returned by the previous page.",
"schema": {
"description": "Opaque cursor returned by the previous page.",
"type": "string"
}
},
{
"name": "organizationId",
"in": "query",
"required": true,
"description": "Organization whose audit trail should be queried.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Organization whose audit trail should be queried."
}
},
{
"name": "actorEmail",
"in": "query",
"required": false,
"description": "Filter by actor email address.",
"schema": {
"description": "Filter by actor email address.",
"type": "string",
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
}
}
],
"responses": {
"200": {
"description": "A page of audit-log entries.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2AuditLogListResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/audit-logs/{id}": {
"get": {
"operationId": "getAuditLog",
"summary": "Get Audit Log",
"description": "Return one organization audit-log entry. Requires an Enterprise subscription and organization admin or owner access.",
"tags": ["Audit Logs"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Audit-log entry identifier.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Audit-log entry identifier."
}
},
{
"name": "organizationId",
"in": "query",
"required": true,
"description": "Organization whose audit-log entry should be returned.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Organization whose audit-log entry should be returned."
}
}
],
"responses": {
"200": {
"description": "The requested audit-log entry.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2AuditLogResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/move": {
"post": {
"operationId": "moveFileItems",
"summary": "Move Files",
"description": "Move up to 1,000 files to a canonical folder path or the workspace root.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "Files and destination selected for a bulk move.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MoveFileItemsRequest"
}
}
}
},
"responses": {
"200": {
"description": "Count of moved files.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2MoveFileItemsResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/{fileId}/share": {
"get": {
"operationId": "getFileShare",
"summary": "Get File Share",
"description": "Return the current public-share configuration for a file.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
},
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace that owns the file.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
}
}
],
"responses": {
"200": {
"description": "Current nullable file-share state.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2GetFileShareResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"put": {
"operationId": "upsertFileShare",
"summary": "Enable or Disable File Share",
"description": "Create or update a server-tokenized public share. Disabling retains its token and configuration for later re-enablement.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
}
],
"requestBody": {
"required": true,
"description": "Desired public-share state and access policy.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertFileShareRequest"
}
}
}
},
"responses": {
"200": {
"description": "The updated file share.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2UpsertFileShareResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/{fileId}/content": {
"put": {
"operationId": "updateFileContent",
"summary": "Replace File Content",
"description": "Replace the complete contents of an existing file from UTF-8 or base64 input.",
"tags": ["Files"],
"parameters": [
{
"name": "fileId",
"in": "path",
"required": true,
"description": "File identifier.",
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "File identifier."
}
}
],
"requestBody": {
"required": true,
"description": "Workspace scope and complete replacement content.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateFileContentRequest"
}
}
}
},
"responses": {
"200": {
"description": "The updated file.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2FileResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/bulk-delete": {
"post": {
"operationId": "bulkDeleteFiles",
"summary": "Delete Files",
"description": "Delete up to 1,000 workspace files in one operation.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "Workspace and files selected for deletion.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkDeleteFilesRequest"
}
}
}
},
"responses": {
"200": {
"description": "Count of deleted files.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkDeleteFilesResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
},
"/api/v2/files/folders": {
"get": {
"operationId": "listFilesFolders",
"summary": "List Folders",
"description": "List workspace file folders with optional parent-path filtering and sorting.",
"tags": ["Files"],
"parameters": [
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace whose folders should be listed.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace whose folders should be listed."
}
},
{
"name": "parentPath",
"in": "query",
"required": false,
"description": "Restrict results to direct children of this parent path.",
"schema": {
"description": "Restrict results to direct children of this parent path.",
"type": "string"
}
},
{
"name": "search",
"in": "query",
"required": false,
"description": "Case-insensitive substring match against the folder name.",
"schema": {
"description": "Case-insensitive substring match against the folder name.",
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
{
"name": "sortBy",
"in": "query",
"required": false,
"description": "Field used to sort the result.",
"schema": {
"default": "name",
"description": "Field used to sort the result.",
"type": "string",
"enum": ["name", "createdAt", "updatedAt"]
}
},
{
"name": "sortOrder",
"in": "query",
"required": false,
"description": "Sort direction.",
"schema": {
"default": "asc",
"description": "Sort direction.",
"type": "string",
"enum": ["asc", "desc"]
}
}
],
"responses": {
"200": {
"description": "Workspace file folders.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileFolderListResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"post": {
"operationId": "createFilesFolder",
"summary": "Create Folder",
"description": "Create a canonical folder path in a workspace.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "Workspace and canonical path for a new folder.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateFileFolderRequest"
}
}
}
},
"responses": {
"200": {
"description": "The created folder.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileFolderResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"patch": {
"operationId": "relocateFilesFolder",
"summary": "Rename or Move Folder",
"description": "Rename or move a folder and atomically rewrite descendant canonical paths.",
"tags": ["Files"],
"requestBody": {
"required": true,
"description": "Current and destination canonical paths for a folder.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RelocateFileFolderRequest"
}
}
}
},
"responses": {
"200": {
"description": "The relocated folder.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileFolderResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
},
"delete": {
"operationId": "deleteFilesFolder",
"summary": "Delete Folder",
"description": "Delete a folder, optionally including every nested file and folder.",
"tags": ["Files"],
"parameters": [
{
"name": "workspaceId",
"in": "query",
"required": true,
"description": "Workspace containing the folder.",
"schema": {
"type": "string",
"minLength": 1,
"description": "Workspace containing the folder."
}
},
{
"name": "path",
"in": "query",
"required": true,
"description": "Path of the folder to delete.",
"schema": {
"description": "Path of the folder to delete.",
"type": "string"
}
},
{
"name": "recursive",
"in": "query",
"required": false,
"description": "Delete nested files and folders when true.",
"schema": {
"description": "Delete nested files and folders when true.",
"default": "false",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Folder deletion confirmation and deleted item counts.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteFileFolderResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
}
}
}
},
"components": {
"securitySchemes": {
"apiKey": {
"type": "apiKey",
"in": "header",
"name": "X-API-Key",
"description": "Your Sim API key (personal or workspace). Generate one from the Sim dashboard under Settings > API Keys."
}
},
"headers": {
"Content-Type": {
"description": "MIME type of the file, defaulting to application/octet-stream when the stored type is unavailable.",
"schema": {
"type": "string",
"title": "Content type",
"description": "MIME type of the file, defaulting to application/octet-stream when the stored type is unavailable."
}
},
"Content-Disposition": {
"description": "Attachment disposition containing sanitized and RFC 5987 encoded filenames.",
"schema": {
"type": "string",
"title": "Content disposition",
"description": "Attachment disposition containing sanitized and RFC 5987 encoded filenames."
}
},
"Content-Length": {
"description": "File size in bytes.",
"schema": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Content length",
"description": "File size in bytes."
}
},
"X-RateLimit-Limit": {
"description": "Maximum requests allowed in the current window.",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"title": "Rate limit",
"description": "Maximum requests allowed in the current window."
}
},
"X-RateLimit-Remaining": {
"description": "Requests remaining in the current window.",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"title": "Rate limit remaining",
"description": "Requests remaining in the current window."
}
},
"X-RateLimit-Reset": {
"description": "ISO 8601 timestamp when the current rate-limit window resets.",
"schema": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"title": "Rate limit reset",
"description": "ISO 8601 timestamp when the current rate-limit window resets."
}
},
"Retry-After": {
"description": "Seconds to wait before retrying a rate-limited request.",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"title": "Retry after",
"description": "Seconds to wait before retrying a rate-limited request."
}
},
"X-Run-Id": {
"description": "Identifier assigned to the workflow run.",
"schema": {
"type": "string",
"minLength": 1,
"title": "Run identifier",
"description": "Identifier assigned to the workflow run."
}
}
},
"responses": {
"BadRequest": {
"description": "The request is invalid.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"Unauthorized": {
"description": "The API key is missing or invalid.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"UsageLimitExceeded": {
"description": "The workspace has exceeded its usage or billing limits.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"Forbidden": {
"description": "The caller lacks access to the resource.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"NotFound": {
"description": "The requested resource was not found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"Conflict": {
"description": "The request conflicts with current resource state.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"RunIdConflict": {
"description": "The run identifier is already associated with a different request.",
"headers": {
"X-Run-Id": {
"$ref": "#/components/headers/X-Run-Id"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"Gone": {
"description": "The requested generated resource has expired.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"PayloadTooLarge": {
"description": "The request body exceeds the allowed size.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"UnsupportedMediaType": {
"description": "The request uses an unsupported media type.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"Locked": {
"description": "The resource is locked and cannot be modified.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"RateLimited": {
"description": "The caller exceeded the request rate limit.",
"headers": {
"Retry-After": {
"$ref": "#/components/headers/Retry-After"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"InternalError": {
"description": "An unexpected server error occurred.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
},
"ServiceUnavailable": {
"description": "A required service is temporarily unavailable.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2Error"
}
}
}
}
},
"schemas": {
"V2Error": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Stable machine-readable error code."
},
"message": {
"type": "string",
"description": "Human-readable explanation of the error."
},
"details": {
"description": "Optional structured error details."
}
},
"required": ["code", "message"],
"additionalProperties": false,
"description": "Canonical error details."
}
},
"required": ["error"],
"additionalProperties": false,
"title": "v2 error response",
"description": "Canonical error envelope returned by the public v2 API.",
"examples": [
{
"error": {
"code": "BAD_REQUEST",
"message": "The request is invalid."
}
}
]
},
"V2File": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique file identifier.",
"examples": ["wf_V1StGXR8z5jdHi6BmyT91"]
},
"name": {
"type": "string",
"description": "Original file name.",
"examples": ["data.csv"]
},
"size": {
"type": "number",
"minimum": 0,
"description": "File size in bytes.",
"examples": [1024]
},
"type": {
"type": "string",
"description": "MIME type of the file.",
"examples": ["text/csv"]
},
"key": {
"type": "string",
"description": "Storage key for the file.",
"examples": ["workspace/example/data.csv"]
},
"folderPath": {
"type": "string",
"description": "Canonical containing-folder path. `/` is the workspace root."
},
"uploadedByEmail": {
"type": "string",
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
"description": "Current email address of the uploader.",
"examples": ["jane@example.com"]
},
"uploadedAt": {
"type": "string",
"description": "ISO 8601 timestamp when the file was uploaded.",
"format": "date-time",
"examples": ["2026-01-15T10:30:00Z"]
},
"updatedAt": {
"type": "string",
"description": "ISO 8601 timestamp of the last content or metadata write.",
"format": "date-time",
"examples": ["2026-01-15T10:30:00Z"]
}
},
"required": [
"id",
"name",
"size",
"type",
"key",
"folderPath",
"uploadedByEmail",
"uploadedAt",
"updatedAt"
],
"additionalProperties": false,
"title": "Workspace file",
"description": "A workspace file exposed by the public v2 API."
},
"V2FileListResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/V2File"
},
"description": "Items in the current page."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Opaque cursor for the next page, or null when no more items remain."
}
},
"required": ["data", "nextCursor"],
"additionalProperties": false,
"title": "File list response",
"description": "A cursor-paginated page of workspace files.",
"examples": [
{
"data": [
{
"id": "wf_V1StGXR8z5jdHi6BmyT91",
"name": "data.csv",
"size": 1024,
"type": "text/csv",
"key": "workspace/example/data.csv",
"folderPath": "/Engineering",
"uploadedByEmail": "jane@example.com",
"uploadedAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-01-15T10:30:00Z"
}
],
"nextCursor": null
}
]
},
"V2FileResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2File"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "File response",
"description": "A single workspace file.",
"examples": [
{
"data": {
"id": "wf_V1StGXR8z5jdHi6BmyT91",
"name": "data.csv",
"size": 1024,
"type": "text/csv",
"key": "workspace/example/data.csv",
"folderPath": "/Engineering",
"uploadedByEmail": "jane@example.com",
"uploadedAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-01-15T10:30:00Z"
}
}
]
},
"CreateFileRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace in which to create the file."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "File name, including its extension. Path separators and dot segments are rejected."
},
"contentType": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "MIME type. When omitted, it is inferred from the file extension."
},
"folderPath": {
"description": "Canonical containing-folder path. Omit for the workspace root.",
"type": "string"
},
"content": {
"default": "",
"description": "Initial file content. Omit or send an empty string for a zero-byte file.",
"type": "string",
"maxLength": 70000000
},
"encoding": {
"default": "utf-8",
"description": "Encoding of the content field.",
"type": "string",
"enum": ["utf-8", "base64"]
}
},
"required": ["workspaceId", "name"],
"additionalProperties": false,
"title": "Create file request",
"description": "Inline content and placement for a new workspace file."
},
"V2FileUpload": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Upload session identifier."
},
"status": {
"type": "string",
"enum": [
"uploading",
"completing",
"finalizing",
"completed",
"failed",
"aborting",
"aborted",
"expired"
],
"description": "Current upload session status."
},
"name": {
"type": "string",
"description": "File name supplied when the session was created."
},
"contentType": {
"type": "string",
"description": "MIME type supplied when the session was created."
},
"size": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Expected file size in bytes."
},
"expiresAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "ISO 8601 time when the upload session expires."
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Failure message, or null when no failure has occurred."
},
"file": {
"anyOf": [
{
"$ref": "#/components/schemas/V2File"
},
{
"type": "null"
}
],
"description": "Registered file after finalization, or null before finalization completes."
}
},
"required": ["id", "status", "name", "contentType", "size", "expiresAt", "error", "file"],
"additionalProperties": false,
"title": "File upload session",
"description": "Current state of a resumable workspace-file upload session."
},
"V2PutUploadTransfer": {
"type": "object",
"properties": {
"method": {
"type": "string",
"const": "put",
"description": "Upload strategy discriminator."
},
"url": {
"type": "string",
"format": "uri",
"description": "Signed URL to which the file bytes are uploaded."
},
"headers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
},
"description": "Headers that must be included with the upload request."
}
},
"required": ["method", "url", "headers"],
"additionalProperties": false,
"title": "Direct upload transfer",
"description": "Instructions for uploading bytes to one signed URL."
},
"V2MultipartUploadTransfer": {
"type": "object",
"properties": {
"method": {
"type": "string",
"const": "multipart",
"description": "Upload strategy discriminator."
},
"partSize": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Required size of each non-final part in bytes."
},
"partCount": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 640,
"description": "Total number of upload parts."
}
},
"required": ["method", "partSize", "partCount"],
"additionalProperties": false,
"title": "Multipart upload transfer",
"description": "Instructions for splitting bytes into a multipart upload."
},
"V2CreateFileUploadData": {
"type": "object",
"properties": {
"session": {
"description": "New upload session.",
"$ref": "#/components/schemas/V2FileUpload"
},
"uploadToken": {
"type": "string",
"minLength": 1,
"description": "Signed control token required by later upload-session requests."
},
"transfer": {
"oneOf": [
{
"$ref": "#/components/schemas/V2PutUploadTransfer"
},
{
"$ref": "#/components/schemas/V2MultipartUploadTransfer"
}
],
"description": "Instructions for transferring the file bytes."
}
},
"required": ["session", "uploadToken", "transfer"],
"additionalProperties": false,
"title": "Create file upload data",
"description": "A new file upload session, its control token, and byte-transfer instructions."
},
"CreateFileUploadResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2CreateFileUploadData"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Create file upload response",
"description": "Upload session, signed control token, and transfer strategy."
},
"CreateFileUploadRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace in which the file will be registered."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "File name, including its extension."
},
"contentType": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "MIME type of the uploaded file."
},
"size": {
"type": "integer",
"minimum": 0,
"maximum": 5368709120,
"description": "Exact file size in bytes."
},
"folderPath": {
"description": "Canonical destination folder path. Omit for the workspace root.",
"type": "string"
}
},
"required": ["workspaceId", "name", "contentType", "size"],
"additionalProperties": false,
"title": "Create file upload request",
"description": "File metadata required to create an upload session."
},
"FileUploadResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2FileUpload"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "File upload response",
"description": "Current upload-session state."
},
"V2UploadPartUrl": {
"type": "object",
"properties": {
"partNumber": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991,
"description": "Multipart part number."
},
"url": {
"type": "string",
"format": "uri",
"description": "Signed URL for this upload part."
},
"headers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
},
"description": "Headers that must be included with the part upload."
},
"expiresAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "ISO 8601 expiration time for the signed URL."
}
},
"required": ["partNumber", "url", "headers", "expiresAt"],
"additionalProperties": false,
"title": "Upload part URL",
"description": "A signed URL and required headers for one multipart upload part."
},
"V2PartUrlsData": {
"type": "object",
"properties": {
"parts": {
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/components/schemas/V2UploadPartUrl"
},
"description": "Signed URLs for requested parts."
}
},
"required": ["parts"],
"additionalProperties": false,
"title": "Upload part URLs",
"description": "Signed transfer URLs for the requested multipart upload parts."
},
"CreateFileUploadPartUrlsResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2PartUrlsData"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Create upload part URLs response",
"description": "Signed multipart upload URLs."
},
"CreateFileUploadPartUrlsRequest": {
"type": "object",
"properties": {
"partNumbers": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"description": "Multipart part numbers for which signed URLs should be created."
}
},
"required": ["partNumbers"],
"additionalProperties": false,
"title": "Create upload part URLs request",
"description": "Multipart part numbers requiring signed URLs.",
"examples": [
{
"partNumbers": [1, 2]
}
]
},
"V2DeleteFileResult": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Identifier of the deleted file."
},
"deleted": {
"type": "boolean",
"const": true,
"description": "Confirms that the file was deleted."
}
},
"required": ["id", "deleted"],
"additionalProperties": false,
"title": "Delete file result",
"description": "File deletion acknowledgement."
},
"V2DeleteFileResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2DeleteFileResult"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Delete file response",
"description": "Deletion confirmation for one file."
},
"RenameFileRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"description": "New file name, including its extension."
}
},
"required": ["workspaceId", "name"],
"additionalProperties": false,
"title": "Rename file request",
"description": "Workspace scope and new file name.",
"examples": [
{
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"name": "renamed.csv"
}
]
},
"V2FileShare": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique share identifier."
},
"token": {
"type": "string",
"description": "Server-generated token embedded in the public share URL."
},
"url": {
"type": "string",
"format": "uri",
"description": "Public share URL.",
"examples": ["https://www.sim.ai/f/share-token-example"]
},
"isActive": {
"type": "boolean",
"description": "Whether the public share currently resolves."
},
"resourceType": {
"type": "string",
"enum": ["file", "folder"],
"description": "Kind of resource being shared."
},
"resourceId": {
"type": "string",
"description": "Identifier of the shared resource."
},
"authType": {
"type": "string",
"enum": ["public", "password", "email", "sso"],
"description": "How access to the share is gated."
},
"hasPassword": {
"type": "boolean",
"description": "Whether a password is stored for this share."
},
"allowedEmails": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 320
},
"description": "Allowed addresses or @domain patterns for email and SSO shares."
}
},
"required": [
"id",
"token",
"url",
"isActive",
"resourceType",
"resourceId",
"authType",
"hasPassword",
"allowedEmails"
],
"additionalProperties": false,
"title": "File share",
"description": "Public-safe share configuration for a workspace file."
},
"V2FileMetadata": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique file identifier.",
"examples": ["wf_V1StGXR8z5jdHi6BmyT91"]
},
"name": {
"type": "string",
"description": "Original file name.",
"examples": ["data.csv"]
},
"size": {
"type": "number",
"minimum": 0,
"description": "File size in bytes.",
"examples": [1024]
},
"type": {
"type": "string",
"description": "MIME type of the file.",
"examples": ["text/csv"]
},
"key": {
"type": "string",
"description": "Storage key for the file.",
"examples": ["workspace/example/data.csv"]
},
"folderPath": {
"type": "string",
"description": "Canonical containing-folder path. `/` is the workspace root."
},
"uploadedByEmail": {
"type": "string",
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
"description": "Current email address of the uploader.",
"examples": ["jane@example.com"]
},
"uploadedAt": {
"type": "string",
"description": "ISO 8601 timestamp when the file was uploaded.",
"format": "date-time",
"examples": ["2026-01-15T10:30:00Z"]
},
"updatedAt": {
"type": "string",
"description": "ISO 8601 timestamp of the last content or metadata write.",
"format": "date-time",
"examples": ["2026-01-15T10:30:00Z"]
},
"share": {
"anyOf": [
{
"$ref": "#/components/schemas/V2FileShare"
},
{
"type": "null"
}
],
"description": "Current public-share state, or null when the file has never been shared."
}
},
"required": [
"id",
"name",
"size",
"type",
"key",
"folderPath",
"uploadedByEmail",
"uploadedAt",
"updatedAt",
"share"
],
"additionalProperties": false,
"title": "File metadata",
"description": "Workspace file metadata enriched with nullable public-share state."
},
"V2FileMetadataResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2FileMetadata"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "File metadata response",
"description": "File metadata enriched with its current nullable public-share state.",
"examples": [
{
"data": {
"id": "wf_V1StGXR8z5jdHi6BmyT91",
"name": "data.csv",
"size": 1024,
"type": "text/csv",
"key": "workspace/example/data.csv",
"folderPath": "/Engineering",
"uploadedByEmail": "jane@example.com",
"uploadedAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-01-15T10:30:00Z",
"share": null
}
},
{
"data": {
"id": "wf_V1StGXR8z5jdHi6BmyT91",
"name": "data.csv",
"size": 1024,
"type": "text/csv",
"key": "workspace/example/data.csv",
"folderPath": "/Engineering",
"uploadedByEmail": "jane@example.com",
"uploadedAt": "2026-01-15T10:30:00Z",
"updatedAt": "2026-01-15T10:30:00Z",
"share": {
"id": "shr_8Hf3kL9wQ2mNpXr6Tz1Vb",
"token": "share-token-example",
"url": "https://www.sim.ai/f/share-token-example",
"isActive": true,
"resourceType": "file",
"resourceId": "wf_V1StGXR8z5jdHi6BmyT91",
"authType": "public",
"hasPassword": false,
"allowedEmails": []
}
}
}
]
},
"V2AuditLogEntry": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique audit-log entry identifier.",
"examples": ["audit_2c3d4e5f6g"]
},
"workspaceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Workspace where the action occurred, or null for organization-level actions."
},
"actorName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Display name of the person who performed the action."
},
"actorEmail": {
"anyOf": [
{
"type": "string",
"format": "email",
"pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
{
"type": "null"
}
],
"description": "Email address of the person who performed the action."
},
"action": {
"type": "string",
"description": "Action that was performed.",
"examples": ["file.uploaded"]
},
"resourceType": {
"type": "string",
"description": "Type of resource affected by the action.",
"examples": ["file"]
},
"resourceId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Identifier of the affected resource."
},
"resourceName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Display name of the affected resource."
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Human-readable description of the action."
},
"metadata": {
"description": "Arbitrary per-action JSON metadata."
},
"createdAt": {
"type": "string",
"description": "ISO 8601 timestamp when the action occurred.",
"format": "date-time",
"examples": ["2026-01-15T10:30:00Z"]
}
},
"required": [
"id",
"workspaceId",
"actorName",
"actorEmail",
"action",
"resourceType",
"resourceId",
"resourceName",
"description",
"metadata",
"createdAt"
],
"additionalProperties": false,
"title": "Audit-log entry",
"description": "Public enterprise audit-log entry with privacy-sensitive request data omitted."
},
"V2AuditLogListResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/V2AuditLogEntry"
},
"description": "Items in the current page."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Opaque cursor for the next page, or null when no more items remain."
}
},
"required": ["data", "nextCursor"],
"additionalProperties": false,
"title": "Audit-log list response",
"description": "A cursor-paginated page of audit-log entries.",
"examples": [
{
"data": [
{
"id": "audit_2c3d4e5f6g",
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"actorName": "Jane Smith",
"actorEmail": "jane@example.com",
"action": "file.uploaded",
"resourceType": "file",
"resourceId": "wf_V1StGXR8z5jdHi6BmyT91",
"resourceName": "data.csv",
"description": "Uploaded file \"data.csv\" via API",
"metadata": {
"fileSize": 1024,
"fileType": "text/csv"
},
"createdAt": "2026-01-15T10:30:00Z"
}
],
"nextCursor": null
}
]
},
"V2AuditLogResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2AuditLogEntry"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Audit-log response",
"description": "A single audit-log entry.",
"examples": [
{
"data": {
"id": "audit_2c3d4e5f6g",
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"actorName": "Jane Smith",
"actorEmail": "jane@example.com",
"action": "file.uploaded",
"resourceType": "file",
"resourceId": "wf_V1StGXR8z5jdHi6BmyT91",
"resourceName": "data.csv",
"description": "Uploaded file \"data.csv\" via API",
"metadata": {
"fileSize": 1024,
"fileType": "text/csv"
},
"createdAt": "2026-01-15T10:30:00Z"
}
}
]
},
"V2MoveFileItemsResult": {
"type": "object",
"properties": {
"movedItems": {
"type": "object",
"properties": {
"files": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Number of files moved."
}
},
"required": ["files"],
"additionalProperties": false,
"description": "Counts of file items moved by the request."
}
},
"required": ["movedItems"],
"additionalProperties": false,
"title": "Move file items result",
"description": "Counts of workspace file items moved by the request."
},
"V2MoveFileItemsResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2MoveFileItemsResult"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Move files response",
"description": "Count of files moved by the operation.",
"examples": [
{
"data": {
"movedItems": {
"files": 1
}
}
}
]
},
"MoveFileItemsRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace containing the files."
},
"fileIds": {
"minItems": 1,
"maxItems": 1000,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "File identifiers to update."
},
"targetFolderPath": {
"description": "Destination folder path. Omit to move files to the workspace root.",
"type": "string"
}
},
"required": ["workspaceId", "fileIds"],
"additionalProperties": false,
"title": "Move files request",
"description": "Files and destination selected for a bulk move."
},
"V2GetFileShareResult": {
"type": "object",
"properties": {
"share": {
"anyOf": [
{
"$ref": "#/components/schemas/V2FileShare"
},
{
"type": "null"
}
],
"description": "Current public share, or null when the file has never been shared."
}
},
"required": ["share"],
"additionalProperties": false,
"title": "File share result",
"description": "The nullable public-share state for a file."
},
"V2GetFileShareResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2GetFileShareResult"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Get file share response",
"description": "Current public-share state for a file.",
"examples": [
{
"data": {
"share": {
"id": "shr_8Hf3kL9wQ2mNpXr6Tz1Vb",
"token": "share-token-example",
"url": "https://www.sim.ai/f/share-token-example",
"isActive": true,
"resourceType": "file",
"resourceId": "wf_V1StGXR8z5jdHi6BmyT91",
"authType": "public",
"hasPassword": false,
"allowedEmails": []
}
}
},
{
"data": {
"share": null
}
}
]
},
"V2UpsertFileShareResult": {
"type": "object",
"properties": {
"share": {
"description": "Updated public share.",
"$ref": "#/components/schemas/V2FileShare"
}
},
"required": ["share"],
"additionalProperties": false,
"title": "Updated file share",
"description": "The updated public-share state for a file."
},
"V2UpsertFileShareResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2UpsertFileShareResult"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Upsert file share response",
"description": "Updated public-share state for a file.",
"examples": [
{
"data": {
"share": {
"id": "shr_8Hf3kL9wQ2mNpXr6Tz1Vb",
"token": "share-token-example",
"url": "https://www.sim.ai/f/share-token-example",
"isActive": true,
"resourceType": "file",
"resourceId": "wf_V1StGXR8z5jdHi6BmyT91",
"authType": "public",
"hasPassword": false,
"allowedEmails": []
}
}
}
]
},
"UpsertFileShareRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
},
"isActive": {
"type": "boolean",
"description": "Whether the share should resolve."
},
"authType": {
"description": "How access to the share is gated.",
"type": "string",
"enum": ["public", "password", "email", "sso"]
},
"password": {
"description": "Password for a password-gated share.",
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"allowedEmails": {
"description": "Allowed addresses or @domain patterns for email and SSO shares.",
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 320
}
}
},
"required": ["workspaceId", "isActive"],
"additionalProperties": false,
"title": "Upsert file share request",
"description": "Desired public-share state and access policy.",
"examples": [
{
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"isActive": true,
"authType": "public"
},
{
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"isActive": false
}
]
},
"UpdateFileContentRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace that owns the file."
},
"content": {
"type": "string",
"maxLength": 70000000,
"description": "Complete replacement content for the file."
},
"encoding": {
"default": "utf-8",
"description": "Encoding of the content field.",
"type": "string",
"enum": ["utf-8", "base64"]
}
},
"required": ["workspaceId", "content"],
"additionalProperties": false,
"title": "Update file content request",
"description": "Workspace scope and complete replacement content.",
"examples": [
{
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"content": "replacement text"
}
]
},
"V2BulkDeleteFilesResult": {
"type": "object",
"properties": {
"deletedItems": {
"type": "object",
"properties": {
"files": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Number of files deleted."
}
},
"required": ["files"],
"additionalProperties": false,
"description": "Counts of file items deleted by the request."
}
},
"required": ["deletedItems"],
"additionalProperties": false,
"title": "Bulk delete files result",
"description": "Counts of workspace files deleted by the request."
},
"BulkDeleteFilesResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2BulkDeleteFilesResult"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Bulk delete files response",
"description": "Count of files deleted by the operation.",
"examples": [
{
"data": {
"deletedItems": {
"files": 1
}
}
}
]
},
"BulkDeleteFilesRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace containing the files."
},
"fileIds": {
"minItems": 1,
"maxItems": 1000,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "File identifiers to update."
}
},
"required": ["workspaceId", "fileIds"],
"additionalProperties": false,
"title": "Bulk delete files request",
"description": "Workspace and files selected for deletion.",
"examples": [
{
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
"fileIds": ["wf_V1StGXR8z5jdHi6BmyT91"]
}
]
},
"V2Folder": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Folder name."
},
"path": {
"type": "string",
"description": "Canonical folder path used as the public folder identifier."
},
"parentPath": {
"type": "string",
"description": "Canonical parent path; `/` is the root."
},
"createdAt": {
"type": "string",
"description": "ISO 8601 timestamp when the folder was created.",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"description": "ISO 8601 timestamp when the folder was last updated.",
"format": "date-time"
}
},
"required": ["name", "path", "parentPath", "createdAt", "updatedAt"],
"additionalProperties": false,
"title": "Folder",
"description": "A canonical workspace folder."
},
"FileFolderListResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/V2Folder"
},
"description": "Items in the current page."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Opaque cursor for the next page, or null when no more items remain."
}
},
"required": ["data", "nextCursor"],
"additionalProperties": false,
"title": "File folder list response",
"description": "Workspace file folders in the current page."
},
"V2FileFolderData": {
"type": "object",
"properties": {
"folder": {
"description": "Created or relocated folder.",
"$ref": "#/components/schemas/V2Folder"
}
},
"required": ["folder"],
"additionalProperties": false,
"title": "File folder data",
"description": "A created or relocated file folder."
},
"FileFolderResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2FileFolderData"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "File folder response",
"description": "A single workspace file folder."
},
"CreateFileFolderRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace in which to create the folder."
},
"path": {
"description": "Path of the folder to create.",
"type": "string"
}
},
"required": ["workspaceId", "path"],
"additionalProperties": false,
"title": "Create file folder request",
"description": "Workspace and canonical path for a new folder."
},
"RelocateFileFolderRequest": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"description": "Workspace containing the folder."
},
"path": {
"description": "Current folder path.",
"type": "string"
},
"destinationPath": {
"description": "New full path for the folder and its descendants.",
"type": "string"
}
},
"required": ["workspaceId", "path", "destinationPath"],
"additionalProperties": false,
"title": "Relocate file folder request",
"description": "Current and destination canonical paths for a folder."
},
"V2DeleteFileFolderData": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Deleted folder path."
},
"deleted": {
"type": "boolean",
"const": true,
"description": "Confirms that the folder was deleted."
},
"deletedItems": {
"type": "object",
"properties": {
"folders": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Number of folders deleted."
},
"files": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Number of files deleted."
}
},
"required": ["folders", "files"],
"additionalProperties": false,
"description": "Counts of folders and files deleted by the request."
}
},
"required": ["path", "deleted", "deletedItems"],
"additionalProperties": false,
"title": "Delete file folder data",
"description": "File-folder deletion acknowledgement and deletion counts."
},
"DeleteFileFolderResponse": {
"type": "object",
"properties": {
"data": {
"description": "Response data.",
"$ref": "#/components/schemas/V2DeleteFileFolderData"
}
},
"required": ["data"],
"additionalProperties": false,
"title": "Delete file folder response",
"description": "Folder deletion confirmation and deleted item counts."
}
}
},
"x-generated-by": "scripts/generate-openapi.ts"
}