Skip to content
Download an execution output

Download an execution output

Fetch the exact bytes selected by view during an execution.

GET/api/v1/executions/:executionId/outputs/:outputId/content

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/executions/01995e57-3027-7557-a233-009ea3dcd8fc/outputs/909e0ae1-f9c7-4a58-af88-c3e23e13707f/content", {
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const bytes = new Uint8Array(await response.arrayBuffer());

Use your server-side apiKey. Replace the example IDs.

Path parameters#

executionIdUUIDrequired

The ID returned in execution.id.

outputIdUUIDrequired

The id in execution.outputFiles.

Responses#

The body contains the saved bytes. Content-Type identifies the media type and Content-Disposition supplies the filename. Selected images open inline and explicit downloads are served as attachments.

200 response
item,quantity
widgets,17

More about this endpoint

The contentPath returned by execute includes /api/v1. Resolve it against the API origin. Keep the API key on your server.

Outputs belong to the saved execution. Later edits, moves, and deletions of their source files do not change a saved output.