{
  "openapi": "3.1.0",
  "info": {
    "title": "Events",
    "version": "2026-10-08",
    "description": "Subscribe to events generated by Motor. Currently supports feature flag events only. This is separate from the planned webhook service for customer-generated events."
  },
  "servers": [
    {
      "url": "https://api.motor.dev/meta"
    }
  ],
  "security": [
    {
      "SecretKey": []
    }
  ],
  "tags": [
    {
      "name": "Event subscriptions"
    }
  ],
  "paths": {
    "/event_subscriptions": {
      "post": {
        "operationId": "createEventSubscription",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Create a event subscription",
        "description": "Creates an endpoint for signed events. The response shows the signing secret once. Credentials: a secret key.",
        "parameters": [
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "A public HTTPS URL on port 443, at most 2,048 bytes, without credentials or a fragment.",
                    "maxLength": 2048
                  },
                  "events": {
                    "type": "array",
                    "description": "Event types, or `feature_flags.*`.",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "environment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "motor",
                      "slack",
                      "discord",
                      "teams"
                    ]
                  }
                },
                "required": [
                  "url",
                  "events",
                  "environment_ids"
                ],
                "additionalProperties": false
              },
              "example": {
                "url": "https://hooks.example.com/motor",
                "events": [
                  "feature_flags.*"
                ],
                "environment_ids": [
                  "ffe_UJAs9eZep7hvba6xBh5dvY"
                ],
                "description": "Deploy bot"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "Location": {
                "description": "The URL of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is a replay of a previously recorded response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionSecret"
                },
                "example": {
                  "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                  "url": "https://hooks.example.com/motor",
                  "events": [
                    "feature_flags.*"
                  ],
                  "environment_ids": [
                    "ffe_UJAs9eZep7hvba6xBh5dvY"
                  ],
                  "description": "Deploy bot",
                  "enabled": true,
                  "disabled_reason": null,
                  "format": "motor",
                  "version": "1",
                  "secret_rotation_ends_at": null,
                  "created_at": "2026-10-05T00:08:33Z",
                  "updated_at": "2026-10-05T00:08:33Z",
                  "secret": "whsec_EXAMPLE_NOT_A_REAL_SECRET"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      },
      "get": {
        "operationId": "listEventSubscriptions",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "List event subscriptions",
        "description": "Lists the team's endpoints. Credentials: a secret key.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page: 1 to 200. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` value returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionList"
                },
                "example": {
                  "data": [
                    {
                      "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                      "url": "https://hooks.example.com/motor",
                      "events": [
                        "feature_flags.*"
                      ],
                      "environment_ids": [
                        "ffe_UJAs9eZep7hvba6xBh5dvY"
                      ],
                      "description": "Deploy bot",
                      "enabled": true,
                      "disabled_reason": null,
                      "format": "motor",
                      "version": "1",
                      "secret_rotation_ends_at": null,
                      "created_at": "2026-10-05T00:08:33Z",
                      "updated_at": "2026-10-05T00:08:33Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/event_subscriptions/{endpoint_id}": {
      "get": {
        "operationId": "getEventSubscription",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Get a event subscription",
        "description": "Returns an endpoint. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscription"
                },
                "example": {
                  "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                  "url": "https://hooks.example.com/motor",
                  "events": [
                    "feature_flags.*"
                  ],
                  "environment_ids": [
                    "ffe_UJAs9eZep7hvba6xBh5dvY"
                  ],
                  "description": "Deploy bot",
                  "enabled": true,
                  "disabled_reason": null,
                  "format": "motor",
                  "version": "1",
                  "secret_rotation_ends_at": null,
                  "created_at": "2026-10-05T00:08:33Z",
                  "updated_at": "2026-10-05T00:08:33Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      },
      "patch": {
        "operationId": "updateEventSubscription",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Update a event subscription",
        "description": "Changes an endpoint. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "A public HTTPS URL on port 443, at most 2,048 bytes, without credentials or a fragment.",
                    "maxLength": 2048
                  },
                  "events": {
                    "type": "array",
                    "description": "Event types, or `feature_flags.*`.",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "environment_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "motor",
                      "slack",
                      "discord",
                      "teams"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "description": "Deploy notifications"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscription"
                },
                "example": {
                  "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                  "url": "https://hooks.example.com/motor",
                  "events": [
                    "feature_flags.*"
                  ],
                  "environment_ids": [
                    "ffe_UJAs9eZep7hvba6xBh5dvY"
                  ],
                  "description": "Deploy notifications",
                  "enabled": true,
                  "disabled_reason": null,
                  "format": "motor",
                  "version": "2",
                  "secret_rotation_ends_at": null,
                  "created_at": "2026-10-05T00:08:33Z",
                  "updated_at": "2026-10-05T00:08:42Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "412": {
            "$ref": "#/components/responses/Error412"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "428": {
            "$ref": "#/components/responses/Error428"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteEventSubscription",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Delete a event subscription",
        "description": "Deletes an endpoint and cancels its pending deliveries. A delivery already in progress may still complete; `in_flight_may_complete` indicates whether there was an active delivery when deletion began. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionDeleted"
                },
                "example": {
                  "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                  "deleted": true,
                  "in_flight_may_complete": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "412": {
            "$ref": "#/components/responses/Error412"
          },
          "428": {
            "$ref": "#/components/responses/Error428"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/event_subscriptions/{endpoint_id}/rotate_secret": {
      "post": {
        "operationId": "rotateEventSubscriptionSecret",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Rotate a signing secret",
        "description": "Creates a new signing secret and returns it in this response. During the rotation overlap period, each delivery includes signatures made with both the old and new secrets. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlap_seconds": {
                    "type": "integer",
                    "description": "0 to 86,400. Default 86,400.",
                    "minimum": 0,
                    "maximum": 86400
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "overlap_seconds": 3600
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is a replay of a previously recorded response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionSecret"
                },
                "example": {
                  "id": "whe_V1nN1KXCbpCbzw7NKeYxfs",
                  "url": "https://hooks.example.com/motor",
                  "events": [
                    "feature_flags.*"
                  ],
                  "environment_ids": [
                    "ffe_UJAs9eZep7hvba6xBh5dvY"
                  ],
                  "description": "Deploy notifications",
                  "enabled": true,
                  "disabled_reason": null,
                  "format": "motor",
                  "version": "3",
                  "secret_rotation_ends_at": "2026-10-05T01:08:45Z",
                  "created_at": "2026-10-05T00:08:33Z",
                  "updated_at": "2026-10-05T00:08:45Z",
                  "secret": "whsec_EXAMPLE_NOT_A_REAL_SECRET"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "412": {
            "$ref": "#/components/responses/Error412"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "428": {
            "$ref": "#/components/responses/Error428"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/event_subscriptions/{endpoint_id}/test": {
      "post": {
        "operationId": "testEventSubscription",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Send a test event",
        "description": "Queues a `feature_flags.webhook.test` event without customer values. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is a replay of a previously recorded response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                },
                "example": {
                  "event_id": "evt_L7MD1mLYvKdP2yCi77gZpR",
                  "endpoint_id": "whe_V1nN1KXCbpCbzw7NKeYxfs"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/event_subscriptions/{endpoint_id}/deliveries": {
      "get": {
        "operationId": "listEventDeliveries",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "List deliveries",
        "description": "Lists an endpoint's deliveries with their attempts, newest first, for 30 days. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page: 1 to 200. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` value returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDeliveryList"
                },
                "example": {
                  "data": [
                    {
                      "id": "whd_L7MD1mLYvKdP2yCi77gZpR",
                      "event_id": "evt_L7MD1mLYvKdP2yCi77gZpR",
                      "status": "pending",
                      "attempt_count": 0,
                      "next_attempt_at": "2026-10-05T00:08:48Z",
                      "attempts": [],
                      "created_at": "2026-10-05T00:08:48Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/event_subscriptions/{endpoint_id}/deliveries/{delivery_id}/retry": {
      "post": {
        "operationId": "retryEventDelivery",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Retry a delivery",
        "description": "Queues a new attempt of a delivery's original event. Credentials: a secret key.",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is a replay of a previously recorded response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDelivery"
                },
                "example": {
                  "id": "whd_LFdyqiU6BRRRF1C51Jng4Q",
                  "event_id": "evt_L7MD1mLYvKdP2yCi77gZpR"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "List events",
        "description": "Lists the team's events, newest first, for 30 days. Credentials: a secret key.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results per page: 1 to 200. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` value returned by the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                },
                "example": {
                  "data": [
                    {
                      "id": "evt_L7MD1mLYvKdP2yCi77gZpR",
                      "type": "feature_flags.webhook.test",
                      "created_at": "2026-10-05T00:08:48Z",
                      "team_id": "team_AFybMp6KhJzT6pZKvZteA5",
                      "environment_id": null,
                      "revision": null,
                      "data": {
                        "endpoint_id": "whe_V1nN1KXCbpCbzw7NKeYxfs"
                      }
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    },
    "/events/{event_id}": {
      "get": {
        "operationId": "getEvent",
        "tags": [
          "Event subscriptions"
        ],
        "summary": "Get an event",
        "description": "Returns an event. Credentials: a secret key.",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MotorMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "ETag": {
                "description": "The ETag identifying this resource or configuration revision. Use it for conditional requests.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                },
                "example": {
                  "id": "evt_L7MD1mLYvKdP2yCi77gZpR",
                  "type": "feature_flags.webhook.test",
                  "created_at": "2026-10-05T00:08:48Z",
                  "team_id": "team_AFybMp6KhJzT6pZKvZteA5",
                  "environment_id": null,
                  "revision": null,
                  "data": {
                    "endpoint_id": "whe_V1nN1KXCbpCbzw7NKeYxfs"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          }
        },
        "security": [
          {
            "SecretKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SecretKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Motor secret key, `motor_sk_...`. Keep it on your server."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and body returns the recorded response for 35 days, with `Idempotency-Replayed: true`; another body with the same key is `409`. Use a new key for a new operation.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "IfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": true,
        "description": "The `ETag` of the resource, or of the environment for configuration changes. A changed tag is `412`; a missing header is `428`.",
        "schema": {
          "type": "string"
        }
      },
      "MotorMode": {
        "name": "Motor-Mode",
        "in": "header",
        "required": false,
        "description": "The feature flags API does not support test mode. Omit this header or set it to `live`. Requests with `test` are rejected before processing or billing. Use a separate environment, such as staging, for tests.",
        "schema": {
          "type": "string",
          "enum": [
            "live"
          ]
        }
      }
    },
    "responses": {
      "Error401": {
        "description": "The credential is missing, invalid, expired, or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error404": {
        "description": "The resource doesn't exist, or belongs to another team.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error409": {
        "description": "The request conflicts with the current state, such as `resource_in_use`, `approval_required`, or a key that exists.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error412": {
        "description": "The `If-Match` tag or the base revision is stale (`revision_conflict`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error422": {
        "description": "A field isn't valid. The message names its JSON path.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error428": {
        "description": "The request needs `If-Match`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Error429": {
        "description": "Too many requests. `Retry-After` gives the seconds to wait.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        }
      }
    },
    "schemas": {
      "Time": {
        "type": "string",
        "description": "A UTC time in RFC 3339, such as `2026-10-05T00:00:00Z`.",
        "format": "date-time"
      },
      "JsonValue": {
        "description": "Any JSON value."
      },
      "Problem": {
        "type": "object",
        "description": "An error. The response has no other data.",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable code, such as `invalid_field`, `not_found`, `revision_conflict`, `resource_in_use`, `limit_reached`, or `rate_limited`."
              },
              "message": {
                "type": "string",
                "description": "What went wrong and what to do, in English."
              },
              "references": {
                "type": "array",
                "description": "For `resource_in_use`: up to 20 keys of resources that refer to this one.",
                "items": {
                  "type": "string"
                }
              },
              "has_more": {
                "type": "boolean",
                "description": "For `resource_in_use`: whether more resources refer to this one."
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "EventSubscriptionSecret": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "environment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "disabled_reason": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "format": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "secret_rotation_ends_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "environment_ids",
          "description",
          "enabled",
          "disabled_reason",
          "format",
          "version",
          "secret_rotation_ends_at",
          "created_at",
          "updated_at",
          "secret"
        ],
        "additionalProperties": false
      },
      "EventSubscriptionList": {
        "type": "object",
        "description": "A single page of results.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventSubscription"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass this value as `cursor` to fetch the next page. A null value means there are no more results."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "EventSubscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "environment_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "disabled_reason": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "format": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "secret_rotation_ends_at": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "environment_ids",
          "description",
          "enabled",
          "disabled_reason",
          "format",
          "version",
          "secret_rotation_ends_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "EventSubscriptionDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "in_flight_may_complete": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "deleted",
          "in_flight_may_complete"
        ],
        "additionalProperties": false
      },
      "Event": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string"
          },
          "endpoint_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "team_id": {
            "type": "string"
          },
          "environment_id": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "revision": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "data": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "additionalProperties": false
      },
      "EventDeliveryList": {
        "type": "object",
        "description": "A single page of results.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventDelivery"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass this value as `cursor` to fetch the next page. A null value means there are no more results."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "EventDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "attempt_count": {
            "type": "integer"
          },
          "next_attempt_at": {
            "type": "string"
          },
          "attempts": {
            "type": "array",
            "items": {}
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_id"
        ],
        "additionalProperties": false
      },
      "EventList": {
        "type": "object",
        "description": "A single page of results.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass this value as `cursor` to fetch the next page. A null value means there are no more results."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      }
    }
  }
}
