flagsmith Webhooks API

Configure webhooks for environments and organisations to receive notifications about flag changes and audit log events.

Business capability
Webhook & Event Subscription Management BC-4270.80

Operations 21

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /environments/{environment_api_key}/webhooks/ List environment webhooks (unversioned path) · List environment webhooks #
Ask an LLM
“Which webhooks receive flag evaluation data for identified users in my environment, via the unversioned path?”
“Can I see the environment webhooks list without the /api/v1 prefix?”
Tell an agent
Using the unversioned route, list webhooks for environment {environment_api_key}.
Show the identity evaluation webhooks on environment {environment_api_key} from the non-v1 endpoint.
POST /environments/{environment_api_key}/webhooks/ Add an environment webhook (unversioned path) · Create an environment webhook #
Ask an LLM
“How can I get flag evaluation data POSTed to my URL whenever identities are evaluated?”
“Can I sign environment webhook payloads with a secret when creating one on the unversioned route?”
Tell an agent
On the unversioned route, add a webhook to environment {environment_api_key} that posts to {url}.
Create an identity evaluation webhook for {environment_api_key} at {url} signed with secret {secret}, non-v1 path.
GET /organisations/{organisation_id}/webhooks/ List organisation audit webhooks (unversioned) · List organisation webhooks #
Ask an LLM
“Which webhooks receive audit log events for my whole organisation, from the unversioned path?”
“Is there a non-v1 endpoint to list an organisation's audit webhooks?”
Tell an agent
Via the unversioned route, list audit log webhooks for organisation {organisation_id}.
Show organisation {organisation_id}'s audit webhooks from the non-v1 endpoint.
POST /organisations/{organisation_id}/webhooks/ Add an organisation audit webhook (unversioned) · Create an organisation webhook #
Ask an LLM
“How do I stream audit log events for changes across my organisation to my own URL?”
“Can the unversioned organisation webhook create call take a signing secret?”
Tell an agent
Using the unversioned route, create an audit log webhook for organisation {organisation_id} posting to {url}.
Send organisation {organisation_id} audit events to {url} signed with {secret}, non-v1 path.
POST /api/v1/cb-webhook/ Receive Chargebee subscription webhooks · Api v1 cb webhook create #
Ask an LLM
“What endpoint handles incoming Chargebee billing webhooks for subscription changes?”
“How are Chargebee payment failures used to detect subscriptions in dunning?”
Tell an agent
Deliver this Chargebee subscription event to the billing webhook receiver.
Process the Chargebee payment failure notification to update dunning state.
POST /api/v1/cohort-sync/mixpanel/webhook/ Receive a Mixpanel cohort sync · Api v1 cohort sync mixpanel webhook create #
Ask an LLM
“How does Mixpanel push cohort membership into Flagsmith each sync cycle?”
“Can the Mixpanel sync send only added and removed members instead of the full list?”
Tell an agent
Apply the Mixpanel cohort sync action {action} with parameters {parameters}.
Ingest this Mixpanel cohort membership payload {parameters}.
POST /api/v1/cohort-sync/webhook/cohorts/{id}/members/add/ Add members to a CSV cohort · Api v1 cohort sync webhook cohorts members add create #
Ask an LLM
“How do I add identities to an existing CSV cohort without re-uploading the file?”
“Is it safe to retry adding a member who is already in the cohort?”
Tell an agent
Add identifiers {identifiers} to cohort {id}.
Put these users {identifiers} into CSV cohort {id} through the sync webhook.
POST /api/v1/cohort-sync/webhook/cohorts/{id}/members/remove/ Remove members from a CSV cohort · Api v1 cohort sync webhook cohorts members remove create #
Ask an LLM
“How can I take specific identities out of a CSV cohort?”
“What happens if I remove someone who isn't a member of the cohort?”
Tell an agent
Remove identifiers {identifiers} from cohort {id}.
Drop these users {identifiers} out of CSV cohort {id}.
GET /api/v1/environments/{environment_api_key}/webhooks/ List an environment's webhooks (v1) · Api v1 environments webhooks list #
Ask an LLM
“What webhooks are set up on my environment in the v1 API?”
“Can I check which of an environment's webhooks are enabled?”
Tell an agent
List the v1 webhooks for environment {environment_api_key}.
Show every webhook configured on environment {environment_api_key} with its enabled status.
POST /api/v1/environments/{environment_api_key}/webhooks/ Create an environment webhook (v1) · Api v1 environments webhooks create #
Ask an LLM
“How do I add a webhook to an environment through the v1 API?”
“Can I create an environment webhook disabled so it doesn't fire yet?”
Tell an agent
Create a v1 webhook on environment {environment_api_key} pointing to {url}.
Add webhook {url} to environment {environment_api_key} with enabled set to {enabled}.
PUT /api/v1/environments/{environment_api_key}/webhooks/{id}/ Replace an environment webhook · Api v1 environments webhooks update #
Ask an LLM
“How do I fully replace an environment webhook's URL and settings?”
“Does a full update of an environment webhook require the URL again?”
Tell an agent
Replace environment {environment_api_key} webhook {id} so it posts to {url}.
Overwrite webhook {id} on {environment_api_key} with URL {url} and secret {secret}.
PATCH /api/v1/environments/{environment_api_key}/webhooks/{id}/ Edit part of an environment webhook · Api v1 environments webhooks partial update #
Ask an LLM
“Can I just switch off an environment webhook without changing its URL?”
“What's the way to rotate only the secret on an environment webhook?”
Tell an agent
Set enabled to {enabled} on webhook {id} in environment {environment_api_key}.
Change only the secret of environment webhook {id} on {environment_api_key} to {secret}.
DELETE /api/v1/environments/{environment_api_key}/webhooks/{id}/ Delete an environment webhook · Api v1 environments webhooks destroy #
Ask an LLM
“How do I remove a webhook from an environment?”
“Can I delete an environment webhook I no longer need?”
Tell an agent destructive · confirm first
Delete webhook {id} from environment {environment_api_key}.
Remove the environment webhook {id} on {environment_api_key} permanently.
POST /api/v1/github-webhook/ Receive GitHub integration webhooks · Api v1 github webhook create #
Ask an LLM
“Which endpoint receives events from the GitHub integration?”
“Where should the GitHub app deliver its webhook events?”
Tell an agent
Deliver this GitHub event to the GitHub webhook receiver.
Forward the incoming GitHub webhook payload for processing.
GET /api/v1/organisations/{organisation_pk}/webhooks/ List organisation webhooks (v1) · Api v1 organisations webhooks list #
Ask an LLM
“What webhooks does my organisation have in the v1 API?”
“Can I page through an organisation's webhooks?”
Tell an agent
List the v1 webhooks for organisation {organisation_pk}.
Show page {page} of organisation {organisation_pk}'s webhooks.
POST /api/v1/organisations/{organisation_pk}/webhooks/ Create an organisation webhook (v1) · Api v1 organisations webhooks create #
Ask an LLM
“How do I add an organisation-level webhook with the v1 API?”
“Can a new v1 organisation webhook start out disabled?”
Tell an agent
Create a v1 webhook for organisation {organisation_pk} posting to {url}.
Add organisation webhook {url} to {organisation_pk} with enabled {enabled}.
GET /api/v1/organisations/{organisation_pk}/webhooks/{id}/ Get an organisation webhook · Api v1 organisations webhooks retrieve #
Ask an LLM
“What URL and status does a specific organisation webhook have?”
“Can I look up one organisation webhook by its ID?”
Tell an agent
Get webhook {id} of organisation {organisation_pk}.
Show the details of organisation {organisation_pk}'s webhook {id}.
PUT /api/v1/organisations/{organisation_pk}/webhooks/{id}/ Replace an organisation webhook · Api v1 organisations webhooks update #
Ask an LLM
“How do I fully replace an organisation webhook's configuration?”
“Must I resend the URL when replacing an organisation webhook?”
Tell an agent
Replace organisation {organisation_pk} webhook {id} so it posts to {url}.
Overwrite org webhook {id} in {organisation_pk} with URL {url} and secret {secret}.
PATCH /api/v1/organisations/{organisation_pk}/webhooks/{id}/ Edit part of an organisation webhook · Api v1 organisations webhooks partial update #
Ask an LLM
“Can I pause an organisation webhook by just flipping enabled?”
“Is there a way to change only an organisation webhook's URL?”
Tell an agent
Set enabled to {enabled} on organisation {organisation_pk} webhook {id}.
Point org webhook {id} in {organisation_pk} at new URL {url}, leaving the rest unchanged.
DELETE /api/v1/organisations/{organisation_pk}/webhooks/{id}/ Delete an organisation webhook · Api v1 organisations webhooks destroy #
Ask an LLM
“How do I stop audit events going to an old organisation webhook by deleting it?”
“Can I remove an organisation webhook entirely?”
Tell an agent destructive · confirm first
Delete webhook {id} from organisation {organisation_pk}.
Remove organisation {organisation_pk}'s webhook {id} permanently.
POST /api/v1/webhooks/test/ Send a test webhook · Api v1 webhooks test create #
Ask an LLM
“Can I fire a test payload at a webhook URL before saving it?”
“How do I check my endpoint accepts webhook requests signed with my secret?”
Tell an agent
Send a test webhook to {webhook_url} for scope {scope}.
Test {webhook_url} with scope {scope} signing it with {secret}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/flagsmith:flagsmith-webhooks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

