Generate the cross-account IAM policy for an S3 source
POST
/api/sources/policy
const url = 'https://api.langparse.dev/api/sources/policy';const options = { method: 'POST', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"kind":"s3","mode":"source","resource":"example","region":"example","prefix":"example"}'};
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/sources/policy \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: <X-Api-Key>' \ --data '{ "kind": "s3", "mode": "source", "resource": "example", "region": "example", "prefix": "example" }'Returns the trust + permission policy to create in YOUR AWS account before wiring an S3 bucket as a source.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
kind
required
string
mode
required
string
resource
required
Bucket name / queue / topic ARN.
string
region
string
prefix
string
Responses
Section titled “Responses”IAM policy documents
Media typeapplication/json
object
key
additional properties
any
Examplegenerated
{}