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
  • API Reference
      • POSTCreate Upload
      • POSTConfirm Upload
      • DELDelete Upload
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceuploads

Create Upload

POST
/api/v1/uploads
POST
/api/v1/uploads
$curl -X POST https://api.onepin.ai/api/v1/uploads \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "filename": "data_analysis_script.py",
> "category": "script"
>}'
1{
2 "data": {
3 "upload": {
4 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
5 "user_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
6 "filename": "data_analysis_script.py",
7 "category": "script",
8 "content_type": "text/x-python",
9 "status": "pending",
10 "created_at": "2024-01-15T09:30:00Z",
11 "updated_at": "2024-01-15T09:30:00Z",
12 "workspace_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
13 "format": "py",
14 "size_bytes": 2048,
15 "download_url": "https://cdn.onepin.ai/uploads/3fa85f64-5717-4562-b3fc-2c963f66afa6/download",
16 "context_type": "project",
17 "context_id": "9f8e7d6c-5b4a-3c2d-1e0f-9a8b7c6d5e4f"
18 },
19 "upload_url": "https://storage.onepin.ai/presigned/upload/3fa85f64-5717-4562-b3fc-2c963f66afa6"
20 },
21 "meta": {
22 "request_id": "req_1234567890abcdef",
23 "timestamp": "2024-01-15T09:30:00Z"
24 }
25}
Request a presigned URL for uploading a file.
Was this page helpful?
Previous

Confirm Upload

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects an object.
filenamestringRequired1-255 characters
categoryenumRequired
Allowed values:

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error