Upload a file
https://revise.io/api/v1/filesUpload one nonempty file with a supported extension: DOCX, MD/Markdown, HTML/HTM, TXT, RTF, ODT, PDF, JPEG/JPG, PNG, WebP, or GIF. Text, Markdown, and HTML must be UTF-8. Prompt targets accept only DOCX, Markdown, HTML, and text; other formats must be converted first. There is no public upload-list or original-file-download endpoint.
See files and retention for integration guidance.
TypeScript#
import { ReviseClient } from "@reviseio/api";
const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const result = await revise.files.upload(
{ filename: "report.md", data: new TextEncoder().encode("# Quarterly report") },
{ idempotencyKey: "upload-42" },
);Authorization#
AuthorizationstringrequiredBearer <key>, with an API key from the console.
Headers#
Idempotency-Keystringrequiredmin length 1 · max length 200
Body#
multipart/form-data · required
filestring<binary>requiredOne nonempty file, at most 18 MiB. Accounts may retain up to 100 undeleted uploads totaling 256 MiB. Filename: at most 255 bytes, with no path separators or control characters. DOCX/ODT expanded archives are limited to 128 MiB; DOCX archives may contain at most 10,000 entries.
lifetimestringdefault: "ephemeral"Ephemeral files can be claimed by one request and are deleted immediately on success. Failed or cancelled requests retain their source for 24 hours; unused uploads expire 24 hours after upload. Persistent templates remain until explicit deletion.
one of "ephemeral", "persistent"
Responses#
200FileIdempotent upload replay
Headers
LocationstringAccount-authenticated path to retrieve this resource.
Idempotent-ReplayedstringPresent with value true on an idempotent replay.
Body
idstringrequiredfilenamestringrequiredEmpty once expired or deleted.
bytesintegerrequiredsha256stringrequiredstatusstringrequiredone of "uploaded", "expired", "deleted"
created_atstring<date-time>requiredexpires_atstring | nullrequireddeleted_atstring | nullrequiredlifetimestringrequiredone of "ephemeral", "persistent"
201FileUploaded file metadata. Store its ID for job creation or later deletion.
Headers
LocationstringAccount-authenticated path to retrieve this resource.
Idempotent-ReplayedstringPresent with value true on an idempotent replay.
Body
idstringrequiredfilenamestringrequiredEmpty once expired or deleted.
bytesintegerrequiredsha256stringrequiredstatusstringrequiredone of "uploaded", "expired", "deleted"
created_atstring<date-time>requiredexpires_atstring | nullrequireddeleted_atstring | nullrequiredlifetimestringrequiredone of "ephemeral", "persistent"
defaultErrorError
errorobjectrequiredProperties
codestringrequiredmessagestringrequireddetailsobject