> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://onepin.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://onepin.ai/docs/_mcp/server.

# List Workflow Uploads

GET https://api.onepin.ai/api/v1/workflows/{workflow_id}/uploads

List confirmed uploads attached to a workflow.

Returns only uploads that have been confirmed (fully transferred and
committed to the workflow), plus confirmed uploads the workflow definition's
Script Input nodes reference by id (e.g. a file attached in the assistant
chat, which stays bound to its assistant session). In-progress or abandoned
uploads are excluded. Each item includes a short-lived download URL for the
uploaded file.

Reference: https://onepin.ai/docs/reference/api-reference/workflows/list-workflow-uploads-api-v-1-workflows-workflow-id-uploads-get

## Authentication

- `Authorization` header (bearer token, required) — Clerk JWT token
- `Authorization` header (bearer token, required) — Onepin live API key (`op_live_...`). Test and public keys are reserved in Phase 1.

## Servers

- `https://api.onepin.ai` (prod, default)
- `https://dev-api.onepin.ai` (dev)

## Request

### Path parameters

- `workflow_id` (string, required)

### Query parameters

- `offset` (integer, optional, default: 0) — Zero-based pagination offset.
- `limit` (integer, optional, default: 50) — Maximum items to return (1–100).

### Headers

- `X-Workspace-Id` (string, optional, nullable)

## Response

### 200

Successful Response

- `data` (list of UploadOut, required)
- `meta` (Meta, required)
- `pagination` (PaginationMeta, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### UploadOut

- `id` (string, required) — Unique upload identifier. Use this as `upload_id` in confirm and delete calls.
- `user_id` (string, required) — ID of the user who created the upload.
- `filename` (string, required) — Sanitized display filename (Unicode-safe, extension preserved).
- `category` (string, required) — Upload category: `script` or `dictionary`.
- `content_type` (string, required) — MIME type inferred from the file extension at create time.
- `status` (string, required) — `pending` until confirmed; `uploaded` after a successful confirm call.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `workspace_id` (string, optional, nullable) — Workspace this upload is scoped to, if any. Set at create time via `X-Workspace-Id` or derived from the bound resource at confirm time.
- `format` (string, optional, nullable) — Normalized format identifier (e.g. `mp3`, `txt`), if applicable.
- `size_bytes` (integer, optional, nullable) — File size in bytes. Populated after a successful confirm.
- `char_count` (integer, optional, nullable) — Decoded character count of the uploaded script: the sum of Unicode code-point lengths of each stripped, non-empty line (leading/trailing whitespace, blank lines, and newlines excluded). This is always code points; it equals the billed `unit_chars` for character-billed models but not for byte-billed models (e.g. Fish Audio), which bill UTF-8 bytes. Populated after a successful confirm for `script` uploads in `.txt` or `.pdf` format (a PDF is parsed with the same text extractor the run uses). `null` while pending, for a PDF whose text cannot be extracted (encrypted, scanned/image-only, or corrupt), and for `dictionary` (audio) uploads.
- `line_count` (integer, optional, nullable) — Number of non-empty lines in the uploaded script. Populated alongside `char_count` (same scope: confirmed `script` `.txt`/`.pdf` uploads); `null` otherwise.
- `detected_language` (string, optional, nullable) — Server-detected dominant source language as a bare BCP-47 code (e.g. `en`, `ko`). Populated after a successful confirm for `script` `.txt`/`.pdf` uploads. The client maps it to a supported regional locale (e.g. `en` → `en-us`). `null` when detection is not confident, when the detected language is not a supported locale, and for non-script uploads — in which case the source language is picked manually.
- `download_url` (string, optional, nullable) — Short-lived presigned URL for downloading the confirmed file. `null` for pending uploads.
- `context_type` (string, optional, nullable) — Resource type this upload is attached to (e.g. `workflow` or `playground`). Set at confirm time.
- `context_id` (string, optional, nullable) — ID of the attached resource. Set at confirm time.

### Meta

- `request_id` (string, required)
- `timestamp` (datetime, required)

### PaginationMeta

- `limit` (integer, required)
- `next` (string, optional, nullable)
- `prev` (string, optional, nullable)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "user_id": "string",
      "filename": "string",
      "category": "string",
      "content_type": "string",
      "status": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "workspace_id": "string",
      "format": "string",
      "size_bytes": 1,
      "char_count": 1,
      "line_count": 1,
      "detected_language": "string",
      "download_url": "string",
      "context_type": "string",
      "context_id": "string"
    }
  ],
  "meta": {
    "request_id": "string",
    "timestamp": "2024-01-15T09:30:00Z"
  },
  "pagination": {
    "limit": 1,
    "next": "string",
    "prev": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.onepin.ai/api/v1/workflows/workflow_id/uploads"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.onepin.ai/api/v1/workflows/workflow_id/uploads';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.onepin.ai/api/v1/workflows/workflow_id/uploads"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.onepin.ai/api/v1/workflows/workflow_id/uploads")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.onepin.ai/api/v1/workflows/workflow_id/uploads")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.onepin.ai/api/v1/workflows/workflow_id/uploads', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.onepin.ai/api/v1/workflows/workflow_id/uploads");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.onepin.ai/api/v1/workflows/workflow_id/uploads")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```