---
title: "Create audit log subscription"
method: POST
path: "/api/v2/integrations/{integrationKey}"
tags: ["Integration audit log subscriptions"]
---

# Create audit log subscription

`POST /api/v2/integrations/{integrationKey}`

Create an audit log subscription.<br /><br />For each subscription, you must specify the set of resources you wish to subscribe to audit log notifications for. You can describe these resources using a custom role policy. To learn more, read [Custom role concepts](https://launchdarkly.com/docs/home/account/role-concepts).

## Path parameters

- `integrationKey` string, string, required — The integration key

## Request body

- SubscriptionPost
  - `name` string, required — A human-friendly name for your audit log subscription.
  - `statements` StatementPost[]
    - `resources` string[] — Resource specifier strings
    - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> field must be empty to use this field.
    - `actions` ActionSpecifier[] — Actions to perform on a resource
    - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> field must be empty to use this field.
    - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
  - `on` boolean — Whether or not you want your subscription to actively send events.
  - `tags` string[] — An array of tags for this subscription.
  - `config` object, required — The unique set of fields required to configure an audit log subscription integration of this type. Refer to the <code>formVariables</code> field in the corresponding <code>manifest.json</code> at https://github.com/launchdarkly/integration-framework/tree/main/integrations for a full list of fields for the integration you wish to configure.
  - `url` string — Slack webhook receiver URL. Only necessary for legacy Slack webhook integrations.
  - `apiKey` string — Datadog API key. Only necessary for legacy Datadog webhook integrations.

## Response `201`

Integration response

- Integration
  - `_links` object — The location and content type of related resources
  - `_id` string — The ID for this integration audit log subscription
  - `kind` string — The type of integration
  - `name` string — A human-friendly name for the integration
  - `config` object — Details on configuration for an integration of this type. Refer to the <code>formVariables</code> field in the corresponding <code>manifest.json</code> for a full list of fields for each integration.
  - `statements` Statement[] — Represents a Custom role policy, defining a resource kinds filter the integration audit log subscription responds to.
    - `resources` string[] — Resource specifier strings
    - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
    - `actions` ActionSpecifier[] — Actions to perform on a resource
    - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
    - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
  - `on` boolean — Whether the integration is currently active
  - `tags` string[] — An array of tags for this integration
  - `_access` Access
    - `denied` AccessDenied[], required
      - `action` string, required
      - `reason` AccessDeniedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
    - `allowed` AccessAllowedRep[], required
      - `action` string, required
      - `reason` AccessAllowedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
  - `_status` IntegrationSubscriptionStatusRep
    - `successCount` integer
    - `lastSuccess` integer
    - `lastError` integer
    - `errorCount` integer
    - `errors` IntegrationStatusRep[]
      - `statusCode` integer
      - `responseBody` string
      - `timestamp` integer
  - `url` string — Slack webhook receiver URL. Only used for legacy Slack webhook integrations.
  - `apiKey` string — Datadog API key. Only used for legacy Datadog webhook integrations.

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

---

[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)
