{
  "openapi": "3.1.1",
  "info": {
    "title": "Growth Rail Public API",
    "description": "Public REST API for Growth Rail. Authenticate all requests with `Authorization: Bearer <api-key>`.",
    "contact": {
      "name": "Growth Rail",
      "url": "https://growthrail.io"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "http://api.growthrail.dev/"
    }
  ],
  "paths": {
    "/api/v1/public/projects/{projectId}/users": {
      "get": {
        "tags": [
          "App Users"
        ],
        "summary": "List app users in a project.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ProjectId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "HasReferrals",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "App Users"
        ],
        "summary": "Create a new app user in a project.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "App user creation payload. `ClientProvidedId` must be unique within the project.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppUserDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppUserDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppUserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/users/{uniqueId}": {
      "get": {
        "tags": [
          "App Users"
        ],
        "summary": "Get an app user by their Growth Rail `UniqueId`.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uniqueId",
            "in": "path",
            "description": "The Growth Rail `UniqueId` of the app user.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "App Users"
        ],
        "summary": "Update an app user's attributes.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uniqueId",
            "in": "path",
            "description": "The Growth Rail `UniqueId` of the app user to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Attributes to set. This replaces the entire attributes map.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppUserDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppUserDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppUserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/users/by-user-id/{clientProvidedId}": {
      "get": {
        "tags": [
          "App Users"
        ],
        "summary": "Get an app user by the ID you use in your own system.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientProvidedId",
            "in": "path",
            "description": "The ID you assigned to this user in your own database.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/campaign": {
      "get": {
        "tags": [
          "Campaign"
        ],
        "summary": "Get the campaign configuration for a project.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Campaign"
        ],
        "summary": "Create or update the campaign configuration for a project.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Campaign configuration payload. You can update `ReferrerExperience` and\n`NewUserExperience` independently — omiting a section leaves it unchanged\nif one already exists.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "List all projects for the authenticated client.",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicProjectDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicProjectDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicProjectDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Create a new project.",
        "requestBody": {
          "description": "Project creation payload.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Get a project by its unique ID.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project (e.g. `proj_abc123XY90`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Projects"
        ],
        "summary": "Update a project's name, description, or referral redirect link.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Fields to update.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Delete a project and all of its associated data.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project to delete.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/referrals/track": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Track a new referral arrival.",
        "description": "Call this endpoint when a new user arrives in your application via a referral link.\nStore the returned `ReferralTrackingId` — you will need it to grant the reward later.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Referral tracking payload. Typically the `ReferralCode` is extracted from the referral\nlink query parameter and the `RefereeId` is your newly registered user's ID.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackReferralRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackReferralRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrackReferralRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTrackReferralResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTrackReferralResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTrackReferralResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/referrals/link": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Generate a referral link for an app user.",
        "description": "Returns a shareable referral link that the user can send to their contacts.\nWhen a new user arrives via this link and is tracked, the referrer becomes eligible for a reward.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Referral link request payload. `ReferrerId` is the `clientProvidedId` of the referrer.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralLinkRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralLinkRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralLinkRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReferralLinkResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReferralLinkResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReferralLinkResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/referrals/reward": {
      "post": {
        "tags": [
          "Referrals"
        ],
        "summary": "Grant a reward to a referrer and fire configured webhooks.",
        "description": "Call this when the referred user completes the qualifying event (e.g. purchase, upgrade, signup).\nGrowth Rail credits the reward to the referrer and dispatches all webhooks attached to the\nmatching campaign.\n\nThe project ID is not needed in the body — it's derived from the referral tracking item.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project (used for access validation).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Reward event payload. `ReferralTrackingId` must be the value returned by `POST /track`.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTrackRewardEventRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTrackRewardEventRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicTrackRewardEventRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TrackRewardEventResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackRewardEventResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackRewardEventResponseDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List all webhooks for a project.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/webhooks/{webhookId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook by its ID.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "The UniqueId of the webhook.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook's URL, name, secret, or enabled state.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "The UniqueId of the webhook to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated webhook fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "The UniqueId of the webhook to delete.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/webhooks/{webhookId}/logs": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List recent delivery attempts for a webhook (newest first).",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "description": "The UniqueId of the webhook.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum rows to return (1–500, default 100).",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookLogListResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookLogListResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookLogListResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/projects/{projectId}/webhooks/{campaignId}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a new webhook endpoint.",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The `UniqueId` of the project.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "description": "The `UniqueId` of the campaign.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Webhook creation payload. `Secret` is used to sign the `X-GrowthRail-Signature`\nheader on each delivery so you can verify the payload hasn't been tampered with.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": { }
              },
              "application/json": {
                "schema": { }
              },
              "text/json": {
                "schema": { }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicWebhookDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActivityPageResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecentActivityItemDto"
            }
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "APIKeyCreatedDto": {
        "required": [
          "id",
          "name",
          "key",
          "warning"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "warning": {
            "type": "string"
          }
        }
      },
      "APIKeyDeletedDto": {
        "required": [
          "message",
          "deletedKeyId"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "deletedKeyId": {
            "type": "string"
          },
          "deletedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "APIKeyDto": {
        "required": [
          "id",
          "name",
          "key"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "APIKeyListResponseDto": {
        "required": [
          "clientId",
          "clientUniqueId"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "clientUniqueId": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/APIKeyDto"
            }
          }
        }
      },
      "AppDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "appStoreUrl": {
            "type": "string"
          },
          "playStoreUrl": {
            "type": "string"
          },
          "iconUrl": {
            "type": "string"
          }
        }
      },
      "AppUserDto": {
        "required": [
          "uniqueId",
          "clientProvidedId"
        ],
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "firstSeenAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "totalReferralsGiven": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalReferralsReceived": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "successfulReferrals": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "referredBy": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientProvidedId": {
            "type": "string"
          }
        }
      },
      "AppUserEventDto": {
        "required": [
          "id",
          "type",
          "description"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "AppUserEventsResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUserEventDto"
            }
          }
        }
      },
      "AppUserListResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUserDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AppUserSdkDto": {
        "required": [
          "id",
          "referralCode",
          "referralLink",
          "referrerExperience"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "uniqueId": {
            "type": [
              "null",
              "string"
            ]
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "firstSeenAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "referralCode": {
            "type": "string"
          },
          "referralLink": {
            "type": "string"
          },
          "referrerExperience": {
            "$ref": "#/components/schemas/ReferrerExperienceSdkDto"
          },
          "successfulReferrals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuccessfulReferralSdkDto"
            }
          },
          "setupErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetupErrorDto"
            }
          }
        }
      },
      "BannerSdkDto": {
        "type": "object",
        "properties": {
          "show": {
            "type": "boolean"
          },
          "position": {
            "type": [
              "null",
              "string"
            ]
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "themeColor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CampaignDto": {
        "required": [
          "id",
          "uniqueId",
          "projectId",
          "projectUniqueId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "uniqueId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "projectUniqueId": {
            "type": "string"
          },
          "referrerExperience": {
            "$ref": "#/components/schemas/ReferrerExperienceDto"
          },
          "newUserExperience": {
            "$ref": "#/components/schemas/NewUserExperienceDto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateAPIKeyDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateAppUserDto": {
        "required": [
          "clientProvidedId"
        ],
        "type": "object",
        "properties": {
          "clientProvidedId": {
            "type": "string"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "CreateCheckoutSessionRequest": {
        "required": [
          "interval"
        ],
        "type": "object",
        "properties": {
          "interval": {
            "type": "string",
            "description": "\"monthly\" or \"annual\"."
          }
        }
      },
      "CreateClientResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateProjectDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "referralRedirectLink": {
            "type": "string"
          },
          "appType": {
            "type": "string"
          }
        }
      },
      "CreateProviderConnectionRequestDto": {
        "required": [
          "provider",
          "environment",
          "displayName"
        ],
        "type": "object",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderIntegrationProvider"
          },
          "environment": {
            "$ref": "#/components/schemas/IntegrationEnvironment"
          },
          "displayName": {
            "maxLength": 100,
            "type": "string"
          },
          "providerAccountReference": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateReferralLinkRequestDto": {
        "required": [
          "referrerId"
        ],
        "type": "object",
        "properties": {
          "referrerId": {
            "type": "string",
            "description": "Referrer client provided id"
          },
          "rewardEventName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateReferralLinkResponseDto": {
        "required": [
          "referralLink",
          "referralCode"
        ],
        "type": "object",
        "properties": {
          "referralLink": {
            "type": "string"
          },
          "referralCode": {
            "type": "string"
          }
        }
      },
      "CreateWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          },
          "environmentScope": {
            "$ref": "#/components/schemas/WebhookEnvironmentScope"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "DashboardOverviewDto": {
        "required": [
          "projectId",
          "projectUniqueId",
          "stats"
        ],
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "projectUniqueId": {
            "type": "string"
          },
          "stats": {
            "$ref": "#/components/schemas/DashboardStatsDto"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DashboardStatsDto": {
        "type": "object",
        "properties": {
          "totalReferrers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "conversions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "conversionRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "DeleteAccountRequest": {
        "required": [
          "confirmation"
        ],
        "type": "object",
        "properties": {
          "confirmation": {
            "type": "string"
          }
        }
      },
      "InitAppUserRequestDto": {
        "required": [
          "clientProvidedId"
        ],
        "type": "object",
        "properties": {
          "clientProvidedId": {
            "type": "string"
          },
          "referralTrackingId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Opaque referral tracking id captured by the SDK before signup. Supplying it binds\nattribution to this stable customer/provider user id without completing a reward.",
            "format": "uuid"
          },
          "environment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Optional reward webhook environment filter for setup readiness.\nWhen set, webhook checks require an enabled webhook matching this environment (or Both).\nWhen omitted, any enabled webhook satisfies the check.",
                "$ref": "#/components/schemas/IntegrationEnvironment"
              }
            ]
          }
        }
      },
      "IntegrationEnvironment": {
        "type": "integer"
      },
      "IntegrationStatusDto": {
        "required": [
          "projectId",
          "projectUniqueId"
        ],
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "projectUniqueId": {
            "type": "string"
          },
          "integrated": {
            "type": "boolean"
          },
          "lastEventReceived": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "JoinWaitlistRequestDto": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "JoinWaitlistResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "LinkClickAnalyticsDto": {
        "type": "object",
        "properties": {
          "os": {
            "type": [
              "null",
              "string"
            ]
          },
          "osVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "platform": {
            "type": [
              "null",
              "string"
            ]
          },
          "screenWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "screenHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timezoneOffsetInMinutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceBrand": {
            "type": [
              "null",
              "string"
            ]
          },
          "userAgent": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Device details captured by the link-web-app when a referral link is clicked.\nAll fields are stored for analytics. Only a cross-platform-compatible subset\nis used for probabilistic matching (os, timezoneOffsetInMinutes, locale, screen dims)."
      },
      "LinkDetailsDto": {
        "required": [
          "appName",
          "iconUrl",
          "appStoreUrl",
          "playStoreUrl"
        ],
        "type": "object",
        "properties": {
          "appName": {
            "type": "string"
          },
          "iconUrl": {
            "type": "string"
          },
          "appStoreUrl": {
            "type": "string"
          },
          "playStoreUrl": {
            "type": "string"
          }
        }
      },
      "MatchLinkFingerprintDto": {
        "type": "object",
        "properties": {
          "os": {
            "type": [
              "null",
              "string"
            ]
          },
          "osVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "platform": {
            "type": [
              "null",
              "string"
            ]
          },
          "screenWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "screenHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "timezoneOffsetInMinutes": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceBrand": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MatchLinkResponseDto": {
        "required": [
          "matchFound"
        ],
        "type": "object",
        "properties": {
          "referralTrackingId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "matchFound": {
            "type": "boolean"
          }
        }
      },
      "ModalSdkDto": {
        "required": [
          "theme"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "theme": {
            "$ref": "#/components/schemas/ThemeSdkDto"
          },
          "componentType": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NewUserExperienceDto": {
        "type": "object",
        "properties": {
          "showPromo": {
            "type": "boolean"
          },
          "promoText": {
            "maxLength": 500,
            "type": [
              "null",
              "string"
            ]
          },
          "promoPosition": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NewUserExperienceSdkDto": {
        "required": [
          "banner"
        ],
        "type": "object",
        "properties": {
          "banner": {
            "$ref": "#/components/schemas/BannerSdkDto"
          }
        }
      },
      "OnboardingRequest": {
        "type": "object",
        "properties": {
          "organizationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional promotional plan claim from signup (e.g. \"early_adopter\").\nUnknown or closed offers fall back to Developer."
          }
        }
      },
      "OnboardingResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "onboardingCompleted": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OnboardingStatusResponse": {
        "type": "object",
        "properties": {
          "onboardingCompleted": {
            "type": "boolean"
          },
          "needsClient": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PasswordResetRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "maxLength": 320,
            "minLength": 0,
            "type": "string"
          }
        }
      },
      "PriceInfoDto": {
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Amount in major currency units (e.g. dollars), converted from Stripe's minor units.",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "description": "Stripe recurring interval: \"month\" or \"year\"."
          }
        }
      },
      "PricingResponseDto": {
        "type": "object",
        "properties": {
          "monthly": {
            "$ref": "#/components/schemas/PriceInfoDto"
          },
          "annual": {
            "$ref": "#/components/schemas/PriceInfoDto"
          },
          "earlyAdopterOfferOpen": {
            "type": "boolean"
          }
        }
      },
      "ProbabilisticMatchRequestDto": {
        "required": [
          "fingerprint"
        ],
        "type": "object",
        "properties": {
          "fingerprint": {
            "$ref": "#/components/schemas/MatchLinkFingerprintDto"
          }
        },
        "description": "Device details captured by the mobile SDK for probabilistic link matching.\nOnly cross-platform-compatible fields are used for matching:\nos, timezoneOffsetInMinutes, locale, screenWidth/Height (with ±5px tolerance)."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectDto": {
        "required": [
          "projectSecret",
          "referralRedirectLink"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "uniqueId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "webhooksCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "projectSecret": {
            "type": "string"
          },
          "referralRedirectLink": {
            "type": "string"
          },
          "appType": {
            "type": "string"
          },
          "app": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppDto"
              }
            ]
          }
        }
      },
      "ProviderConnectionResponseDto": {
        "required": [
          "id",
          "provider",
          "kind",
          "environment",
          "displayName",
          "endpointUrl",
          "secretSet",
          "enabled",
          "state"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "$ref": "#/components/schemas/ProviderIntegrationProvider"
          },
          "kind": {
            "$ref": "#/components/schemas/ProviderIntegrationKind"
          },
          "environment": {
            "$ref": "#/components/schemas/IntegrationEnvironment"
          },
          "displayName": {
            "type": "string"
          },
          "providerAccountReference": {
            "type": [
              "null",
              "string"
            ]
          },
          "endpointUrl": {
            "type": "string"
          },
          "secretSet": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "state": {
            "type": "string"
          },
          "lastEventAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastErrorAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProviderEventOutcome": {
        "type": "integer"
      },
      "ProviderInboundEventResponseDto": {
        "required": [
          "id",
          "eventType",
          "externalEventId",
          "outcome",
          "occurredAt",
          "receivedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string"
          },
          "externalEventId": {
            "type": "string"
          },
          "externalTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "outcome": {
            "$ref": "#/components/schemas/ProviderEventOutcome"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProviderIntegrationKind": {
        "type": "integer"
      },
      "ProviderIntegrationProvider": {
        "type": "integer"
      },
      "PublicProjectDto": {
        "required": [
          "uniqueId",
          "name",
          "referralRedirectLink"
        ],
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "webhooksCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "referralRedirectLink": {
            "type": "string"
          }
        }
      },
      "PublicTrackReferralResponseDto": {
        "required": [
          "referralTrackingId"
        ],
        "type": "object",
        "properties": {
          "referralTrackingId": {
            "type": "string",
            "description": "UniqueId of the created referral tracking item - use this when calling the reward endpoint."
          }
        }
      },
      "PublicTrackRewardEventRequestDto": {
        "required": [
          "referralTrackingId",
          "newUserId"
        ],
        "type": "object",
        "properties": {
          "referralTrackingId": {
            "type": "string",
            "description": "UniqueId of the referral tracking item returned from the track-referral endpoint."
          },
          "newUserId": {
            "type": "string",
            "description": "Client-provided ID of the new user who was referred."
          },
          "eventName": {
            "type": [
              "null",
              "string"
            ]
          },
          "environment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationEnvironment"
              }
            ]
          }
        }
      },
      "PublicWebhookDto": {
        "required": [
          "uniqueId",
          "campaignUniqueId",
          "name",
          "url"
        ],
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "campaignUniqueId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "secretSet": {
            "type": "boolean"
          },
          "environmentScope": {
            "$ref": "#/components/schemas/WebhookEnvironmentScope"
          },
          "enabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PublicWebhookListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicWebhookDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RecentActivityItemDto": {
        "required": [
          "id",
          "user",
          "action",
          "time",
          "timestampUtc",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "user": {
            "type": "string"
          },
          "referrerUniqueId": {
            "type": [
              "null",
              "string"
            ]
          },
          "referee": {
            "type": [
              "null",
              "string"
            ]
          },
          "action": {
            "type": "string"
          },
          "time": {
            "type": "string"
          },
          "timestampUtc": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "RedirectUrlResponse": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          }
        }
      },
      "ReferrerExperienceDto": {
        "type": "object",
        "properties": {
          "themeColor": {
            "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
            "type": [
              "null",
              "string"
            ]
          },
          "backgroundColor": {
            "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
            "type": [
              "null",
              "string"
            ]
          },
          "tintColor": {
            "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
            "type": [
              "null",
              "string"
            ]
          },
          "buttonType": {
            "type": [
              "null",
              "string"
            ]
          },
          "buttonPosition": {
            "type": [
              "null",
              "string"
            ]
          },
          "modalTitle": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "modalDescription": {
            "maxLength": 500,
            "type": [
              "null",
              "string"
            ]
          },
          "tintAlpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "componentType": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReferrerExperienceSdkDto": {
        "required": [
          "trigger",
          "modal"
        ],
        "type": "object",
        "properties": {
          "trigger": {
            "$ref": "#/components/schemas/TriggerSdkDto"
          },
          "modal": {
            "$ref": "#/components/schemas/ModalSdkDto"
          }
        }
      },
      "RegisterUserRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RevenueCatConnectionResponseDto": {
        "required": [
          "sandboxEndpointUrl",
          "productionEndpointUrl"
        ],
        "type": "object",
        "properties": {
          "sandboxEndpointUrl": {
            "type": "string"
          },
          "productionEndpointUrl": {
            "type": "string"
          },
          "sandboxSecretSet": {
            "type": "boolean"
          },
          "productionSecretSet": {
            "type": "boolean"
          },
          "lastEventAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "SetAppDetailsDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "appStoreUrl": {
            "type": "string"
          },
          "playStoreUrl": {
            "type": "string"
          },
          "iconUrl": {
            "type": "string"
          }
        }
      },
      "SetProviderConnectionEnabledRequestDto": {
        "required": [
          "enabled"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "SetProviderConnectionSecretRequestDto": {
        "required": [
          "verificationSecret"
        ],
        "type": "object",
        "properties": {
          "verificationSecret": {
            "maxLength": 4000,
            "type": "string"
          }
        }
      },
      "SetRevenueCatSecretRequestDto": {
        "required": [
          "environment",
          "authSecret"
        ],
        "type": "object",
        "properties": {
          "environment": {
            "$ref": "#/components/schemas/IntegrationEnvironment"
          },
          "authSecret": {
            "type": "string"
          }
        }
      },
      "SetStripeSecretRequestDto": {
        "required": [
          "environment",
          "signingSecret"
        ],
        "type": "object",
        "properties": {
          "environment": {
            "$ref": "#/components/schemas/IntegrationEnvironment"
          },
          "signingSecret": {
            "type": "string"
          }
        }
      },
      "SetupErrorDto": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "StripeConnectionResponseDto": {
        "required": [
          "sandboxEndpointUrl",
          "productionEndpointUrl"
        ],
        "type": "object",
        "properties": {
          "sandboxEndpointUrl": {
            "type": "string"
          },
          "productionEndpointUrl": {
            "type": "string"
          },
          "sandboxSecretSet": {
            "type": "boolean"
          },
          "productionSecretSet": {
            "type": "boolean"
          },
          "lastEventAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "SubmitContactRequestDto": {
        "required": [
          "name",
          "email",
          "subject",
          "message"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "email": {
            "maxLength": 320,
            "type": "string"
          },
          "subject": {
            "maxLength": 200,
            "type": "string"
          },
          "message": {
            "maxLength": 5000,
            "type": "string"
          }
        }
      },
      "SubmitContactResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "SubmitDemoRequestDto": {
        "required": [
          "name",
          "email",
          "company",
          "companySize",
          "preferredTime"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "email": {
            "maxLength": 320,
            "type": "string"
          },
          "company": {
            "maxLength": 200,
            "type": "string"
          },
          "companySize": {
            "type": "string"
          },
          "preferredTime": {
            "maxLength": 500,
            "type": "string"
          },
          "message": {
            "maxLength": 5000,
            "type": "string"
          }
        }
      },
      "SubmitDemoResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "SubscriptionResponseDto": {
        "type": "object",
        "properties": {
          "planTier": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "billingInterval": {
            "type": [
              "null",
              "string"
            ]
          },
          "currentPeriodEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "cancelAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageDto"
          }
        }
      },
      "SuccessfulReferralSdkDto": {
        "required": [
          "clientProvidedId"
        ],
        "type": "object",
        "properties": {
          "clientProvidedId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ThemeSdkDto": {
        "type": "object",
        "properties": {
          "primaryColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "backgroundColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "tintColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "tintAlpha": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "TrackReferralRequestDto": {
        "required": [
          "referralCode"
        ],
        "type": "object",
        "properties": {
          "referralCode": {
            "type": "string"
          }
        }
      },
      "TrackReferralResponseDto": {
        "required": [
          "referralTrackingId"
        ],
        "type": "object",
        "properties": {
          "referralTrackingId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "TrackRewardEventRequestDto": {
        "required": [
          "referralTrackingId",
          "refereeId"
        ],
        "type": "object",
        "properties": {
          "referralTrackingId": {
            "type": "string",
            "format": "uuid"
          },
          "refereeId": {
            "type": "string",
            "description": "Referee client provided id"
          },
          "eventName": {
            "type": [
              "null",
              "string"
            ]
          },
          "environment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationEnvironment"
              }
            ]
          }
        }
      },
      "TrackRewardEventResponseDto": {
        "required": [
          "rewardClaimed"
        ],
        "type": "object",
        "properties": {
          "rewardClaimed": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TriggerSdkDto": {
        "type": "object",
        "properties": {
          "position": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayMode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateAppUserDto": {
        "type": "object",
        "properties": {
          "attributes": {
            "type": [
              "null",
              "object"
            ]
          }
        }
      },
      "UpdateCampaignDto": {
        "type": "object",
        "properties": {
          "referrerExperience": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReferrerExperienceDto"
              }
            ]
          },
          "newUserExperience": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NewUserExperienceDto"
              }
            ]
          }
        }
      },
      "UpdateMediaDetailsRequest": {
        "required": [
          "caption"
        ],
        "type": "object",
        "properties": {
          "caption": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateProfileRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateProfileResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pictureUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UpdateProjectDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "appType": {
            "type": "string"
          },
          "referralRedirectLink": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "environmentScope": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WebhookEnvironmentScope"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UsageChartDayDto": {
        "required": [
          "date",
          "label"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageChartProjectDto"
            }
          }
        }
      },
      "UsageChartProjectDto": {
        "required": [
          "projectId",
          "projectName"
        ],
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "projectName": {
            "type": "string"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UsageChartResponseDto": {
        "type": "object",
        "properties": {
          "period": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageChartDayDto"
            }
          }
        }
      },
      "UsageDto": {
        "type": "object",
        "properties": {
          "used": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "limit": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Null means unlimited (Business tier).",
            "format": "int32"
          },
          "periodResetsAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UsageStatsProjectDto": {
        "required": [
          "projectId",
          "projectName"
        ],
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "projectName": {
            "type": "string"
          },
          "totalReferrals": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "successful": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pending": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rewardEvents": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UsageStatsResponseDto": {
        "type": "object",
        "properties": {
          "period": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalReferrals": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "successful": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pending": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rewardEvents": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageStatsProjectDto"
            }
          }
        }
      },
      "UserClaims": {
        "type": "object",
        "properties": {
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "pictureUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "givenName": {
            "type": [
              "null",
              "string"
            ]
          },
          "familyName": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailVerified": {
            "type": "boolean"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isValid": {
            "type": "boolean"
          }
        }
      },
      "UserProfileResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pictureUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UserRegistrationResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pictureUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserResponse": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pictureUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": "string"
          },
          "emailVerified": {
            "type": "boolean"
          },
          "onboardingCompleted": {
            "type": "boolean"
          },
          "needsClient": {
            "type": "boolean"
          },
          "clientId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookDto": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string"
          },
          "campaignUniqueId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "secretSet": {
            "type": "boolean"
          },
          "environmentScope": {
            "$ref": "#/components/schemas/WebhookEnvironmentScope"
          },
          "enabled": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "WebhookEnvironmentScope": {
        "type": "integer"
      },
      "WebhookListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WebhookLogDto": {
        "required": [
          "id",
          "timestamp",
          "event",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "statusCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "responseTime": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "WebhookLogListResponseDto": {
        "required": [
          "webhookId",
          "webhookName"
        ],
        "type": "object",
        "properties": {
          "webhookId": {
            "type": "string"
          },
          "webhookName": {
            "type": "string"
          },
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookLogDto"
            }
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WebhookRetryResponseDto": {
        "type": "object",
        "properties": {
          "deliveryId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        },
        "description": "Result of replaying a webhook from an existing log entry."
      }
    }
  },
  "tags": [
    {
      "name": "Campaign"
    },
    {
      "name": "Projects"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "App Users"
    },
    {
      "name": "Referrals"
    }
  ]
}