---
title: "Generate trust policy"
method: POST
path: "/api/v2/destinations/projects/{projKey}/environments/{envKey}/generate-trust-policy"
tags: ["Data Export destinations"]
---

# Generate trust policy

`POST /api/v2/destinations/projects/{projKey}/environments/{envKey}/generate-trust-policy`

Trust policy to allow Data Export to assume the role and perform operations on AWS resources

## Path parameters

- `projKey` string, string, required — The project key
- `envKey` string, string, required — The environment key

## Response `201`

Generate trust policy response

- GenerateTrustPolicyPostRep
  - `awsTrustPolicy` TrustPolicyDetails
    - `Version` string — The version of the trust policy
    - `Statement` TrustPolicyStatement[] — The statements of the trust policy
      - `Effect` string — The effect of trust policy statement
      - `Action` string[] — The action of trust policy statement
      - `Principal` unknown
      - `Condition` unknown

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `409` — Status conflict
- `429` — Rate limited

## Changes

- **2026-02-28** `69c5c9aafe78` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/destinations/projects/:projKey/environments/:envKey/generate-trust-policy/post.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
