Get a presigned upload URL
POST
/api/v1/models/{modelId}/uploads
const url = 'https://api.langparse.dev/api/v1/models/example/uploads';const options = { method: 'POST', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"fileName":"invoice.pdf","contentType":"application/pdf"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.langparse.dev/api/v1/models/example/uploads \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: <X-Api-Key>' \ --data '{ "fileName": "invoice.pdf", "contentType": "application/pdf" }'Returns a one-time S3 URL. PUT the raw file bytes to it, then call POST /models/{modelId}/parse with the returned { sourceKey }. No size limit.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”modelId
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
fileName
string
Example
invoice.pdfcontentType
string
Example
application/pdfResponses
Section titled “Responses”Presigned upload ticket
Media typeapplication/json
object
id
string
sourceKey
string
uploadUrl
PUT the raw file bytes here.
string
method
string
expiresInSeconds
integer
Example
{ "method": "PUT"}Missing or invalid API key
Model not found