Upload and register source files
Choose the shortest supported path to register hosted, small, or large files as reusable Lingopal jobs.
Every file-based workflow starts with a reusable job_id.
| Source | Use |
|---|---|
| Publicly reachable URL | POST /v2/jobs/register |
| Small local file | POST /v2/jobs/upload-and-register |
| Large local file | POST /v2/storage/uploads, upload bytes, then register source_url |
| Large file requiring multipart transfer | Multipart uploads |
Register an existing URL
export LINGOPAL_API_KEY="your-api-key"
curl -X POST "https://api.lingopal.ai/v2/jobs/register" \
-H "X-API-Key: $LINGOPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"source_url": "https://example.com/source-file.mp4",
"name": "sample-job",
"media_type": "video"
}
]
}'Authorization
APIKeyHeader In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v2/jobs/register" \ -H "Content-Type: application/json" \ -d '{ "items": [ { "source_url": "https://example-bucket.s3.amazonaws.com/presigned_upload/user_123/product-demo.mp4", "name": "Product Demo", "media_type": "video" } ] }'{ "message": "Job registration completed", "registered_count": 1, "error_count": 0, "results": [ { "name": "Product Demo", "source_url": "https://cdn.example.com/uploads/product-demo.mp4", "status": "registered", "job_id": "job_123", "media_type": "video" } ]}Use the API Reference entry for registerJobs for complete request rules and validation behavior.
Send one to 100 items. Each item requires source_url; name and media_type are optional. Inspect every result because a batch can contain both successes and failures.
Upload a small file
export LINGOPAL_API_KEY="your-api-key"
curl -X POST "https://api.lingopal.ai/v2/jobs/upload-and-register" \
-H "X-API-Key: $LINGOPAL_API_KEY" \
-F "name=sample-video" \
-F "file=@/path/to/file.mp4"Authorization
APIKeyHeader In: header
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v2/jobs/upload-and-register" \ -F file="product-demo.mp4" \ -F name="Product Demo" \ -F media_type="video"{ "message": "Job registration completed", "registered_count": 1, "error_count": 0, "results": [ { "name": "Product Demo", "source_url": "https://cdn.example.com/uploads/product-demo.mp4", "status": "registered", "job_id": "job_123", "media_type": "video" } ]}Use the API Reference entry for uploadAndRegisterJob for complete request and response details.
Send the file as multipart/form-data. If the API returns 413, switch to storage upload.
Upload a large file
Create a storage upload from the same workspace using createStorageUpload:
export LINGOPAL_API_KEY="your-api-key"
curl -X POST "https://api.lingopal.ai/v2/storage/uploads" \
-H "X-API-Key: $LINGOPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_ext": "mp4",
"file_size": 2147483648
}'Authorization
APIKeyHeader In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v2/storage/uploads" \ -H "Content-Type: application/json" \ -d '{ "file_ext": "mp4" }'{ "source_url": "https://cdn.example.com/presigned_upload/user_123/source.mp4", "file_path": "presigned_upload/user_123/source.mp4", "upload_id": "2~example-upload-id", "upload_urls": [ { "part_number": 1, "upload_url": "https://example-bucket.s3.amazonaws.com/presigned_upload/user_123/source.mp4?partNumber=1&X-Amz-Signature=..." } ], "method": "PUT", "headers": { "Content-Type": "video/mp4" }}Use the API Reference entry for createStorageUpload for exact request and response fields.
- Send
file_ext; omitfile_sizefor a single presigned PUT. - PUT raw file bytes to the returned upload URL using the returned headers.
- Register the returned
source_urlwithPOST /v2/jobs/register.
Do not send X-API-Key to the presigned storage URL unless its returned headers explicitly require it.