For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
      • login
      • workflows
      • voices
      • templates
      • uploads
LogoLogo
On this page
  • create
  • Synopsis
  • Description
  • Flags
  • Examples
  • File extension validation
  • Errors
  • confirm
  • Synopsis
  • Description
  • Flags
  • Examples
  • Errors
  • delete
  • Synopsis
  • Description
  • Examples
  • Errors
CLICommands

onepin uploads

Was this page helpful?
Previous
Built with

Manage script and dictionary file uploads. Requires uploads:write scope.

Uploads use a three-step presigned URL flow: the CLI creates an upload record, PUTs the file bytes directly to S3 via the presigned URL, then you confirm the upload to finalize it.

Audio file uploads use a separate endpoint that is not accessible via API key. This command handles script (.txt, .docx) and dictionary (.csv) files only.


create

Synopsis

onepin uploads create --file PATH --category {script|dictionary} [OPTIONS]

Description

Three steps executed by this command:

  1. POST /api/v1/uploads with {filename, category} → server returns {upload: {id, ...}, upload_url}.
  2. PUT <upload_url> with the file bytes directly to S3 — the presigned URL is used, not the OnePin API.
  3. Prints the upload_id. The upload is not yet confirmed — run onepin uploads confirm to finalize.

Flags

FlagDescription
--file PATHPath to the local file to upload (required)
--category TEXTFile category: script or dictionary (required)
--jsonEmit JSON to stdout

Examples

$# Upload a script file
$onepin uploads create --file my-script.txt --category script
Upload ID: upl_01JXXXXXXXXXXXXXXXXXXXXX
Status: staged (not yet confirmed)
Next step:
onepin uploads confirm upl_01JXXXXXXXXXXXXXXXXXXXXX --workflow-id <WORKFLOW_ID>
$# Upload a dictionary CSV
$onepin uploads create --file custom-dict.csv --category dictionary
$
$# JSON output (capture upload ID for scripting)
$UPLOAD_ID=$(onepin uploads create --file my-script.txt --category script --json | jq -r '.id')

File extension validation

CategoryAccepted extensions
script.txt, .docx
dictionary.csv

Extension is validated server-side. Mismatches return a 422 error.

Errors

ConditionExit
File not found at --file PATH1 (client-side)
Unsupported file extension for category1 (422)
S3 PUT fails (expired presigned URL, network error)1

confirm

Synopsis

onepin uploads confirm <UPLOAD_ID> --workflow-id <WORKFLOW_ID>

Description

Finalizes an upload by binding it to a workflow. Calls POST /api/v1/uploads/{upload_id} with {context_type: "workflow", context_id: <workflow_id>}.

The server verifies the staged file in S3, consumes storage quota, and transitions the upload to confirmed status. Run this after create.

Flags

FlagDescription
--workflow-id TEXTUUID of the workflow to bind the upload to (required)
--jsonEmit JSON to stdout

Examples

$# Full flow
$onepin uploads create --file script.txt --category script
$# Upload ID: upl_01JXXXXXXXXXXXXXXXXXXXXX
$
$onepin uploads confirm upl_01JXXXXXXXXXXXXXXXXXXXXX \
> --workflow-id 3fa85f64-5717-4562-b3fc-2c963f66afa6
$# ✓ Upload confirmed: upl_01JXXXXXXXXXXXXXXXXXXXXX
$# Scripted flow
$UPLOAD_ID=$(onepin uploads create --file script.txt --category script --json | jq -r '.id')
$onepin uploads confirm "$UPLOAD_ID" --workflow-id "$WORKFLOW_ID"

Errors

ConditionExit
Upload not found1 (404)
File not present in S3 (create step not completed)1 (422)
Workflow not found or not owned by workspace1 (404)

delete

Synopsis

onepin uploads delete <UPLOAD_ID>

Description

Deletes an upload record and removes the associated file from S3. Releases storage quota.

Examples

$onepin uploads delete upl_01JXXXXXXXXXXXXXXXXXXXXX
$# ✓ Deleted: upl_01JXXXXXXXXXXXXXXXXXXXXX

Errors

ConditionExit
Upload not found1 (404)