flagsmith-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Flagsmith Webhooks API
  version: '1.0'
  description: 'Operations tagged Webhooks across 2 of this provider''s published API definitions: flagsmith-admin-api-openapi.yml, flagsmith-api-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.flagsmith.com/api/v1
  description: Flagsmith Production API
tags:
- name: Webhooks
  description: Configure webhooks for environments and organisations to receive notifications about flag changes and audit log events.
paths:
  /environments/{environment_api_key}/webhooks/:
    get:
      operationId: listEnvironmentWebhooks
      summary: List environment webhooks
      description: Retrieves a list of all webhooks configured for a specific environment. Environment webhooks receive flag evaluation data for identified users.
      tags:
      - Webhooks
      parameters:
      - $ref: '#/components/parameters/EnvironmentApiKey'
      responses:
        '200':
          description: Successful response containing a list of webhooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '401':
          description: Unauthorized - invalid or missing API token
      security:
      - apiKeyAuth: []
    post:
      operationId: createEnvironmentWebhook
      summary: Create an environment webhook
      description: Creates a new webhook for an environment. The webhook will receive POST requests containing flag evaluation data whenever identities are evaluated.
      tags:
      - Webhooks
      parameters:
      - $ref: '#/components/parameters/EnvironmentApiKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookInput'
      responses:
        '201':
          description: Webhook created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid or missing API token
      security:
      - apiKeyAuth: []
    servers:
    - url: https://api.flagsmith.com/api/v1
      description: Flagsmith Production API
  /organisations/{organisation_id}/webhooks/:
    get:
      operationId: listOrganisationWebhooks
      summary: List organisation webhooks
      description: Retrieves a list of all webhooks configured for a specific organisation. Organisation webhooks receive audit log events for changes made across the organisation.
      tags:
      - Webhooks
      parameters:
      - $ref: '#/components/parameters/OrganisationId'
      responses:
        '200':
          description: Successful response containing a list of webhooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '401':
          description: Unauthorized - invalid or missing API token
      security:
      - apiKeyAuth: []
    post:
      operationId: createOrganisationWebhook
      summary: Create an organisation webhook
      description: Creates a new webhook for an organisation. The webhook will receive POST requests containing audit log events for changes made across the organisation.
      tags:
      - Webhooks
      parameters:
      - $ref: '#/components/parameters/OrganisationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookInput'
      responses:
        '201':
          description: Webhook created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Bad request - validation error
        '401':
          description: Unauthorized - invalid or missing API token
      security:
      - apiKeyAuth: []
    servers:
    - url: https://api.flagsmith.com/api/v1
      description: Flagsmith Production API
  /api/v1/cb-webhook/:
    post:
      operationId: api_v1_cb_webhook_create
      description: 'Endpoint to handle webhooks from chargebee.


        Payment failure and payment succeeded webhooks are filtered out and processed

        to determine which of our subscriptions are in a dunning state.


        The remaining webhooks are processed if they have subscription data:


        - If subscription is active, check to see if plan has changed and update if so. Always update cancellation date to

        None to ensure that if a subscription is reactivated, it is updated on our end.


        - If subscription is cancelled or not renewing, update subscription on our end to include cancellation date and

        send alert to admin users.'
      tags:
      - Webhooks
      security:
      - basicAuth: []
      responses:
        '200':
          description: No response body
      summary: Api v1 cb webhook create
      x-summary-source: derived
  /api/v1/cohort-sync/mixpanel/webhook/:
    post:
      operationId: api_v1_cohort_sync_mixpanel_webhook_create
      description: Called by Mixpanel every sync cycle with the cohort's full membership (`members`) or the changes since the last sync (`add_members`/`remove_members`).
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MixpanelWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MixpanelWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MixpanelWebhook'
        required: true
      security:
      - Cohort Sync Key: []
      - Cohort Sync Key (Basic): []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MixpanelWebhookResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MixpanelWebhookFailureResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MixpanelWebhookFailureResponse'
          description: ''
      x-flagsmith-minimum-plan: START_UP
      summary: Api v1 cohort sync mixpanel webhook create
      x-summary-source: derived
  /api/v1/cohort-sync/webhook/cohorts/{id}/members/add/:
    post:
      operationId: api_v1_cohort_sync_webhook_cohorts_members_add_create
      description: Add members to a CSV cohort. Accepted deltas are applied to identity data asynchronously. Re-adding a member is a no-op, so retries are safe.
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
        required: true
      security:
      - Cohort Sync Key: []
      - Cohort Sync Key (Basic): []
      responses:
        '200':
          description: No response body
      x-flagsmith-minimum-plan: START_UP
      summary: Api v1 cohort sync webhook cohorts members add create
      x-summary-source: derived
  /api/v1/cohort-sync/webhook/cohorts/{id}/members/remove/:
    post:
      operationId: api_v1_cohort_sync_webhook_cohorts_members_remove_create
      description: Remove members from a CSV cohort. Accepted deltas are applied to identity data asynchronously. Removing a non-member is a no-op, so retries are safe.
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WebhookSyncMembers'
        required: true
      security:
      - Cohort Sync Key: []
      - Cohort Sync Key (Basic): []
      responses:
        '200':
          description: No response body
      x-flagsmith-minimum-plan: START_UP
      summary: Api v1 cohort sync webhook cohorts members remove create
      x-summary-source: derived
  /api/v1/environments/{environment_api_key}/webhooks/:
    get:
      operationId: api_v1_environments_webhooks_list
      description: Manage webhooks for an environment.
      parameters:
      - in: path
        name: environment_api_key
        schema:
          type: string
        required: true
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook_2'
          description: ''
      summary: Api v1 environments webhooks list
      x-summary-source: derived
    post:
      operationId: api_v1_environments_webhooks_create
      description: Manage webhooks for an environment.
      parameters:
      - in: path
        name: environment_api_key
        schema:
          type: string
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Webhook_2'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Webhook_2'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Webhook_2'
        required: true
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook_2'
          description: ''
      summary: Api v1 environments webhooks create
      x-summary-source: derived
  /api/v1/environments/{environment_api_key}/webhooks/{id}/:
    put:
      operationId: api_v1_environments_webhooks_update
      description: Manage webhooks for an environment.
      parameters:
      - in: path
        name: environment_api_key
        schema:
          type: string
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this webhook.
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Webhook_2'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Webhook_2'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Webhook_2'
        required: true
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook_2'
          description: ''
      summary: Api v1 environments webhooks update
      x-summary-source: derived
    patch:
      operationId: api_v1_environments_webhooks_partial_update
      description: Manage webhooks for an environment.
      parameters:
      - in: path
        name: environment_api_key
        schema:
          type: string
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this webhook.
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWebhook'
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook_2'
          description: ''
      summary: Api v1 environments webhooks partial update
      x-summary-source: derived
    delete:
      operationId: api_v1_environments_webhooks_destroy
      description: Manage webhooks for an environment.
      parameters:
      - in: path
        name: environment_api_key
        schema:
          type: string
        required: true
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this webhook.
        required: true
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '204':
          description: No response body
      summary: Api v1 environments webhooks destroy
      x-summary-source: derived
  /api/v1/github-webhook/:
    post:
      operationId: api_v1_github_webhook_create
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      - {}
      responses:
        '200':
          description: No response body
      summary: Api v1 github webhook create
      x-summary-source: derived
  /api/v1/organisations/{organisation_pk}/webhooks/:
    get:
      operationId: api_v1_organisations_webhooks_list
      parameters:
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganisationWebhookList'
          description: ''
      summary: Api v1 organisations webhooks list
      x-summary-source: derived
    post:
      operationId: api_v1_organisations_webhooks_create
      parameters:
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
        required: true
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationWebhook'
          description: ''
      summary: Api v1 organisations webhooks create
      x-summary-source: derived
  /api/v1/organisations/{organisation_pk}/webhooks/{id}/:
    get:
      operationId: api_v1_organisations_webhooks_retrieve
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this organisation webhook.
        required: true
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationWebhook'
          description: ''
      summary: Api v1 organisations webhooks retrieve
      x-summary-source: derived
    put:
      operationId: api_v1_organisations_webhooks_update
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this organisation webhook.
        required: true
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrganisationWebhook'
        required: true
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationWebhook'
          description: ''
      summary: Api v1 organisations webhooks update
      x-summary-source: derived
    patch:
      operationId: api_v1_organisations_webhooks_partial_update
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this organisation webhook.
        required: true
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOrganisationWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedOrganisationWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedOrganisationWebhook'
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationWebhook'
          description: ''
      summary: Api v1 organisations webhooks partial update
      x-summary-source: derived
    delete:
      operationId: api_v1_organisations_webhooks_destroy
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this organisation webhook.
        required: true
      - in: path
        name: organisation_pk
        schema:
          type: integer
        required: true
      tags:
      - Webhooks
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '204':
          description: No response body
      summary: Api v1 organisations webhooks destroy
      x-summary-source: derived
  /api/v1/webhooks/test/:
    post:
      operationId: api_v1_webhooks_test_create
      tags:
      - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TestWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TestWebhook'
        required: true
      security:
      - tokenAuth: []
      - Master API Key: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookSuccessResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookErrorResponse'
          description: ''
      summary: Api v1 webhooks test create
      x-summary-source: derived
