{
  "openapi": "3.0.3",
  "info": {
    "title": "BuzzKit API",
    "version": "1.0.0",
    "description": "The BuzzKit REST API: subscribers, subscriptions, topics, events, segments, messages, workflows, sources and webhooks, all under /v1. Every response is a JSON envelope { success, data, error, metadata }; errors carry a lowercase snake_case code, a message and, when a field is at fault, its param.",
    "contact": {
      "name": "BuzzKit",
      "url": "https://buzzkit.dev",
      "email": "hello@buzzkit.dev"
    },
    "license": {
      "name": "AGPL-3.0",
      "url": "https://github.com/buzzkit-dev/buzzkit/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://api.buzzkit.dev",
      "description": "BuzzKit Cloud"
    },
    {
      "url": "http://localhost:8790",
      "description": "Local development"
    }
  ],
  "externalDocs": {
    "description": "BuzzKit documentation",
    "url": "https://docs.buzzkit.dev"
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from the dashboard. The scopes listed on each operation are the `resource:action` grants a key needs (`messages:send`, `subscribers:read`, `topics:*`, `*`); `account:*` scopes and key management are session-only. Workspace keys (bk_ws_) reach every tenant and pick one with the buzzkit-tenant header; tenant keys (bk_tn_) are locked to one tenant; client keys (bk_pk_) ship inside an app and only work on /v1/client/*."
      }
    },
    "schemas": {
      "Expression": {
        "description": "A segment condition. Groups nest with all, any and not; a leaf compares an attribute, counts an event in a window, tests activity or tests channel reachability.",
        "anyOf": [
          {
            "type": "object",
            "required": [
              "all"
            ],
            "properties": {
              "all": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Expression"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "any"
            ],
            "properties": {
              "any": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Expression"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "not"
            ],
            "properties": {
              "not": {
                "$ref": "#/components/schemas/Expression"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": true
          }
        ]
      },
      "Error": {
        "type": "object",
        "description": "The envelope every error uses. `error.code` is a stable lowercase snake_case code, `error.param` names the offending field when there is one, and `metadata.requestId` is what to quote in support requests.",
        "required": [
          "success",
          "data",
          "error",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "data": {
            "type": "object",
            "nullable": true,
            "description": "Always null on an error."
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "invalid_api_key"
              },
              "message": {
                "type": "string"
              },
              "param": {
                "type": "string",
                "nullable": true
              },
              "details": {
                "type": "array",
                "nullable": true,
                "description": "Present on validation errors: one entry per failing field.",
                "items": {
                  "type": "object",
                  "properties": {
                    "param": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "metadata": {
            "type": "object",
            "required": [
              "timestamp"
            ],
            "properties": {
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/health": {
      "get": {
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getHealth",
        "summary": "Get health",
        "security": []
      }
    },
    "/v1/profile": {
      "get": {
        "tags": [
          "Profile"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getProfile",
        "summary": "Get profile",
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Profile"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateProfile",
        "summary": "Update a profile",
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkspaces",
        "summary": "List workspaces",
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Workspaces"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createWorkspace",
        "summary": "Create a workspace",
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkspace",
        "summary": "Get a workspace",
        "security": [
          {
            "bearerAuth": [
              "workspace:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "nullable": true,
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "nullable": true,
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "avatarUrl": {
                    "nullable": true,
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateWorkspace",
        "summary": "Update a workspace",
        "security": [
          {
            "bearerAuth": [
              "workspace:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkspace",
        "summary": "Delete a workspace",
        "security": [
          {
            "bearerAuth": [
              "workspace:delete"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/members": {
      "get": {
        "tags": [
          "Members"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkspaceMembers",
        "summary": "List workspace members",
        "security": [
          {
            "bearerAuth": [
              "members:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/members/{id}": {
      "get": {
        "tags": [
          "Members"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkspaceMember",
        "summary": "Get a workspace member",
        "security": [
          {
            "bearerAuth": [
              "members:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Members"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin",
                      "owner"
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin",
                      "owner"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin",
                      "owner"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateWorkspaceMember",
        "summary": "Update a workspace member",
        "security": [
          {
            "bearerAuth": [
              "members:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Members"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkspaceMember",
        "summary": "Delete a workspace member",
        "security": [
          {
            "bearerAuth": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/invites": {
      "get": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkspaceInvites",
        "summary": "List workspace invites",
        "security": [
          {
            "bearerAuth": [
              "invites:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin"
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createWorkspaceInvite",
        "summary": "Create a workspace invite",
        "security": [
          {
            "bearerAuth": [
              "invites:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/invites/{id}": {
      "get": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkspaceInvite",
        "summary": "Get a workspace invite",
        "security": [
          {
            "bearerAuth": [
              "invites:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkspaceInvite",
        "summary": "Delete a workspace invite",
        "security": [
          {
            "bearerAuth": [
              "invites:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/invites/{id}/resend": {
      "post": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "resendInvite",
        "summary": "Resend an invite",
        "security": [
          {
            "bearerAuth": [
              "invites:write"
            ]
          }
        ]
      }
    },
    "/v1/invites/{token}": {
      "get": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getInvite",
        "summary": "Get an invite",
        "security": []
      }
    },
    "/v1/invites/{token}/accept": {
      "post": {
        "tags": [
          "Invites"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "acceptInvite",
        "summary": "Accept an invite",
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/keys": {
      "get": {
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "workspace",
                "tenant",
                "client"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkspaceKeys",
        "summary": "List workspace keys",
        "security": [
          {
            "bearerAuth": [
              "keys:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "workspace",
                      "tenant",
                      "client"
                    ]
                  },
                  "tenant": {
                    "minLength": 1,
                    "description": "Tenant slug — required for tenant keys",
                    "type": "string"
                  },
                  "scopes": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "expiresAt": {
                    "format": "date-time",
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "workspace",
                      "tenant",
                      "client"
                    ]
                  },
                  "tenant": {
                    "minLength": 1,
                    "description": "Tenant slug — required for tenant keys",
                    "type": "string"
                  },
                  "scopes": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "expiresAt": {
                    "format": "date-time",
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "workspace",
                      "tenant",
                      "client"
                    ]
                  },
                  "tenant": {
                    "minLength": 1,
                    "description": "Tenant slug — required for tenant keys",
                    "type": "string"
                  },
                  "scopes": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "expiresAt": {
                    "format": "date-time",
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createWorkspaceKey",
        "summary": "Create a workspace key",
        "security": [
          {
            "bearerAuth": [
              "keys:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/keys/{id}": {
      "get": {
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkspaceKey",
        "summary": "Get a workspace key",
        "security": [
          {
            "bearerAuth": [
              "keys:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkspaceKey",
        "summary": "Delete a workspace key",
        "security": [
          {
            "bearerAuth": [
              "keys:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/audit": {
      "get": {
        "tags": [
          "Audit"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "name": "actorType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "member",
                "user",
                "key",
                "system"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getAudit",
        "summary": "Get audit",
        "security": [
          {
            "bearerAuth": [
              "audit:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkspaceWebhooks",
        "summary": "List workspace webhooks",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createWorkspaceWebhook",
        "summary": "Create a workspace webhook",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/catalog": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getCatalog",
        "summary": "Get catalog",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/events/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWebhookEvent",
        "summary": "Get a webhook event",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkspaceWebhook",
        "summary": "Get a workspace webhook",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "nullable": true,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "nullable": true,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "events": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 120,
                      "type": "string"
                    }
                  },
                  "tenant": {
                    "nullable": true,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateWorkspaceWebhook",
        "summary": "Update a workspace webhook",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkspaceWebhook",
        "summary": "Delete a workspace webhook",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/{id}/rotate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "rotateWebhook",
        "summary": "Rotate a webhook",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "success",
                "failed",
                "exhausted"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWebhookDeliveries",
        "summary": "List webhook deliveries",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/{id}/deliveries/{deliveryId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWebhookDelivery",
        "summary": "Get a webhook delivery",
        "security": [
          {
            "bearerAuth": [
              "webhooks:read"
            ]
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceSlug}/webhooks/{id}/deliveries/{deliveryId}/replay": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "workspaceSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "replayDelivery",
        "summary": "Replay a delivery",
        "security": [
          {
            "bearerAuth": [
              "webhooks:write"
            ]
          }
        ]
      }
    },
    "/v1/tenants": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listTenants",
        "summary": "List tenants",
        "security": [
          {
            "bearerAuth": [
              "tenants:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Tenants"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createTenant",
        "summary": "Create a tenant",
        "security": [
          {
            "bearerAuth": [
              "tenants:write"
            ]
          }
        ]
      }
    },
    "/v1/tenants/{tenantSlug}": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getTenant",
        "summary": "Get a tenant",
        "security": [
          {
            "bearerAuth": [
              "tenants:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "settings": {
                    "additionalProperties": true,
                    "description": "Structured tenant settings — validated against the settings catalog",
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "settings": {
                    "additionalProperties": true,
                    "description": "Structured tenant settings — validated against the settings catalog",
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "metadata": {
                    "description": "Free-form data, e.g. your own customer id",
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "settings": {
                    "additionalProperties": true,
                    "description": "Structured tenant settings — validated against the settings catalog",
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateTenant",
        "summary": "Update a tenant",
        "security": [
          {
            "bearerAuth": [
              "tenants:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteTenant",
        "summary": "Delete a tenant",
        "security": [
          {
            "bearerAuth": [
              "tenants:write"
            ]
          }
        ]
      }
    },
    "/v1/tenants/{tenantSlug}/identity-secret": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getTenantIdentitySecret",
        "summary": "Get the tenant identity secret",
        "security": [
          {
            "bearerAuth": [
              "tenants:secrets"
            ]
          }
        ]
      }
    },
    "/v1/tenants/{tenantSlug}/identity-secret/rotate": {
      "post": {
        "tags": [
          "Tenants"
        ],
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "rotateTenantIdentitySecret",
        "summary": "Rotate the tenant identity secret",
        "security": [
          {
            "bearerAuth": [
              "tenants:secrets"
            ]
          }
        ]
      }
    },
    "/v1/credentials": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listCredentials",
        "summary": "List credentials",
        "security": [
          {
            "bearerAuth": [
              "credentials:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Credentials"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "p8",
                      "teamId",
                      "keyId",
                      "bundleId"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "apns"
                        ]
                      },
                      "p8": {
                        "minLength": 1,
                        "maxLength": 10000,
                        "type": "string"
                      },
                      "teamId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "keyId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "bundleId": {
                        "minLength": 1,
                        "maxLength": 255,
                        "type": "string"
                      },
                      "environment": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "production"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "sandbox"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "serviceAccount"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "fcm"
                        ]
                      },
                      "serviceAccount": {
                        "anyOf": [
                          {
                            "minLength": 1,
                            "maxLength": 20000,
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "apiKey"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "resend"
                        ]
                      },
                      "apiKey": {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "p8",
                      "teamId",
                      "keyId",
                      "bundleId"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "apns"
                        ]
                      },
                      "p8": {
                        "minLength": 1,
                        "maxLength": 10000,
                        "type": "string"
                      },
                      "teamId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "keyId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "bundleId": {
                        "minLength": 1,
                        "maxLength": 255,
                        "type": "string"
                      },
                      "environment": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "production"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "sandbox"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "serviceAccount"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "fcm"
                        ]
                      },
                      "serviceAccount": {
                        "anyOf": [
                          {
                            "minLength": 1,
                            "maxLength": 20000,
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "apiKey"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "resend"
                        ]
                      },
                      "apiKey": {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "p8",
                      "teamId",
                      "keyId",
                      "bundleId"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "apns"
                        ]
                      },
                      "p8": {
                        "minLength": 1,
                        "maxLength": 10000,
                        "type": "string"
                      },
                      "teamId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "keyId": {
                        "minLength": 10,
                        "maxLength": 10,
                        "type": "string"
                      },
                      "bundleId": {
                        "minLength": 1,
                        "maxLength": 255,
                        "type": "string"
                      },
                      "environment": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "production"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "sandbox"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "serviceAccount"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "fcm"
                        ]
                      },
                      "serviceAccount": {
                        "anyOf": [
                          {
                            "minLength": 1,
                            "maxLength": 20000,
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "provider",
                      "apiKey"
                    ],
                    "properties": {
                      "provider": {
                        "type": "string",
                        "enum": [
                          "resend"
                        ]
                      },
                      "apiKey": {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createCredential",
        "summary": "Create a credential",
        "security": [
          {
            "bearerAuth": [
              "credentials:write"
            ]
          }
        ]
      }
    },
    "/v1/credentials/{id}": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getCredential",
        "summary": "Get a credential",
        "security": [
          {
            "bearerAuth": [
              "credentials:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteCredential",
        "summary": "Delete a credential",
        "security": [
          {
            "bearerAuth": [
              "credentials:write"
            ]
          }
        ]
      }
    },
    "/v1/credentials/{id}/validate": {
      "post": {
        "tags": [
          "Credentials"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "validateCredential",
        "summary": "Validate a credential",
        "security": [
          {
            "bearerAuth": [
              "credentials:write"
            ]
          }
        ]
      }
    },
    "/v1/secrets": {
      "get": {
        "tags": [
          "Secrets"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSecrets",
        "summary": "List secrets",
        "security": [
          {
            "bearerAuth": [
              "secrets:read"
            ]
          }
        ]
      }
    },
    "/v1/secrets/{name}": {
      "get": {
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z][A-Za-z0-9_]{0,47}$",
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSecret",
        "summary": "Get a secret",
        "security": [
          {
            "bearerAuth": [
              "secrets:read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z][A-Za-z0-9_]{0,47}$",
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "value"
                ],
                "properties": {
                  "value": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "value"
                ],
                "properties": {
                  "value": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "value"
                ],
                "properties": {
                  "value": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "upsertSecret",
        "summary": "Upsert a secret",
        "security": [
          {
            "bearerAuth": [
              "secrets:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z][A-Za-z0-9_]{0,47}$",
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteSecret",
        "summary": "Delete a secret",
        "security": [
          {
            "bearerAuth": [
              "secrets:write"
            ]
          }
        ]
      }
    },
    "/v1/sources": {
      "get": {
        "tags": [
          "Sources"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSources",
        "summary": "List sources",
        "security": [
          {
            "bearerAuth": [
              "sources:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Sources"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "provider"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "provider"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "provider"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createSource",
        "summary": "Create a source",
        "security": [
          {
            "bearerAuth": [
              "sources:write"
            ]
          }
        ]
      }
    },
    "/v1/sources/{id}": {
      "get": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSource",
        "summary": "Get a source",
        "security": [
          {
            "bearerAuth": [
              "sources:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused"
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "provider": {
                    "minLength": 1,
                    "maxLength": 40,
                    "type": "string"
                  },
                  "verification": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "secret": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateSource",
        "summary": "Update a source",
        "security": [
          {
            "bearerAuth": [
              "sources:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteSource",
        "summary": "Delete a source",
        "security": [
          {
            "bearerAuth": [
              "sources:write"
            ]
          }
        ]
      }
    },
    "/v1/sources/{id}/ingest": {
      "post": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "ingestSourceDelivery",
        "summary": "Ingest a source delivery",
        "security": []
      }
    },
    "/v1/sources/{id}/preview": {
      "post": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payload"
                ],
                "properties": {
                  "payload": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "payload"
                ],
                "properties": {
                  "payload": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "payload"
                ],
                "properties": {
                  "payload": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "mapping": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "previewSource",
        "summary": "Preview a source",
        "security": [
          {
            "bearerAuth": [
              "sources:read"
            ]
          }
        ]
      }
    },
    "/v1/sources/{id}/deliveries": {
      "get": {
        "tags": [
          "Sources"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSourceDeliveries",
        "summary": "List source deliveries",
        "security": [
          {
            "bearerAuth": [
              "sources:read"
            ]
          }
        ]
      }
    },
    "/v1/subscribers": {
      "get": {
        "tags": [
          "Subscribers"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSubscribers",
        "summary": "List subscribers",
        "security": [
          {
            "bearerAuth": [
              "subscribers:read"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}": {
      "get": {
        "tags": [
          "Subscribers"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSubscriber",
        "summary": "Get a subscriber",
        "security": [
          {
            "bearerAuth": [
              "subscribers:read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Subscribers"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "timezone": {
                    "minLength": 1,
                    "maxLength": 64,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "timezone": {
                    "minLength": 1,
                    "maxLength": 64,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "timezone": {
                    "minLength": 1,
                    "maxLength": 64,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "upsertSubscriber",
        "summary": "Upsert a subscriber",
        "security": [
          {
            "bearerAuth": [
              "subscribers:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Subscribers"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteSubscriber",
        "summary": "Delete a subscriber",
        "security": [
          {
            "bearerAuth": [
              "subscribers:write"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}/subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSubscriberSubscriptions",
        "summary": "List subscriber subscriptions",
        "security": [
          {
            "bearerAuth": [
              "subscriptions:read"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}/preferences": {
      "get": {
        "tags": [
          "Preferences"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSubscriberPreferences",
        "summary": "Get subscriber preferences",
        "security": [
          {
            "bearerAuth": [
              "subscribers:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Preferences"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateSubscriberPreferences",
        "summary": "Update subscriber preferences",
        "security": [
          {
            "bearerAuth": [
              "subscribers:write"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}/deliveries": {
      "get": {
        "tags": [
          "Deliveries"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSubscriberDeliveries",
        "summary": "List subscriber deliveries",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}/timeline": {
      "get": {
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSubscriberTimeline",
        "summary": "Get a subscriber timeline",
        "security": [
          {
            "bearerAuth": [
              "subscribers:read"
            ]
          }
        ]
      }
    },
    "/v1/subscribers/{externalId}/runs": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "maxLength": 256,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSubscriberRuns",
        "summary": "List subscriber runs",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/subscriptions": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createSubscription",
        "summary": "Create a subscription",
        "security": [
          {
            "bearerAuth": [
              "subscriptions:write"
            ]
          }
        ]
      }
    },
    "/v1/subscriptions/{id}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSubscription",
        "summary": "Get a subscription",
        "security": [
          {
            "bearerAuth": [
              "subscriptions:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateSubscription",
        "summary": "Update a subscription",
        "security": [
          {
            "bearerAuth": [
              "subscriptions:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteSubscription",
        "summary": "Delete a subscription",
        "security": [
          {
            "bearerAuth": [
              "subscriptions:write"
            ]
          }
        ]
      }
    },
    "/v1/topics": {
      "get": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listTopics",
        "summary": "List topics",
        "security": [
          {
            "bearerAuth": [
              "topics:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Topics"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createTopic",
        "summary": "Create a topic",
        "security": [
          {
            "bearerAuth": [
              "topics:write"
            ]
          }
        ]
      }
    },
    "/v1/topic-categories": {
      "get": {
        "tags": [
          "Topics"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listTopicCategories",
        "summary": "List topic categories",
        "security": [
          {
            "bearerAuth": [
              "topics:read"
            ]
          }
        ]
      }
    },
    "/v1/topic-categories/{id}": {
      "patch": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateTopicCategory",
        "summary": "Update a topic category",
        "security": [
          {
            "bearerAuth": [
              "topics:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteTopicCategory",
        "summary": "Delete a topic category",
        "security": [
          {
            "bearerAuth": [
              "topics:write"
            ]
          }
        ]
      }
    },
    "/v1/topics/{topicSlug}": {
      "get": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "topicSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getTopic",
        "summary": "Get a topic",
        "security": [
          {
            "bearerAuth": [
              "topics:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "topicSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "nullable": true,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "nullable": true,
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "nullable": true,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "nullable": true,
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "category": {
                    "nullable": true,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "dailyCap": {
                    "nullable": true,
                    "minimum": 1,
                    "maximum": 50,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer"
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "uniqueItems": true,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "push",
                        "email"
                      ]
                    }
                  },
                  "defaultOptedIn": {
                    "type": "boolean"
                  },
                  "channelDefaults": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateTopic",
        "summary": "Update a topic",
        "security": [
          {
            "bearerAuth": [
              "topics:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Topics"
        ],
        "parameters": [
          {
            "name": "topicSlug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteTopic",
        "summary": "Delete a topic",
        "security": [
          {
            "bearerAuth": [
              "topics:write"
            ]
          }
        ]
      }
    },
    "/v1/segments": {
      "get": {
        "tags": [
          "Segments"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSegments",
        "summary": "List segments",
        "security": [
          {
            "bearerAuth": [
              "segments:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Segments"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "expression"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "expression"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "expression"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createSegment",
        "summary": "Create a segment",
        "security": [
          {
            "bearerAuth": [
              "segments:write"
            ]
          }
        ]
      }
    },
    "/v1/segments/preview": {
      "post": {
        "tags": [
          "Segments"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "expression"
                ],
                "properties": {
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "expression"
                ],
                "properties": {
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "expression"
                ],
                "properties": {
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "previewSegment",
        "summary": "Preview a segment",
        "security": [
          {
            "bearerAuth": [
              "segments:read"
            ]
          }
        ]
      }
    },
    "/v1/segments/{segmentSlug}": {
      "get": {
        "tags": [
          "Segments"
        ],
        "parameters": [
          {
            "name": "segmentSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getSegment",
        "summary": "Get a segment",
        "security": [
          {
            "bearerAuth": [
              "segments:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Segments"
        ],
        "parameters": [
          {
            "name": "segmentSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "expression": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateSegment",
        "summary": "Update a segment",
        "security": [
          {
            "bearerAuth": [
              "segments:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Segments"
        ],
        "parameters": [
          {
            "name": "segmentSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteSegment",
        "summary": "Delete a segment",
        "security": [
          {
            "bearerAuth": [
              "segments:write"
            ]
          }
        ]
      }
    },
    "/v1/segments/{segmentSlug}/members": {
      "get": {
        "tags": [
          "Segments"
        ],
        "parameters": [
          {
            "name": "segmentSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listSegmentMembers",
        "summary": "List segment members",
        "security": [
          {
            "bearerAuth": [
              "segments:read"
            ]
          }
        ]
      }
    },
    "/v1/workflows": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkflows",
        "summary": "List workflows",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Workflows"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "spec"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "spec"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "name",
                  "spec"
                ],
                "properties": {
                  "slug": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createWorkflow",
        "summary": "Create a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:write"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkflow",
        "summary": "Get a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "minLength": 1,
                    "maxLength": 100,
                    "type": "string"
                  },
                  "description": {
                    "nullable": true,
                    "maxLength": 500,
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateWorkflow",
        "summary": "Update a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteWorkflow",
        "summary": "Delete a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:write"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}/publish": {
      "post": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "publishWorkflow",
        "summary": "Publish a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:write"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}/pause": {
      "post": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "pauseWorkflow",
        "summary": "Pause a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:write"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}/runs": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "sleeping",
                "waiting",
                "completed",
                "canceled",
                "failed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listWorkflowRuns",
        "summary": "List workflow runs",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}/schedule": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getWorkflowSchedule",
        "summary": "Get a workflow schedule",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/workflows/{workflowSlug}/test": {
      "post": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "workflowSlug",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object",
                "properties": {
                  "version": {
                    "minimum": 1,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "type": "integer"
                      }
                    ]
                  },
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "event": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "server",
                          "ios",
                          "android",
                          "web",
                          "system",
                          "webhook"
                        ]
                      }
                    }
                  },
                  "at": {
                    "type": "string"
                  },
                  "assume": {
                    "type": "object",
                    "additionalProperties": {
                      "additionalProperties": false,
                      "type": "object",
                      "properties": {
                        "matched": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "status": {
                          "minimum": 100,
                          "maximum": 599,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 100,
                              "maximum": 599,
                              "type": "integer"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "additionalProperties": false,
                "type": "object",
                "properties": {
                  "version": {
                    "minimum": 1,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "type": "integer"
                      }
                    ]
                  },
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "event": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "server",
                          "ios",
                          "android",
                          "web",
                          "system",
                          "webhook"
                        ]
                      }
                    }
                  },
                  "at": {
                    "type": "string"
                  },
                  "assume": {
                    "type": "object",
                    "additionalProperties": {
                      "additionalProperties": false,
                      "type": "object",
                      "properties": {
                        "matched": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "status": {
                          "minimum": 100,
                          "maximum": 599,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 100,
                              "maximum": 599,
                              "type": "integer"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "additionalProperties": false,
                "type": "object",
                "properties": {
                  "version": {
                    "minimum": 1,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 1,
                        "type": "integer"
                      }
                    ]
                  },
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "event": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "server",
                          "ios",
                          "android",
                          "web",
                          "system",
                          "webhook"
                        ]
                      }
                    }
                  },
                  "at": {
                    "type": "string"
                  },
                  "assume": {
                    "type": "object",
                    "additionalProperties": {
                      "additionalProperties": false,
                      "type": "object",
                      "properties": {
                        "matched": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "status": {
                          "minimum": 100,
                          "maximum": 599,
                          "anyOf": [
                            {
                              "format": "integer",
                              "default": 0,
                              "type": "string"
                            },
                            {
                              "minimum": 100,
                              "maximum": 599,
                              "type": "integer"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "testWorkflow",
        "summary": "Test a workflow",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/runs": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "sleeping",
                "waiting",
                "completed",
                "canceled",
                "failed"
              ]
            }
          },
          {
            "name": "workflow",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listRuns",
        "summary": "List runs",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/runs/{runId}": {
      "get": {
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getRun",
        "summary": "Get a run",
        "security": [
          {
            "bearerAuth": [
              "workflows:read"
            ]
          }
        ]
      }
    },
    "/v1/messages": {
      "get": {
        "tags": [
          "Messages"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "processing",
                "completed",
                "scheduled",
                "canceled"
              ]
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "push",
                "email"
              ]
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "minLength": 3,
              "maxLength": 48,
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listMessages",
        "summary": "List messages",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Messages"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      },
                      {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "minLength": 1,
                          "maxLength": 256,
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "topic": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "segment": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "where": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "ttlSeconds": {
                    "minimum": 60,
                    "maximum": 2419200,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 60,
                        "maximum": 2419200,
                        "type": "integer"
                      }
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "required": [
                      "at"
                    ],
                    "properties": {
                      "at": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                        "type": "string"
                      },
                      "timezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "defaultTimezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      }
                    }
                  },
                  "idempotencyKey": {
                    "minLength": 1,
                    "maxLength": 255,
                    "type": "string"
                  },
                  "title": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "body": {
                    "maxLength": 4000,
                    "type": "string"
                  },
                  "subtitle": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "badge": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  },
                  "sound": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "imageUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "collapseId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "threadId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "interruptionLevel": {
                    "type": "string",
                    "enum": [
                      "passive",
                      "active",
                      "timeSensitive",
                      "critical"
                    ]
                  },
                  "relevanceScore": {
                    "minimum": 0,
                    "maximum": 1,
                    "type": "number"
                  },
                  "targetContentId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "deepLink": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "action": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "policy": {
                    "type": "string",
                    "enum": [
                      "ignore"
                    ]
                  },
                  "actions": {
                    "minItems": 1,
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "title"
                      ],
                      "properties": {
                        "id": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "title": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "destructive": {
                          "type": "boolean"
                        },
                        "foreground": {
                          "type": "boolean"
                        },
                        "input": {
                          "type": "boolean"
                        },
                        "placeholder": {
                          "maxLength": 64,
                          "type": "string"
                        }
                      }
                    }
                  },
                  "apns": {
                    "type": "object",
                    "properties": {
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "fcm": {
                    "type": "object",
                    "properties": {
                      "android": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      },
                      {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "minLength": 1,
                          "maxLength": 256,
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "topic": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "segment": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "where": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "ttlSeconds": {
                    "minimum": 60,
                    "maximum": 2419200,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 60,
                        "maximum": 2419200,
                        "type": "integer"
                      }
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "required": [
                      "at"
                    ],
                    "properties": {
                      "at": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                        "type": "string"
                      },
                      "timezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "defaultTimezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      }
                    }
                  },
                  "idempotencyKey": {
                    "minLength": 1,
                    "maxLength": 255,
                    "type": "string"
                  },
                  "title": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "body": {
                    "maxLength": 4000,
                    "type": "string"
                  },
                  "subtitle": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "badge": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  },
                  "sound": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "imageUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "collapseId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "threadId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "interruptionLevel": {
                    "type": "string",
                    "enum": [
                      "passive",
                      "active",
                      "timeSensitive",
                      "critical"
                    ]
                  },
                  "relevanceScore": {
                    "minimum": 0,
                    "maximum": 1,
                    "type": "number"
                  },
                  "targetContentId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "deepLink": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "action": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "policy": {
                    "type": "string",
                    "enum": [
                      "ignore"
                    ]
                  },
                  "actions": {
                    "minItems": 1,
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "title"
                      ],
                      "properties": {
                        "id": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "title": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "destructive": {
                          "type": "boolean"
                        },
                        "foreground": {
                          "type": "boolean"
                        },
                        "input": {
                          "type": "boolean"
                        },
                        "placeholder": {
                          "maxLength": 64,
                          "type": "string"
                        }
                      }
                    }
                  },
                  "apns": {
                    "type": "object",
                    "properties": {
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "fcm": {
                    "type": "object",
                    "properties": {
                      "android": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "maxLength": 256,
                        "type": "string"
                      },
                      {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "minLength": 1,
                          "maxLength": 256,
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "topic": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "segment": {
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "minLength": 3,
                    "maxLength": 48,
                    "type": "string"
                  },
                  "where": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "all"
                        ],
                        "properties": {
                          "all": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "any"
                        ],
                        "properties": {
                          "any": {
                            "minItems": 1,
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Expression"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "not"
                        ],
                        "properties": {
                          "not": {
                            "$ref": "#/components/schemas/Expression"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "ref"
                            ],
                            "properties": {
                              "ref": {
                                "pattern": "^[a-z$][a-zA-Z0-9_$.-]{0,199}$",
                                "type": "string"
                              },
                              "eq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "neq": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              },
                              "gt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "gte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lt": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "lte": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              "in": {
                                "minItems": 1,
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "contains": {
                                "minLength": 1,
                                "maxLength": 200,
                                "type": "string"
                              },
                              "exists": {
                                "type": "boolean"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "count"
                            ],
                            "properties": {
                              "count": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              },
                              "eq": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "gte": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lt": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "lte": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "never"
                            ],
                            "properties": {
                              "never": {
                                "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
                                "type": "string"
                              },
                              "within": {
                                "pattern": "^(\\d{1,5})(m|h|d)$",
                                "type": "string"
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "lastSeen"
                            ],
                            "properties": {
                              "lastSeen": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "within": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  },
                                  "olderThan": {
                                    "pattern": "^(\\d{1,5})(m|h|d)$",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "channel"
                            ],
                            "properties": {
                              "channel": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "push"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "email"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "sms"
                                    ]
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "ttlSeconds": {
                    "minimum": 60,
                    "maximum": 2419200,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 60,
                        "maximum": 2419200,
                        "type": "integer"
                      }
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "required": [
                      "at"
                    ],
                    "properties": {
                      "at": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$",
                        "type": "string"
                      },
                      "timezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "defaultTimezone": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      }
                    }
                  },
                  "idempotencyKey": {
                    "minLength": 1,
                    "maxLength": 255,
                    "type": "string"
                  },
                  "title": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "body": {
                    "maxLength": 4000,
                    "type": "string"
                  },
                  "subtitle": {
                    "maxLength": 500,
                    "type": "string"
                  },
                  "badge": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  },
                  "sound": {
                    "maxLength": 100,
                    "type": "string"
                  },
                  "imageUrl": {
                    "format": "uri",
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "collapseId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "threadId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "category": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "interruptionLevel": {
                    "type": "string",
                    "enum": [
                      "passive",
                      "active",
                      "timeSensitive",
                      "critical"
                    ]
                  },
                  "relevanceScore": {
                    "minimum": 0,
                    "maximum": 1,
                    "type": "number"
                  },
                  "targetContentId": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "deepLink": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "action": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "minLength": 1,
                        "maxLength": 64,
                        "type": "string"
                      },
                      "data": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "policy": {
                    "type": "string",
                    "enum": [
                      "ignore"
                    ]
                  },
                  "actions": {
                    "minItems": 1,
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "title"
                      ],
                      "properties": {
                        "id": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "title": {
                          "minLength": 1,
                          "maxLength": 64,
                          "type": "string"
                        },
                        "destructive": {
                          "type": "boolean"
                        },
                        "foreground": {
                          "type": "boolean"
                        },
                        "input": {
                          "type": "boolean"
                        },
                        "placeholder": {
                          "maxLength": 64,
                          "type": "string"
                        }
                      }
                    }
                  },
                  "apns": {
                    "type": "object",
                    "properties": {
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  "fcm": {
                    "type": "object",
                    "properties": {
                      "android": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      },
                      "payload": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "sendMessage",
        "summary": "Send a message",
        "security": [
          {
            "bearerAuth": [
              "messages:send"
            ]
          }
        ]
      }
    },
    "/v1/messages/{id}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getMessage",
        "summary": "Get a message",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/messages/{id}/cancel": {
      "post": {
        "tags": [
          "Messages"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "cancelMessage",
        "summary": "Cancel a message",
        "security": [
          {
            "bearerAuth": [
              "messages:send"
            ]
          }
        ]
      }
    },
    "/v1/messages/{id}/deliveries": {
      "get": {
        "tags": [
          "Messages"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "retrying",
                "sent",
                "delivered",
                "bounced",
                "failed",
                "invalid"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listMessageDeliveries",
        "summary": "List message deliveries",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "anyOf": [
                {
                  "format": "integer",
                  "default": 0,
                  "type": "string"
                },
                {
                  "minimum": 1,
                  "maximum": 100,
                  "type": "integer"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "server",
                "ios",
                "android",
                "web",
                "system",
                "webhook"
              ]
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "afterId",
            "in": "query",
            "required": false,
            "schema": {
              "minLength": 1,
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listEvents",
        "summary": "List events",
        "security": [
          {
            "bearerAuth": [
              "events:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Events"
        ],
        "requestBody": {
          "content": {},
          "required": true
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "trackEvents",
        "summary": "Track events",
        "security": [
          {
            "bearerAuth": [
              "events:write"
            ]
          }
        ]
      }
    },
    "/v1/events/names": {
      "get": {
        "tags": [
          "Events"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listEventNames",
        "summary": "List event names",
        "security": [
          {
            "bearerAuth": [
              "events:read"
            ]
          }
        ]
      }
    },
    "/v1/events/names/{name}": {
      "get": {
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getEventName",
        "summary": "Get an event name",
        "security": [
          {
            "bearerAuth": [
              "events:read"
            ]
          }
        ]
      }
    },
    "/v1/events/token": {
      "get": {
        "tags": [
          "Events"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getEventsToken",
        "summary": "Get an events token",
        "security": [
          {
            "bearerAuth": [
              "events:read"
            ]
          }
        ]
      }
    },
    "/v1/events/volume": {
      "get": {
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d"
              ]
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "pattern": "^\\$?[a-z0-9][a-z0-9_.-]{0,99}$",
              "maxLength": 100,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getEventVolume",
        "summary": "Get event volume",
        "security": [
          {
            "bearerAuth": [
              "events:read"
            ]
          }
        ]
      }
    },
    "/v1/stats": {
      "get": {
        "tags": [
          "Stats"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getStats",
        "summary": "Get stats",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/deliveries/{id}": {
      "get": {
        "tags": [
          "Deliveries"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getDelivery",
        "summary": "Get a delivery",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/deliveries/{id}/attempts": {
      "get": {
        "tags": [
          "Deliveries"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "listDeliveryAttempts",
        "summary": "List delivery attempts",
        "security": [
          {
            "bearerAuth": [
              "messages:read"
            ]
          }
        ]
      }
    },
    "/v1/client/identify": {
      "post": {
        "tags": [
          "Client"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "identifySubscriber",
        "summary": "Identify a subscriber",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/subscriptions": {
      "post": {
        "tags": [
          "Client"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "push",
                      "email"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  },
                  "token": {
                    "minLength": 8,
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "address": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "pushPermission": {
                    "type": "string",
                    "enum": [
                      "notDetermined",
                      "denied",
                      "authorized",
                      "provisional",
                      "ephemeral"
                    ]
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "appVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "appBuild": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "sdkVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "osVersion": {
                        "maxLength": 40,
                        "type": "string"
                      },
                      "model": {
                        "maxLength": 60,
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "installedAt": {
                        "maxLength": 40,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "createClientSubscription",
        "summary": "Create a client subscription",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/subscriptions/{id}": {
      "patch": {
        "tags": [
          "Client"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateClientSubscription",
        "summary": "Update a client subscription",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Client"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteClientSubscription",
        "summary": "Delete a client subscription",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/preferences": {
      "get": {
        "tags": [
          "Client"
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getClientPreferences",
        "summary": "Get client preferences",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Client"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "preferences"
                ],
                "properties": {
                  "preferences": {
                    "minProperties": 1,
                    "maxProperties": 100,
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "push": {
                              "type": "boolean"
                            },
                            "email": {
                              "type": "boolean"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "updateClientPreferences",
        "summary": "Update client preferences",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/events": {
      "post": {
        "tags": [
          "Client"
        ],
        "requestBody": {
          "content": {},
          "required": true
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "trackClientEvents",
        "summary": "Track client events",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/live-activities": {
      "post": {
        "tags": [
          "Client"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId",
                  "attributesType",
                  "token"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "activity",
                      "start"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "token": {
                    "minLength": 32,
                    "maxLength": 512,
                    "pattern": "^[0-9a-fA-F]+$",
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId",
                  "attributesType",
                  "token"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "activity",
                      "start"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "token": {
                    "minLength": 32,
                    "maxLength": 512,
                    "pattern": "^[0-9a-fA-F]+$",
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "externalId",
                  "attributesType",
                  "token"
                ],
                "properties": {
                  "externalId": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "identityHash": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "activity",
                      "start"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "token": {
                    "minLength": 32,
                    "maxLength": 512,
                    "pattern": "^[0-9a-fA-F]+$",
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "production",
                      "sandbox"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "registerClientLiveActivity",
        "summary": "Register a client live activity",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/client/live-activities/{id}": {
      "delete": {
        "tags": [
          "Client"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "endClientLiveActivity",
        "summary": "End a client live activity",
        "security": [
          {
            "bearerAuth": [
              "client"
            ]
          }
        ]
      }
    },
    "/v1/live-activities/send": {
      "post": {
        "tags": [
          "Live Activities"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "to",
                  "event",
                  "contentState"
                ],
                "properties": {
                  "to": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "start",
                      "update",
                      "end"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "contentState": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "alert": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "maxLength": 500,
                        "type": "string"
                      },
                      "body": {
                        "maxLength": 4000,
                        "type": "string"
                      },
                      "sound": {
                        "maxLength": 100,
                        "type": "string"
                      }
                    }
                  },
                  "staleDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "dismissalDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "timestamp": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "to",
                  "event",
                  "contentState"
                ],
                "properties": {
                  "to": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "start",
                      "update",
                      "end"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "contentState": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "alert": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "maxLength": 500,
                        "type": "string"
                      },
                      "body": {
                        "maxLength": 4000,
                        "type": "string"
                      },
                      "sound": {
                        "maxLength": 100,
                        "type": "string"
                      }
                    }
                  },
                  "staleDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "dismissalDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "timestamp": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "to",
                  "event",
                  "contentState"
                ],
                "properties": {
                  "to": {
                    "minLength": 1,
                    "maxLength": 256,
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "start",
                      "update",
                      "end"
                    ]
                  },
                  "activityId": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "attributesType": {
                    "minLength": 1,
                    "maxLength": 128,
                    "type": "string"
                  },
                  "contentState": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "alert": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "maxLength": 500,
                        "type": "string"
                      },
                      "body": {
                        "maxLength": 4000,
                        "type": "string"
                      },
                      "sound": {
                        "maxLength": 100,
                        "type": "string"
                      }
                    }
                  },
                  "staleDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "dismissalDate": {
                    "maxLength": 40,
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "high",
                      "normal"
                    ]
                  },
                  "timestamp": {
                    "minimum": 0,
                    "anyOf": [
                      {
                        "format": "integer",
                        "default": 0,
                        "type": "string"
                      },
                      {
                        "minimum": 0,
                        "type": "integer"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response for status 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error",
                    "metadata"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true,
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "param": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "required": [
                        "timestamp"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "requestId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed or fails validation; `error.code` is `validation`, `bad_request` or `parse` and `error.details` lists every failing field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No credential, or an invalid, expired or revoked one: `missing_authorization`, `invalid_api_key`, `api_key_expired`, `invalid_session`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential cannot do this: `missing_permission` for a missing scope, `forbidden` for another workspace, tenant or key kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The addressed resource does not exist for this credential, including malformed ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The write conflicts with existing state: `conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "sendLiveActivityUpdate",
        "summary": "Send a live activity update",
        "security": [
          {
            "bearerAuth": [
              "messages:send"
            ]
          }
        ]
      }
    }
  }
}
