Skip to content

Create a destination (webhook / S3 / SQS / SNS)

POST
/api/destinations
curl --request POST \
--url https://api.langparse.dev/api/destinations \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "kind": "webhook", "name": "Ops webhook", "url": "https://example.com/hook", "secret": "whsec_…", "sourceIds": [ "rest-api" ] }'

Create a destination to deliver parsed results to. Bind it to one or more sourceIds (use rest-api for API-submitted documents), choose the resultShape, and — for S3/SQS/SNS — assume a cross-account role from POST /destinations/policy.

Media typeapplication/json
object
kind
required
string
Allowed values: webhook s3 sqs sns
name
string
resultShape
string
Allowed values: full data-only
sourceIds

Sources routed here (‘rest-api’ for API-submitted docs).

Array<string>
writeTags
boolean
url

Webhook only

string
secret

Webhook HMAC secret

string
bucket
string
prefix
string
region
string
roleArn

S3/SQS/SNS — role from /destinations/policy.

string
Example
{
"kind": "webhook",
"name": "Ops webhook",
"url": "https://example.com/hook",
"secret": "whsec_…",
"sourceIds": [
"rest-api"
]
}

The created destination.

Media typeapplication/json
object
data
required

A destination (secret redacted to hasSecret). Own key id.

object
key
additional properties
any
Example
{
"data": {
"id": "dst_wh01",
"kind": "webhook",
"name": "Ops webhook",
"enabled": true,
"hasSecret": true
}
}

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"
}