components:
  parameters:
    EnvironmentApiKey:
      name: environment_api_key
      in: path
      description: The API key for the environment
      required: true
      schema:
        type: string
    OrganisationId:
      name: organisation_id
      in: path
      description: The unique identifier for the organisation
      required: true
      schema:
        type: integer
  schemas:
    WebhookInput:
      type: object
      description: Input object for creating or updating a webhook
      required:
      - url
      properties:
        url:
          type: string
          format: uri
          description: The URL to send webhook events to
        enabled:
          type: boolean
          description: Whether the webhook should be enabled
        secret:
          type: string
          description: Optional secret for signing webhook payloads with HMAC-SHA256
    Webhook:
      type: object
      description: A webhook configuration for receiving event notifications from Flagsmith.
      properties:
        id:
          type: integer
          description: The unique identifier for this webhook
        url:
          type: string
          format: uri
          description: The URL to send webhook events to
        enabled:
          type: boolean
          description: Whether the webhook is currently enabled
        created_at:
          type: string
          format: date-time
          description: When the webhook was created
        updated_at:
          type: string
          format: date-time
          description: When the webhook was last updated
        secret:
          type: string
          description: Optional secret used to sign webhook payloads with HMAC-SHA256 for verification
    PatchedWebhook:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        url:
          type: string
          format: uri
          maxLength: 200
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        secret:
          type: string
          maxLength: 255
    WebhookScopeTypeEnum:
      enum:
      - organisation
      - environment
      type: string
      description: '* `organisation` - organisation

        * `environment` - environment'
    TestWebhook:
      type: object
      properties:
        webhook_url:
          type: string
          format: uri
        scope:
          $ref: '#/components/schemas/Scope'
        secret:
          type:
          - string
          - 'null'
      required:
      - scope
      - webhook_url
    TestWebhookSuccessResponse:
      type: object
      properties:
        detail:
          type: string
        status:
          type: integer
          default: 200
      required:
      - detail
    ActionEnum:
      enum:
      - members
      - add_members
      - remove_members
      type: string
      description: '* `members` - members

        * `add_members` - add_members

        * `remove_members` - remove_members'
    MixpanelParameters:
      type: object
      properties:
        mixpanel_cohort_id:
          type: string
          maxLength: 255
        mixpanel_cohort_name:
          type: string
          maxLength: 2000
        members:
          type: array
          items:
            $ref: '#/components/schemas/MixpanelMember'
      required:
      - members
      - mixpanel_cohort_id
      - mixpanel_cohort_name
    MixpanelMember:
      type: object
      properties:
        mixpanel_distinct_id:
          type: string
      required:
      - mixpanel_distinct_id
    OrganisationWebhook:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        url:
          type: string
          format: uri
          maxLength: 200
        enabled:
          type: boolean
        secret:
          type: string
          maxLength: 255
        created_at:
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
      required:
      - url
    Webhook_2:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        url:
          type: string
          format: uri
          maxLength: 200
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        secret:
          type: string
          maxLength: 255
      required:
      - url
    WebhookSyncMembers:
      type: object
      properties:
        identifiers:
          type: array
          items:
            type: string
          description: Identity identifiers, each at most 1024 bytes of UTF-8.
          maxItems: 10000
          minItems: 1
      required:
      - identifiers
    MixpanelWebhookError:
      type: object
      properties:
        message:
          type: string
        code:
          type: integer
      required:
      - code
      - message
    PatchedOrganisationWebhook:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        url:
          type: string
          format: uri
          maxLength: 200
        enabled:
          type: boolean
        secret:
          type: string
          maxLength: 255
        created_at:
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
    MixpanelWebhookResponse:
      type: object
      properties:
        action:
          type: string
        status:
          type: string
      required:
      - action
      - status
    TestWebhookErrorResponse:
      type: object
      properties:
        detail:
          type: string
        status:
          type: integer
        body:
          type:
          - string
          - 'null'
      required:
      - detail
      - status
    MixpanelWebhookFailureResponse:
      type: object
      properties:
        action:
          type:
          - string
          - 'null'
        status:
          type: string
        error:
          $ref: '#/components/schemas/MixpanelWebhookError'
      required:
      - action
      - error
      - status
    PaginatedOrganisationWebhookList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationWebhook'
    MixpanelWebhook:
      type: object
      properties:
        action:
          $ref: '#/components/schemas/ActionEnum'
        parameters:
          $ref: '#/components/schemas/MixpanelParameters'
      required:
      - action
      - parameters
    Scope:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/WebhookScopeTypeEnum'
      required:
      - type
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: A secret Organisation API Token prefixed with 'Api-Key'. For example, 'Api-Key your-token-here'. This token should never be exposed in client-side code.
    Cohort_Sync_Key:
      type: http
      scheme: bearer
      description: For cohort sync endpoints called by an external cohort source, such as Amplitude.
    Cohort_Sync_Key__Basic:
      type: http
      scheme: basic
      description: For cohort sync endpoints called by an external cohort source that can only send Basic credentials, such as Mixpanel. The key is the password; the username is ignored.
    Environment_API_Key:
      type: apiKey
      in: header
      name: X-Environment-Key
      description: For SDK endpoints. <a href='https://docs.flagsmith.com/clients/rest#public-api-endpoints'>Find out more</a>.
    Master_API_Key:
      type: apiKey
      in: header
      name: Authorization
      description: For Management API endpoints. <a href='https://docs.flagsmith.com/integrating-with-flagsmith/flagsmith-api-overview/management-api'>Find out more</a>.
    basicAuth:
      type: http
      scheme: basic
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
externalDocs:
  description: Flagsmith Admin API Documentation
  url: https://docs.flagsmith.com/integrating-with-flagsmith/flagsmith-api-overview/admin-api
x-refined-from:
- flagsmith-admin-api-openapi.yml
- flagsmith-api-openapi.json