Revise API menu

Upload a file

POSThttps://revise.io/api/v1/files

Upload 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#

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#

Authorizationstringrequired

Bearer <key>, with an API key from the console.

Headers#

Idempotency-Keystringrequired

min length 1 · max length 200

Body#

multipart/form-data · required

filestring<binary>required

One 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

Locationstring

Account-authenticated path to retrieve this resource.

Idempotent-Replayedstring

Present with value true on an idempotent replay.

Body

idstringrequired
filenamestringrequired

Empty once expired or deleted.

bytesintegerrequired
sha256stringrequired
statusstringrequired

one of "uploaded", "expired", "deleted"

created_atstring<date-time>required
expires_atstring | nullrequired
deleted_atstring | nullrequired
lifetimestringrequired

one of "ephemeral", "persistent"

201FileUploaded file metadata. Store its ID for job creation or later deletion.

Headers

Locationstring

Account-authenticated path to retrieve this resource.

Idempotent-Replayedstring

Present with value true on an idempotent replay.

Body

idstringrequired
filenamestringrequired

Empty once expired or deleted.

bytesintegerrequired
sha256stringrequired
statusstringrequired

one of "uploaded", "expired", "deleted"

created_atstring<date-time>required
expires_atstring | nullrequired
deleted_atstring | nullrequired
lifetimestringrequired

one of "ephemeral", "persistent"

defaultErrorError
errorobjectrequired
Properties
codestringrequired
messagestringrequired
detailsobject