Skip to content

Create a source (managed inbox or your S3 bucket)

POST
/api/sources
curl --request POST \
--url https://api.langparse.dev/api/sources \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "kind": "s3-managed", "name": "Dropbox inbox", "modelId": "mdl_inv01" }'

Create a source: a LangParse-managed inbox (s3-managed) or your own bucket (s3, cross-account via a role from POST /sources/policy). Bind it to a modelId or routerId so arriving files parse automatically.

Media typeapplication/json
object
kind
required
string
Allowed values: s3-managed s3
name
string
modelId
string
routerId
string
tagSourceFiles
boolean
bucket

BYO (kind=s3) only.

string
region
string
prefix
string
roleArn

BYO (kind=s3) only — role from /sources/policy.

string
Example
{
"kind": "s3-managed",
"name": "Dropbox inbox",
"modelId": "mdl_inv01"
}

The created source (+ S3 notification config for BYO buckets).

Media typeapplication/json
object
data
required
object
key
additional properties
any
Examplegenerated
{
"data": {}
}

Missing or invalid API key.

Media typeapplication/json

Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.

object
statusCode
integer
statusMessage
string
Example
{
"statusCode": 404,
"statusMessage": "Document not found"
}