{
  "components": {
    "schemas": {
      "api.ClientItem": {
        "properties": {
          "avatarImageUrl": {
            "description": "AvatarImageUrl is the URL of the client's avatar image. Read-only.",
            "example": "https://portal.example.com/avatars/alex.png",
            "format": "uri",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the ID of the company the client belongs to. In multi-company portals see companyIds.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "companyIds": {
            "description": "CompanyIDs lists every company the client belongs to in multi-company portals.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "creationMethod": {
            "description": "CreationMethod records how the client was created. Read-only.",
            "enum": [
              "client",
              "directSignUp",
              "import",
              "internalUser"
            ],
            "example": "client",
            "type": "string"
          },
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values for the client, keyed by custom field key.",
            "type": "object"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "email": {
            "description": "Email is the client's email address, used as the unique login identifier within the portal.",
            "example": "alex.morgan@example.com",
            "format": "email",
            "type": "string"
          },
          "fallbackColor": {
            "description": "FallbackColor is the hex color (e.g. \"#4F46E5\") used as the avatar background when\nno avatar image is set. The native pattern documents intent; the constraint is\nre-applied to the spec by the enrich-openapi post-processing step.",
            "example": "#4F46E5",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "familyName": {
            "description": "FamilyName is the client's last (family) name.",
            "example": "Morgan",
            "type": "string"
          },
          "firstLoginDate": {
            "description": "FirstLogin is the timestamp of the client's first login. Read-only.",
            "example": "2024-01-15T09:30:00Z",
            "nullable": true,
            "type": "string"
          },
          "givenName": {
            "description": "GivenName is the client's first (given) name.",
            "example": "Alex",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "inviteUrl": {
            "description": "InviteUrl is the one-time invite link, returned only when an invite has just been sent. Read-only.",
            "example": "https://portal.example.com/invite/abc123",
            "format": "uri",
            "type": "string"
          },
          "invitedBy": {
            "description": "InvitedBy is the ID of the internal user who invited the client, when applicable. Read-only.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "type": "string"
          },
          "lastLoginDate": {
            "description": "LastLogin is the timestamp of the client's most recent login. Read-only.",
            "example": "2024-02-20T14:05:00Z",
            "nullable": true,
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "status": {
            "description": "Status is the client's lifecycle status. Server-managed (read-only).",
            "enum": [
              "unknown",
              "deleted",
              "active",
              "notInvited",
              "invited"
            ],
            "example": "active",
            "type": "string"
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.CompanyItem": {
        "properties": {
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values for the company, keyed by custom field key.",
            "type": "object"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "fallbackColor": {
            "description": "FallbackColor is the hex color (e.g. \"#4F46E5\") used as the background when no\nicon image is set. The native pattern documents intent; the constraint is\nre-applied to the spec by the enrich-openapi post-processing step.",
            "example": "#4F46E5",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "iconImageUrl": {
            "description": "AvatarImageURL is the URL of the company's icon image.",
            "example": "https://portal.example.com/icons/acme.png",
            "format": "uri",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "isPlaceholder": {
            "description": "IsPlaceholder is true when the company was auto-created as a placeholder. Read-only.",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "Name is the company's display name. Required on create.",
            "example": "Acme Inc",
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.CreateClientInput": {
        "properties": {
          "companyId": {
            "description": "CompanyID associates the client with a single company.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values keyed by custom field key.",
            "type": "object"
          },
          "email": {
            "description": "Email is the client's email address.",
            "example": "jane@example.com",
            "format": "email",
            "type": "string"
          },
          "familyName": {
            "description": "FamilyName is the client's last name.",
            "example": "Doe",
            "type": "string"
          },
          "givenName": {
            "description": "GivenName is the client's first name.",
            "example": "Jane",
            "type": "string"
          }
        },
        "required": [
          "email",
          "familyName",
          "givenName"
        ],
        "type": "object"
      },
      "api.CreateCompanyInput": {
        "properties": {
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values keyed by custom field key.",
            "type": "object"
          },
          "fallbackColor": {
            "description": "FallbackColor is the hex color used as the icon background when no image is set.",
            "example": "#4F46E5",
            "type": "string"
          },
          "iconImageUrl": {
            "description": "IconImageUrl is the URL of the company's icon image.",
            "example": "https://example.com/icon.png",
            "format": "uri",
            "type": "string"
          },
          "isPlaceholder": {
            "description": "IsPlaceholder marks the company as a placeholder record.",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "Name is the company's display name.",
            "example": "Acme Inc.",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "api.DeleteItemResponse": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "object": {
            "$ref": "#/components/schemas/constants.ApiObject"
          }
        },
        "type": "object"
      },
      "api.InternalUserItem": {
        "properties": {
          "avatarImageUrl": {
            "description": "AvatarImageUrl is the URL of the internal user's avatar image. Read-only.",
            "example": "https://portal.example.com/avatars/jordan.png",
            "format": "uri",
            "type": "string"
          },
          "companyAccessList": {
            "description": "CompanyAccessList is the set of company IDs the internal user can access when\nisClientAccessLimited is true. Empty when the user has access to all companies.",
            "example": [
              "550e8400-e29b-41d4-a716-446655440000"
            ],
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "email": {
            "description": "Email is the internal user's email address, used as the unique login identifier within the portal.",
            "example": "jordan.lee@example.com",
            "format": "email",
            "type": "string"
          },
          "fallbackColor": {
            "description": "FallbackColor is the hex color (e.g. \"#4F46E5\") used as the avatar background when\nno avatar image is set. The native pattern documents intent; the constraint is\nre-applied to the spec by the enrich-openapi post-processing step.",
            "example": "#4F46E5",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "familyName": {
            "description": "FamilyName is the internal user's last (family) name.",
            "example": "Lee",
            "type": "string"
          },
          "givenName": {
            "description": "GivenName is the internal user's first (given) name.",
            "example": "Jordan",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "isClientAccessLimited": {
            "description": "IsClientAccessLimited is true when the internal user can only access the companies\nlisted in companyAccessList; false (or null) grants access to all companies.",
            "example": true,
            "nullable": true,
            "type": "boolean"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "role": {
            "description": "Role is the internal user's role within the portal.",
            "example": "admin",
            "type": "string"
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.ItemFields": {
        "properties": {
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.List": {
        "properties": {
          "data": {
            "items": {},
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.UpdateClientInput": {
        "properties": {
          "companyId": {
            "description": "CompanyID moves the client to a different company.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values keyed by custom field key.",
            "type": "object"
          },
          "familyName": {
            "description": "FamilyName is the client's last name.",
            "example": "Doe",
            "type": "string"
          },
          "givenName": {
            "description": "GivenName is the client's first name.",
            "example": "Jane",
            "type": "string"
          }
        },
        "type": "object"
      },
      "api.UpdateCompanyInput": {
        "properties": {
          "customFields": {
            "additionalProperties": {
              "nullable": true,
              "oneOf": [
                {
                  "description": "Value for text, number (numeric string), email, url, and phoneNumber fields.",
                  "type": "string"
                },
                {
                  "description": "Selected option IDs for multiSelect fields.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "description": "Structured value for address fields.",
                  "properties": {
                    "addressLine1": {
                      "type": "string"
                    },
                    "addressLine2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "fullAddress": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "description": "CustomFields holds custom field values keyed by custom field key.",
            "type": "object"
          },
          "name": {
            "description": "Name is the company's display name.",
            "example": "Acme Inc.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "appConnection.AppConnection": {
        "properties": {
          "clientIds": {
            "description": "external facing root fields",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "companyId": {
            "nullable": true,
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "domainMetadata": {
            "$ref": "#/components/schemas/appConnection.AppConnectionFields"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "installId": {
            "type": "string"
          },
          "membershipType": {
            "$ref": "#/components/schemas/appConnection.AppConnectionMembershipType"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/appConnection.AppConnectionType"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "appConnection.AppConnectionFields": {
        "properties": {
          "autoSizeEmbed": {
            "type": "boolean"
          },
          "companyId": {
            "type": "string"
          },
          "embedCode": {
            "type": "string"
          },
          "embedLink": {
            "type": "string"
          },
          "embedlyData": {
            "$ref": "#/components/schemas/embedly.OEmbedResponse"
          },
          "extensionConfigId": {
            "type": "string"
          },
          "memberIDs": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "appConnection.AppConnectionMembershipType": {
        "enum": [
          "individual",
          "group",
          "company"
        ],
        "type": "string",
        "x-enum-varnames": [
          "Individual",
          "Group",
          "Company"
        ]
      },
      "appConnection.AppConnectionType": {
        "enum": [
          "embed",
          "link"
        ],
        "type": "string",
        "x-enum-varnames": [
          "AppConnectionEmbed",
          "AppConnectionLink"
        ]
      },
      "app_instance.AppConnectInput": {
        "properties": {
          "autoSizeEmbed": {
            "description": "AutoSizeEmbed controls whether an embed connection auto-sizes its iframe; defaults to true.",
            "example": true,
            "type": "boolean"
          },
          "clientIds": {
            "description": "ClientIDs are the clients the connection should be scoped to; all must belong to the same company.",
            "example": [
              "550e8400-e29b-41d4-a716-446655440000",
              "7c9e6679-7425-40de-944b-e07fc1f90ae7"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "companyId": {
            "description": "CompanyID scopes the connection to a company; required when no clients are provided.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "format": "uuid",
            "type": "string"
          },
          "content": {
            "description": "Content is the embed code (for embed connections) or the destination URL (for link connections).",
            "example": "https://app.example.com/embed",
            "type": "string"
          },
          "membershipType": {
            "description": "MembershipType overrides how the connection's membership is interpreted (individual, group, or company).",
            "enum": [
              "individual",
              "group",
              "company"
            ],
            "example": "company",
            "type": "string"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.AppConnectionType"
              }
            ],
            "description": "Type is the kind of connection to create.",
            "enum": [
              "embed",
              "link"
            ],
            "example": "link"
          }
        },
        "required": [
          "content",
          "type"
        ],
        "type": "object"
      },
      "app_instance.AppConnectionType": {
        "enum": [
          "embed",
          "link"
        ],
        "type": "string",
        "x-enum-varnames": [
          "AppConnectionEmbed",
          "AppConnectionLink"
        ]
      },
      "app_instance.AppInstall": {
        "properties": {
          "appBuilderId": {
            "type": "string"
          },
          "appId": {
            "description": "AppID is the identifier of the backing application, and the same value notifications carry in their\nappId so callers can join the two. Empty for embed, link, and manual installs, which have no backing app.",
            "example": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
            "format": "uuid",
            "type": "string"
          },
          "autoSizeEmbed": {
            "type": "boolean"
          },
          "content": {
            "description": "extension",
            "type": "string"
          },
          "disabled": {
            "description": "internal-api only\nmodule",
            "type": "boolean"
          },
          "displayName": {
            "description": "DisplayName is the human-readable label shown for the install in the sidebar.",
            "example": "Billing Portal",
            "type": "string"
          },
          "embedCode": {
            "type": "string"
          },
          "embedCount": {
            "type": "integer"
          },
          "embedLink": {
            "type": "string"
          },
          "embedlyData": {
            "$ref": "#/components/schemas/embedly.OEmbedResponse"
          },
          "icon": {
            "description": "Icon is the design-system icon name shown for the install; exposed on the public API.",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the app install. For core modules this is a deterministic UUID derived from the workspace and module name.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "isAuthenticated": {
            "type": "boolean"
          },
          "isDraft": {
            "description": "app-builder drafts: when the install was created by the App Builder and\nhas not yet been deployed, IsDraft is true and AppBuilderID points to the\nsource builder so the sidebar can deep-link to its session.",
            "type": "boolean"
          },
          "isInternalApp": {
            "type": "boolean"
          },
          "isRoot": {
            "type": "boolean"
          },
          "iuSidebarHidden": {
            "type": "boolean"
          },
          "notificationConfig": {
            "allOf": [
              {
                "$ref": "#/components/schemas/marketplace_application.NotificationConfig"
              }
            ],
            "description": "NotificationConfig carries the backing app's declared notification settings so the\nIU notifications page can render a row per setting. Internal-only for now (omitexternal);\nexposing it on the public installs API is handled separately."
          },
          "object": {
            "example": "appInstall",
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "queryParams": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "array"
          },
          "sort": {
            "type": "integer"
          },
          "status": {
            "description": "Status is the publication state of the install's backing app. Only apps built with the\nApp Builder can be \"draft\": they stay there until their first successful publish, and are\nnot shown to clients until then. Every other install is \"published\".",
            "enum": [
              "draft",
              "published"
            ],
            "example": "published",
            "type": "string"
          },
          "supportsExpiringTokens": {
            "type": "boolean"
          },
          "type": {
            "description": "Type is the kind of install.",
            "enum": [
              "core",
              "custom",
              "marketplace",
              "embed",
              "link",
              "manual"
            ],
            "example": "marketplace",
            "type": "string"
          },
          "visibilityConfig": {
            "items": {
              "$ref": "#/components/schemas/fields_models.VisibilityRule"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationActionLabel": {
        "properties": {
          "pluralNoun": {
            "example": "invoices",
            "type": "string"
          },
          "singularNoun": {
            "example": "invoice",
            "type": "string"
          },
          "verb": {
            "example": "review",
            "type": "string"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationSetting": {
        "properties": {
          "default": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationSurfaceDefaults"
              }
            ],
            "description": "Default is the per-internal-user default delivery state for each surface."
          },
          "id": {
            "description": "ID is the stable identifier to pass as `notificationSettingId` when creating a notification.",
            "example": "invoice-paid",
            "type": "string"
          },
          "label": {
            "description": "Label is the human-readable name shown to internal users.",
            "example": "Invoice paid",
            "type": "string"
          },
          "surfaces": {
            "description": "Surfaces are the delivery channels this setting supports.",
            "example": [
              "product",
              "email"
            ],
            "items": {
              "enum": [
                "product",
                "email"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationSettingDeltaInput": {
        "properties": {
          "default": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationSurfaceDefaults"
              }
            ],
            "description": "Default, when present, replaces the setting's per-internal-user default delivery state."
          },
          "id": {
            "description": "ID targets an existing setting to update or delete. Leave it empty to add a new setting —\nnew settings are always assigned a generated id.",
            "example": "invoice-paid",
            "type": "string"
          },
          "label": {
            "description": "Label, when present, replaces the setting's label. Required when adding a setting.",
            "example": "Invoice paid",
            "maxLength": 100,
            "type": "string"
          },
          "surfaces": {
            "description": "Surfaces, when present, replaces the setting's delivery channels. Required when adding a\nsetting.",
            "example": [
              "product",
              "email"
            ],
            "items": {
              "enum": [
                "product",
                "email"
              ],
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationSettingInput": {
        "properties": {
          "default": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationSurfaceDefaults"
              }
            ],
            "description": "Default is the per-internal-user default delivery state; omitted surfaces default to off."
          },
          "id": {
            "description": "ID is the setting's stable identifier, referenced by notificationSettingId on\nPOST /v1/notifications and by internal users' saved preferences. Omit it to have one\ngenerated.",
            "example": "invoice-paid",
            "type": "string"
          },
          "label": {
            "description": "Label is the human-readable name shown to internal users.",
            "example": "Invoice paid",
            "maxLength": 100,
            "type": "string"
          },
          "surfaces": {
            "description": "Surfaces are the delivery channels the setting supports.",
            "example": [
              "product",
              "email"
            ],
            "items": {
              "enum": [
                "product",
                "email"
              ],
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "label",
          "surfaces"
        ],
        "type": "object"
      },
      "app_instance.InstallNotificationSettings": {
        "properties": {
          "actionLabel": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationActionLabel"
              }
            ],
            "description": "ActionLabel is the app's generic \"[verb] [count] [noun]\" label, present only when declared."
          },
          "notifications": {
            "description": "Notifications is every notification setting the app exposes for this install. Empty when the\ninstall's backing app declares no settings. A setting's `id` is the value to pass as\n`notificationSettingId` when creating a notification via POST /v1/notifications. If the\nrecipient's preferences disable every requested delivery target for a setting, that POST\ncreates nothing and returns 202.",
            "items": {
              "$ref": "#/components/schemas/app_instance.InstallNotificationSetting"
            },
            "type": "array"
          },
          "object": {
            "example": "notificationSettings",
            "type": "string"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationSettingsCreateInput": {
        "properties": {
          "actionLabel": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationActionLabel"
              }
            ],
            "description": "ActionLabel optionally declares the app's generic \"[verb] [count] [noun]\" label."
          },
          "notifications": {
            "description": "Notifications is the app's initial list of notification settings.",
            "items": {
              "$ref": "#/components/schemas/app_instance.InstallNotificationSettingInput"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "notifications"
        ],
        "type": "object"
      },
      "app_instance.InstallNotificationSettingsPatchInput": {
        "properties": {
          "actionLabel": {
            "allOf": [
              {
                "$ref": "#/components/schemas/app_instance.InstallNotificationActionLabel"
              }
            ],
            "description": "ActionLabel, when present, replaces the app's action label. Send an empty object to clear\nit; omit the field to leave it unchanged."
          },
          "notifications": {
            "description": "Notifications is a list of per-setting deltas: an entry without an id adds a new setting, an\nentry with an id and no other fields deletes that setting, and an entry with an id plus\nfields updates the provided fields of that setting.",
            "items": {
              "$ref": "#/components/schemas/app_instance.InstallNotificationSettingDeltaInput"
            },
            "maxItems": 50,
            "type": "array"
          }
        },
        "type": "object"
      },
      "app_instance.InstallNotificationSurfaceDefaults": {
        "properties": {
          "email": {
            "description": "Email is true when the email channel starts enabled for internal users.",
            "example": false,
            "type": "boolean"
          },
          "product": {
            "description": "Product is true when the in-product channel starts enabled for internal users.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "audit_log.AuditEventType": {
        "enum": [
          "userLoggedIn",
          "userLoggedOut",
          "userLoginSucceeded",
          "userLoginFailed",
          "passwordReset",
          "passwordChanged",
          "googleDelinked",
          "magicLinkSent",
          "workspaceMfaEnabled",
          "workspaceMfaDisabled",
          "clientCreated",
          "clientActivated",
          "clientUpdated",
          "clientDeleted",
          "clientInvited",
          "companyCreated",
          "companyUpdated",
          "companyCustomFieldsUpdated",
          "companyDeleted",
          "clientCustomFieldsUpdated",
          "fileCreated",
          "fileUpdated",
          "fileDeleted",
          "folderCreated",
          "folderUpdated",
          "folderDeleted",
          "linkCreated",
          "linkUpdated",
          "linkDeleted",
          "invoiceCreated",
          "invoiceInitiated",
          "invoicePaid",
          "invoiceUpdated",
          "invoiceDeleted",
          "invoiceVoided",
          "invoiceDownloaded",
          "refundRequested",
          "refundSucceeded",
          "refundFailed",
          "messageSent",
          "messageChannelCreated",
          "messageChannelDeleted",
          "taskCreated",
          "taskUpdated",
          "taskDeleted",
          "taskArchived",
          "taskCompleted",
          "paymentSucceeded",
          "paymentFailed",
          "subscriptionCreated",
          "subscriptionCancelled",
          "priceCreated",
          "productCreated",
          "productUpdated",
          "contractRequested",
          "contractCompleted",
          "contractDownloaded",
          "fileDownloaded",
          "fileBatchDownloaded",
          "fileBatchDeleted",
          "noteCreated",
          "noteUpdated",
          "noteDeleted",
          "internalUserCreated",
          "internalUserDeleted",
          "internalUserAccessLevelChanged",
          "internalUserClientVisibilitySet",
          "apiKeyCreated",
          "apiKeyDeleted",
          "formCreated",
          "formEdited",
          "formAssigned",
          "formResponseCompleted",
          "customEvent",
          "sessionStarted",
          "sessionEnded",
          "appApiResourceRegistered",
          "appApiResourceUpdated",
          "appApiResourceDeleted",
          "appBuilderSecretUpdated",
          "appEventEmitted",
          "qaAgentBearerMinted",
          "qaImpersonationTokenMinted",
          "qaPrincipalCreated",
          "qaPrincipalDeleted"
        ],
        "type": "string",
        "x-enum-varnames": [
          "EventUserLoggedIn",
          "EventUserLoggedOut",
          "EventUserLoginSucceeded",
          "EventUserLoginFailed",
          "EventPasswordReset",
          "EventPasswordChanged",
          "EventGoogleDelinked",
          "EventMagicLinkSent",
          "EventWorkspaceMfaEnabled",
          "EventWorkspaceMfaDisabled",
          "EventClientCreated",
          "EventClientActivated",
          "EventClientUpdated",
          "EventClientDeleted",
          "EventClientInvited",
          "EventCompanyCreated",
          "EventCompanyUpdated",
          "EventCompanyCustomFieldsUpdated",
          "EventCompanyDeleted",
          "EventClientCustomFieldsUpdated",
          "EventFileCreated",
          "EventFileUpdated",
          "EventFileDeleted",
          "EventFolderCreated",
          "EventFolderUpdated",
          "EventFolderDeleted",
          "EventLinkCreated",
          "EventLinkUpdated",
          "EventLinkDeleted",
          "EventInvoiceCreated",
          "EventInvoiceInitiated",
          "EventInvoicePaid",
          "EventInvoiceUpdated",
          "EventInvoiceDeleted",
          "EventInvoiceVoided",
          "EventInvoiceDownloaded",
          "EventRefundRequested",
          "EventRefundSucceeded",
          "EventRefundFailed",
          "EventMessageSent",
          "EventMessageChannelCreated",
          "EventMessageChannelDeleted",
          "EventTaskCreated",
          "EventTaskUpdated",
          "EventTaskDeleted",
          "EventTaskArchived",
          "EventTaskCompleted",
          "EventPaymentSucceeded",
          "EventPaymentFailed",
          "EventSubscriptionCreated",
          "EventSubscriptionCancelled",
          "EventPriceCreated",
          "EventProductCreated",
          "EventProductUpdated",
          "EventContractRequested",
          "EventContractCompleted",
          "EventContractDownloaded",
          "EventFileDownloaded",
          "EventFileBatchDownloaded",
          "EventFileBatchDeleted",
          "EventNoteCreated",
          "EventNoteUpdated",
          "EventNoteDeleted",
          "EventInternalUserCreated",
          "EventInternalUserDeleted",
          "EventInternalUserAccessLevelChanged",
          "EventInternalUserClientVisibilitySet",
          "EventAPIKeyCreated",
          "EventAPIKeyDeleted",
          "EventFormCreated",
          "EventFormEdited",
          "EventFormAssigned",
          "EventFormResponseCompleted",
          "EventCustomEvent",
          "EventSessionStarted",
          "EventSessionEnded",
          "EventAppApiResourceRegistered",
          "EventAppApiResourceUpdated",
          "EventAppApiResourceDeleted",
          "EventAppBuilderSecretUpdated",
          "EventAppEventEmitted",
          "EventQAAgentBearerMinted",
          "EventQAImpersonationTokenMinted",
          "EventQAPrincipalCreated",
          "EventQAPrincipalDeleted"
        ]
      },
      "audit_log.AuditLog": {
        "properties": {
          "actorAgentId": {
            "description": "ActorAgentID identifies the agent-class QA bearer that authenticated the\nrequest behind this event, when ActorID is the real principal being\nimpersonated rather than a direct actor. Nil for every ordinary action —\nthis only appears on agent-as-user activity, never a bare user. Set from\nauth.RequestPermissions.ActorAgentID (stamped by the platform-api\nauthorizer's impersonation-token branch). Internal-only.",
            "example": "qa-agent:b1c2d3e4",
            "type": "string"
          },
          "actorId": {
            "description": "ActorID is the ID of the user or system actor that triggered the event.",
            "example": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff",
            "type": "string"
          },
          "actorRole": {
            "description": "ActorRole is the normalized role of the actor (e.g. \"admin\", \"staff\"). Internal-only.",
            "example": "admin",
            "type": "string"
          },
          "actorType": {
            "description": "ActorType identifies whether the actor is an internal user or a client user.",
            "enum": [
              "internalUser",
              "clientUser"
            ],
            "example": "internalUser",
            "type": "string"
          },
          "apiKeyRef": {
            "description": "APIKeyRef references the API key used for platform-API-sourced events. Internal-only.",
            "example": "key_01HZX8K9P2",
            "type": "string"
          },
          "automationId": {
            "description": "AutomationID is the ID of the automation that triggered the event, when applicable.",
            "example": "auto_01HZX8K9P2",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the ID of the company the actor belongs to, when the actor is a client user.",
            "example": "c1d2e3f4-a5b6-4712-9988-ffeeddccbbaa",
            "type": "string"
          },
          "context": {
            "additionalProperties": true,
            "description": "Context carries event-specific metadata as arbitrary key/value pairs.",
            "type": "object"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "eventDescription": {
            "description": "EventDescription is a human-readable description of the event.",
            "example": "Client created",
            "type": "string"
          },
          "eventDetails": {
            "example": "Updated billing address",
            "type": "string"
          },
          "eventTextEntity": {
            "example": "Acme Corp",
            "type": "string"
          },
          "eventTextPrefix": {
            "description": "EventTextPrefix / EventTextEntity / EventDetails are computed at read\ntime by FormatEvent (see event_formatter.go) and exposed to the internal\naudit log page and the CSV export so both render identical text. Not\npersisted, and tagged omitexternal — these are UI helpers, not part of\nthe public platform API contract.\n\nPrefix and Entity intentionally omit `omitempty`: FormatEvent sets one\nof them to \"\" on purpose for events like messageSent (entity is the\nlinked label, no prefix). With omitempty the empty string would drop\nfrom the wire, the client would `??` back to eventDescription, and the\nrow would render as `Message sent \"Message sent\"` instead of a single\nlinked `Message sent`.",
            "example": "Client",
            "type": "string"
          },
          "eventType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/audit_log.AuditEventType"
              }
            ],
            "description": "EventType categorizes the event.",
            "example": "clientCreated"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "ip": {
            "description": "IP is the client IP address that triggered the event.",
            "example": "203.0.113.42",
            "type": "string"
          },
          "isSuperAdminTriggered": {
            "description": "IsSuperAdminTriggered is set when the event originated from an Assembly super-admin\nproxy session (the admin signed in via /admin and is acting on behalf of a portal user).\nHidden from external / platform-API consumers via omitexternal.",
            "example": false,
            "type": "boolean"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/audit_log.Source"
              }
            ],
            "description": "Source indicates where the event originated from.",
            "enum": [
              "web",
              "platform",
              "automation",
              "system"
            ],
            "example": "web"
          },
          "updatedAt": {
            "type": "string"
          },
          "userAgent": {
            "description": "UserAgent is the User-Agent header of the request that triggered the event.\nUserAgent and IP are intentionally exposed to external consumers (no omitexternal tag).\nThese fields contain PII; consumers are responsible for GDPR/CCPA compliance",
            "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "audit_log.CreateAuditLogEventAPIRequest": {
        "properties": {
          "actorId": {
            "description": "ActorID is the ID of the actor the event is attributed to.",
            "example": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company the actor belongs to, when the actor is a client user.",
            "example": "c1d2e3f4-a5b6-4712-9988-ffeeddccbbaa",
            "type": "string"
          },
          "context": {
            "additionalProperties": true,
            "description": "Context carries event-specific metadata as arbitrary key/value pairs.",
            "type": "object"
          },
          "eventDescription": {
            "description": "EventDescription is a human-readable description of the event (max 500 characters).",
            "example": "Client viewed the dashboard",
            "maxLength": 500,
            "type": "string"
          },
          "eventType": {
            "description": "CustomEventType is the event type to record (max 100 characters).",
            "example": "customEvent",
            "maxLength": 100,
            "type": "string"
          },
          "lastActivityAt": {
            "description": "LastActivityAt is the frontend's latest evidence of user activity for the session\nthis event pertains to. On sessionEnded it stamps the entry's CreatedAt so the\ninactivity timer reports the actual moment the user became idle; on sessionStarted\nit carries the prior session's last-activity forward so the orphan backfill can\nstamp the synthetic sessionEnded accurately.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "context",
          "eventDescription",
          "eventType"
        ],
        "type": "object"
      },
      "audit_log.ListAuditLogsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/audit_log.AuditLog"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "audit_log.Source": {
        "enum": [
          "web",
          "platform",
          "automation",
          "system"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SourceWeb",
          "SourcePlatform",
          "SourceAutomation",
          "SourceSystem"
        ]
      },
      "billing.BillingFieldsModel": {
        "properties": {
          "absorbTransactionFees": {
            "type": "boolean"
          },
          "allowPaymentViaACH": {
            "type": "boolean"
          },
          "allowPaymentViaCC": {
            "type": "boolean"
          },
          "attachment": {
            "type": "string"
          },
          "attachmentIdentityId": {
            "type": "string"
          },
          "cancelledAt": {
            "type": "string"
          },
          "clientUserId": {
            "type": "string"
          },
          "collectionMethod": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "createDraft": {
            "type": "boolean"
          },
          "createdBy": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "dateOfIssue": {
            "type": "string"
          },
          "daysUntilDue": {
            "type": "integer"
          },
          "dueDate": {
            "type": "string"
          },
          "fileKey": {
            "type": "string"
          },
          "ignoreStripe": {
            "type": "boolean"
          },
          "interval": {
            "type": "string"
          },
          "intervalCount": {
            "description": "only for subscription invoices",
            "type": "integer"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/fields_models.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "type": "string"
          },
          "paidManually": {
            "type": "boolean"
          },
          "prorate": {
            "type": "boolean"
          },
          "quickbooksId": {
            "type": "string"
          },
          "reactivatedBy": {
            "description": "not set by the front-end",
            "type": "string"
          },
          "resetBillingCycle": {
            "type": "boolean"
          },
          "scheduleEndDate": {
            "type": "integer"
          },
          "scheduleIterations": {
            "type": "integer"
          },
          "scheduleStartDate": {
            "type": "integer"
          },
          "taxPercentage": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "billing.GetSubscriptionTemplatesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/billing.Template"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "billing.PurchaseFields": {
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/invoice.Origin"
          }
        },
        "type": "object"
      },
      "billing.SubscriptionFields": {
        "properties": {
          "absorbTransactionFees": {
            "type": "boolean"
          },
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/invoice.PaymentsAddress"
              }
            ],
            "description": "Address stores the selected billing address from custom fields"
          },
          "allowPaymentViaACH": {
            "type": "boolean"
          },
          "allowPaymentViaCC": {
            "type": "boolean"
          },
          "attachment": {
            "type": "string"
          },
          "cancelledAt": {
            "type": "string"
          },
          "clientUserId": {
            "type": "string"
          },
          "collectionMethod": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "daysUntilDue": {
            "type": "integer"
          },
          "forcePaused": {
            "description": "ForcePaused indicates this subscription was paused due to workspace plan lapse",
            "type": "boolean"
          },
          "interval": {
            "type": "string"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/fields_models.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "type": "string"
          },
          "paymentPreferences": {
            "allOf": [
              {
                "$ref": "#/components/schemas/payment.PaymentPreferences"
              }
            ],
            "description": "new property to hold payment preferenced for the subscription"
          },
          "prorate": {
            "type": "boolean"
          },
          "purchaseFields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billing.PurchaseFields"
              }
            ],
            "description": "Used to store a confirmation token to automatically pay the first invoice of a subscription created from a purchase"
          },
          "reactivatedBy": {
            "description": "not set by the front-end",
            "type": "string"
          },
          "resetBillingCycle": {
            "type": "boolean"
          },
          "scheduleEndDate": {
            "type": "integer"
          },
          "scheduleIterations": {
            "type": "integer"
          },
          "scheduleStartDate": {
            "type": "integer"
          },
          "taxPercentage": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "billing.Template": {
        "properties": {
          "additionalFields": {
            "$ref": "#/components/schemas/billing.TemplateAdditionalFields"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "currency": {
            "description": "Currency is the three-letter ISO 4217 currency code the subscription is billed in.",
            "example": "usd",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "fields": {
            "$ref": "#/components/schemas/billing.BillingFieldsModel"
          },
          "filteredListIndexPkey": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billingutils.BillingPeriodType"
              }
            ],
            "description": "Interval is the billing cadence of the subscription.",
            "enum": [
              "day",
              "week",
              "month",
              "quarterly",
              "biannually",
              "year",
              "semiannually"
            ],
            "example": "month"
          },
          "intervalCount": {
            "description": "IntervalCount is the number of intervals between each billing cycle.",
            "example": 1,
            "type": "integer"
          },
          "lineItems": {
            "description": "LineItems are the products and one-off charges billed by this subscription template.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "description": "Memo is the note shown to the client on invoices generated from this template.",
            "example": "Thank you for your business",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name of the subscription template.",
            "example": "Monthly Retainer",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "taxPercentage": {
            "description": "TaxPercentage is the tax rate applied to the subscription, expressed as a percentage; absent when no tax is configured.",
            "example": 8.25,
            "nullable": true,
            "type": "number"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "billing.TemplateAdditionalFields": {
        "properties": {
          "templateName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "billingutils.BillingPeriodType": {
        "enum": [
          "day",
          "week",
          "month",
          "quarterly",
          "biannually",
          "year",
          "semiannually"
        ],
        "type": "string",
        "x-enum-varnames": [
          "BillingPeriodTypeDay",
          "BillingPeriodTypeWeek",
          "BillingPeriodTypeMonth",
          "BillingPeriodTypeQuarter",
          "BillingPeriodTypeBiannual",
          "BillingPeriodTypeYear",
          "BillingPeriodTypeSemiAnnually"
        ]
      },
      "companies.ManageCompanyClientError": {
        "properties": {
          "clientId": {
            "type": "string"
          },
          "error": {
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "company.addClientToCompanyRequest": {
        "properties": {
          "clientIds": {
            "description": "ClientIDs are the IDs of the clients to add to the company. At least one ID is required.",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "clientIds"
        ],
        "type": "object"
      },
      "company.addClientToCompanyResponse": {
        "properties": {
          "addClientErrors": {
            "description": "AddClientErrors lists the clients that could not be added, with the reason for each.",
            "items": {
              "$ref": "#/components/schemas/companies.ManageCompanyClientError"
            },
            "type": "array"
          },
          "addedClientIds": {
            "description": "AddedClientIDs are the IDs of the clients successfully added to the company.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "constants.ApiObject": {
        "enum": [
          "client",
          "internalUser",
          "company",
          "customField",
          "customFieldOption",
          "file",
          "fileChannel",
          "folder",
          "messageChannel",
          "message",
          "notification"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ApiObjectClient",
          "ApiObjectInternalUser",
          "ApiObjectCompany",
          "ApiObjectCustomField",
          "ApiObjectCustomFieldOption",
          "ApiObjectFile",
          "ApiObjectFileChannel",
          "ApiObjectFolder",
          "ApiObjectMessageChannel",
          "ApiObjectMessage",
          "ApiObjectNotification"
        ]
      },
      "constants.SignStatus": {
        "enum": [
          "pending",
          "sent",
          "done"
        ],
        "type": "string",
        "x-enum-varnames": [
          "FileEsigStatusSignPending",
          "FileEsigStatusSignSent",
          "FileEsigStatusSignDone"
        ]
      },
      "contracts.Bounds": {
        "properties": {
          "height": {
            "type": "number"
          },
          "pageHeight": {
            "type": "number"
          },
          "pageWidth": {
            "type": "number"
          },
          "resizedHeight": {
            "type": "integer"
          },
          "resizedWidth": {
            "type": "integer"
          },
          "width": {
            "type": "number"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "contracts.Contract": {
        "properties": {
          "clientId": {
            "description": "ClientID is the ID of the client the contract is assigned to.",
            "example": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the ID of the company the contract is associated with.",
            "example": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
            "format": "uuid",
            "type": "string"
          },
          "contractTemplateId": {
            "description": "ContractTemplateID is the ID of the template the contract was created from, when applicable.",
            "example": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creationMode": {
            "description": "CreationMode indicates whether the contract was created from a template or as a one-off document.",
            "enum": [
              "oneOff",
              "template"
            ],
            "example": "template",
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "fields": {
            "description": "ContractFields Represent all the inputs which are dropped on the contract to be filled by admin, client or autofilled",
            "items": {
              "$ref": "#/components/schemas/contracts.ContractField"
            },
            "type": "array"
          },
          "fileUrl": {
            "description": "FileKey is a presigned URL to the original (unsigned) contract document.",
            "example": "https://files.assembly.com/protected/contract.pdf",
            "format": "uri",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "isMigrated": {
            "type": "boolean"
          },
          "name": {
            "description": "Name is the human-readable name of the contract.",
            "example": "Master Services Agreement",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/users.Owner"
          },
          "pageKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "portalId": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "recipientId": {
            "description": "Deprecated: use ClientID and CompanyID instead",
            "example": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
            "format": "uuid",
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "shareDate": {
            "format": "date-time",
            "type": "string"
          },
          "signatureEvents": {
            "description": "SignatureEvents holds the audit information about the user who performed any action on the contract document",
            "items": {
              "$ref": "#/components/schemas/contracts.SignatureEvent"
            },
            "type": "array"
          },
          "signedFileUrl": {
            "description": "SignedFileKey is a presigned URL to the signed contract document, populated once the contract is signed.",
            "example": "https://files.assembly.com/protected/contract-signed.pdf",
            "format": "uri",
            "type": "string"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/contracts.ContractStatus"
              }
            ],
            "description": "Status is the current status of the contract.",
            "enum": [
              "pending",
              "signed"
            ],
            "example": "pending"
          },
          "submissionDate": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "contracts.ContractCreationMode": {
        "enum": [
          "oneOff",
          "template"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ContractCreationModeOneOff",
          "ContractCreationModeTemplate"
        ]
      },
      "contracts.ContractField": {
        "properties": {
          "autoFillField": {
            "description": "pattern is {{client.firstName}} or {{client.customField.\u003ccustom_field_id\u003e}}",
            "type": "string"
          },
          "bounds": {
            "$ref": "#/components/schemas/contracts.Bounds"
          },
          "encodedImgValue": {
            "type": "string"
          },
          "id": {
            "description": "ID uniquely identifies the field within the contract.",
            "example": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
            "type": "string"
          },
          "inputType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/contracts.InputType"
              }
            ],
            "description": "InputType indicates who fills the field, or whether it is auto-filled or variable.",
            "enum": [
              "client",
              "fixed",
              "autoFill",
              "variable"
            ],
            "example": "client"
          },
          "isOptional": {
            "description": "IsOptional reports whether the field may be left blank.",
            "example": false,
            "type": "boolean"
          },
          "label": {
            "example": "Signature",
            "type": "string"
          },
          "page": {
            "description": "Page is the 0-based page index the field is placed on.",
            "example": 0,
            "type": "integer"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/contracts.FieldType"
              }
            ],
            "description": "FieldType is the kind of input rendered on the contract.",
            "enum": [
              "signature",
              "initials",
              "date",
              "text"
            ],
            "example": "signature"
          },
          "value": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "contracts.ContractStatus": {
        "enum": [
          "pending",
          "signed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ContractStatusPending",
          "ContractStatusSigned"
        ]
      },
      "contracts.ContractTemplate": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/contracts.ContractField"
            },
            "type": "array"
          },
          "fileKey": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "latestSubmissionDate": {
            "description": "LatestSubmissionDate is the timestamp of the most recent signed contract from this template.",
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "description": "Name is the human-readable name of the template.",
            "example": "NDA Template",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/users.Owner"
          },
          "pageKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "portalId": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "requestsCount": {
            "description": "SubmissionRequests is the number of contracts that have been sent from this template.",
            "example": 12,
            "type": "integer"
          },
          "submissionsCount": {
            "description": "Submissions is the number of contracts created from this template that have been signed.",
            "example": 8,
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "contracts.CreateContractRequest": {
        "properties": {
          "clientId": {
            "description": "ClientId is the client the contract is assigned to. One of clientId or recipientId must be provided.",
            "example": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyId is the company the contract is associated with. Required when the client belongs to multiple companies.",
            "example": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
            "format": "uuid",
            "type": "string"
          },
          "contractTemplateId": {
            "description": "ContractTemplateID is the template to create the contract from. Required unless creationMode is oneOff.",
            "example": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
            "format": "uuid",
            "type": "string"
          },
          "creationMode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/contracts.ContractCreationMode"
              }
            ],
            "description": "CreationMode indicates whether the contract is created from a template or as a one-off document.",
            "enum": [
              "oneOff",
              "template"
            ],
            "example": "template"
          },
          "fields": {
            "description": "ContractFields are the input fields for a one-off contract.",
            "items": {
              "$ref": "#/components/schemas/contracts.ContractField"
            },
            "type": "array"
          },
          "fileKey": {
            "description": "FileKey is the storage key of the uploaded document for a one-off contract.",
            "example": "uploads/contract.pdf",
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "name": {
            "description": "Name is the human-readable name of the contract.",
            "example": "Master Services Agreement",
            "type": "string"
          },
          "recipientId": {
            "description": "RecipientId is the recipient the contract is assigned to. Deprecated: use clientId instead. One of clientId or recipientId must be provided.",
            "example": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
            "format": "uuid",
            "type": "string"
          },
          "variableValues": {
            "additionalProperties": true,
            "description": "VariableValues maps a template's variable field IDs to their values. Must cover every variable field on the template.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "contracts.FieldType": {
        "enum": [
          "signature",
          "initials",
          "date",
          "text",
          "checkbox"
        ],
        "type": "string",
        "x-enum-varnames": [
          "FieldTypeSignature",
          "FieldTypeInitials",
          "FieldTypeDate",
          "FieldTypeText",
          "FieldTypeCheckbox"
        ]
      },
      "contracts.InputType": {
        "enum": [
          "client",
          "fixed",
          "autoFill",
          "variable"
        ],
        "type": "string",
        "x-enum-varnames": [
          "InputTypeClient",
          "InputTypeFixed",
          "InputTypeAutoFill",
          "InputTypeVariable"
        ]
      },
      "contracts.ListContractTemplatesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/contracts.ContractTemplate"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "contracts.ListContractsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/contracts.Contract"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "contracts.SignatureEvent": {
        "properties": {
          "email": {
            "type": "string"
          },
          "eventAt": {
            "type": "string"
          },
          "sourceIP": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/contracts.SignatureEventType"
          }
        },
        "type": "object"
      },
      "contracts.SignatureEventType": {
        "enum": [
          "sent",
          "signed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SignatureEventTypeSent",
          "SignatureEventTypeSigned"
        ]
      },
      "customfields.ClientCustomField": {
        "properties": {
          "entityType": {
            "description": "EntityType is the entity the custom field belongs to.",
            "enum": [
              "client",
              "company"
            ],
            "example": "client",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the custom field.",
            "example": "d8e8fca2-dc0f-4f3b-9a2e-1f6f3c2b7a10",
            "format": "uuid",
            "type": "string"
          },
          "key": {
            "description": "Key is a \"human-readable\" alternative to ID, uniqueness must be enforced on this identifier",
            "example": "accountTier",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name of the custom field.",
            "example": "Account tier",
            "type": "string"
          },
          "object": {
            "description": "Object is the resource type discriminator.",
            "example": "customField",
            "type": "string"
          },
          "options": {
            "description": "Options are the selectable values; only present for multiSelect fields.",
            "items": {
              "$ref": "#/components/schemas/customfields.ClientCustomFieldOption"
            },
            "type": "array"
          },
          "order": {
            "description": "Order is the position of the custom field relative to others of the same entity type.",
            "example": 0,
            "type": "integer"
          },
          "type": {
            "description": "Type is the data type of the custom field.",
            "enum": [
              "text",
              "number",
              "email",
              "url",
              "phoneNumber",
              "address",
              "multiSelect"
            ],
            "example": "multiSelect",
            "type": "string"
          }
        },
        "type": "object"
      },
      "customfields.ClientCustomFieldOption": {
        "properties": {
          "color": {
            "description": "Color is the display color for the option.",
            "example": "rgba(204, 0, 0, 1)",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the option.",
            "example": "f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c",
            "format": "uuid",
            "type": "string"
          },
          "key": {
            "description": "Key is a \"human-readable\" alternative to ID\nuniqueness must be enforced against other option key values for a given custom field",
            "example": "highPriority",
            "type": "string"
          },
          "label": {
            "description": "Label is the human-readable text shown for the option.",
            "example": "High priority",
            "type": "string"
          },
          "object": {
            "description": "Object is the resource type discriminator.",
            "example": "customFieldOption",
            "type": "string"
          }
        },
        "type": "object"
      },
      "customfields.createCustomFieldInput": {
        "properties": {
          "entityType": {
            "description": "EntityType is the entity the custom field belongs to.",
            "enum": [
              "client",
              "company"
            ],
            "example": "client",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name of the custom field.",
            "example": "Account tier",
            "type": "string"
          },
          "options": {
            "description": "Options are the selectable values; only valid for multiSelect fields.",
            "items": {
              "$ref": "#/components/schemas/customfields.createCustomFieldOption"
            },
            "type": "array"
          },
          "type": {
            "description": "Type is the data type of the custom field.",
            "enum": [
              "text",
              "number",
              "email",
              "url",
              "phoneNumber",
              "address",
              "multiSelect"
            ],
            "example": "multiSelect",
            "type": "string"
          }
        },
        "required": [
          "entityType",
          "name",
          "type"
        ],
        "type": "object"
      },
      "customfields.createCustomFieldOption": {
        "properties": {
          "label": {
            "description": "Label is the human-readable text shown for the option.",
            "example": "High priority",
            "type": "string"
          }
        },
        "required": [
          "label"
        ],
        "type": "object"
      },
      "customfields.createCustomFieldsRequest": {
        "properties": {
          "customFields": {
            "description": "CustomFields is the list of custom fields to create; must contain at least one entry.",
            "items": {
              "$ref": "#/components/schemas/customfields.createCustomFieldInput"
            },
            "type": "array"
          }
        },
        "required": [
          "customFields"
        ],
        "type": "object"
      },
      "customfields.createCustomFieldsResponse": {
        "properties": {
          "customFields": {
            "description": "CustomFields are the custom fields that were created.",
            "items": {
              "$ref": "#/components/schemas/customfields.ClientCustomField"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dispatcher.Error": {
        "properties": {
          "code": {
            "type": "string"
          },
          "data": {},
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "embedly.OEmbedResponse": {
        "properties": {
          "author_name": {
            "type": "string"
          },
          "author_url": {
            "type": "string"
          },
          "cache_age": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "html": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "provider_url": {
            "type": "string"
          },
          "thumbnail_height": {
            "type": "integer"
          },
          "thumbnail_url": {
            "type": "string"
          },
          "thumbnail_width": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "fields_models.LineItem": {
        "properties": {
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "priceId": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "rate": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "fields_models.VisibilityComparator": {
        "enum": [
          "includesAnyOf",
          "doesntContainAnyOf",
          "includesAllOf"
        ],
        "type": "string",
        "x-enum-varnames": [
          "IncludesAnyOf",
          "DoesntContainAnyOf",
          "IncludesAllOf"
        ]
      },
      "fields_models.VisibilityRule": {
        "properties": {
          "comparator": {
            "$ref": "#/components/schemas/fields_models.VisibilityComparator"
          },
          "customFieldId": {
            "description": "only needed when ruleType is CustomFieldVisibility",
            "type": "string"
          },
          "isCompanyCustomField": {
            "type": "boolean"
          },
          "ruleType": {
            "$ref": "#/components/schemas/fields_models.VisibilityRuleType"
          },
          "valueItems": {
            "description": "used for client visibility rules with per-company granularity",
            "items": {
              "$ref": "#/components/schemas/fields_models.VisibilityRuleValueItem"
            },
            "type": "array"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "fields_models.VisibilityRuleType": {
        "enum": [
          "client",
          "company",
          "customField",
          "noVisibility"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ClientVisibility",
          "CompanyVisibility",
          "CustomFieldVisibility",
          "NoVisibility"
        ]
      },
      "fields_models.VisibilityRuleValueItem": {
        "properties": {
          "companyId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "filechannel.CreateFileChannelInput": {
        "properties": {
          "clientId": {
            "description": "Client to create an individual channel for (new schema).",
            "example": "a1b2c3d4-0000-0000-0000-000000000001",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "description": "Company to create a company-wide channel for (new schema).",
            "example": "a1b2c3d4-0000-0000-0000-000000000002",
            "format": "uuid",
            "type": "string"
          },
          "memberIds": {
            "description": "Member ids for a group channel (new schema, used with membershipType=group).",
            "example": [
              "a1b2c3d4-0000-0000-0000-000000000003"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "membershipEntityId": {
            "description": "Id of the entity (client or company) the channel is based on (deprecated legacy schema).",
            "example": "a1b2c3d4-0000-0000-0000-000000000002",
            "format": "uuid",
            "type": "string"
          },
          "membershipType": {
            "description": "Channel grouping type.",
            "enum": [
              "individual",
              "company",
              "group"
            ],
            "example": "company",
            "type": "string"
          }
        },
        "type": "object"
      },
      "filechannels.FileChannel": {
        "properties": {
          "clientId": {
            "description": "Populated in the platform API only, these fields do not exist in the DB\nClient this channel belongs to (set when membershipType is individual).",
            "example": "a1b2c3d4-0000-0000-0000-000000000001",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "description": "Company this channel belongs to (set when membershipType is company).",
            "example": "a1b2c3d4-0000-0000-0000-000000000002",
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "lastNotificationSenderId": {
            "description": "Id of the member who triggered the most recent notification.",
            "example": "a1b2c3d4-0000-0000-0000-000000000003",
            "format": "uuid",
            "type": "string"
          },
          "lastNotificationTimestamp": {
            "description": "Notification fields populated from Fields[\"lastNotification\"]\nTimestamp of the most recent notification on the channel.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "memberIds": {
            "description": "Ids of the channel members.",
            "example": [
              "a1b2c3d4-0000-0000-0000-000000000003"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "membershipEntityId": {
            "description": "Id of the entity (client or company) the channel is based on (deprecated legacy field).",
            "example": "a1b2c3d4-0000-0000-0000-000000000002",
            "format": "uuid",
            "type": "string"
          },
          "membershipType": {
            "description": "How the channel's members are grouped together.",
            "enum": [
              "individual",
              "company",
              "group"
            ],
            "example": "company",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "rootClientPermissions": {
            "description": "Default permission level granted to client members on the channel's root folder.",
            "enum": [
              "read_write",
              "read_only"
            ],
            "example": "read_write",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "files.AdditionalFields": {
        "type": "object"
      },
      "files.CreateFileInput": {
        "properties": {
          "channelID": {
            "description": "ChannelID is the file channel the item is created in.",
            "example": "a8f2c1d4-1234-4abc-9def-0123456789ab",
            "type": "string"
          },
          "clientPermissions": {
            "description": "ClientPermissions sets the folder locking permissions for the created file/folder",
            "enum": [
              "read_write",
              "read_only"
            ],
            "example": "read_write",
            "type": "string"
          },
          "duplicateBehavior": {
            "allOf": [
              {
                "$ref": "#/components/schemas/files.DuplicateBehavior"
              }
            ],
            "description": "DuplicateBehavior specifies how to handle if a file with the same name already exists at the path.\nDefaults to \"append\" (keep both) when omitted.",
            "enum": [
              "append",
              "replace"
            ],
            "example": "append"
          },
          "fileKey": {
            "description": "FileKey is the S3 object key for an already-uploaded file's binary data.",
            "example": "files/a8f2c1d4/2024-01-02T15:04:05Z/brochure.pdf",
            "type": "string"
          },
          "linkUrl": {
            "description": "FileURL is the external link target. Required when creating a link.",
            "example": "https://example.com/brochure.pdf",
            "format": "uri",
            "type": "string"
          },
          "path": {
            "description": "Path is the folder location for the item. Required when creating a folder.",
            "example": "/contracts/2024",
            "type": "string"
          },
          "type": {
            "description": "Type is the kind of item to create. Defaults to \"file\" when omitted on the path.",
            "enum": [
              "file",
              "folder",
              "link"
            ],
            "example": "file",
            "type": "string"
          }
        },
        "required": [
          "channelID",
          "type"
        ],
        "type": "object"
      },
      "files.DuplicateBehavior": {
        "enum": [
          "append",
          "replace"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DuplicateBehaviorAppend",
          "DuplicateBehaviorReplace"
        ]
      },
      "files.Fields": {
        "properties": {
          "eSignatureStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.SignStatus"
              }
            ],
            "description": "ESignatureStatus reflects the e-signature state when the file is part of a signing flow.",
            "enum": [
              "pending",
              "sent",
              "done"
            ],
            "example": "done"
          },
          "linkUrl": {
            "description": "FileUrl is the external link target, only set for link items.",
            "example": "https://example.com/brochure.pdf",
            "format": "uri",
            "type": "string"
          },
          "name": {
            "description": "Name is the display name of the file, folder, or link.",
            "example": "brochure.pdf",
            "type": "string"
          },
          "path": {
            "description": "Path is the location of the item within its file channel.",
            "example": "/contracts/2024",
            "type": "string"
          },
          "size": {
            "description": "Size is the file size in bytes.",
            "example": 20480,
            "type": "integer"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/files.FileUploadStatus"
              }
            ],
            "description": "Status indicates whether the file's binary data has finished uploading.",
            "enum": [
              "pending",
              "complete"
            ],
            "example": "complete"
          }
        },
        "type": "object"
      },
      "files.File": {
        "properties": {
          "additionalFields": {
            "$ref": "#/components/schemas/files.AdditionalFields"
          },
          "channelId": {
            "description": "ChannelID is the file channel the item belongs to.",
            "example": "a8f2c1d4-1234-4abc-9def-0123456789ab",
            "type": "string"
          },
          "clientPermissions": {
            "description": "ClientPermissions controls client read/write access for folders.",
            "enum": [
              "read_write",
              "read_only"
            ],
            "example": "read_write",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "description": "CreatorId is the id of the user who created the file.",
            "example": "f4a1b2c3-1234-4abc-9def-0123456789ab",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "downloadUrl": {
            "description": "DownloadURL is a presigned URL for downloading the file's contents.",
            "format": "uri",
            "type": "string"
          },
          "fields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/files.Fields"
              }
            ],
            "description": "Fields holds the item's name, path, link target, size, and status."
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "lastModifiedBy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/files.LastModifiedBy"
              }
            ],
            "description": "LastModifiedBy identifies the user who last modified the file."
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "updatedAt": {
            "description": "UpdatedDate is when the file was last updated.",
            "format": "date-time",
            "type": "string"
          },
          "uploadUrl": {
            "description": "UploadURL is a presigned URL for uploading the file's binary data, set on creation of an unuploaded file.",
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "files.FilePresignedDownload": {
        "properties": {
          "downloadUrl": {
            "description": "DownloadUrl is a short-lived presigned URL for the file's binary contents.",
            "example": "https://s3.amazonaws.com/bucket/protected/...?X-Amz-Signature=...",
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "files.FileUploadStatus": {
        "enum": [
          "pending",
          "complete"
        ],
        "type": "string",
        "x-enum-varnames": [
          "UploadPending",
          "UploadComplete"
        ]
      },
      "files.LastModifiedBy": {
        "properties": {
          "id": {
            "description": "Id is the id of the user who last modified the file.",
            "example": "f4a1b2c3-1234-4abc-9def-0123456789ab",
            "type": "string"
          },
          "object": {
            "description": "Object is the entity type of the modifier (e.g. internalUser, client).",
            "example": "internalUser",
            "type": "string"
          }
        },
        "type": "object"
      },
      "files.ListOutput": {
        "properties": {
          "data": {
            "description": "Data is the page of files, folders, and links.",
            "items": {
              "$ref": "#/components/schemas/files.File"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.CreateFormInput": {
        "properties": {
          "additionalFields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormAdditionalFields"
              }
            ],
            "description": "AdditionalFields holds form-level metadata such as title and description."
          },
          "fields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormFields"
              }
            ],
            "description": "Fields is the ordered set of questions/inputs that make up the form."
          }
        },
        "required": [
          "additionalFields",
          "fields"
        ],
        "type": "object"
      },
      "forms.Form": {
        "properties": {
          "additionalFields": {
            "$ref": "#/components/schemas/forms.FormAdditionalFields"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "fields": {
            "$ref": "#/components/schemas/forms.FormFields"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/users.Owner"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.FormAdditionalFields": {
        "properties": {
          "formResponseRequests": {
            "description": "Number of clients the form has been assigned to (response requests created).",
            "example": 12,
            "type": "integer"
          },
          "formResponseSubmissions": {
            "description": "Number of assigned responses that have been completed.",
            "example": 8,
            "type": "integer"
          },
          "latestSubmissionDate": {
            "description": "Timestamp of the most recent completed submission, if any.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.FormFieldType": {
        "enum": [
          "shortAnswer",
          "longAnswer",
          "singleSelect",
          "multiSelect",
          "title",
          "fileUpload",
          "phoneNumber",
          "email",
          "date",
          "dropdown"
        ],
        "type": "string",
        "x-enum-varnames": [
          "FormFieldTypeShortAnswer",
          "FormFieldTypeLongAnswer",
          "FormFieldTypeSingleSelect",
          "FormFieldTypeMultiSelect",
          "FormFieldTypeTitle",
          "FormFieldTypeFileUpload",
          "FormFieldTypePhoneNumber",
          "FormFieldTypeEmail",
          "FormFieldTypeDate",
          "FormFieldTypeDropdown"
        ]
      },
      "forms.FormFields": {
        "properties": {
          "allowMultipleSubmissions": {
            "description": "Whether a client may submit the form more than once.",
            "example": false,
            "type": "boolean"
          },
          "description": {
            "description": "Human-readable description shown to clients.",
            "example": "Tell us about your business so we can tailor onboarding.",
            "type": "string"
          },
          "formFieldIds": {
            "description": "IDs of the form's question templates, in display order.",
            "example": [
              "q_abc123",
              "q_def456"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "formFields": {
            "description": "Questions only being used in the request DTO and not while saving in the database\nit indicates the questions which are being created/updated by the POST/PUT APIs",
            "items": {
              "$ref": "#/components/schemas/forms.FormQuestionFields"
            },
            "type": "array"
          },
          "name": {
            "description": "Display name of the form.",
            "example": "Client Intake Form",
            "type": "string"
          },
          "visibility": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormVisibilityType"
              }
            ],
            "description": "Controls who can see the form: only clients it is sent to, or all clients.",
            "enum": [
              "requestedClients",
              "allClients"
            ],
            "example": "requestedClients"
          }
        },
        "type": "object"
      },
      "forms.FormQuestionFields": {
        "properties": {
          "description": {
            "description": "Optional helper text shown beneath the prompt.",
            "example": "As it appears on your incorporation documents.",
            "type": "string"
          },
          "formFieldId": {
            "description": "InputID only used in case of updating form where form questions are saved already\ndoesn't exist in database and only used for processing of record",
            "example": "q_abc123",
            "type": "string"
          },
          "hasOtherOption": {
            "description": "Whether select-type questions offer a free-text \"Other\" choice.",
            "example": false,
            "type": "boolean"
          },
          "isRequired": {
            "description": "Whether the client must answer this question to submit the form.",
            "example": true,
            "type": "boolean"
          },
          "multipleChoiceOptions": {
            "description": "Choices for singleSelect, multiSelect, and dropdown questions.",
            "example": [
              "Option A",
              "Option B"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "description": "Question prompt shown to the client.",
            "example": "What is your company name?",
            "type": "string"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormFieldType"
              }
            ],
            "description": "Question type, which determines how the answer is collected and rendered.",
            "enum": [
              "shortAnswer",
              "longAnswer",
              "singleSelect",
              "multiSelect",
              "title",
              "fileUpload",
              "phoneNumber",
              "email",
              "date",
              "dropdown"
            ],
            "example": "shortAnswer"
          }
        },
        "type": "object"
      },
      "forms.FormResponse": {
        "properties": {
          "clientId": {
            "description": "ID of the client the response is assigned to.",
            "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "description": "ID of the company the client belongs to for this response.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "fields": {
            "$ref": "#/components/schemas/forms.FormResponseFields"
          },
          "filteredListIndexPkey": {
            "type": "string"
          },
          "formId": {
            "description": "ID of the form this response belongs to.",
            "example": "d290f1ee-6c54-4b01-90e6-d701748f0851",
            "format": "uuid",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/users.Owner"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.FormResponseFields": {
        "properties": {
          "allowMultipleSubmissions": {
            "description": "Whether the originating form allows multiple submissions.",
            "example": false,
            "type": "boolean"
          },
          "formDescription": {
            "description": "Description of the form at the time the response was created.",
            "example": "Tell us about your business so we can tailor onboarding.",
            "type": "string"
          },
          "formFieldIds": {
            "description": "IDs of the form's questions, in display order.",
            "example": [
              "q_abc123",
              "q_def456"
            ],
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "formFields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/forms.FormResponseQuestion"
            },
            "description": "Answered questions keyed by question ID.",
            "nullable": true,
            "type": "object"
          },
          "formName": {
            "description": "Name of the form at the time the response was created.",
            "example": "Client Intake Form",
            "type": "string"
          },
          "status": {
            "description": "Completion status of the response.",
            "enum": [
              "pending",
              "completed",
              "open"
            ],
            "example": "pending",
            "type": "string"
          },
          "submissionDate": {
            "description": "Timestamp the client completed the response, if completed.",
            "format": "date-time",
            "type": "string"
          },
          "visibility": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormVisibilityType"
              }
            ],
            "description": "Visibility of the originating form.",
            "enum": [
              "requestedClients",
              "allClients"
            ],
            "example": "requestedClients"
          }
        },
        "type": "object"
      },
      "forms.FormResponseQuestion": {
        "properties": {
          "answer": {
            "description": "Answer given by the client. Its shape depends on the question Type: a string for\ntext/date/email questions, a string array for multiSelect, or file names for fileUpload.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ]
          },
          "attachmentUrls": {
            "description": "Presigned download URLs for fileUpload answers, valid for 15 minutes.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "example": "As it appears on your incorporation documents.",
            "type": "string"
          },
          "hasOtherOption": {
            "example": false,
            "type": "boolean"
          },
          "isRequired": {
            "example": true,
            "type": "boolean"
          },
          "multipleChoiceOptions": {
            "example": [
              "Option A",
              "Option B"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "description": "Values copied from question template",
            "example": "What is your company name?",
            "type": "string"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/forms.FormFieldType"
              }
            ],
            "enum": [
              "shortAnswer",
              "longAnswer",
              "singleSelect",
              "multiSelect",
              "title",
              "fileUpload",
              "phoneNumber",
              "email",
              "date",
              "dropdown"
            ],
            "example": "shortAnswer"
          }
        },
        "type": "object"
      },
      "forms.FormVisibilityType": {
        "enum": [
          "requestedClients",
          "allClients"
        ],
        "type": "string",
        "x-enum-varnames": [
          "FormVisibilityTypeOnSend",
          "FormVisibilityTypeAllClients"
        ]
      },
      "forms.ListFormResponsesOutput": {
        "properties": {
          "data": {
            "description": "The page of form responses.",
            "items": {
              "$ref": "#/components/schemas/forms.FormResponse"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.ListFormsOutput": {
        "properties": {
          "data": {
            "description": "The page of forms.",
            "items": {
              "$ref": "#/components/schemas/forms.Form"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.RecipientInfo": {
        "properties": {
          "clientId": {
            "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
            "format": "uuid",
            "type": "string"
          },
          "companyId": {
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "forms.SendFormRequest": {
        "properties": {
          "clientCompanyIds": {
            "description": "Client/company pairs to assign the form to. Required when clientIds is omitted.",
            "items": {
              "$ref": "#/components/schemas/forms.RecipientInfo"
            },
            "type": "array"
          },
          "clientIds": {
            "description": "Client IDs to assign the form to. Required when clientCompanyIds is omitted.",
            "example": [
              "a1b2c3d4-5678-90ab-cdef-1234567890ab"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "formId": {
            "description": "ID of the form to assign.",
            "example": "d290f1ee-6c54-4b01-90e6-d701748f0851",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "formId"
        ],
        "type": "object"
      },
      "handler.SuccessResponse": {
        "properties": {
          "success": {
            "description": "Whether the operation succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.UpdateFolderPermissionsRequest": {
        "properties": {
          "clientPermissions": {
            "description": "Client access level applied to the folder. Required.",
            "enum": [
              "read_only read_write"
            ],
            "example": "read_only",
            "type": "string"
          }
        },
        "required": [
          "clientPermissions"
        ],
        "type": "object"
      },
      "handler.UpdateRootFolderPermissionsRequest": {
        "properties": {
          "channelId": {
            "description": "ID of the file channel whose root folder permissions are updated. Required.",
            "example": "a1b2c3d4-0000-1111-2222-333344445555",
            "type": "string"
          },
          "clientPermissions": {
            "description": "Client access level applied to the root folder. Required.",
            "enum": [
              "read_only read_write"
            ],
            "example": "read_write",
            "type": "string"
          }
        },
        "required": [
          "channelId",
          "clientPermissions"
        ],
        "type": "object"
      },
      "internal_notes.CreateNoteHandlerInput": {
        "properties": {
          "content": {
            "description": "Content is the body of the note. Optional; a note may have a title only.",
            "example": "Discussed the rollout timeline and next steps.",
            "type": "string"
          },
          "entityId": {
            "description": "ForeignKeyId is the ID of the client or company to attach the note to.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "type": "string"
          },
          "entityType": {
            "description": "ForeignKeyType is the kind of entity to attach the note to.",
            "enum": [
              "client",
              "company"
            ],
            "example": "client",
            "type": "string"
          },
          "title": {
            "description": "Title is the short heading of the note.",
            "example": "Onboarding call summary",
            "type": "string"
          }
        },
        "required": [
          "entityId",
          "entityType",
          "title"
        ],
        "type": "object"
      },
      "internal_notes.ListNotesOutput": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/internal_notes.Note"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_notes.Note": {
        "properties": {
          "content": {
            "description": "Content is the body of the note.",
            "example": "Discussed the rollout timeline and next steps.",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "description": "CreatorId is the ID of the internal user who created the note.\nTODO(@foley): Let's remove this and use CreatedBy from Model, we'll need\n              to do some backward compatibility work for the platform API.",
            "example": "7b1c5d9e-2f34-4a8b-9c0d-1e2f3a4b5c6d",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "entityId": {
            "description": "ForeignKeyId is the ID of the client or company the note is attached to.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "type": "string"
          },
          "entityType": {
            "description": "ForeignKeyType is the kind of entity the note is attached to.",
            "enum": [
              "client",
              "company"
            ],
            "example": "client",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "portalId": {
            "description": "PortalID is the workspace the note belongs to.",
            "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "title": {
            "description": "Title is the short heading of the note.",
            "example": "Onboarding call summary",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "internal_notes.UpdateNoteInput": {
        "properties": {
          "content": {
            "description": "Content is the new body for the note.",
            "example": "Revised the rollout timeline after the kickoff call.",
            "type": "string"
          },
          "title": {
            "description": "Title is the new heading for the note.",
            "example": "Updated onboarding summary",
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoice.CreateInvoiceRequest": {
        "properties": {
          "clientId": {
            "description": "ClientID is the client the invoice is billed to. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "client_a1b2c3d4e5f6",
            "type": "string"
          },
          "collectionMethod": {
            "description": "CollectionMethod is how the invoice is collected.",
            "enum": [
              "sendInvoice",
              "chargeAutomatically",
              "paymentLink"
            ],
            "example": "sendInvoice",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company the invoice is billed to. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "company_a1b2c3d4e5f6",
            "type": "string"
          },
          "currency": {
            "description": "Currency is the ISO currency code.",
            "example": "usd",
            "type": "string"
          },
          "daysUntilDue": {
            "description": "DaysUntilDue sets the due date relative to creation, as an alternative to dueDate.",
            "example": 14,
            "type": "integer"
          },
          "dueDate": {
            "description": "DueDate is the date the invoice is due.",
            "example": "2024-03-01T00:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "lineItems": {
            "description": "LineItems are the invoice line items. Required unless templateId is provided, in which case the template's line items are used when omitted. Must contain at least one item when provided.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "minItems": 1,
            "type": "array"
          },
          "memo": {
            "description": "Memo is an optional note shown on the invoice.",
            "example": "Thanks for your business",
            "type": "string"
          },
          "paymentMethodPreferences": {
            "description": "PaymentMethodPreferences restricts which payment methods are offered.",
            "items": {
              "$ref": "#/components/schemas/payment.PaymentMethodPreference"
            },
            "type": "array"
          },
          "recipientId": {
            "description": "RecipientID is the recipient (client or company) of the invoice. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "client_a1b2c3d4e5f6",
            "type": "string"
          },
          "subscriptionId": {
            "description": "SubscriptionID optionally associates the invoice with a subscription.",
            "example": "sub_a1b2c3d4e5f6",
            "type": "string"
          },
          "taxPercentage": {
            "description": "TaxPercentage is an optional tax rate applied to the invoice.",
            "example": 8.5,
            "type": "number"
          },
          "templateId": {
            "description": "TemplateID optionally seeds the invoice from an invoice template.",
            "example": "itmpl_a1b2c3d4e5f6",
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoice.GetInvoiceResponse": {
        "properties": {
          "data": {
            "description": "Invoices is the page of invoices matching the query.",
            "items": {
              "$ref": "#/components/schemas/invoice.Invoice"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoice.Invoice": {
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/invoice.PaymentsAddress"
              }
            ],
            "description": "Address stores the selected billing address from custom fields"
          },
          "amountPaid": {
            "description": "AmountPaid is the amount paid so far in the smallest currency unit (e.g. cents).",
            "type": "integer"
          },
          "attachmentKeys": {
            "description": "AttachmentKeys are the storage keys of the invoice attachments.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "attachmentUrls": {
            "description": "AttachmentUrls are presigned download URLs for the invoice attachments.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "billingReason": {
            "description": "BillingReason describes why the invoice was created (e.g. manual, subscription cycle).",
            "example": "manual",
            "type": "string"
          },
          "clientId": {
            "description": "ClientID is the ID of the client the invoice is billed to.",
            "example": "client_a1b2c3d4e5f6",
            "type": "string"
          },
          "collectionMethod": {
            "description": "CollectionMethod controls how the invoice is collected.",
            "enum": [
              "sendInvoice",
              "chargeAutomatically",
              "paymentLink"
            ],
            "example": "sendInvoice",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the ID of the company the invoice is billed to.",
            "example": "company_a1b2c3d4e5f6",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "currency": {
            "description": "Currency is the ISO 4217 currency code the invoice is denominated in.",
            "example": "usd",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "daysUntilDue": {
            "description": "DaysUntilDue is the number of days from issuance until the invoice is due.",
            "example": 14,
            "type": "integer"
          },
          "dueDate": {
            "description": "DueDate is the RFC 3339 timestamp by which the invoice must be paid.",
            "example": "2024-03-01T00:00:00Z",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "entityType": {
            "description": "ObjectType is the internal entity type discriminator.",
            "type": "string"
          },
          "fileKey": {
            "description": "FileKey is the storage key of the invoice PDF.",
            "type": "string"
          },
          "fileUrl": {
            "description": "FileUrl is the presigned download URL for the invoice PDF.",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "interval": {
            "description": "Property copied from subscription when creating invoice\nWe need this value when we have to show line items descriptions (Format \"Item (at US$621.00 / month)\") on invoice details for subscriptions invoices.\nWe can fetch this directly from subscription at that time, but we delete subscriptions when we delete\nthe recipient (client/company). For deleted recipients we still show invoices which were paid in the past. So we need to store this value here\nto show line items descriptions for invoices even if subscriptions are deleted.",
            "type": "string"
          },
          "invoiceCreationStatus": {
            "enum": [
              "ephemeral",
              "pending",
              "created"
            ],
            "type": "string"
          },
          "latestRefundStatus": {
            "description": "LatestRefundStatus is the status of the most recent refund issued against the invoice, when any.",
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "example": "succeeded",
            "type": "string"
          },
          "lineItems": {
            "description": "LineItems are the priced line items that make up the invoice.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "description": "Memo is an optional note shown to the recipient on the invoice.",
            "example": "Thanks for your business",
            "type": "string"
          },
          "number": {
            "description": "Number is the human-readable invoice number.",
            "example": "INV-0001",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "origin": {
            "allOf": [
              {
                "$ref": "#/components/schemas/invoice.Origin"
              }
            ],
            "description": "Origin indicates how the invoice was created.",
            "enum": [
              "internal",
              "payment_link",
              "product_store"
            ],
            "example": "internal"
          },
          "paidManually": {
            "type": "boolean"
          },
          "payment": {
            "description": "represents the successful payments only",
            "items": {
              "$ref": "#/components/schemas/payment.Payment"
            },
            "type": "array"
          },
          "paymentMethodPreferences": {
            "description": "field is only used for platform api and should not be used anywhere else on FE/BE",
            "items": {
              "$ref": "#/components/schemas/payment.PaymentMethodPreference"
            },
            "type": "array"
          },
          "paymentPreferences": {
            "allOf": [
              {
                "$ref": "#/components/schemas/payment.PaymentPreferences"
              }
            ],
            "description": "fields is used for BE/FE only"
          },
          "paymentSourceId": {
            "type": "string"
          },
          "paymentSuccessDate": {
            "description": "PaymentSuccessDate is the RFC 3339 timestamp at which payment succeeded; absent until paid.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          },
          "portalId": {
            "description": "PortalID is the ID of the portal the invoice belongs to.",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "quickBooksData": {
            "$ref": "#/components/schemas/invoice.QuickBooksData"
          },
          "receiptKey": {
            "type": "string"
          },
          "receiptNumber": {
            "description": "ReceiptNumber is the human-readable receipt number, set once the invoice is paid.",
            "example": "REC-0001",
            "type": "string"
          },
          "receiptUrl": {
            "description": "ReceiptUrl is the presigned download URL for the receipt PDF.",
            "type": "string"
          },
          "recipientId": {
            "description": "Deprecated: use ClientID and CompanyID instead",
            "example": "client_a1b2c3d4e5f6",
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "sentDate": {
            "description": "SentDate is the RFC 3339 timestamp at which the invoice was sent to the recipient.",
            "example": "2024-02-15T09:00:00Z",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sourcePaymentLinkId": {
            "description": "SourcePaymentLinkId is the ID of the payment link that produced this invoice, when applicable.",
            "example": "plink_a1b2c3d4e5f6",
            "type": "string"
          },
          "status": {
            "description": "Status is the current lifecycle state of the invoice.",
            "enum": [
              "draft",
              "open",
              "void",
              "paid",
              "processing"
            ],
            "example": "open",
            "type": "string"
          },
          "subscription": {
            "allOf": [
              {
                "$ref": "#/components/schemas/subscription.Subscription"
              }
            ],
            "description": "Subscription is populated from search results when subscriptionId is present (not persisted)"
          },
          "subscriptionId": {
            "description": "SubscriptionID is the ID of the subscription that generated this invoice, when applicable.",
            "example": "sub_a1b2c3d4e5f6",
            "type": "string"
          },
          "taxAmount": {
            "description": "TaxAmount is the computed tax in the smallest currency unit (e.g. cents).",
            "example": 1275,
            "type": "integer"
          },
          "taxPercentage": {
            "description": "TaxPercentage is the tax rate applied to the invoice, expressed as a percentage.",
            "example": 8.5,
            "nullable": true,
            "type": "number"
          },
          "templateId": {
            "description": "TemplateID is the ID of the invoice template the invoice was created from, when applicable.",
            "example": "itmpl_a1b2c3d4e5f6",
            "type": "string"
          },
          "total": {
            "description": "Total is the invoice total in the smallest currency unit (e.g. cents).",
            "example": 15000,
            "type": "integer"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoice.Origin": {
        "enum": [
          "internal",
          "payment_link",
          "product_store"
        ],
        "type": "string",
        "x-enum-varnames": [
          "OriginInternal",
          "OriginPaymentLink",
          "OriginProductStore"
        ]
      },
      "invoice.PaymentsAddress": {
        "properties": {
          "addressLine1": {
            "description": "AddressLine1 is the first line of the billing street address.",
            "example": "548 Market St",
            "type": "string"
          },
          "addressLine2": {
            "description": "AddressLine2 is the second line of the billing street address.",
            "example": "Suite 100",
            "type": "string"
          },
          "city": {
            "description": "City is the billing city.",
            "example": "San Francisco",
            "type": "string"
          },
          "country": {
            "description": "Country is the billing country.",
            "example": "United States",
            "type": "string"
          },
          "fullAddress": {
            "description": "FullAddress is the formatted, single-line billing address.",
            "example": "548 Market St, San Francisco, CA 94105",
            "type": "string"
          },
          "postalCode": {
            "description": "PostalCode is the billing postal or ZIP code.",
            "example": "94105",
            "type": "string"
          },
          "region": {
            "description": "Region is the billing state, province, or region.",
            "example": "California",
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoice.QuickBooksData": {
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "paymentId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoiceTemplate.GetInvoiceTemplateResponse": {
        "properties": {
          "data": {
            "description": "InvoiceTemplates is the page of invoice templates for the portal.",
            "items": {
              "$ref": "#/components/schemas/invoiceTemplate.InvoiceTemplate"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "invoiceTemplate.InvoiceTemplate": {
        "properties": {
          "attachmentKeys": {
            "description": "AttachmentKeys are the storage keys of files attached to the template.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "lineItems": {
            "description": "LineItems are the billable line items that make up the template; at least one is required.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "description": "Memo is an optional note shown on invoices created from this template.",
            "example": "Thank you for your business",
            "type": "string"
          },
          "name": {
            "description": "Name is the human-readable name of the invoice template.",
            "example": "Monthly retainer",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "taxPercentage": {
            "description": "TaxPercentage is the tax rate applied to the template total, expressed as a percentage (e.g. 8.5 for 8.5%).",
            "example": 8.5,
            "nullable": true,
            "type": "number"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "line_item.LineItem": {
        "properties": {
          "amount": {
            "description": "Amount is the per-unit charge in the smallest currency unit (e.g. cents) for a one-off line item. Required, together with description, when priceId is absent.",
            "example": 5000,
            "type": "integer"
          },
          "description": {
            "description": "Description is the human-readable description of a one-off line item. Required, together with amount, when priceId is absent.",
            "example": "Onboarding setup fee",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "priceId": {
            "description": "PriceId is the ID of the price this line item bills for. Either priceId or amount with description must be provided.",
            "example": "price_1a2b3c",
            "type": "string"
          },
          "priceInterval": {
            "description": "PriceInterval is the recurring interval of the referenced price, when the line item bills a recurring price.",
            "example": "month",
            "type": "string"
          },
          "productId": {
            "description": "ProductId is the ID of the product this line item bills for; absent for one-off charges.",
            "example": "prod_1a2b3c",
            "type": "string"
          },
          "quantity": {
            "description": "Quantity is the number of units billed for this line item. Required.",
            "example": 2,
            "maximum": 1000000,
            "minimum": 1,
            "type": "number"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.NotificationActionLabel": {
        "properties": {
          "pluralNoun": {
            "type": "string"
          },
          "singularNoun": {
            "type": "string"
          },
          "verb": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.NotificationConfig": {
        "properties": {
          "actionLabel": {
            "$ref": "#/components/schemas/marketplace_application.NotificationActionLabel"
          },
          "notifications": {
            "items": {
              "$ref": "#/components/schemas/marketplace_application.NotificationSetting"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "marketplace_application.NotificationSetting": {
        "properties": {
          "default": {
            "$ref": "#/components/schemas/marketplace_application.NotificationSurfaceDefaults"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "surfaces": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "marketplace_application.NotificationSurfaceDefaults": {
        "properties": {
          "email": {
            "type": "boolean"
          },
          "product": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "marketplace_application.Task": {
        "properties": {
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "description": {
            "description": "Description is the optional long-form details of the task.",
            "example": "Write the welcome email for new clients.",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "name": {
            "description": "Name is the human-readable title of the task.",
            "example": "Draft the onboarding email",
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskComment": {
        "properties": {
          "authorId": {
            "description": "AuthorID is the identifier of the user who authored the comment.",
            "example": "64734088-94c7-47dd-b2fe-e5ac7e5cfaf4",
            "type": "string"
          },
          "content": {
            "description": "Content is the body text of the comment.",
            "example": "Looks good, ready to ship.",
            "type": "string"
          },
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "taskId": {
            "description": "TaskID is the identifier of the task this comment belongs to.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskCommentList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/marketplace_application.TaskComment"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskInput": {
        "properties": {
          "clientId": {
            "description": "ClientID assigns the task to a client user; CompanyID is required when set.",
            "example": "64734088-94c7-47dd-b2fe-e5ac7e5cfaf4",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID assigns the task to a company; required when assigning to a client.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "description": {
            "description": "Description is the optional long-form details of the task.",
            "example": "Write the welcome email for new clients.",
            "type": "string"
          },
          "dueDate": {
            "description": "DueDate is when the task is due, in RFC 3339 format.",
            "example": "2025-05-01T16:18:54Z",
            "format": "date-time",
            "type": "string"
          },
          "internalUserId": {
            "description": "InternalUserID assigns the task to an internal user.",
            "example": "64734088-94c7-47dd-b2fe-e5ac7e5cfaf4",
            "type": "string"
          },
          "isArchived": {
            "description": "IsArchived archives or unarchives the task. Used when updating a task.",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "Name is the human-readable name of the task.",
            "example": "Draft the onboarding email",
            "type": "string"
          },
          "parentTaskId": {
            "description": "ParentTaskID makes this task a subtask of the given parent task.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "status": {
            "description": "Status is the task status: one of todo, inProgress, completed.",
            "enum": [
              "todo",
              "inProgress",
              "completed"
            ],
            "example": "todo",
            "type": "string"
          },
          "templateId": {
            "description": "TemplateID is the task template to create this task from.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "viewers": {
            "description": "Viewers grant view access to the task (assignee must be an internal user).",
            "items": {
              "$ref": "#/components/schemas/marketplace_application.TaskViewer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/marketplace_application.Task"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskTemplate": {
        "properties": {
          "createdAt": {
            "description": "Created is the RFC 3339 timestamp at which the object was created.",
            "example": "2024-01-15T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "createdDate": {
            "description": "CreatedDate is the RFC 3339 timestamp at which the template was created in the app.",
            "example": "2025-05-01T16:18:54Z",
            "format": "date-time",
            "type": "string"
          },
          "deleted": {
            "description": "Deleted is true when the object has been deleted; present only on delete responses.",
            "example": true,
            "type": "boolean"
          },
          "description": {
            "description": "Description is the optional long-form details of the task template.",
            "example": "Standard tasks to run when onboarding a new client.",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the object.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          },
          "name": {
            "description": "Name is the human-readable title of the task template.",
            "example": "Client kickoff checklist",
            "type": "string"
          },
          "object": {
            "allOf": [
              {
                "$ref": "#/components/schemas/constants.ApiObject"
              }
            ],
            "description": "Object is the type of the object (e.g. \"client\", \"company\")."
          },
          "updatedAt": {
            "description": "Updated is the RFC 3339 timestamp at which the object was last updated.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskTemplateList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/marketplace_application.TaskTemplate"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "marketplace_application.TaskViewer": {
        "properties": {
          "clientId": {
            "description": "ClientID grants a client viewing access; their CompanyID must also be set.",
            "example": "64734088-94c7-47dd-b2fe-e5ac7e5cfaf4",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID grants a company viewing access (leave ClientID empty).",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          }
        },
        "type": "object"
      },
      "me.MeResponse": {
        "properties": {
          "email": {
            "description": "Email is the authenticated user's email address.",
            "example": "alex.morgan@example.com",
            "format": "email",
            "type": "string"
          },
          "familyName": {
            "description": "FamilyName is the authenticated user's last (family) name.",
            "example": "Morgan",
            "type": "string"
          },
          "givenName": {
            "description": "GivenName is the authenticated user's first (given) name.",
            "example": "Alex",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the authenticated user.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "messagechannel.CreateMessageChannelRequest": {
        "properties": {
          "clientId": {
            "description": "ClientID is the client id for an individual channel. Alternative to membershipEntityId.",
            "example": "client_abc123",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company id for a company channel, or to disambiguate a client that belongs to multiple companies.",
            "example": "company_abc123",
            "type": "string"
          },
          "memberIds": {
            "description": "MemberIds are the client user ids to include. Required for group channels.",
            "example": [
              "user_abc123",
              "user_def456"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "membershipEntityId": {
            "description": "MembershipEntityId is the company id (company channel) or client id (individual channel) the channel is scoped to.",
            "example": "client_abc123",
            "type": "string"
          },
          "membershipType": {
            "description": "MembershipType is the kind of channel to create.",
            "enum": [
              "company",
              "individual",
              "group"
            ],
            "example": "individual",
            "type": "string"
          }
        },
        "required": [
          "membershipType"
        ],
        "type": "object"
      },
      "messagechannel.MessageChannel": {
        "properties": {
          "clientId": {
            "description": "ClientID is the id of the client associated with an individual channel.",
            "example": "client_abc123",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the id of the company associated with the channel.",
            "example": "company_abc123",
            "type": "string"
          },
          "createdAt": {
            "description": "CreatedAt is the time the channel was created.",
            "example": "2023-01-01T00:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "ID is the unique identifier of the message channel.",
            "example": "abc123",
            "format": "uuid",
            "type": "string"
          },
          "lastMessageDate": {
            "description": "LastMessage is the time the most recent message was sent in the channel.",
            "example": "2023-01-03T00:00:00Z",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "lastRead": {
            "description": "LastRead is the time the viewer last read the channel. Populated alongside UnreadCount; omitted otherwise.",
            "example": "2023-01-02T12:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "memberIds": {
            "description": "MemberIds are the user ids that belong to the channel.",
            "example": [
              "user_abc123",
              "user_def456"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "membershipEntityId": {
            "description": "MembershipEntityId is the id of the entity (company or client) the channel is scoped to.",
            "example": "client_abc123",
            "type": "string"
          },
          "membershipType": {
            "description": "MembershipType describes whether the channel is scoped to a company, a single client, or an ad-hoc group.",
            "enum": [
              "company",
              "individual",
              "group"
            ],
            "example": "individual",
            "type": "string"
          },
          "object": {
            "description": "Object is the resource type discriminator, always \"messageChannel\".",
            "example": "messageChannel",
            "type": "string"
          },
          "unreadCount": {
            "description": "UnreadCount is the number of unread messages for the viewer. Populated by the /unread\nendpoint and by the list endpoint when includeUnread=true; omitted otherwise.",
            "example": 3,
            "type": "integer"
          },
          "updatedAt": {
            "description": "UpdatedAt is the time the channel was last updated.",
            "example": "2023-01-02T00:00:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "messagechannel.UnreadSummary": {
        "properties": {
          "totalUnreadCount": {
            "description": "TotalUnreadCount is the aggregate number of unread messages across all returned channels.",
            "example": 5,
            "type": "integer"
          },
          "unreadChannels": {
            "description": "UnreadChannels are the channels in which the member has at least one unread message.",
            "items": {
              "$ref": "#/components/schemas/messagechannel.MessageChannel"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "messages.CreateMessageInput": {
        "properties": {
          "channelId": {
            "description": "ChannelID identifies the channel the message is sent to. Required. Must be a bare UUID and must not include the GetStream 'messaging:' prefix.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "senderId": {
            "description": "SenderID optionally overrides the author of the message. When omitted, the authenticated user is used. When set it must be the UUID of a member of the channel.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "text": {
            "description": "Text is the body of the message. Required. Limited to 5000 characters by GetStream.",
            "example": "Thanks for the update, I'll review the contract today.",
            "type": "string"
          }
        },
        "required": [
          "channelId",
          "text"
        ],
        "type": "object"
      },
      "messages.Message": {
        "properties": {
          "channelId": {
            "description": "ChannelID is the channel the message belongs to (bare UUID, without the GetStream 'messaging:' prefix).",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "isAttachmentIncluded": {
            "description": "IsAttachmentIncluded indicates whether the message has one or more attachments.",
            "example": false,
            "type": "boolean"
          },
          "object": {
            "description": "Object is the resource type discriminator, always \"message\".",
            "example": "message",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "senderId": {
            "description": "SenderID is the UUID of the member who authored the message.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "text": {
            "description": "Text is the body of the message. Empty when the message only carries attachments.",
            "example": "Thanks for the update, I'll review the contract today.",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.AdditionalFields": {
        "properties": {
          "channelName": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.CreateInput": {
        "properties": {
          "deliveryTargets": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.DeliveryTargets"
              }
            ],
            "description": "DeliveryTargets describes how the notification should be delivered. Required."
          },
          "notificationSettingId": {
            "description": "NotificationSettingId optionally selects one of the app's declared notification settings\n(see the app's notificationConfig). When provided, delivery on each surface is resolved\nagainst the recipient's per-setting preference, falling back to the app's configured default.\nOptional; when omitted, all requested delivery targets are delivered as-is.",
            "example": "550e8400-e29b-41d4-a716-446655440006",
            "type": "string"
          },
          "recipientClientId": {
            "description": "RecipientClientID is the client to notify. Pair with recipientCompanyId.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "recipientCompanyId": {
            "description": "RecipientCompanyID is the company of the client being notified.",
            "example": "550e8400-e29b-41d4-a716-446655440003",
            "format": "uuid",
            "type": "string"
          },
          "recipientId": {
            "deprecated": true,
            "description": "RecipientID is the recipient to notify. Deprecated: prefer recipientClientId+\nrecipientCompanyId or recipientInternalUserId, which take precedence when provided.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "recipientInternalUserId": {
            "description": "RecipientInternalUserID is the internal user to notify.",
            "example": "550e8400-e29b-41d4-a716-446655440004",
            "format": "uuid",
            "type": "string"
          },
          "recipientType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.MemberType"
              }
            ],
            "description": "RecipientType is the kind of member being notified.",
            "enum": [
              "client",
              "internalUser",
              "company"
            ],
            "example": "client"
          },
          "senderCompanyId": {
            "description": "SenderCompanyID is the sender's company, required when notifying an internal user.",
            "example": "550e8400-e29b-41d4-a716-446655440003",
            "format": "uuid",
            "type": "string"
          },
          "senderId": {
            "description": "SenderID is the member triggering the notification. Required.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "deliveryTargets",
          "senderId"
        ],
        "type": "object"
      },
      "notifications.DeliveryTargets": {
        "properties": {
          "email": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.EmailDeliveryTarget"
              }
            ],
            "description": "Email delivers the notification by email."
          },
          "inProduct": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.InProductDeliveryTarget"
              }
            ],
            "description": "InProduct delivers the notification to the in-product notification inbox."
          }
        },
        "type": "object"
      },
      "notifications.EmailDeliveryTarget": {
        "properties": {
          "body": {
            "description": "Body is the plain-text email body. Either body or htmlBody must be provided.",
            "example": "A new file was uploaded to your portal.",
            "type": "string"
          },
          "ctaParams": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "CtaParams are key/value parameters used to build the email's call-to-action link.",
            "type": "object"
          },
          "header": {
            "description": "Header is the email header. Required.",
            "example": "You have a new file",
            "type": "string"
          },
          "htmlBody": {
            "description": "HtmlBody is HTML for the email body, sanitized to a safe subset (basic formatting, lists, and https links); other tags, inline styles, images and scripts are stripped. Either body or htmlBody must be provided.",
            "example": "\u003cp\u003eA new file was uploaded to your portal.\u003c/p\u003e",
            "type": "string"
          },
          "subject": {
            "description": "Subject is the email subject line. Required.",
            "example": "New file uploaded",
            "type": "string"
          },
          "title": {
            "description": "Title is the email title. Required.",
            "example": "New file uploaded",
            "type": "string"
          }
        },
        "required": [
          "header",
          "subject",
          "title"
        ],
        "type": "object"
      },
      "notifications.EventType": {
        "enum": [
          "files.created",
          "file.created",
          "contract.signed",
          "contract.requested",
          "formResponse.requested",
          "formResponse.completed",
          "form.created",
          "invoice.paid",
          "invoice.requested",
          "invoice.processing",
          "invoice.paymentFailed",
          "refund.requested",
          "refund.processed",
          "refund.failed",
          "autoChargePayment.requested",
          "customApp.action",
          "customApp.buildComplete",
          "internalChat.mentioned",
          "channel.mentioned"
        ],
        "type": "string",
        "x-enum-varnames": [
          "NewFileGroups",
          "NewFile",
          "ContractSigned",
          "ContractRequested",
          "FormResponseRequested",
          "FormResponseCompleted",
          "FormCreated",
          "InvoicePaid",
          "InvoiceRequested",
          "InvoiceProcessing",
          "InvoicePaymentFailed",
          "RefundRequested",
          "RefundProcessed",
          "RefundFailed",
          "AutoChargePayment",
          "CustomAppAction",
          "AppBuilderBuildComplete",
          "InternalChatMention",
          "ChannelMention"
        ]
      },
      "notifications.Fields": {
        "properties": {
          "channelId": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "count": {
            "description": "Count is only used for notification groups, which represent multiple notifications",
            "type": "integer"
          },
          "formId": {
            "type": "string"
          },
          "groupingEntityType": {
            "description": "GroupingEntityType designates the notification entity types that are associated with a notification grouping",
            "type": "string"
          },
          "itemName": {
            "description": "ItemName is used to capture data for inbox notifications, for example the filename for an esig complete notification (if files are not loaded into state)",
            "type": "string"
          },
          "notificationGroup": {
            "type": "string"
          },
          "senderID": {
            "type": "string"
          },
          "senderType": {
            "type": "string"
          },
          "senderUserId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.InProductDeliveryTarget": {
        "properties": {
          "body": {
            "description": "Body is the optional supporting text shown beneath the title.",
            "example": "A new file was uploaded to your portal.",
            "type": "string"
          },
          "ctaParams": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "CtaParams are key/value parameters used to build the notification's call-to-action link.",
            "type": "object"
          },
          "isRead": {
            "description": "IsRead indicates whether the recipient has read the notification. Read-only.",
            "example": false,
            "type": "boolean"
          },
          "title": {
            "description": "Title is the headline shown in the inbox. Required.",
            "example": "New file uploaded",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "notifications.MemberType": {
        "enum": [
          "USER",
          "CLIENT_USER",
          "CLIENT_COMPANY"
        ],
        "type": "string",
        "x-enum-varnames": [
          "Internal",
          "Client",
          "Company"
        ]
      },
      "notifications.Notification": {
        "properties": {
          "additionalFields": {
            "$ref": "#/components/schemas/notifications.AdditionalFields"
          },
          "appId": {
            "description": "AppID is the ID of the custom app that created the notification, when applicable.",
            "example": "550e8400-e29b-41d4-a716-446655440005",
            "format": "uuid",
            "type": "string"
          },
          "assetS3Key": {
            "type": "string"
          },
          "channelId": {
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company the notification is associated with, when applicable.",
            "example": "550e8400-e29b-41d4-a716-446655440003",
            "format": "uuid",
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "defaultListIndexPkey": {
            "description": "DefaultListIndexPkey for the notification model is used to mark whether a notification is an inbox notification",
            "type": "string"
          },
          "deliveryTargets": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.DeliveryTargets"
              }
            ],
            "description": "DeliveryTargets describes how the notification is delivered (in-product and/or email)."
          },
          "event": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.EventType"
              }
            ],
            "description": "Event is the domain event that triggered the notification.",
            "enum": [
              "files.created",
              "file.created",
              "contract.signed",
              "contract.requested",
              "formResponse.requested",
              "formResponse.completed",
              "form.created",
              "invoice.paid",
              "invoice.requested",
              "invoice.processing",
              "invoice.paymentFailed",
              "refund.requested",
              "refund.processed",
              "refund.failed",
              "autoChargePayment.requested",
              "customApp.action",
              "internalChat.mentioned",
              "channel.mentioned"
            ],
            "example": "file.created"
          },
          "fields": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.Fields"
              }
            ],
            "description": "todo: remove fields once FE doesn't use them"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "isGroup": {
            "type": "boolean"
          },
          "isRead": {
            "description": "Deprecated: use DeliveryTargets.InProduct.IsRead",
            "type": "boolean"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "recipientClientId": {
            "description": "RecipientClientID is the recipient client ID, set when the recipient is a client.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "recipientCompanyId": {
            "description": "RecipientCompanyID is the recipient company ID, set when the recipient is a client (their company).",
            "example": "550e8400-e29b-41d4-a716-446655440003",
            "format": "uuid",
            "type": "string"
          },
          "recipientId": {
            "description": "RecipientID is the ID of the member the notification is delivered to.",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "type": "string"
          },
          "recipientInternalUserId": {
            "description": "RecipientInternalUserID is the recipient internal user ID, set when the recipient is an internal user.",
            "example": "550e8400-e29b-41d4-a716-446655440004",
            "format": "uuid",
            "type": "string"
          },
          "recipientType": {
            "$ref": "#/components/schemas/notifications.MemberType"
          },
          "ref": {
            "type": "string"
          },
          "reminders": {
            "$ref": "#/components/schemas/notifications.Reminders"
          },
          "resourceId": {
            "description": "ResourceID is the ID of the resource the notification refers to (e.g. the uploaded file or invoice).",
            "example": "550e8400-e29b-41d4-a716-446655440002",
            "type": "string"
          },
          "senderCompanyId": {
            "description": "SenderCompanyID is the sender's company ID, set when the recipient is an internal user.",
            "example": "550e8400-e29b-41d4-a716-446655440003",
            "format": "uuid",
            "type": "string"
          },
          "senderId": {
            "description": "SenderID is the ID of the member who triggered the notification.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "senderType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/notifications.MemberType"
              }
            ],
            "description": "SenderType is the kind of member that sent the notification.",
            "enum": [
              "client",
              "internalUser",
              "company"
            ],
            "example": "internalUser"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.NotificationSuppressedResponse": {
        "properties": {
          "message": {
            "description": "Message is a human-readable acknowledgement of the suppressed request.",
            "example": "notification suppressed by recipient notification settings",
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.NotificationsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/notifications.Notification"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "notifications.Reminders": {
        "properties": {
          "scheduled": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sent": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "notificationsettings.InternalUserNotificationSettings": {
        "properties": {
          "disableInProduct": {
            "description": "DisableInProduct is true when the user has globally disabled in-product notifications;\nwhen true it overrides every per-category setting in notifyAbout.",
            "example": false,
            "type": "boolean"
          },
          "emailSettings": {
            "description": "EmailSettings is the user's global email delivery preference: \"always\" sends every\nnotification email, \"not_active\" only emails the user when they have no active session,\nand \"no_emails\" disables notification emails entirely.",
            "enum": [
              "always",
              "not_active",
              "no_emails"
            ],
            "example": "not_active",
            "type": "string"
          },
          "notifyAbout": {
            "additionalProperties": {
              "$ref": "#/components/schemas/notificationsettings.InternalUserNotifyAboutSetting"
            },
            "description": "NotifyAbout maps a notification category to the user's per-channel opt-outs.\nFirst-party keys: newClientDirectSignup, newClientActivation, newMessages, paidInvoices,\nprocessingInvoices, paymentFailedInvoices, uploadedFiles, signedContracts,\nnewFormResponses, newTeamMemberActivation, assistantMention. Every notification setting\ndeclared by the portal's installed apps appears under its camelCased label (the app's\ndeclared default when the user hasn't customized it), with appId and\nnotificationSettingId identifying the app setting it belongs to.",
            "type": "object"
          },
          "object": {
            "example": "internalUserNotificationSettings",
            "type": "string"
          }
        },
        "type": "object"
      },
      "notificationsettings.InternalUserNotifyAboutSetting": {
        "properties": {
          "appId": {
            "description": "AppID is the ID of the installed app this setting belongs to. Present only for app-declared settings.",
            "type": "string"
          },
          "disableEmail": {
            "description": "DisableEmail is true when email notifications for this category are off.",
            "example": true,
            "type": "boolean"
          },
          "disableInProduct": {
            "description": "DisableInProduct is true when in-product notifications for this category are off.",
            "example": false,
            "type": "boolean"
          },
          "notificationSettingId": {
            "description": "NotificationSettingID is the ID of the app's notification setting. Present only for app-declared settings.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "offline.IssueResponse": {
        "properties": {
          "token": {
            "description": "Token is an app-scoped bearer token for use in subsequent API calls.",
            "type": "string"
          },
          "tokenExpiresAt": {
            "description": "TokenExpiresAt is the Unix timestamp (seconds) when the bearer token expires.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "payment.Fee": {
        "properties": {
          "absorbedAmount": {
            "description": "AbsorbedAmount is what the internal user paid, in the smallest currency unit; equals TotalAmount when IsFeeAbsorbed is true.",
            "example": 0,
            "type": "integer"
          },
          "chargedAmount": {
            "description": "ChargedAmount is what the client paid, in the smallest currency unit; 0 when IsFeeAbsorbed is true.",
            "example": 150,
            "type": "integer"
          },
          "isFeeAbsorbed": {
            "description": "IsFeeAbsorbed reports whether the internal user absorbed the transaction fee instead of passing it to the client.",
            "example": false,
            "type": "boolean"
          },
          "items": {
            "description": "Items is the list of individual fee components that make up the total.",
            "items": {
              "$ref": "#/components/schemas/payment.FeeItem"
            },
            "type": "array"
          },
          "totalAmount": {
            "description": "TotalAmount is the total transaction fee (internal user plus client), in the smallest currency unit.",
            "example": 150,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "payment.FeeAmountExternal": {
        "properties": {
          "paidByClient": {
            "description": "PaidByClient is the portion of the transaction fee charged to the client, in the smallest currency unit (e.g. cents).",
            "example": 150,
            "type": "integer"
          },
          "paidByPlatform": {
            "description": "PaidByPlatform is the portion of the transaction fee absorbed by the internal user, in the smallest currency unit (e.g. cents).",
            "example": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "payment.FeeItem": {
        "properties": {
          "amount": {
            "description": "Amount is the fee component value in the smallest currency unit (e.g. cents).",
            "example": 150,
            "type": "integer"
          },
          "type": {
            "description": "Type identifies which fee component this line item represents.",
            "enum": [
              "achFixed",
              "achPercentage",
              "ccFixed",
              "ccPercentage",
              "ccInternationalPercentage",
              "ccConversionPercentage",
              "recurringPercentage",
              "storePercentage",
              "invoicePercentage",
              "achThresholdExceededPercentage"
            ],
            "example": "ccPercentage",
            "type": "string"
          }
        },
        "type": "object"
      },
      "payment.GetPaymentsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/payment.Payment"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "payment.Payment": {
        "properties": {
          "amount": {
            "description": "Amount is the payment amount in the smallest currency unit (e.g. cents).",
            "example": 10000,
            "type": "integer"
          },
          "brand": {
            "description": "Brand is the card brand or bank descriptor of the payment method.",
            "example": "Visa",
            "type": "string"
          },
          "chargedAt": {
            "description": "ChargedAt is the RFC 3339 timestamp at which the payment was charged.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "declineCode": {
            "description": "DeclineCode is the lower-camel-cased decline reason returned when a payment fails.",
            "example": "insufficientFunds",
            "type": "string"
          },
          "entityType": {
            "description": "ObjectType is the internal entity type discriminator for the record.",
            "example": "PAYMENT",
            "type": "string"
          },
          "fee": {
            "allOf": [
              {
                "$ref": "#/components/schemas/payment.Fee"
              }
            ],
            "description": "Fee is the full transaction-fee breakdown for the payment."
          },
          "feeAmount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/payment.FeeAmountExternal"
              }
            ],
            "description": "FeeAmount is the client-facing split of the transaction fee between platform and client.",
            "nullable": true
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "intentId": {
            "description": "IntentId is the Stripe payment intent identifier associated with the payment.",
            "example": "pi_3OabcdEFghIJklmn",
            "type": "string"
          },
          "invoiceId": {
            "description": "InvoiceId is the ID of the invoice this payment was made against.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "last4Digits": {
            "description": "Last4Digits is the last four digits of the card or bank account used.",
            "example": "4242",
            "type": "string"
          },
          "message": {
            "description": "Message is a human-readable status or decline message for the payment.",
            "example": "The card has insufficient funds to complete the purchase.",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "paymentMethod": {
            "description": "PaymentMethod is the type of payment method used for the payment.",
            "enum": [
              "bankAccount",
              "creditCard"
            ],
            "example": "creditCard",
            "type": "string"
          },
          "portalId": {
            "description": "PortalId is the ID of the portal that owns the payment.",
            "example": "a1b2c3d4",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "ref": {
            "type": "string"
          },
          "status": {
            "description": "Status is the current state of the payment.",
            "enum": [
              "pending",
              "processing",
              "succeeded",
              "failed",
              "refunded"
            ],
            "example": "succeeded",
            "type": "string"
          },
          "stripeChargeId": {
            "description": "StripeChargeId is the Stripe charge identifier backing this payment.",
            "example": "ch_3OabcdEFghIJklmn",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "payment.PaymentMethodPreference": {
        "properties": {
          "feePaidByClient": {
            "description": "FeesPaidByClient reports whether the transaction fee for this method is charged to the client.",
            "example": true,
            "type": "boolean"
          },
          "type": {
            "description": "Type is the payment method type this preference applies to.",
            "enum": [
              "bankAccount",
              "creditCard"
            ],
            "example": "creditCard",
            "type": "string"
          }
        },
        "type": "object"
      },
      "payment.PaymentPreferences": {
        "properties": {
          "absorbTransactionFee": {
            "description": "AbsorbTransactionFee lists the payment method types for which the internal user absorbs the transaction fee.",
            "items": {
              "enum": [
                "bankAccount",
                "creditCard"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "paymentMethodTypes": {
            "description": "PaymentMethodTypes lists the payment method types accepted for the portal.",
            "items": {
              "enum": [
                "bankAccount",
                "creditCard"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "price.CreatePriceInput": {
        "properties": {
          "amount": {
            "description": "Amount is the price amount in the currency's smallest unit (e.g. cents).",
            "example": 5000,
            "type": "integer"
          },
          "currency": {
            "default": "usd",
            "description": "Currency is the ISO currency code.",
            "example": "usd",
            "type": "string"
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billingutils.BillingPeriodType"
              }
            ],
            "description": "Interval is the billing period for recurring prices.",
            "enum": [
              "day",
              "week",
              "month",
              "quarterly",
              "biannually",
              "year",
              "semiannually"
            ],
            "example": "month"
          },
          "intervalCount": {
            "description": "IntervalCount is the number of intervals between billings.",
            "example": 1,
            "type": "integer"
          },
          "productId": {
            "description": "ProductId is the product this price belongs to.",
            "example": "d1f8c9e2-3b4a-4c5d-9e6f-7a8b9c0d1e2f",
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/price.PriceType"
              }
            ],
            "description": "Type is whether the price is one-time or recurring.",
            "enum": [
              "oneTime",
              "recurring"
            ],
            "example": "recurring"
          }
        },
        "required": [
          "amount",
          "productId"
        ],
        "type": "object"
      },
      "price.GetPricesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/price.Price"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "price.Price": {
        "properties": {
          "amount": {
            "description": "Amount is the price amount in the smallest currency unit (e.g. cents).",
            "example": 5000,
            "type": "integer"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "currency": {
            "default": "usd",
            "description": "Currency is the ISO-4217 currency code. Defaults to usd when omitted.",
            "example": "usd",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billingutils.BillingPeriodType"
              }
            ],
            "description": "Interval is the recurring billing period. Omit for one-time prices.",
            "enum": [
              "day",
              "week",
              "month",
              "quarterly",
              "biannually",
              "year",
              "semiannually"
            ],
            "example": "month"
          },
          "intervalCount": {
            "description": "IntervalCount is the number of intervals between billings for a recurring price.",
            "example": 1,
            "nullable": true,
            "type": "integer"
          },
          "isUsed": {
            "description": "IsUsed indicates whether the price is already referenced by a subscription or invoice and therefore cannot be deleted.",
            "example": false,
            "type": "boolean"
          },
          "object": {
            "type": "string"
          },
          "portalId": {
            "description": "PortalID is the ID of the portal that owns this price.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "productId": {
            "description": "ProductId is the ID of the product this price belongs to.",
            "example": "d1f8c9e2-3b4a-4c5d-9e6f-7a8b9c0d1e2f",
            "format": "uuid",
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/price.PriceType"
              }
            ],
            "description": "Type is a computed field and should not be used in any logic on BE or Webapp",
            "enum": [
              "oneTime",
              "recurring"
            ],
            "example": "recurring"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "price.PriceType": {
        "enum": [
          "oneTime",
          "recurring"
        ],
        "type": "string",
        "x-enum-varnames": [
          "PriceTypeOneTime",
          "PriceTypeRecurring"
        ]
      },
      "product.CreateProductInput": {
        "properties": {
          "description": {
            "description": "Description is an optional product description.",
            "example": "Access to all premium features",
            "type": "string"
          },
          "imageUrls": {
            "description": "ImageUrls are URLs of product images.",
            "example": [
              "https://assets.example.com/products/premium.png"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "Name is the product's display name.",
            "example": "Premium Plan",
            "type": "string"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/product.ProductStatusType"
              }
            ],
            "description": "Status is the product lifecycle state.",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "product.GetProductsResponse": {
        "properties": {
          "data": {
            "description": "Products is the page of products matching the query.",
            "items": {
              "$ref": "#/components/schemas/product.Product"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "product.Product": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "description": {
            "description": "Description is an optional free-text description of the product.",
            "example": "Access to all premium features",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "imageUrls": {
            "description": "ImageUrls holds the URLs of images associated with the product.",
            "example": [
              "https://assets.example.com/products/premium.png"
            ],
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "isUsed": {
            "description": "IsUsed reports whether the product is referenced elsewhere and therefore cannot be deleted.",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "Name is the human-readable product name. Required on create and must be unique within the portal.",
            "example": "Premium Plan",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "portalId": {
            "description": "PortalID is the ID of the portal that owns the product. Assigned by the server.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/price.Price"
              }
            ],
            "description": "Price is only populated when the product has exactly one price."
          },
          "priceIds": {
            "description": "PriceIDs holds the IDs of the prices belonging to this product.",
            "example": [
              "price_1a2b3c"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "prices": {
            "description": "Prices holds the full price objects associated with the product.",
            "items": {
              "$ref": "#/components/schemas/price.Price"
            },
            "type": "array"
          },
          "ref": {
            "type": "string"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/product.ProductStatusType"
              }
            ],
            "description": "Status indicates whether the product is active or archived. Assigned by the server on create.",
            "enum": [
              "active",
              "archived"
            ],
            "example": "active"
          },
          "taxPercentage": {
            "description": "TaxPercentage is the tax rate applied to the product, expressed as a percentage.",
            "example": 8.5,
            "type": "number"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "product.ProductStatusType": {
        "enum": [
          "active",
          "archived"
        ],
        "type": "string",
        "x-enum-varnames": [
          "ProductStatusTypeActive",
          "ProductStatusTypeArchived"
        ]
      },
      "refund.CreateRefundRequest": {
        "properties": {
          "invoiceId": {
            "example": "inv_123",
            "type": "string"
          }
        },
        "required": [
          "invoiceId"
        ],
        "type": "object"
      },
      "refund.GetRefundsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/refund.Refund"
            },
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "refund.Refund": {
        "properties": {
          "amount": {
            "description": "Amount is the refunded amount in the smallest currency unit (e.g. cents).",
            "example": 5000,
            "type": "integer"
          },
          "completedAt": {
            "description": "CompletedAt is the RFC 3339 timestamp at which the refund succeeded; absent until then.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "failureReason": {
            "description": "FailureReason is the reason the refund failed, populated only for failed refunds.",
            "example": "insufficient_funds",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "invoiceId": {
            "description": "InvoiceID is the ID of the invoice the refund was issued against.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "receiptKey": {
            "description": "ReceiptKey is the storage key of the refund receipt, when one is available.",
            "example": "receipts/re_1a2b3c.pdf",
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/refund.RefundStatusType"
              }
            ],
            "description": "Status is the current state of the refund as it progresses through processing.",
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "example": "succeeded"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "refund.RefundStatusType": {
        "enum": [
          "pending",
          "succeeded",
          "failed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "RefundStatusPending",
          "RefundStatusSucceeded",
          "RefundStatusFailed"
        ]
      },
      "session.ExchangeRequest": {
        "properties": {
          "cookieSessionId": {
            "description": "CookieSessionID optionally identifies the session behind a bearer the\ncaller already holds. It is only consulted when the presented session\ntoken was already consumed: the response then says whether the consumer\nwas the same viewer (see ExchangeRejectionHeader), letting the caller tell\na harmless replay from a cross-viewer race. Absent keeps the legacy\nopaque rejection.",
            "type": "string"
          },
          "sessionId": {
            "description": "SessionID is the session token ID previously issued for this app.",
            "type": "string"
          }
        },
        "required": [
          "sessionId"
        ],
        "type": "object"
      },
      "session.ExchangeResponse": {
        "properties": {
          "session": {
            "allOf": [
              {
                "$ref": "#/components/schemas/session.SessionPayload"
              }
            ],
            "description": "Session contains the user and company context stored in the session token."
          },
          "token": {
            "description": "Token is a user-scoped bearer token that can be used for subsequent API calls.",
            "type": "string"
          },
          "tokenExpiresAt": {
            "description": "TokenExpiresAt is the Unix timestamp when the bearer token expires.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "session.SessionPayload": {
        "properties": {
          "appId": {
            "description": "AppID is the marketplace application that issued the session.",
            "type": "string"
          },
          "clientUserId": {
            "description": "ClientUserID is the client (external) user associated with the session, if any.",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company associated with the session, if any.",
            "type": "string"
          },
          "instanceId": {
            "description": "InstanceID is the installed app instance the session was opened for, if any.",
            "type": "string"
          },
          "internalUserId": {
            "description": "InternalUserID is the internal user associated with the session, if any.",
            "type": "string"
          },
          "notificationId": {
            "description": "NotificationID is the notification the session was opened for, if the app\nis rendering a Notification Center surface.",
            "type": "string"
          },
          "portalId": {
            "description": "PortalID is the workspace the session belongs to.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "subscription.CreateSubscriptionInput": {
        "properties": {
          "clientId": {
            "description": "ClientID is the client the subscription bills. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "string"
          },
          "collectionMethod": {
            "description": "CollectionMethod is how invoices for the subscription are collected.",
            "enum": [
              "sendInvoice",
              "chargeAutomatically"
            ],
            "example": "sendInvoice",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the company the subscription bills. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
            "type": "string"
          },
          "currency": {
            "description": "Currency is the ISO currency code.",
            "example": "usd",
            "type": "string"
          },
          "daysUntilDue": {
            "description": "DaysUntilDue sets the invoice due date relative to issuance.",
            "example": 30,
            "type": "integer"
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billingutils.BillingPeriodType"
              }
            ],
            "description": "Interval is the billing period.",
            "example": "month"
          },
          "intervalCount": {
            "description": "IntervalCount is the number of intervals between billings.",
            "example": 1,
            "type": "integer"
          },
          "lineItems": {
            "description": "LineItems are the subscription line items. Required unless templateId is provided, in which case the template's line items are used when omitted. Must contain at least one item when provided.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "minItems": 1,
            "type": "array"
          },
          "memo": {
            "description": "Memo is an optional note shown on generated invoices.",
            "example": "Monthly retainer",
            "type": "string"
          },
          "paymentMethodPreferences": {
            "description": "PaymentMethodPreferences restricts which payment methods are offered.",
            "items": {
              "$ref": "#/components/schemas/payment.PaymentMethodPreference"
            },
            "type": "array"
          },
          "recipientId": {
            "description": "RecipientID is the recipient (client or company) of the subscription. Exactly one of clientId, companyId, or recipientId must be provided.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "string"
          },
          "taxPercentage": {
            "description": "TaxPercentage is an optional tax rate applied to generated invoices.",
            "example": 8.25,
            "type": "number"
          },
          "templateId": {
            "description": "TemplateID optionally seeds the subscription from a subscription template.",
            "example": "a7c3e9f1-2b4d-4e6a-8c0f-1d2e3f4a5b6c",
            "type": "string"
          }
        },
        "type": "object"
      },
      "subscription.GetSubscriptionResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/subscription.Subscription"
            },
            "nullable": true,
            "type": "array"
          },
          "nextToken": {
            "description": "base64 encoded JSON representing a NextToken",
            "type": "string"
          }
        },
        "type": "object"
      },
      "subscription.Subscription": {
        "properties": {
          "additionalFields": {
            "additionalProperties": true,
            "description": "StripeObject would hold field from stripe's subscription or subscription schedule object",
            "type": "object"
          },
          "cancelledAt": {
            "description": "CancelledAt is the RFC 3339 timestamp at which the subscription was cancelled; absent while active.",
            "example": "2024-02-20T14:05:00Z",
            "format": "date-time",
            "type": "string"
          },
          "clientId": {
            "description": "ClientID is the ID of the client user the subscription bills.",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "string"
          },
          "collectionMethod": {
            "description": "CollectionMethod determines how the subscription's invoices are collected.",
            "enum": [
              "sendInvoice",
              "chargeAutomatically"
            ],
            "example": "sendInvoice",
            "type": "string"
          },
          "companyId": {
            "description": "CompanyID is the ID of the company the subscription bills.",
            "example": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "creatorId": {
            "type": "string"
          },
          "currency": {
            "description": "Currency is the ISO 4217 currency code the subscription is billed in.",
            "example": "usd",
            "type": "string"
          },
          "data": {
            "type": "string"
          },
          "daysUntilDue": {
            "description": "DaysUntilDue is the number of days a recipient has to pay an invoice when collected by sending an invoice.",
            "example": 30,
            "type": "integer"
          },
          "fields": {
            "$ref": "#/components/schemas/billing.SubscriptionFields"
          },
          "filteredListIndexPkey": {
            "description": "{client_id}/INBOX_NOTIFICATION",
            "type": "string"
          },
          "forcePaused": {
            "description": "ForcePaused indicates the subscription was paused because the workspace plan lapsed.",
            "example": false,
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "identityId": {
            "type": "string"
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/billingutils.BillingPeriodType"
              }
            ],
            "description": "Interval is the billing period the subscription recurs on.",
            "example": "monthly"
          },
          "intervalCount": {
            "description": "IntervalCount is the number of intervals between each billing cycle.",
            "example": 1,
            "type": "integer"
          },
          "lineItems": {
            "description": "LineItems are the products and ad-hoc charges billed on each cycle.",
            "items": {
              "$ref": "#/components/schemas/line_item.LineItem"
            },
            "type": "array"
          },
          "memo": {
            "description": "Memo is an optional note shown to the recipient on generated invoices.",
            "example": "Monthly retainer",
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "paymentMethodPreferences": {
            "description": "field is only used for platform api and should not be used anywhere else on FE/BE",
            "items": {
              "$ref": "#/components/schemas/payment.PaymentMethodPreference"
            },
            "type": "array"
          },
          "paymentSourceId": {
            "description": "PaymentSourceId is the ID of the saved payment source charged for automatically-collected subscriptions.",
            "example": "card_1a2b3c",
            "type": "string"
          },
          "previousAttributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "recipientId": {
            "description": "RecipientID is the ID of the client or company the subscription bills.\nDeprecated: use ClientID and CompanyID instead",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "status": {
            "description": "Status is the current lifecycle status of the subscription, mirrored from Stripe.",
            "example": "active",
            "type": "string"
          },
          "taxPercentage": {
            "description": "TaxPercentage is the tax rate applied to the subscription, as a percentage.",
            "example": 8.25,
            "nullable": true,
            "type": "number"
          },
          "templateId": {
            "description": "TemplateID is the ID of the subscription template the subscription was created from, when applicable.",
            "example": "a7c3e9f1-2b4d-4e6a-8c0f-1d2e3f4a5b6c",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "users.InternalUserPatchRequest": {
        "properties": {
          "companyAccessList": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "isClientAccessLimited": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "users.Owner": {
        "properties": {
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/users.OwnerFields"
          }
        },
        "type": "object"
      },
      "users.OwnerFields": {
        "properties": {
          "avatarImageUrl": {
            "type": "string"
          },
          "companyAvatarUrl": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "fallbackColor": {
            "type": "string"
          },
          "familyName": {
            "type": "string"
          },
          "givenName": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "workspace.Labels": {
        "properties": {
          "groupTerm": {
            "description": "Singular term used for a group of clients (e.g. \"Company\").",
            "example": "Company",
            "type": "string"
          },
          "groupTermPlural": {
            "description": "Plural term used for groups of clients (e.g. \"Companies\").",
            "example": "Companies",
            "type": "string"
          },
          "individualTerm": {
            "description": "Singular term used for an individual client (e.g. \"Client\").",
            "example": "Client",
            "type": "string"
          },
          "individualTermPlural": {
            "description": "Plural term used for individual clients (e.g. \"Clients\").",
            "example": "Clients",
            "type": "string"
          }
        },
        "type": "object"
      },
      "workspace.Workspace": {
        "properties": {
          "brandName": {
            "description": "Display name of the brand shown to clients.",
            "example": "Acme Inc.",
            "type": "string"
          },
          "colorAccent": {
            "description": "Hex accent color used throughout the client portal.",
            "example": "#3a70e8",
            "type": "string"
          },
          "colorSidebarBackground": {
            "description": "Hex color of the client sidebar background.",
            "example": "#ffffff",
            "type": "string"
          },
          "colorSidebarText": {
            "description": "Hex color of the client sidebar text.",
            "example": "#000000",
            "type": "string"
          },
          "font": {
            "description": "Font family used in the client portal.",
            "example": "Inter",
            "type": "string"
          },
          "fullLogoUrl": {
            "description": "URL of the full logo used for the workspace.",
            "example": "https://cdn.assembly.com/logo.png",
            "format": "uri",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier of the workspace (portal).",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "format": "uuid",
            "type": "string"
          },
          "industry": {
            "description": "Industry selected for the workspace during onboarding.",
            "example": "Marketing",
            "type": "string"
          },
          "isClientDirectSignUpEnabled": {
            "description": "Whether clients can sign up directly without an invitation.",
            "example": false,
            "type": "boolean"
          },
          "isCompaniesEnabled": {
            "description": "Whether the companies feature is enabled for the workspace.",
            "example": true,
            "type": "boolean"
          },
          "labels": {
            "allOf": [
              {
                "$ref": "#/components/schemas/workspace.Labels"
              }
            ],
            "description": "Custom terminology configured for the workspace."
          },
          "logOutUrl": {
            "description": "URL clients are redirected to after signing out.",
            "example": "https://example.com/logout",
            "format": "uri",
            "type": "string"
          },
          "metaDescription": {
            "description": "Page description used in meta tags.",
            "example": "Manage your projects with Acme.",
            "type": "string"
          },
          "metaTitle": {
            "description": "Page title shown in the browser tab and meta tags.",
            "example": "Acme Client Portal",
            "type": "string"
          },
          "portalUrl": {
            "description": "Fully qualified URL of the client-facing portal.",
            "example": "clients.acme.com",
            "format": "uri",
            "type": "string"
          },
          "socialSharingImageUrl": {
            "description": "URL of the image used when the workspace is shared on social media.",
            "example": "https://cdn.assembly.com/social.png",
            "format": "uri",
            "type": "string"
          },
          "squareIconUrl": {
            "description": "URL of the square icon used for the workspace.",
            "example": "https://cdn.assembly.com/icon.png",
            "format": "uri",
            "type": "string"
          },
          "squareLoginImageUrl": {
            "description": "URL of the square image shown on the login screen.",
            "example": "https://cdn.assembly.com/login.png",
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "contact": {},
    "title": "Assembly API",
    "version": ""
  },
  "openapi": "3.0.0",
  "paths": {
    "/v1/channels/files": {
      "get": {
        "description": "Returns a paginated list of file channels, optionally filtered by company, client, or membership type.",
        "operationId": "list-file-channels",
        "parameters": [
          {
            "description": "Filter by company id",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by client id",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by channel grouping type",
            "in": "query",
            "name": "membershipType",
            "schema": {
              "enum": [
                "individual",
                "company",
                "group"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by member id (deprecated legacy schema)",
            "in": "query",
            "name": "memberId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by id of entity the channel is based on (deprecated legacy schema)",
            "in": "query",
            "name": "membershipEntityId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of items to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous response",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/filechannels.FileChannel"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List File Channels",
        "tags": [
          "File Channels"
        ]
      },
      "post": {
        "description": "Creates a file channel. Provide companyId for a company channel, clientId for an individual channel, or membershipType=group with memberIds. The legacy membershipEntityId/membershipType pair is still accepted.",
        "operationId": "create-file-channel",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/filechannel.CreateFileChannelInput"
              }
            }
          },
          "description": "File channel to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/filechannels.FileChannel"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create File Channel",
        "tags": [
          "File Channels"
        ]
      }
    },
    "/v1/channels/files/{id}": {
      "get": {
        "description": "Retrieves a single file channel by its id. The requesting user must be a member of the channel.",
        "operationId": "retrieve-file-channel",
        "parameters": [
          {
            "description": "File channel id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/filechannels.FileChannel"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unauthorized"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get File Channel by id",
        "tags": [
          "File Channels"
        ]
      }
    },
    "/v1/clients": {
      "get": {
        "description": "Lists the clients within the portal, paginated. Supports filtering by\ncompany, name, email, and tag-based custom field values.",
        "operationId": "list-clients",
        "parameters": [
          {
            "description": "Maximum number of clients to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by company ID",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by client given (first) name",
            "in": "query",
            "name": "givenName",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by client family (last) name",
            "in": "query",
            "name": "familyName",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by client email",
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by tag-based custom field values. Repeatable bracket-style param: customFields[\u003cfieldKey\u003e]=\u003coptionKey\u003e[,\u003coptionKey\u003e...]. Values within a single bracket are matched with OR; multiple bracketed fields are combined with AND. Only multi-select custom fields are supported.",
            "explode": true,
            "in": "query",
            "name": "customFields",
            "schema": {
              "additionalProperties": {
                "description": "Comma-separated option keys to match (OR within a field).",
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/api.ClientItem"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List clients",
        "tags": [
          "Clients"
        ]
      },
      "post": {
        "description": "Creates a client. Requires givenName, familyName, email, and a company\nassociation (companyId, or companyIds in multi-company portals). Set the\n`sendInvite=true` query param to email the client an invite on creation.",
        "operationId": "create-client",
        "parameters": [
          {
            "description": "Send the client an invite email on creation",
            "in": "query",
            "name": "sendInvite",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/api.CreateClientInput"
              }
            }
          },
          "description": "Client to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ClientItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a client",
        "tags": [
          "Clients"
        ]
      }
    },
    "/v1/clients/{id}": {
      "delete": {
        "description": "Deletes a client by ID. The response echoes the deleted object's ID with `deleted: true`.",
        "operationId": "delete-client",
        "parameters": [
          {
            "description": "Client ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ClientItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing client ID or client could not be deleted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a client",
        "tags": [
          "Clients"
        ]
      },
      "get": {
        "description": "Returns a single client by ID.",
        "operationId": "retrieve-client",
        "parameters": [
          {
            "description": "Client ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ClientItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid or unknown client ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a client",
        "tags": [
          "Clients"
        ]
      },
      "patch": {
        "description": "Partially updates a client. Only givenName, familyName, companyId, and\ncustomFields are mutable; any other field in the body is ignored and\nechoed back in the `X-Ignored-Fields` response header. Set `sendInvite=true`\nto send (or resend) the client's invite when they are not yet active.",
        "operationId": "update-client",
        "parameters": [
          {
            "description": "Client ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Send or resend the client's invite email",
            "in": "query",
            "name": "sendInvite",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/api.UpdateClientInput"
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ClientItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Client not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update a client",
        "tags": [
          "Clients"
        ]
      }
    },
    "/v1/clients/{id}/app-visibility": {
      "get": {
        "description": "Returns the same Client object as GET /v1/clients/{id} with an\nadditional `appVisibility` field nested at the root. The field\nis an array grouping the apps visible to the client by each\ncompany the client belongs to. The same install may appear in\nmore than one group when visible across multiple companies.",
        "operationId": "retrieve-client-app-visibility",
        "parameters": [
          {
            "description": "Client ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ClientItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid or unknown client ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a client with app visibility",
        "tags": [
          "Clients"
        ]
      }
    },
    "/v1/comments": {
      "get": {
        "description": "Lists task comments from the Tasks marketplace app installed on the workspace. The request is proxied to the app's comments API. Requires the Tasks app to be installed.",
        "operationId": "get_v1-comments",
        "parameters": [
          {
            "description": "Maximum number of comments to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous list response",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter comments to a single task by its id",
            "in": "query",
            "name": "taskId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskCommentList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameter for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, or app resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List task comments",
        "tags": [
          "Comments"
        ]
      }
    },
    "/v1/comments/{commentId}": {
      "delete": {
        "description": "Deletes a task comment by id via the Tasks marketplace app installed on the workspace. The request is proxied to the app's comments API and returns the deleted comment marker. Requires the Tasks app to be installed.",
        "operationId": "delete_v1-comments-commentid",
        "parameters": [
          {
            "description": "Comment id",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskComment"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or comment not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a task comment",
        "tags": [
          "Comments"
        ]
      },
      "get": {
        "description": "Retrieves a single task comment by id from the Tasks marketplace app installed on the workspace. The request is proxied to the app's comments API. Requires the Tasks app to be installed.",
        "operationId": "get_v1-comments-commentid",
        "parameters": [
          {
            "description": "Comment id",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskComment"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or comment not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a task comment",
        "tags": [
          "Comments"
        ]
      }
    },
    "/v1/companies": {
      "get": {
        "description": "Lists the companies within the portal, paginated. Supports filtering by\nname (case-insensitive substring) and placeholder status.",
        "operationId": "list-companies",
        "parameters": [
          {
            "description": "Maximum number of companies to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case-insensitive substring filter on company name",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by placeholder status",
            "in": "query",
            "name": "isPlaceholder",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/api.CompanyItem"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List companies",
        "tags": [
          "Companies"
        ]
      },
      "post": {
        "description": "Creates a company. Requires a name; fallbackColor, iconImageUrl, and\ncustomFields are optional.",
        "operationId": "create-company",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/api.CreateCompanyInput"
              }
            }
          },
          "description": "Company to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.CompanyItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}": {
      "delete": {
        "description": "Deletes a company by its ID. Returns the deleted object marker.",
        "operationId": "delete-company",
        "parameters": [
          {
            "description": "Company ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ItemFields"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing company ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Company not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a company",
        "tags": [
          "Companies"
        ]
      },
      "get": {
        "description": "Retrieves a single company by its ID.",
        "operationId": "retrieve-company",
        "parameters": [
          {
            "description": "Company ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.CompanyItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing company ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Company not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a company",
        "tags": [
          "Companies"
        ]
      },
      "patch": {
        "description": "Updates a company's name and/or custom field values. A non-empty name is required.",
        "operationId": "update-company",
        "parameters": [
          {
            "description": "Company ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/api.UpdateCompanyInput"
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.CompanyItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or missing company name"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update a company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/companies/{id}/clients": {
      "post": {
        "description": "Associates one or more existing clients with a company. Set\n`confirmPromotePlaceholder=true` to promote a placeholder company when adding clients.",
        "operationId": "add-clients-to-company",
        "parameters": [
          {
            "description": "Company ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Promote a placeholder company when adding clients",
            "in": "query",
            "name": "confirmPromotePlaceholder",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/company.addClientToCompanyRequest"
              }
            }
          },
          "description": "Clients to add",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/company.addClientToCompanyResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Add clients to a company",
        "tags": [
          "Companies"
        ]
      }
    },
    "/v1/contract-templates": {
      "get": {
        "description": "Returns a paginated list of contract templates for the workspace, optionally filtered by name.",
        "operationId": "list-contract-templates",
        "parameters": [
          {
            "description": "Filter templates by name.",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contracts.ListContractTemplatesResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters or unable to list templates"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List Contract Templates",
        "tags": [
          "Contract Templates"
        ]
      }
    },
    "/v1/contract-templates/{id}": {
      "get": {
        "description": "Retrieves a single contract template by its ID.",
        "operationId": "retrieve-contract-template",
        "parameters": [
          {
            "description": "Contract template ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contracts.ContractTemplate"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Contract template not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get Contract Template by ID",
        "tags": [
          "Contract Templates"
        ]
      }
    },
    "/v1/contracts": {
      "get": {
        "description": "Returns a paginated list of contracts for the workspace, optionally filtered by status, template, recipient, or name.",
        "operationId": "list-contracts",
        "parameters": [
          {
            "description": "Filter contracts by status.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "signed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter contracts by contract template ID.",
            "in": "query",
            "name": "contractTemplateId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter contracts by recipient ID. Deprecated alias for clientId.",
            "in": "query",
            "name": "recipientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter contracts by client ID.",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter contracts by name.",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contracts.ListContractsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List contracts",
        "tags": [
          "Contracts"
        ]
      },
      "post": {
        "description": "Creates and sends a contract to a recipient, either from a contract template or as a one-off contract.",
        "operationId": "send-contract",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contracts.CreateContractRequest"
              }
            }
          },
          "description": "Contract to create and send",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contracts.Contract"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Malformed body or invalid recipient/template/variable values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Contract template not found"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Send Contract",
        "tags": [
          "Contracts"
        ]
      }
    },
    "/v1/contracts/{id}": {
      "get": {
        "description": "Retrieves a single contract by its ID.",
        "operationId": "retrieve-contract",
        "parameters": [
          {
            "description": "Contract ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contracts.Contract"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Contract not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get Contract",
        "tags": [
          "Contracts"
        ]
      }
    },
    "/v1/custom-fields": {
      "get": {
        "description": "Lists the custom fields configured for the portal. Supports filtering by\nname and by the entity the field belongs to (client or company).",
        "operationId": "list-custom-fields",
        "parameters": [
          {
            "description": "Filter custom fields by name (case-insensitive exact match)",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter custom fields by the entity they belong to",
            "in": "query",
            "name": "entityType",
            "schema": {
              "enum": [
                "client",
                "company"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/customfields.ClientCustomField"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Custom fields could not be retrieved"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List custom fields",
        "tags": [
          "Custom Fields"
        ]
      },
      "post": {
        "description": "Creates one or more custom fields for the portal. Each field requires a name,\na type, and the entity it belongs to. Options may only be supplied for\nmulti-select fields.",
        "operationId": "create-custom-field",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customfields.createCustomFieldsRequest"
              }
            }
          },
          "description": "Custom fields to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customfields.createCustomFieldsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create custom fields",
        "tags": [
          "Custom Fields"
        ]
      }
    },
    "/v1/custom-fields/{id}/options": {
      "get": {
        "description": "Lists the selectable options for a multi-select custom field. Supports\nfiltering the returned options by label.",
        "operationId": "list-custom-field-options",
        "parameters": [
          {
            "description": "Custom field ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter options by label (case-insensitive exact match)",
            "in": "query",
            "name": "label",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/customfields.ClientCustomFieldOption"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing custom field ID or unknown custom field"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List custom field options",
        "tags": [
          "Custom Fields"
        ]
      }
    },
    "/v1/events": {
      "get": {
        "description": "Returns a paginated list of audit log events for the authenticated workspace, optionally filtered by date range, event type, and actor. Requires internal-user privileges.",
        "operationId": "list-events",
        "parameters": [
          {
            "description": "Inclusive start date filter (RFC3339)",
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Inclusive end date filter (RFC3339)",
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated list of event types to filter by",
            "in": "query",
            "name": "eventType",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated list of actor IDs to filter by",
            "in": "query",
            "name": "actorId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_log.ListAuditLogsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks internal-user privileges"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List audit events",
        "tags": [
          "Events"
        ]
      },
      "post": {
        "description": "Records a custom audit log event for the authenticated workspace. Platform-API callers must be on an enterprise plan.",
        "operationId": "create-event",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/audit_log.CreateAuditLogEventAPIRequest"
              }
            }
          },
          "description": "Audit event to create",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_log.AuditLog"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, validation error, or disallowed event type"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Caller lacks privileges or workspace is not on an enterprise plan"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create an audit event",
        "tags": [
          "Events"
        ]
      }
    },
    "/v1/events/{id}": {
      "get": {
        "description": "Returns a single audit log event by its ID for the authenticated workspace.",
        "operationId": "retrieve-event",
        "parameters": [
          {
            "description": "Audit event ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/audit_log.AuditLog"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Audit event not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get audit event by ID",
        "tags": [
          "Events"
        ]
      }
    },
    "/v1/files": {
      "get": {
        "description": "Lists files, folders, and links within a file channel. `channelId` is required;\npass `path` to scope the listing to a folder within the channel.",
        "operationId": "list-files",
        "parameters": [
          {
            "description": "File channel id to list files from",
            "in": "query",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Folder path within the channel to scope the listing",
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of items to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination token for the next page of results",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/files.ListOutput"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination params or missing channelId"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List files within a file channel",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/root/permissions": {
      "put": {
        "description": "Updates the client access level on a file channel's root folder. Requires internal-user privileges. On the Internal API the change cascades to all folders in the channel; on the Platform API only the root folder is updated.",
        "operationId": "update-root-folder-permissions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.UpdateRootFolderPermissionsRequest"
              }
            }
          },
          "description": "Root folder permissions to apply",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, missing channelId, or clientPermissions is missing or not one of read_only/read_write"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Caller lacks internal-user privileges or access to the channel's company"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "File channel not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update Root Folder Permissions",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/{fileType}": {
      "post": {
        "description": "Creates a file, folder, or link record within a file channel. `channelID` is\nrequired; `path` is required for folders and `linkUrl` for links. Files default\nto \"append\" behavior (keep both, adding a numbered suffix) when a file with the\nsame name already exists at the path.",
        "operationId": "create-file",
        "parameters": [
          {
            "description": "The type of file object to be created. This can be 'file', 'folder', or 'link'.",
            "in": "path",
            "name": "fileType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/files.CreateFileInput"
              }
            }
          },
          "description": "File to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/files.File"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a File",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/{id}": {
      "delete": {
        "description": "Deletes a file, folder, or link by its id and returns the deleted item reference.",
        "operationId": "delete-file",
        "parameters": [
          {
            "description": "File id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ItemFields"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing file id"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Not authorized to delete this file"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "File not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a File",
        "tags": [
          "Files"
        ]
      },
      "get": {
        "description": "Returns the metadata for a single file, folder, or link by its id.",
        "operationId": "retrieve-file",
        "parameters": [
          {
            "description": "File id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/files.File"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing file id"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "File not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get a File's metadata",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/{id}/download": {
      "get": {
        "description": "Streams the raw contents of a file as an octet-stream.",
        "operationId": "download-a-file",
        "parameters": [
          {
            "description": "File id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "File contents"
          },
          "400": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing file id, record is not a downloadable file, or file is too large"
          },
          "401": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "File not found"
          },
          "500": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get a File's contents",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/{id}/download-url": {
      "get": {
        "description": "Returns a short-lived presigned download URL for a file's contents.",
        "operationId": "retrieve-download-url-of-a-file",
        "parameters": [
          {
            "description": "File id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/files.FilePresignedDownload"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing file id or record is not a downloadable file"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "File not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get a File's download url",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/{id}/permissions/": {
      "put": {
        "description": "Updates the client access level on a folder. Requires internal-user privileges. On the Internal API the change cascades to all descendant folders; on the Platform API only the target folder is updated.",
        "operationId": "put_v1files{id}permissions",
        "parameters": [
          {
            "description": "ID of the folder to update",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.UpdateFolderPermissionsRequest"
              }
            }
          },
          "description": "Folder permissions to apply",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.SuccessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, missing clientPermissions, or target is not a folder"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Caller lacks internal-user privileges or access to the folder's company"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Folder not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update Folder Permissions",
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/form-responses": {
      "post": {
        "description": "Assigns a form to one or more clients, creating a pending form response for each recipient. Provide either clientIds or clientCompanyIds.",
        "operationId": "request-form-response",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/forms.SendFormRequest"
              }
            }
          },
          "description": "Form assignment request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/forms.ListFormResponsesOutput"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or recipient information"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Form not found or could not be assigned"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Assign a form to clients",
        "tags": [
          "Form Responses"
        ]
      }
    },
    "/v1/forms": {
      "get": {
        "description": "Lists the forms within the portal, paginated.",
        "operationId": "list-forms",
        "parameters": [
          {
            "description": "Maximum number of forms to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/forms.ListFormsOutput"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List forms",
        "tags": [
          "Forms"
        ]
      },
      "post": {
        "description": "Creates a form with its questions. Note: Assembly forms do not support conditional/branching logic — questions are presented as a flat, ordered sequence.",
        "operationId": "create-form",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/forms.CreateFormInput"
              }
            }
          },
          "description": "Form to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/forms.Form"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a form",
        "tags": [
          "Forms"
        ]
      }
    },
    "/v1/forms/{id}": {
      "get": {
        "description": "Returns a single form, including its questions and response counts, by ID.",
        "operationId": "retrieve-form",
        "parameters": [
          {
            "description": "Form ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/forms.Form"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Form not found"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a form",
        "tags": [
          "Forms"
        ]
      }
    },
    "/v1/forms/{id}/form-responses": {
      "get": {
        "description": "Lists the submissions (form responses) for a form, paginated. Optionally filter by completion status.",
        "operationId": "list-form-responses",
        "parameters": [
          {
            "description": "Form ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter form responses by completion status",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "completed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Maximum number of form responses to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/forms.ListFormResponsesOutput"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List a form's submissions",
        "tags": [
          "Forms"
        ]
      }
    },
    "/v1/installs": {
      "get": {
        "description": "Returns every app install visible to the caller in the workspace, including core\nmodules, marketplace apps, custom apps, embeds, and links. The set is scoped by the\ncaller's permissions: clients only receive installs whose visibility rules include them.",
        "operationId": "list-app-installs",
        "parameters": [
          {
            "description": "When true, an internal caller previews the install list as a client would see it.",
            "in": "query",
            "name": "previewAsClient",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/app_instance.AppInstall"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Workspace app installs could not be found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List app installs",
        "tags": [
          "Installs"
        ]
      }
    },
    "/v1/installs/{installId}": {
      "get": {
        "description": "Returns a single app install by its ID. Core modules may be addressed by their\ndeterministic UUID; marketplace, custom, embed, and link installs are addressed by\ntheir install ID.",
        "operationId": "retrieve-app-install",
        "parameters": [
          {
            "description": "Unique identifier of the app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app_instance.AppInstall"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get an app install",
        "tags": [
          "Installs"
        ]
      }
    },
    "/v1/installs/{installId}/connections": {
      "get": {
        "description": "Returns the app connections (per-client, per-group, or per-company embeds and links)\nattached to a manual app install. Optionally filter the result by company or client.\nThe install must be a manual-type app; core and marketplace installs do not support\nconnections.",
        "operationId": "list-app-connections",
        "parameters": [
          {
            "description": "Unique identifier of the manual app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter connections to a single company",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter connections to a single client",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/appConnection.AppConnection"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install is not a manual app or its connections could not be loaded"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller is not permitted to list connections"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List app install connections",
        "tags": [
          "Installs"
        ]
      },
      "post": {
        "description": "Creates an embed or link connection on a manual app install, scoped to a set of\nclients or a company. All targeted clients must belong to the same company. Requires\ninternal-user privileges.",
        "operationId": "create-app-connection",
        "parameters": [
          {
            "description": "Unique identifier of the manual app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app_instance.AppConnectInput"
              }
            }
          },
          "description": "Connection to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/appConnection.AppConnection"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, install type, link, company, or client set"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "A matching connection already exists or could not be created"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create an app install connection",
        "tags": [
          "Installs"
        ]
      }
    },
    "/v1/installs/{installId}/notification-settings": {
      "get": {
        "description": "Returns the notification settings an app declares for the given install. Each\nsetting's `id` is the value to pass as `notificationSettingId` when creating a\nnotification via POST /v1/notifications. Installs whose backing app declares no\nnotification settings return an empty `notifications` array.",
        "operationId": "retrieve-install-notification-settings",
        "parameters": [
          {
            "description": "Unique identifier of the app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app_instance.InstallNotificationSettings"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get an app install's notification settings",
        "tags": [
          "Installs"
        ]
      },
      "patch": {
        "description": "Applies partial changes to the notification settings of the install's backing app.\nEntries in `notifications` are per-setting deltas: an entry without an `id` adds a new\nsetting (label and surfaces required; the id is generated), an entry with only an `id`\ndeletes that setting, and an entry with an `id` plus fields updates the provided fields\nof that setting. Settings not referenced are left unchanged; an id that matches no\nsetting fails with 400. `actionLabel`, when present, replaces the app's action label —\nsend an empty object to clear it. Fails with 404 until the app's settings are created\nvia POST or the App Setup page. Requests authenticated with an app API key may only\nmanage the calling app's own installs — for a published marketplace app this changes the\napp's settings in every workspace it is installed in. Requests authenticated with a\nregular API key require workspace admin privileges.",
        "operationId": "update-install-notification-settings",
        "parameters": [
          {
            "description": "Unique identifier of the app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app_instance.InstallNotificationSettingsPatchInput"
              }
            }
          },
          "description": "Notification setting deltas to apply",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app_instance.InstallNotificationSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid body, unknown or duplicate setting ids, or the install has no backing app"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, app key targeting another app's install, or caller lacks admin privileges"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found, or the app has no notification settings yet"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update an app install's notification settings",
        "tags": [
          "Installs"
        ]
      },
      "post": {
        "description": "Declares the initial notification settings of the install's backing app. This endpoint\nis create-only: when the app already has notification settings (created here or authored\non the App Setup page) it fails with 409 and the settings must be changed via PATCH.\nSetting ids are stable identifiers referenced by `notificationSettingId` on\nPOST /v1/notifications and by internal users' saved preferences; omit a setting's id to\nhave one generated. Requests authenticated with an app API key may only manage the\ncalling app's own installs — for a published marketplace app this changes the app's\nsettings in every workspace it is installed in. Requests authenticated with a regular\nAPI key require workspace admin privileges.",
        "operationId": "create-install-notification-settings",
        "parameters": [
          {
            "description": "Unique identifier of the app install",
            "in": "path",
            "name": "installId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app_instance.InstallNotificationSettingsCreateInput"
              }
            }
          },
          "description": "Notification settings to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app_instance.InstallNotificationSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid body, duplicate setting ids, or the install has no backing app"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, app key targeting another app's install, or caller lacks admin privileges"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App install not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "The app already has notification settings"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create an app install's notification settings",
        "tags": [
          "Installs"
        ]
      }
    },
    "/v1/internal-users": {
      "get": {
        "description": "Lists the internal users (portal team members) within the portal, paginated.",
        "operationId": "list-internal-users",
        "parameters": [
          {
            "description": "Maximum number of internal users to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/api.InternalUserItem"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List internal users",
        "tags": [
          "Internal Users"
        ]
      }
    },
    "/v1/internal-users/{id}": {
      "get": {
        "description": "Retrieves a single internal user (portal team member) by ID.",
        "operationId": "retrieve-internal-user",
        "parameters": [
          {
            "description": "ID of the internal user to retrieve",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.InternalUserItem"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "No internal user found with the given ID"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get an internal user",
        "tags": [
          "Internal Users"
        ]
      },
      "patch": {
        "description": "Updates an internal user's client-access scope. Only the isClientAccessLimited\nand companyAccessList fields are accepted; all other fields are server-managed.",
        "operationId": "update-internal-user",
        "parameters": [
          {
            "description": "ID of the internal user to update",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/users.InternalUserPatchRequest"
              }
            }
          },
          "description": "Internal user fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.InternalUserItem"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Malformed request body"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Caller lacks permission to update internal users"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Internal user or a referenced company was not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update an internal user",
        "tags": [
          "Internal Users"
        ]
      }
    },
    "/v1/internal-users/{id}/notification-settings": {
      "get": {
        "description": "Retrieves an internal user's notification preferences: the global in-product\ntoggle, the global email delivery mode, and per-category opt-outs under\nnotifyAbout. Settings declared by the workspace's installed apps appear under\ndynamic customApp:\u003cappId\u003e:\u003cnotificationSettingId\u003e keys, using the app's declared\ndefaults until the user customizes them. Users who have never changed their\nsettings return the default preferences.",
        "operationId": "retrieve-internal-user-notification-settings",
        "parameters": [
          {
            "description": "ID of the internal user",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationsettings.InternalUserNotificationSettings"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "No internal user found with the given ID"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get an internal user's notification settings",
        "tags": [
          "Internal Users"
        ]
      }
    },
    "/v1/invoice-templates": {
      "get": {
        "description": "Returns a paginated list of the invoice templates configured for the portal.",
        "operationId": "list-invoice-templates",
        "parameters": [
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoiceTemplate.GetInvoiceTemplateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List invoice templates",
        "tags": [
          "Invoice Templates"
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "description": "Returns a paginated list of invoices for the portal. Supports filtering\nby client, company, and subscription.",
        "operationId": "list-invoices",
        "parameters": [
          {
            "description": "Filter by client ID",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by company ID. Required with clientId when includeCompanyInvoices is true (returns that client's invoices plus the company's).",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "When true with clientId, also include invoices billed to companyId. companyId is required in that case.",
            "in": "query",
            "name": "includeCompanyInvoices",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by subscription ID",
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoice.GetInvoiceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query or pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List invoices",
        "tags": [
          "Invoices"
        ]
      },
      "post": {
        "description": "Creates an invoice for a client or company. Requires a recipient\n(clientId or companyId) and at least one line item. The collection\nmethod determines how the invoice is collected.",
        "operationId": "create-invoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/invoice.CreateInvoiceRequest"
              }
            }
          },
          "description": "Invoice to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoice.Invoice"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or invoice field values"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Referenced subscription or connected account not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create an invoice",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "description": "Returns a single invoice by ID.",
        "operationId": "retrieve-invoice",
        "parameters": [
          {
            "description": "Invoice ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoice.Invoice"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invoice not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve an invoice",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "description": "Returns the user that owns the API key making the request.",
        "operationId": "retrieve-me",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/me.MeResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "The API key doesn't have permissions to perform the request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "User not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve the current user",
        "tags": [
          "Me"
        ]
      }
    },
    "/v1/message-channels": {
      "get": {
        "description": "Returns a paginated list of message channels the requester is a member of, optionally filtered by membership and enriched with unread state.",
        "operationId": "list-message-channels",
        "parameters": [
          {
            "description": "Filter by client id. Alias for membershipEntityId.",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by the entity (company or client) the channel is scoped to.",
            "in": "query",
            "name": "membershipEntityId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter to channels scoped to this company. Combine with clientId to fetch the individual channel for a specific client/company pair.",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter to channels containing this member id, and use it as the viewer for includeUnread enrichment.",
            "in": "query",
            "name": "memberId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by channel membership type.",
            "in": "query",
            "name": "membershipType",
            "schema": {
              "enum": [
                "company",
                "individual",
                "group"
              ],
              "type": "string"
            }
          },
          {
            "description": "Enrich each channel with unreadCount and lastRead for the viewer.",
            "in": "query",
            "name": "includeUnread",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Maximum number of records to return. Capped at 100.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.List"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters, membership type, includeUnread value, or limit exceeded"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get a list of Message Channels",
        "tags": [
          "Message Channels"
        ]
      },
      "post": {
        "description": "Creates a message channel. Required fields depend on membershipType: company channels need membershipEntityId or companyId; individual channels need membershipEntityId or clientId; group channels need memberIds.",
        "operationId": "create-message-channel",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/messagechannel.CreateMessageChannelRequest"
              }
            }
          },
          "description": "Message channel to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagechannel.MessageChannel"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or membership parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Referenced company or client user not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create Message Channel",
        "tags": [
          "Message Channels"
        ]
      }
    },
    "/v1/message-channels/unread": {
      "get": {
        "description": "Returns the messaging channels where the specified user has unread messages, plus an aggregate total. When userId is omitted, the requester's own user is used.",
        "operationId": "list-unread-message-channels",
        "parameters": [
          {
            "description": "Internal user or client id whose unread channels to summarize. Defaults to the requester's user id.",
            "in": "query",
            "name": "userId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagechannel.UnreadSummary"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "User not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get unread message channels for a user",
        "tags": [
          "Message Channels"
        ]
      }
    },
    "/v1/message-channels/{id}": {
      "get": {
        "description": "Returns a single message channel by id. The requester must be a member of the channel.",
        "operationId": "retrieve-message-channel",
        "parameters": [
          {
            "description": "ID of the message channel to retrieve",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messagechannel.MessageChannel"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing channel id"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Channel not found or requester is not a member"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get Message Channel by id",
        "tags": [
          "Message Channels"
        ]
      }
    },
    "/v1/messages": {
      "get": {
        "description": "Returns a paginated list of messages in a channel, most recent first. The channelId\nquery parameter is required and must be a bare UUID (do not include the GetStream\n'messaging:' prefix). A maximum of 100 messages are returned per page.",
        "operationId": "list-messages",
        "parameters": [
          {
            "description": "Channel ID to list messages for (UUID format only, do not include the 'messaging:' prefix)",
            "in": "query",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of messages to return (capped at 100)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/api.List"
                    },
                    {
                      "properties": {
                        "data": {
                          "items": {
                            "$ref": "#/components/schemas/messages.Message"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters or channel ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Message channel not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List messages",
        "tags": [
          "Messages"
        ]
      },
      "post": {
        "description": "Sends a message to a channel. Requires channelId and text. channelId must be a bare\nUUID (do not include the GetStream 'messaging:' prefix). When senderId is provided it\nmust be a member of the channel; otherwise the authenticated user is used as the author.",
        "operationId": "send-message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/messages.CreateMessageInput"
              }
            }
          },
          "description": "Message to send",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/messages.Message"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, channel ID, or sender ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Send a message",
        "tags": [
          "Messages"
        ]
      }
    },
    "/v1/notes": {
      "get": {
        "description": "Returns a paginated list of notes. Filter by a client or company by supplying both entityId and entityType; when neither is supplied, all notes the caller can access are returned. Supplying entityId without entityType is rejected.",
        "operationId": "list-notes",
        "parameters": [
          {
            "description": "Filter by the ID of the client or company the note is attached to",
            "in": "query",
            "name": "entityId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by entity type",
            "in": "query",
            "name": "entityType",
            "schema": {
              "enum": [
                "client",
                "company"
              ],
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 20,
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_notes.ListNotesOutput"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid limit, missing entity type, or invalid entity type"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks access to the entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List notes",
        "tags": [
          "Notes"
        ]
      },
      "post": {
        "description": "Creates an internal note attached to a client or company. Requires title, entityId, and entityType; content is optional. Only internal users with sufficient privileges can create notes.",
        "operationId": "create-note",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/internal_notes.CreateNoteHandlerInput"
              }
            }
          },
          "description": "Note to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_notes.Note"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, content too long, or invalid entity type/ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks access to the entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a note",
        "tags": [
          "Notes"
        ]
      }
    },
    "/v1/notes/{id}": {
      "delete": {
        "description": "Permanently deletes a note by ID and returns a deletion confirmation. Only internal users with access to the note's entity can delete it.",
        "operationId": "delete-note",
        "parameters": [
          {
            "description": "Note ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.ItemFields"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks access to the note"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Note not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a note",
        "tags": [
          "Notes"
        ]
      },
      "get": {
        "description": "Returns a single note by ID. Only internal users with access to the note's entity can retrieve it.",
        "operationId": "retrieve-note",
        "parameters": [
          {
            "description": "Note ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_notes.Note"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid entity type associated with the note"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks access to the note"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Note not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a note",
        "tags": [
          "Notes"
        ]
      },
      "patch": {
        "description": "Updates the title and/or content of an existing note. Only the fields supplied are changed. Only internal users with access to the note's entity can update it.",
        "operationId": "update-note",
        "parameters": [
          {
            "description": "Note ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/internal_notes.UpdateNoteInput"
              }
            }
          },
          "description": "Fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_notes.Note"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, empty title, or content too long"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks access to the note"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Note not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update a note",
        "tags": [
          "Notes"
        ]
      }
    },
    "/v1/notifications": {
      "get": {
        "description": "Returns a paginated list of notifications for a recipient. When no recipient filter is supplied, the authenticated user's notifications are returned. Only unread notifications are returned unless includeRead is true.",
        "operationId": "list-notifications",
        "parameters": [
          {
            "description": "Filter by recipient user ID. Defaults to the authenticated user when omitted.",
            "in": "query",
            "name": "recipientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by recipient client ID.",
            "in": "query",
            "name": "recipientClientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by recipient internal user ID.",
            "in": "query",
            "name": "recipientInternalUserId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Include read notifications in the response.",
            "in": "query",
            "name": "includeRead",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Filter by recipient company ID.",
            "in": "query",
            "name": "recipientCompanyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.NotificationsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters or missing recipient ID"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List notifications",
        "tags": [
          "Notifications"
        ]
      },
      "post": {
        "description": "Creates a notification for a recipient. Requires senderId, a recipient (recipientClientId or recipientInternalUserId), and at least one delivery target. Notifications can only be created from a custom app. When notificationSettingId is provided and the recipient's notification settings disable every requested delivery target, no notification is created and the request returns 202.",
        "operationId": "create-notification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/notifications.CreateInput"
              }
            }
          },
          "description": "Notification to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.Notification"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.NotificationSuppressedResponse"
                }
              }
            },
            "description": "No notification was created: every requested delivery target is disabled by the recipient's notification settings"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or notification parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a notification",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/v1/notifications/{id}": {
      "delete": {
        "description": "Deletes a notification by ID.",
        "operationId": "delete-notification",
        "parameters": [
          {
            "description": "Notification ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/api.DeleteItemResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Notification not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a notification",
        "tags": [
          "Notifications"
        ]
      },
      "get": {
        "description": "Returns a single notification by ID.",
        "operationId": "retrieve-notification",
        "parameters": [
          {
            "description": "Notification ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.Notification"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Notification not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a notification",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/v1/notifications/{id}/read": {
      "post": {
        "description": "Marks a notification as read and returns the updated notification.",
        "operationId": "mark-notification-read",
        "parameters": [
          {
            "description": "Notification ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.Notification"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Notification not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Mark notification as read",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/v1/notifications/{id}/unread": {
      "post": {
        "description": "Marks a notification as unread and returns the updated notification.",
        "operationId": "mark-notification-unread",
        "parameters": [
          {
            "description": "Notification ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notifications.Notification"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Notification not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Mark notification as unread",
        "tags": [
          "Notifications"
        ]
      }
    },
    "/v1/payments": {
      "get": {
        "description": "Returns a paginated list of payments for the portal. When invoiceId is supplied, only\npayments for that invoice are returned. Requires internal-user privileges.",
        "operationId": "list-payments",
        "parameters": [
          {
            "description": "Filter payments by invoice ID",
            "in": "query",
            "name": "invoiceId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/payment.GetPaymentsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks internal-user privileges"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "The invoice referenced by invoiceId was not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List payments",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/prices": {
      "get": {
        "description": "Returns a paginated list of prices. When productId is supplied, only prices belonging to that product are returned; otherwise all prices for the portal are returned. Requires internal-user privileges.",
        "operationId": "list-prices",
        "parameters": [
          {
            "description": "Filter prices by product ID.",
            "in": "query",
            "name": "productId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/price.GetPricesResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List prices",
        "tags": [
          "Prices"
        ]
      },
      "post": {
        "description": "Creates a price for a product. Requires internal-user privileges. The product must already exist, and the price must be unique within the product (a recurring price is unique by amount, currency, and interval; a one-time price is unique by amount and currency).",
        "operationId": "create-a-price",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/price.CreatePriceInput"
              }
            }
          },
          "description": "Price to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/price.Price"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, unknown product, invalid billing period, or negative amount"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "A matching price already exists for the product"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a price",
        "tags": [
          "Prices"
        ]
      }
    },
    "/v1/prices/{id}": {
      "get": {
        "description": "Returns a single price by ID scoped to the authenticated portal.",
        "operationId": "retrieve-price",
        "parameters": [
          {
            "description": "Price ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/price.Price"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Price not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a price",
        "tags": [
          "Prices"
        ]
      }
    },
    "/v1/products": {
      "get": {
        "description": "Returns a paginated list of products in the caller's portal, optionally filtered by name (case-insensitive substring match).",
        "operationId": "list-products",
        "parameters": [
          {
            "description": "Filter by product name (case-insensitive substring match)",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of products to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous call",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/product.GetProductsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination token"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "API key lacks the payments permission"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List products",
        "tags": [
          "Products"
        ]
      },
      "post": {
        "description": "Creates a product, optionally bundling one or more prices supplied in the request body.\nOnly the product name is required; status, portal, and price IDs are assigned by the server.",
        "operationId": "create-a-product",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/product.CreateProductInput"
              }
            }
          },
          "description": "Product to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/product.Product"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Product name already exists or a supplied price has an invalid billing period"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "API key lacks the payments permission"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a product",
        "tags": [
          "Products"
        ]
      }
    },
    "/v1/products/{id}": {
      "get": {
        "description": "Returns a single product scoped to the caller's portal. When the product has exactly one price, that price is embedded in the response.",
        "operationId": "retrieve-product",
        "parameters": [
          {
            "description": "ID of the product to retrieve",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/product.Product"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "API key lacks the payments permission"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Product not found in the caller's portal"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get a product by ID",
        "tags": [
          "Products"
        ]
      }
    },
    "/v1/refunds": {
      "get": {
        "description": "Returns a paginated list of refunds issued against an invoice. Requires internal-user privileges.",
        "operationId": "ListRefunds",
        "parameters": [
          {
            "description": "ID of the invoice to list refunds for",
            "in": "query",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund.GetRefundsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing invoiceId or invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks internal-user privileges"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List refunds",
        "tags": [
          "Refunds"
        ]
      },
      "post": {
        "description": "Issues a refund against a paid invoice. The refund may be queued for\nreview depending on the portal's billing configuration.",
        "operationId": "CreateRefund",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/refund.CreateRefundRequest"
              }
            }
          },
          "description": "Refund to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/refund.Refund"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body or invoice cannot be refunded in its current state"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invoice not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a refund",
        "tags": [
          "Refunds"
        ]
      }
    },
    "/v1/session": {
      "post": {
        "description": "Validates the presented session token (issued for this app) and returns the session payload together with a short-lived, user-scoped bearer token.",
        "operationId": "session-exchange",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/session.ExchangeRequest"
              }
            }
          },
          "description": "Session exchange request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/session.ExchangeResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid sessionId, or session has no associated user"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API key required; session token expired; or session belongs to a different app"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Session token not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Exchange a session token for a bearer token",
        "tags": [
          "Session"
        ]
      }
    },
    "/v1/subscription-templates": {
      "get": {
        "description": "Returns a paginated list of the portal's subscription templates.",
        "operationId": "list-subscription-templates",
        "parameters": [
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/billing.GetSubscriptionTemplatesResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List subscription templates",
        "tags": [
          "Subscription Templates"
        ]
      }
    },
    "/v1/subscriptions": {
      "get": {
        "description": "Returns a paginated list of subscriptions. Client users always receive their own subscriptions plus company-targeted subscriptions for their company; recipient query params are ignored. Internal callers can filter by recipient: companyId alone returns every subscription in that company, clientId returns that client's subscriptions, and clientId with companyId returns that client's subscriptions in that company.",
        "operationId": "list-subscriptions",
        "parameters": [
          {
            "description": "Filter by client ID. Combined with companyId when both are supplied. Ignored for client-user callers.",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by company ID. Combined with clientId when both are supplied. Ignored for client-user callers.",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by recipient ID (deprecated; prefer clientId or companyId). Ignored for client-user callers.",
            "in": "query",
            "name": "recipientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum number of records to return.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous request.",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/subscription.GetSubscriptionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid pagination parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks permission"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List subscriptions",
        "tags": [
          "Subscriptions"
        ]
      },
      "post": {
        "description": "Creates a recurring subscription for a client or company. Requires a recipient (clientId or companyId), at least one line item, and a connected payout account on the portal. The billing interval is inferred from recurring prices when present, otherwise taken from the request.",
        "operationId": "create-subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/subscription.CreateSubscriptionInput"
              }
            }
          },
          "description": "Subscription to create",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/subscription.Subscription"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body, recipient, interval, or line items"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks permission"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Payout account, recipient, or subscription template not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a subscription",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{id}": {
      "get": {
        "description": "Returns a single subscription by ID. Client users may only retrieve their own subscriptions or company-targeted subscriptions for their company; other subscriptions in the portal return 404.",
        "operationId": "retrieve-subscription",
        "parameters": [
          {
            "description": "Subscription ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/subscription.Subscription"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks permission"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Subscription not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a subscription",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/v1/subscriptions/{id}/cancel": {
      "post": {
        "description": "Cancels an active subscription (or its underlying schedule) and returns the updated subscription. Cancelling an already-cancelled subscription returns an error.",
        "operationId": "cancel-subscription",
        "parameters": [
          {
            "description": "Subscription ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/subscription.Subscription"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing subscription ID or subscription already cancelled"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key, or caller lacks permission"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Subscription not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Cancel a subscription",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/v1/task-templates": {
      "get": {
        "description": "Lists task templates from the Tasks marketplace app installed on the workspace. The request is proxied to the app's task-templates API. Requires the Tasks app to be installed.",
        "operationId": "list-task-templates",
        "parameters": [
          {
            "description": "Maximum number of task templates to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous list response",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskTemplateList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameter for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, or app resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List task templates",
        "tags": [
          "Task Templates"
        ]
      }
    },
    "/v1/task-templates/{id}": {
      "get": {
        "description": "Retrieves a single task template by id from the Tasks marketplace app installed on the workspace. The request is proxied to the app's task-templates API. Requires the Tasks app to be installed.",
        "operationId": "retrieve-task-template",
        "parameters": [
          {
            "description": "Task template id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskTemplate"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or task template not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a task template",
        "tags": [
          "Task Templates"
        ]
      }
    },
    "/v1/tasks": {
      "get": {
        "description": "Lists tasks from the Tasks marketplace app installed on the workspace. The request is proxied to the app's task API and the response shape is defined by that app's registered resource schema. Requires the Tasks app to be installed.",
        "operationId": "retrieve-tasks",
        "parameters": [
          {
            "description": "Maximum number of tasks to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor returned by a previous list response",
            "in": "query",
            "name": "nextToken",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter tasks by the id of the internal user that created them",
            "in": "query",
            "name": "createdBy",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter to the subtasks of the given parent task id",
            "in": "query",
            "name": "parentTaskId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter tasks by status",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "todo",
                "inProgress",
                "completed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter tasks by the id of the assigned client",
            "in": "query",
            "name": "clientId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter tasks by the id of the assigned internal user",
            "in": "query",
            "name": "internalUserId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter tasks by the id of the assigned company",
            "in": "query",
            "name": "companyId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.TaskList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid query parameter for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, or app resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List tasks",
        "tags": [
          "Tasks"
        ]
      },
      "post": {
        "description": "Creates a task via the Tasks marketplace app installed on the workspace. The request body is validated against the app's registered resource schema and proxied to the app's task API. Requires the Tasks app to be installed.",
        "operationId": "create-task",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/marketplace_application.TaskInput"
              }
            }
          },
          "description": "Task fields",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.Task"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, or app resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create a task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/tasks/{id}": {
      "delete": {
        "description": "Deletes a task by id via the Tasks marketplace app installed on the workspace. The request is proxied to the app's task API and returns the deleted task marker. Requires the Tasks app to be installed.",
        "operationId": "delete-task",
        "parameters": [
          {
            "description": "Task id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.Task"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or task not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Delete a task",
        "tags": [
          "Tasks"
        ]
      },
      "get": {
        "description": "Retrieves a single task by id from the Tasks marketplace app installed on the workspace. The request is proxied to the app's task API. Requires the Tasks app to be installed.",
        "operationId": "retrieve-task",
        "parameters": [
          {
            "description": "Task id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.Task"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or task not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve a task",
        "tags": [
          "Tasks"
        ]
      },
      "patch": {
        "description": "Partially updates a task by id via the Tasks marketplace app installed on the workspace. Only the provided fields are changed. The request is proxied to the app's task API. Requires the Tasks app to be installed.",
        "operationId": "update-task",
        "parameters": [
          {
            "description": "Task id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/marketplace_application.TaskInput"
              }
            }
          },
          "description": "Task fields to update",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marketplace_application.Task"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Invalid request body for the app resource"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App not found, not installed on the workspace, app resource not found, or task not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rejected the request as unprocessable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API request failed or unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Update a task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/token": {
      "post": {
        "description": "Issues a short-lived, app-scoped bearer token using the app API key alone — no user session required. Intended for cron jobs and background workers that operate outside a user iframe. The token expires after one hour; re-mint it from the API key on expiry.",
        "operationId": "offline-token-issue",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/offline.IssueResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "App API key required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Unexpected server error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Issue an app-scoped offline bearer token",
        "tags": [
          "Token"
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "description": "Returns the configuration and branding of the workspace associated with the authenticated API key's portal.",
        "operationId": "retrieve-workspace",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/workspace.Workspace"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Workspace configuration could not be resolved"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dispatcher.Error"
                }
              }
            },
            "description": "Missing or invalid API key"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retrieve the workspace",
        "tags": [
          "Workspaces"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.assembly.com"
    }
  ]
}