openapi: 3.1.1
info:
  title: Terros API
  version: 1.0.0
  termsOfService: https://www.terros.com/terms
  contact:
    email: support@terros.com
    url: https://help.terros.com
  description: >-
    Welcome to the Terros API documentation.
        Our API provides a powerful, flexible way to integrate Terros' services into your own applications.

    Every endpoint is a `POST` that takes a JSON body.


    Terros IDs are strings that start with a prefix naming the entity, followed
    by `.` or `:` and a unique suffix:

    `Account.` for accounts, `U.` or `U:` for users, `Team.` for teams, `C.` or
    `C:` for companies,

    `Event.` for calendar events, `Task.` for tasks, `WF.` for workflows, `S.`
    for workflow stages,

    and `A.` for workflow actions. Treat IDs as opaque and send them back
    exactly as the API returned them.
servers:
  - description: Production
    url: https://api.terros.com
  - description: Staging
    url: https://api.staging.terros.com
security:
  - TerrosApiKey: []
tags:
  - name: Account
    description: Accounts represent potential customers.       The object contains
      information about the location and current status of the account.
  - name: Activity
    description: Activity log entries tracking actions taken on accounts and other records.
  - name: Area
    description: Areas define geographic territories used for account assignment and
      canvassing.
  - name: Attachment
    description: File attachments with secure upload and download URLs.
  - name: Calendar
    description: Calendar events for users, and the external calendars (Google or
      Microsoft) their events sync to.
  - name: Company
    description: Companies represent the top-level organization that owns users,
      teams, and configuration.
  - name: Connect
    description: Connect apps, versions, and scripts used to build integrations with
      external systems.
  - name: Contact
    description: Contacts represent interactions with potential customers.
  - name: Custom Field
    description: Custom fields define company-specific fields for accounts, teams,
      and users.
  - name: Disposition
    description: Dispositions represent the various states of a customer interaction.
  - name: Evaluation
    description: Evaluations represent the assessment of pitches.
  - name: Export
    description: Bulk export data from the system to JSON, JSON Lines, or CSV files.
  - name: External Link
    description: External links available in company and team scopes.
  - name: Game
    description: Games are competitions whose participants score against configured
      criteria.
  - name: Import
    description: Bulk import data from CSV/spreadsheet files into the system.
  - name: Location
    description: Locations represent locations on the map.
  - name: Permission
    description: Permissions control the actions users and roles can perform.
  - name: Program
    description: Programs enroll users, manually or by auto-enrollment rules, and
      assign them tasks.
  - name: Ratio
    description: "Custom stats: ratio, percentage, and advanced formula stats built
      from report KPIs, shown as report columns."
  - name: Report
    description: Reports represent the various reports generated by the system.
  - name: Role
    description: Roles group permissions and are assigned to users directly or on a team.
  - name: Screenshot
    description: Notifications when users take screenshots of the Terros mobile app.
  - name: Search
    description: Search across accounts, calendar events, companies, locations,
      teams, and users.
  - name: Task
    description: Task objects represent tasks to be completed by reps.
  - name: Team
    description: aka Office, Region, Department, etc.
  - name: User
    description: Users are the people who use our application. Each login is tied to
      a single user.
  - name: Webhook
    description: Webhooks send changes to your records to your own HTTPS endpoint.
  - name: Workflow
    description: Workflows define stages and actions used to track pipeline progress.
x-terros-cli-builtins:
  - api log
  - api refresh
  - auth login
  - auth token
  - connect pack
  - connect publish
  - connect validate
  - mcp
  - whoami
paths:
  /account/add:
    post:
      operationId: account-add-v1
      summary: Add Account
      tags:
        - Account
      description: "Creates a new account and returns the created object. Provide
        either a `locationId` or a `location` address, which is matched to a
        known location. Omit `ownerId` to make the authenticated user the owner.
        Depending on the company's duplicate account setting, the request may
        fail as a duplicate, return the existing account with `duplicate: true`,
        or create another account when duplicates are allowed. Requires the
        `account:add` permission. Use `/account/upsert` instead to sync records
        from an external system (it matches existing accounts and resolves users
        by email or clientUserId), and `/account/batch` to add, update, or
        remove up to 20 accounts in one request."
      requestBody:
        content:
          application/json:
            example:
              account:
                statusId: AS.test
                ownerId: U.test
                location:
                  line1: 1234 Main St
                  locality: Irvine
                  countrySubd: CA
                  postal1: "92780"
                  latlng:
                    latitude: 33.7
                    longitude: -117.8
                workflowHistory:
                  - actionId: A.123
                    stageId: S.456
                    timestamp: 1753228412133
                    userId: U.test
                workflowId: WF.test
                teamId: Team.test
                resident:
                  firstName: MO
                  lastName: FAN
                  email: sampletest@gmail.com
                  phone: "1234567890"
            schema:
              type: object
              properties:
                account:
                  type: object
                  properties:
                    customFields:
                      $ref: "#/components/schemas/__schema6"
                    importId:
                      $ref: "#/components/schemas/importId"
                    workflowId:
                      $ref: "#/components/schemas/__schema14"
                    workflowHistory:
                      $ref: "#/components/schemas/__schema15"
                    workflowStageId:
                      $ref: "#/components/schemas/__schema20"
                    workflowActionId:
                      $ref: "#/components/schemas/__schema21"
                    deviceLocation:
                      $ref: "#/components/schemas/__schema22"
                    checkpoints:
                      $ref: "#/components/schemas/__schema23"
                    accountId:
                      $ref: "#/components/schemas/__schema24"
                    statusId:
                      $ref: "#/components/schemas/__schema25"
                    accountSource:
                      $ref: "#/components/schemas/__schema26"
                    sourceStatus:
                      $ref: "#/components/schemas/__schema28"
                    sourceId:
                      $ref: "#/components/schemas/__schema30"
                    externalLeadId:
                      $ref: "#/components/schemas/__schema32"
                    locationId:
                      $ref: "#/components/schemas/__schema34"
                    location:
                      $ref: "#/components/schemas/__schema36"
                    ownerId:
                      $ref: "#/components/schemas/__schema44"
                    owner:
                      $ref: "#/components/schemas/__schema45"
                    closerId:
                      $ref: "#/components/schemas/__schema62"
                    closer:
                      $ref: "#/components/schemas/__schema63"
                    resident:
                      $ref: "#/components/schemas/__schema64"
                    resident2:
                      $ref: "#/components/schemas/__schema83"
                    language:
                      $ref: "#/components/schemas/__schema84"
                    rescheduleCount:
                      $ref: "#/components/schemas/__schema85"
                    dealSize:
                      $ref: "#/components/schemas/__schema87"
                    appointmentDate:
                      $ref: "#/components/schemas/__schema89"
                    test:
                      $ref: "#/components/schemas/__schema90"
                    teamId:
                      $ref: "#/components/schemas/__schema92"
                    contacts:
                      $ref: "#/components/schemas/__schema93"
                    notes:
                      $ref: "#/components/schemas/__schema98"
                    isParent:
                      $ref: "#/components/schemas/__schema103"
                    parentAccountId:
                      $ref: "#/components/schemas/__schema105"
                    tags:
                      $ref: "#/components/schemas/__schema106"
                    hooks:
                      $ref: "#/components/schemas/__schema108"
                  description: Details of the account object to add.
              required:
                - account
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                account:
                  location:
                    postal1: "92780"
                    locality: Irvine
                    line1: 1234 Main St
                    latlng:
                      latitude: 33.7
                      longitude: -117.8
                    countrySubd: CA
                  resident:
                    firstName: Test
                    lastName: Resident
                    phone: "5555555555"
                  accountId: Account.test
                  contacts: []
                  createdAt: 1753228412212
                  updatedBy: U:logan
                  teamId: Team.test
                  createdBy: U:logan
                  ownerId: U.test
                  statusHistory:
                    - statusId: AS.a0-L34D
                      statusChangedDate: 1753228412127
                  statusId: AS.a0-L34D
                  workflowActionId: A.123
                  workflowStageId: S.456
                  workflowHistory:
                    - actionId: A.123
                      stageId: S.456
                      timestamp: 1753228412133
                      userId: U.test
                  workflowId: WF.test
                  closerId: U.xxxcloser
                  updatedAt: 1753228518382
                  notes: []
                  locationId: TLoc.test
                  lastUpdateProcess: dev-account-update-v1
                  modifiedBy:
                    - userId: U:logan
                      timestamp: 1753228518382
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  account:
                    description: The created account object.
                    $ref: "#/components/schemas/__schema923"
                  duplicate:
                    description: Whether the account already existed and was returned instead of
                      being created.
                    $ref: "#/components/schemas/__schema924"
                required:
                  - type
                  - account
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/batch:
    post:
      operationId: account-batch-v1
      x-terros-destructive: true
      summary: Batch Accounts
      tags:
        - Account
      description: "Processes a mixed batch of account add, update, and remove
        operations, up to 20 operations per request. Each operation behaves like
        `/account/add`, `/account/update`, or `/account/remove`, returns its own
        success or error result, and enforces its corresponding permission. A
        remove operation accepts the same optional `cascade` flag as
        `/account/remove`: by default an account with calendar events is not
        deleted and that operation returns an error, while `cascade: true` also
        permanently deletes the calendar events associated with the account,
        along with the event attachments and custom-field attachment files on
        the account. A failed cascade keeps that account and fails only its own
        operation. To delete notes on several accounts, send one `update`
        operation per account whose `account` holds the `accountId` and the note
        IDs in `deletedNotes`. Use this instead of repeated single calls when
        changing several specific accounts by ID. Use `/account/bulk` instead to
        change every account that matches a filter."
      requestBody:
        content:
          application/json:
            example:
              operations:
                - op: add
                  account:
                    statusId: AS.test
                    ownerId: U.test
                    location:
                      line1: 1234 Main St
                      locality: Irvine
                      countrySubd: CA
                      postal1: "92780"
                      latlng:
                        latitude: 33.7
                        longitude: -117.8
                    workflowHistory:
                      - actionId: A.123
                        stageId: S.456
                        timestamp: 1753228412133
                        userId: U.test
                    workflowId: WF.test
                    teamId: Team.test
                    resident:
                      firstName: MO
                      lastName: FAN
                      email: sampletest@gmail.com
                      phone: "1234567890"
                - op: update
                  account:
                    accountId: Account.test
                    workflowId: WF.updated
                - op: remove
                  accountId: Account.toRemove
                  cascade: true
            schema:
              type: object
              properties:
                operations:
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema130"
                  description: List of account operations to process. Up to 20 operations per
                    request.
              required:
                - operations
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                results:
                  - index: 0
                    op: add
                    success: true
                    accountId: Account.test
                    duplicate: false
                  - index: 1
                    op: update
                    success: true
                    accountId: Account.test
                  - index: 2
                    op: remove
                    success: true
                    accountId: Account.toRemove
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  results:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema930"
                    description: Per-record results in the same order as the request operations.
                required:
                  - type
                  - results
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/bulk:
    post:
      operationId: account-bulk-v1
      summary: Bulk Modify Accounts
      tags:
        - Account
      description: Applies one or more bulk actions to all accounts matching the
        provided filter. Supported actions are `updateStatus`, `updateStage`,
        `updateCustomField`, `clearDisposition`, and `delete`. Unchanged
        accounts are skipped. Changes are applied in the background after the
        request returns. Requires the `account:manage` permission. Use
        `/account/batch` instead to change specific accounts by ID, or
        `/account/rollback` to move accounts back to an earlier stage in their
        history.
      requestBody:
        content:
          application/json:
            example:
              filter:
                teamIds:
                  - Team.test
                workflowStageIds:
                  - S.456
              actions:
                - actionType: updateCustomField
                  fieldId: CF.priority
                  value: high
                - actionType: updateStage
                  stageId: S.Lead
            schema:
              type: object
              properties:
                filter:
                  type: object
                  properties:
                    cities:
                      $ref: "#/components/schemas/__schema148"
                    states:
                      $ref: "#/components/schemas/__schema149"
                    zipCodes:
                      $ref: "#/components/schemas/__schema151"
                    customFields:
                      $ref: "#/components/schemas/__schema153"
                    advancedCustomFields:
                      $ref: "#/components/schemas/__schema155"
                    statusIds:
                      $ref: "#/components/schemas/__schema158"
                    workflowId:
                      $ref: "#/components/schemas/__schema159"
                    workflowStageIds:
                      $ref: "#/components/schemas/__schema160"
                    searchByCurrentStage:
                      $ref: "#/components/schemas/__schema161"
                    workflowActionIds:
                      $ref: "#/components/schemas/__schema163"
                    tagIds:
                      $ref: "#/components/schemas/__schema164"
                    teamIds:
                      $ref: "#/components/schemas/__schema165"
                    userIds:
                      $ref: "#/components/schemas/__schema166"
                    coordinates:
                      $ref: "#/components/schemas/__schema167"
                    boundingBox:
                      $ref: "#/components/schemas/__schema168"
                    quadrantId:
                      $ref: "#/components/schemas/__schema170"
                    workflowActionCount:
                      $ref: "#/components/schemas/__schema171"
                    contactCount:
                      $ref: "#/components/schemas/__schema172"
                    lastActivityDate:
                      $ref: "#/components/schemas/__schema173"
                    lastActionDate:
                      $ref: "#/components/schemas/__schema177"
                    stageEntryDate:
                      $ref: "#/components/schemas/__schema178"
                    companyId:
                      $ref: "#/components/schemas/__schema179"
                  description: Filter selecting which accounts to modify.
                actions:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema180"
                  description: Bulk actions to apply to each matched account.
              required:
                - filter
                - actions
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/get:
    post:
      operationId: account-get-v1
      summary: Get Account
      tags:
        - Account
      description: Retrieves a single account by its `accountId`, including its
        workflow stage and action names, custom fields, and location. The
        response includes the account's `notes`, each with its `noteId`, author
        `userId`, `timestamp` (UTC milliseconds) and `text`. Notes with empty
        text are included, so use this to find notes to clean up; delete them
        with `deletedNotes` on `/account/update`, or `/account/batch` for
        several accounts. Callers with company-level `account:save` permission
        also receive `potentialDuplicates`. Returns an error if the caller is
        not allowed to view the account. Use `/account/match` instead when you
        only have an externalLeadId, sourceId, or address, `/account/list` to
        filter many accounts, and `/search` for free-text lookup by name or
        address.
      requestBody:
        content:
          application/json:
            example:
              accountId: Account.test
            schema:
              type: object
              properties:
                accountId:
                  type: string
                  pattern: ^Account((\.)|(:))[\s\S]{0,}$
                  description: The unique identifier of the account to retrieve.
                  example: Account.123-4aBc_d
                  $ref: "#/components/schemas/accountId"
              required:
                - accountId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                account:
                  location:
                    postal1: "92780"
                    locality: Irvine
                    line1: 1234 Main St
                    latlng:
                      latitude: 33.7
                      longitude: -117.8
                    countrySubd: CA
                  resident:
                    firstName: Test
                    lastName: Resident
                    phone: "5555555555"
                  accountId: Account.test
                  contacts: []
                  createdAt: 1753228412212
                  updatedBy: U:logan
                  teamId: Team.test
                  createdBy: U:logan
                  ownerId: U.test
                  statusHistory:
                    - statusId: AS.a0-L34D
                      statusChangedDate: 1753228412127
                  statusId: AS.a0-L34D
                  workflowActionId: A.123
                  workflowStageId: S.456
                  workflowHistory:
                    - actionId: A.123
                      stageId: S.456
                      timestamp: 1753228412133
                      userId: U.test
                  workflowId: WF.test
                  closerId: U.xxxcloser
                  updatedAt: 1753228518382
                  notes: []
                  locationId: TLoc.test
                  lastUpdateProcess: dev-account-update-v1
                  modifiedBy:
                    - userId: U:logan
                      timestamp: 1753228518382
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  account:
                    description: The retrieved account object.
                    $ref: "#/components/schemas/__schema923"
                  potentialDuplicates:
                    description: List of potential duplicate accounts.
                    $ref: "#/components/schemas/__schema933"
                required:
                  - type
                  - account
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/list:
    post:
      operationId: account-list-v1
      summary: List Accounts
      tags:
        - Account
      description: "Lists accounts visible to the authenticated user. Pass
        `searchInput` to filter by workflow, stage, action, team, user, tags,
        city, state, zip code, custom fields, polygon, or date range, or pass
        `nearby` to return accounts closest to a coordinate. With no filters,
        users with company-wide `account:list` access get all company accounts
        and other users get the accounts they own. Users without the
        `account:list` permission receive an empty list. `size` sets the page
        size (10–1000); pass the returned `sortTimestamp` inside `searchInput`
        to fetch the next page. `nearby` searches return no `sortTimestamp` and
        cannot be paged. Send the `sortTimestamp` array back unchanged: it holds
        the sort value and the account ID, so accounts that share a sort value,
        such as the same `createdDate`, are neither skipped nor repeated. A
        single sort value (legacy) is still accepted: the next page starts at
        the first account with that value, so accounts that share it can be
        repeated but are not skipped. Use `/account/get` for a single known
        account, `/account/match` to look up an account by external identifier
        or address, and `/search` for quick free-text search across accounts,
        users, teams, and more."
      requestBody:
        content:
          application/json:
            example:
              searchInput:
                statusIds: []
                stageIds:
                  - S.123
                  - S.456
                lastActionDate:
                  gte: 1767225600000
                teamIds:
                  - Team.test
              size: 100
            schema:
              type: object
              properties:
                nearby:
                  $ref: "#/components/schemas/latlng"
                searchInput:
                  description: Search criteria for listing accounts.
                  $ref: "#/components/schemas/__schema183"
                size:
                  description: Page size (10–1000).
                  $ref: "#/components/schemas/__schema208"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                accounts:
                  - location:
                      postal1: "92780"
                      locality: Irvine
                      line1: 1234 Main St
                      latlng:
                        latitude: 33.7
                        longitude: -117.8
                      countrySubd: CA
                    resident:
                      firstName: Test
                      lastName: Resident
                      phone: "5555555555"
                    accountId: Account.test
                    contacts: []
                    createdAt: 1753228412212
                    updatedBy: U:logan
                    teamId: Team.test
                    createdBy: U:logan
                    ownerId: U.test
                    statusHistory:
                      - statusId: AS.a0-L34D
                        statusChangedDate: 1753228412127
                    statusId: AS.a0-L34D
                    workflowActionId: A.123
                    workflowStageId: S.456
                    workflowHistory:
                      - actionId: A.123
                        stageId: S.456
                        timestamp: 1753228412133
                        userId: U.test
                    workflowId: WF.test
                    closerId: U.xxxcloser
                    updatedAt: 1753228518382
                    notes: []
                    locationId: TLoc.test
                    lastUpdateProcess: dev-account-update-v1
                    modifiedBy:
                      - userId: U:logan
                        timestamp: 1753228518382
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  accounts:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema923"
                  sortTimestamp:
                    $ref: "#/components/schemas/__schema934"
                  total:
                    $ref: "#/components/schemas/__schema941"
                required:
                  - type
                  - accounts
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/match:
    post:
      operationId: account-match-v1
      summary: Match Account
      tags:
        - Account
      description: Finds an existing account using a cascading match strategy. Tries
        each provided criterion in priority order — accountId, externalLeadId,
        sourceId, then address — and returns the first match found. A sourceId
        match uses sourceId alone. accountSource is not required and is not part
        of the key. When matching by address, additional accounts at the same
        location may also be returned. Only accounts the caller can view are
        returned, and the response has no `account` when nothing matches. Call
        this before `/account/add` to avoid creating duplicates, or use
        `/account/upsert` to match and write in one call. Use `/account/get`
        instead when you already have the accountId.
      requestBody:
        content:
          application/json:
            example:
              accountId: Account.test
            schema:
              type: object
              properties:
                accountId:
                  description: The unique identifier of an account to look up.
                  $ref: "#/components/schemas/accountId"
                externalLeadId:
                  description: The external lead identifier used to look up an account.
                  $ref: "#/components/schemas/__schema209"
                sourceId:
                  description: External identifier used to look up an account. sourceId is a
                    single-part key. accountSource is not required and is not
                    used for this lookup.
                  $ref: "#/components/schemas/__schema210"
                location:
                  description: An address used to look up an account by its matched location.
                  $ref: "#/components/schemas/__schema211"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                account:
                  location:
                    postal1: "92780"
                    locality: Irvine
                    line1: 1234 Main St
                    latlng:
                      latitude: 33.7
                      longitude: -117.8
                    countrySubd: CA
                  resident:
                    firstName: Test
                    lastName: Resident
                    phone: "5555555555"
                  accountId: Account.test
                  contacts: []
                  createdAt: 1753228412212
                  updatedBy: U:logan
                  teamId: Team.test
                  createdBy: U:logan
                  ownerId: U.test
                  statusHistory:
                    - statusId: AS.a0-L34D
                      statusChangedDate: 1753228412127
                  statusId: AS.a0-L34D
                  workflowActionId: A.123
                  workflowStageId: S.456
                  workflowHistory:
                    - actionId: A.123
                      stageId: S.456
                      timestamp: 1753228412133
                      userId: U.test
                  workflowId: WF.test
                  closerId: U.xxxcloser
                  updatedAt: 1753228518382
                  notes: []
                  locationId: TLoc.test
                  lastUpdateProcess: dev-account-update-v1
                  modifiedBy:
                    - userId: U:logan
                      timestamp: 1753228518382
                matchedOn: accountId
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  account:
                    description: The matched account, if one was found.
                    $ref: "#/components/schemas/__schema923"
                  matchedOn:
                    description: The criterion that produced the matched account.
                    $ref: "#/components/schemas/__schema943"
                  additionalMatches:
                    description: Other accounts at the same matched location (populated only for
                      address matches).
                    $ref: "#/components/schemas/__schema944"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/remove:
    post:
      operationId: account-remove-v1
      summary: Remove Account
      tags:
        - Account
      description: Permanently deletes an existing account. By default, accounts that
        have calendar events cannot be deleted. Set `cascade` to true to also
        permanently delete associated calendar events, along with the event
        attachments and custom-field attachment files on the account; notes
        stored on the account are removed with the account. Cascade deletion
        uses the same `account:manage` permission as ordinary account removal.
        Use `/account/batch` to remove several specific accounts, or
        `/account/bulk` with the `delete` action to remove every account
        matching a filter.
      requestBody:
        content:
          application/json:
            example:
              accountId: Account.test
              cascade: true
            schema:
              type: object
              properties:
                accountId:
                  type: string
                  pattern: ^Account((\.)|(:))[\s\S]{0,}$
                  description: The unique identifier of the account to remove
                  example: Account.123-4aBc_d
                  $ref: "#/components/schemas/accountId"
                cascade:
                  $ref: "#/components/schemas/__schema146"
              required:
                - accountId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/rollback:
    post:
      operationId: account-rollback-v1
      summary: Roll Back Accounts
      tags:
        - Account
      description: Moves accounts matching the filter back to the most recent rollback
        target stage in their history, or to the workflow's default rollback
        stage. Accounts already in a target or protected stage are skipped. Only
        the stage changes, and rolled back stages earn no new credit. Set dryRun
        to preview how many accounts would roll back to each stage, use the
        default stage, or be skipped, without changing anything. Rollback must
        be enabled on the workflow, the filter must include an area, team, or
        user, and the caller must hold one of the workflow's rollback roles on
        the teams that own the accounts. Use `/account/bulk` with `updateStage`
        instead to move accounts to a specific stage.
      requestBody:
        content:
          application/json:
            example:
              filter:
                workflowId: WF.123
                teamIds:
                  - Team.test
              fromStageIds:
                - S.NotHome
                - S.NotInterested
              dryRun: true
            schema:
              type: object
              properties:
                filter:
                  type: object
                  properties:
                    cities:
                      $ref: "#/components/schemas/__schema148"
                    states:
                      $ref: "#/components/schemas/__schema149"
                    zipCodes:
                      $ref: "#/components/schemas/__schema151"
                    customFields:
                      $ref: "#/components/schemas/__schema153"
                    advancedCustomFields:
                      $ref: "#/components/schemas/__schema155"
                    statusIds:
                      $ref: "#/components/schemas/__schema158"
                    workflowId:
                      $ref: "#/components/schemas/WFId"
                    workflowStageIds:
                      $ref: "#/components/schemas/__schema160"
                    searchByCurrentStage:
                      $ref: "#/components/schemas/__schema161"
                    workflowActionIds:
                      $ref: "#/components/schemas/__schema163"
                    tagIds:
                      $ref: "#/components/schemas/__schema164"
                    teamIds:
                      $ref: "#/components/schemas/__schema165"
                    userIds:
                      $ref: "#/components/schemas/__schema166"
                    coordinates:
                      $ref: "#/components/schemas/__schema167"
                    boundingBox:
                      $ref: "#/components/schemas/__schema168"
                    quadrantId:
                      $ref: "#/components/schemas/__schema170"
                    workflowActionCount:
                      $ref: "#/components/schemas/__schema171"
                    contactCount:
                      $ref: "#/components/schemas/__schema172"
                    lastActivityDate:
                      $ref: "#/components/schemas/__schema173"
                    lastActionDate:
                      $ref: "#/components/schemas/__schema177"
                    stageEntryDate:
                      $ref: "#/components/schemas/__schema178"
                    companyId:
                      $ref: "#/components/schemas/__schema179"
                  required:
                    - workflowId
                  description: Filter selecting which accounts to roll back. Must include the
                    workflow and an area, team, or user. Stage filters are
                    ignored; use fromStageIds.
                fromStageIds:
                  description: Only roll back accounts currently in these stages. Defaults to
                    every eligible stage.
                  $ref: "#/components/schemas/__schema222"
                dryRun:
                  description: When true, returns a preview of the rollback without changing
                    anything. Defaults to false.
                  $ref: "#/components/schemas/__schema223"
              required:
                - filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  mode:
                    type: string
                    enum:
                      - dryRun
                      - run
                    description: dryRun when only previewed, run when queued.
                  matchedCount:
                    type: number
                    description: Number of matched accounts. On a run, these are queued for
                      rollback.
                  preview:
                    description: Rollback preview. Only set on a dry run.
                    $ref: "#/components/schemas/__schema945"
                required:
                  - type
                  - mode
                  - matchedCount
                additionalProperties: false
              examples:
                Dry Run:
                  value:
                    type: success
                    mode: dryRun
                    matchedCount: 120
                    preview:
                      total: 120
                      targets:
                        - stageId: S.Prospect
                          count: 80
                        - stageId: S.HotLead
                          count: 25
                      defaultCount: 30
                      skippedCount: 15
                Run:
                  value:
                    type: success
                    mode: run
                    matchedCount: 120
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/update:
    post:
      operationId: account-update-v1
      summary: Update Account
      tags:
        - Account
      description: Partially updates an existing account by `accountId` and returns
        the updated object. Omitted fields keep their current values; set
        `ownerId` or `teamId` to `null` to clear them. `customFields` replaces
        the whole custom field map; use `customFieldsPatch` to set or clear
        (`null`) only the fields you name, keeping the rest, including fields
        you cannot view. `contacts` and `notes` are added or updated, and
        `deletedContacts` and `deletedNotes` remove entries by ID. To delete
        notes, read their `noteId`s from `/account/get` and send them in
        `deletedNotes` with the `accountId`; deleted notes cannot be restored.
        Use `/account/batch` to delete notes on several accounts. Set
        `workflowActionId` or `workflowStageId` to record a workflow action or
        move the account to a stage; actions restricted to specific roles
        require the caller to hold one of them. `actorId` may be a User ID,
        email, or clientUserId; omit it to attribute new workflow history to the
        authenticated user. The caller must be the account's owner or closer, or
        hold the `account:save` permission. Changing the owner, closer, or team
        also requires the `account:manage` permission. Use `/account/upsert`
        instead when you only have an external identifier, and `/account/batch`
        to update several accounts in one request.
      requestBody:
        content:
          application/json:
            example:
              account:
                accountId: Account.abc123
                workflowActionId: A.abc123
                teamId: Team.abc123
                resident:
                  firstName: Jane
                  lastName: Doe
                  phone: "5555555555"
                notes:
                  - text: Homeowner asked for a follow-up next week.
                    userId: U.abc123
                    timestamp: 1753228412133
            schema:
              type: object
              properties:
                account:
                  $ref: "#/components/schemas/__schema131"
              required:
                - account
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                account:
                  location:
                    postal1: "92780"
                    locality: Irvine
                    line1: 1234 Main St
                    latlng:
                      latitude: 33.7
                      longitude: -117.8
                    countrySubd: CA
                  resident:
                    firstName: Test
                    lastName: Resident
                    phone: "5555555555"
                  accountId: Account.test
                  contacts: []
                  createdAt: 1753228412212
                  updatedBy: U:logan
                  teamId: Team.test
                  createdBy: U:logan
                  ownerId: U.test
                  statusHistory:
                    - statusId: AS.a0-L34D
                      statusChangedDate: 1753228412127
                  statusId: AS.a0-L34D
                  workflowActionId: A.123
                  workflowStageId: S.456
                  workflowHistory:
                    - actionId: A.123
                      stageId: S.456
                      timestamp: 1753228412133
                      userId: U.test
                  workflowId: WF.test
                  closerId: U.xxxcloser
                  updatedAt: 1753228518382
                  notes: []
                  locationId: TLoc.test
                  lastUpdateProcess: dev-account-update-v1
                  modifiedBy:
                    - userId: U:logan
                      timestamp: 1753228518382
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  account:
                    description: The updated account object.
                    $ref: "#/components/schemas/__schema923"
                required:
                  - type
                  - account
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /account/upsert:
    post:
      operationId: account-upsert-v1
      summary: Upsert Account
      tags:
        - Account
      description: "Creates or updates an account from an external system's data, such
        as a CRM or integration sync. An existing account is matched by
        `accountId`, `sourceId`, or `externalLeadId`, then by address; an
        address match on another user's account follows the company's duplicate
        account setting and may create a new account. The `owner` and `closer`
        are resolved to Terros users by userId, clientUserId, email, name, or
        phone. `actorId` may be a User ID, email, or clientUserId; omit it to
        attribute generated workflow history to the authenticated user. Use the
        'requestType' field to control behavior: 'add' errors if the account
        already exists, 'update' errors if the account does not exist, and
        'upsert' (default) creates or updates as needed. When an existing
        account is found by sourceId, that lookup uses sourceId alone.
        accountSource is not required and is not part of the key. Updating a
        matched account requires the same permissions as `/account/update`: the
        caller must be able to view the account and be its owner or closer, or
        hold the `account:save` permission. An omitted `teamId` keeps the
        account's team. Changing the owner, closer, or team also requires
        `account:manage`. A workflow action restricted to roles requires one of
        those roles. Creating an account requires the `account:add` permission,
        as `/account/add` does. Use `/account/add` or `/account/update` instead
        for direct edits when you have Terros IDs, and `/account/match` to look
        up an account without writing."
      requestBody:
        content:
          application/json:
            example:
              requestType: upsert
              account:
                workflowActionOrStageId: A.123
                workflowId: WF.test
                owner:
                  userId: U.test
                  email: example@example.com
                  firstName: Example
                  lastName: User
            schema:
              type: object
              properties:
                requestType:
                  default: upsert
                  type: string
                  enum:
                    - add
                    - update
                    - upsert
                  description: Controls the behavior of the upsert operation. 'add' errors if the
                    account already exists. 'update' errors if the account does
                    not exist. 'upsert' updates the account if it exists or adds
                    it if it doesn't.
                account:
                  type: object
                  properties:
                    accountId:
                      description: The unique identifier of the account.
                      $ref: "#/components/schemas/accountId"
                    actorId:
                      description: UserId, email, or clientUserId of the actor performing the upsert.
                        Sets the userId on generated workflow history items.
                      $ref: "#/components/schemas/__schema141"
                    statusId:
                      description: The status used to update the account.
                      $ref: "#/components/schemas/accountStatusId"
                    statusHistory:
                      description: Status history of the account.
                      deprecated: true
                      $ref: "#/components/schemas/__schema224"
                    workflowId:
                      description: The workflow associated with the account.
                      $ref: "#/components/schemas/WFId"
                    workflowActionOrStageId:
                      description: The internal stage or action ID used to update the account.
                        Deprecated in favor of workflowTarget.
                      deprecated: true
                      $ref: "#/components/schemas/__schema225"
                    workflowTarget:
                      description: A workflow stage ID (e.g. 'S.Lead'), action ID (e.g. 'A.1'), or an
                        external identifier from a connected integration. When a
                        stage or action ID is provided, it is used directly.
                        Otherwise, Terros resolves the value to a workflow stage
                        or action using the workflow's integration mappings.
                        Takes precedence over workflowActionOrStageId when both
                        are provided.
                      $ref: "#/components/schemas/__schema226"
                    owner:
                      description: Owner of the account.
                      $ref: "#/components/schemas/__schema227"
                    closer:
                      description: Closer of the account.
                      $ref: "#/components/schemas/__schema230"
                    location:
                      description: Address details of the account.
                      $ref: "#/components/schemas/__schema231"
                    resident:
                      description: Customer information of the account, including name, email, and
                        phone number.
                      $ref: "#/components/schemas/__schema236"
                    resident2:
                      description: Additional customer information of the account, including name,
                        email, and phone number.
                      $ref: "#/components/schemas/__schema239"
                    accountSource:
                      description: Optional label for the system the account came from, such as
                        "Salesforce" or "Statra". Stored on the account. Not
                        required to match an existing account by sourceId.
                      $ref: "#/components/schemas/__schema240"
                    sourceStatus:
                      description: The source status of the account, such as "Project Created" or
                        "Lead".
                      $ref: "#/components/schemas/__schema241"
                    lastActionDate:
                      description: When the last action happened, in UTC epoch milliseconds
                      $ref: "#/components/schemas/__schema242"
                    sourceId:
                      description: External identifier for the account. Lookup by sourceId uses this
                        value alone. accountSource is not required for that
                        match and is not part of the key.
                      $ref: "#/components/schemas/__schema243"
                    externalLeadId:
                      description: An external identifier for the account, such as a lead ID from
                        another system.
                      $ref: "#/components/schemas/__schema244"
                    test:
                      type: boolean
                    teamId:
                      description: The team associated with the account, if applicable.
                      $ref: "#/components/schemas/teamId"
                    customFields:
                      description: A map of custom field IDs to their corresponding values. Value
                        types vary per field type.
                      $ref: "#/components/schemas/__schema7"
                    notes:
                      description: Notes to add or update. A note without a userId is written as the
                        actor (actorId), else the authenticated user, so an
                        integration need not pick an author.
                      $ref: "#/components/schemas/__schema245"
                opts:
                  type: object
                  properties:
                    createCustomLocation:
                      default: true
                      type: boolean
              required:
                - account
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                account:
                  location:
                    postal1: "92780"
                    locality: Irvine
                    line1: 1234 Main St
                    latlng:
                      latitude: 33.7
                      longitude: -117.8
                    countrySubd: CA
                  resident:
                    firstName: Test
                    lastName: Resident
                    phone: "5555555555"
                  accountId: Account.test
                  contacts: []
                  createdAt: 1753228412212
                  updatedBy: U:logan
                  teamId: Team.test
                  createdBy: U:logan
                  ownerId: U.test
                  statusHistory:
                    - statusId: AS.a0-L34D
                      statusChangedDate: 1753228412127
                  statusId: AS.a0-L34D
                  workflowActionId: A.123
                  workflowStageId: S.456
                  workflowHistory:
                    - actionId: A.123
                      stageId: S.456
                      timestamp: 1753228412133
                      userId: U.test
                  workflowId: WF.test
                  closerId: U.xxxcloser
                  updatedAt: 1753228518382
                  notes: []
                  locationId: TLoc.test
                  lastUpdateProcess: dev-account-update-v1
                  modifiedBy:
                    - userId: U:logan
                      timestamp: 1753228518382
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  account:
                    description: The added/updated account object.
                    $ref: "#/components/schemas/__schema923"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /activity/list:
    post:
      operationId: activity-list-v1
      tags:
        - Activity
      summary: List Activity
      description: Lists the workflow actions recorded on accounts in a workflow (for
        example, each time a rep logs an action). `workflowId` is required;
        filter further by date range, teams, users, actions, city, state, zip
        code, custom fields, or polygon. Sort by `timestamp` or `distance`. Each
        result includes the user who performed the action. `size` sets the page
        size (10–1000); pass the returned `sortTimestamp` to fetch the next
        page. Use `/account/list` instead to list the accounts themselves.
      requestBody:
        content:
          application/json:
            example:
              workflowId: WF.abc123
              startTime: 1753228412133
              endTime: 1753833212133
              teamIds:
                - Team.abc123
              actionIds:
                - A.abc123
              sortBy: timestamp
              sortOrder: desc
              size: 100
            schema:
              type: object
              properties:
                startTime:
                  $ref: "#/components/schemas/__schema246"
                endTime:
                  $ref: "#/components/schemas/__schema247"
                workflowId:
                  $ref: "#/components/schemas/WFId"
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
                userIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/userId"
                actionIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/AId"
                cities:
                  description: Filter by city names.
                  $ref: "#/components/schemas/__schema248"
                states:
                  description: Filter by state names.
                  $ref: "#/components/schemas/__schema249"
                zipCodes:
                  description: Filter by ZIP codes.
                  $ref: "#/components/schemas/__schema250"
                customFields:
                  description: Filter by custom field values.
                  $ref: "#/components/schemas/__schema156"
                propertyCoordinates:
                  type: array
                  items:
                    $ref: "#/components/schemas/latlng"
                sortTimestamp:
                  type: array
                  prefixItems:
                    - $ref: "#/components/schemas/__schema251"
                    - $ref: "#/components/schemas/__schema252"
                  items: false
                  minItems: 2
                  maxItems: 2
                  description: Activity pagination cursor containing the sort value followed by
                    the activity ID
                sortBy:
                  type: string
                  enum:
                    - distance
                    - timestamp
                sortOrder:
                  type: string
                  enum:
                    - asc
                    - desc
                query:
                  type: string
                size:
                  type: number
                  minimum: 10
                  maximum: 1000
              required:
                - workflowId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                actions: []
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  actions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          pattern: ^Account((\.)|(:))[\s\S]{0,}\|WF\.[\s\S]{0,}\|A\.[\s\S]{0,}\|-?\d+(?:\.\d+)?$
                        workflowId:
                          $ref: "#/components/schemas/WFId"
                        actionId:
                          $ref: "#/components/schemas/AId"
                        timestamp:
                          $ref: "#/components/schemas/utcMillisecondsOutput"
                        userId:
                          $ref: "#/components/schemas/userId"
                        user:
                          $ref: "#/components/schemas/tinyUserOutput"
                        latlng:
                          $ref: "#/components/schemas/latlngOutput"
                        propertyLatLng:
                          $ref: "#/components/schemas/latlngOutput"
                        stageId:
                          $ref: "#/components/schemas/SId"
                        accountId:
                          $ref: "#/components/schemas/accountId"
                        address:
                          type: string
                        city:
                          type: string
                        state:
                          type: string
                        zip:
                          type: string
                      required:
                        - id
                        - workflowId
                        - actionId
                        - timestamp
                        - userId
                        - stageId
                        - accountId
                      additionalProperties: false
                  sortTimestamp:
                    $ref: "#/components/schemas/__schema934"
                  total:
                    $ref: "#/components/schemas/__schema941"
                required:
                  - type
                  - actions
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/get:
    post:
      operationId: area-get-v1
      summary: Get Area
      tags:
        - Area
      description: "Retrieves a single area by its ID, including an area in Trash.
        Returns the area definition: coordinates, assignment configuration,
        filters, `teamId` and `userIds`, `runHistory` (the last 20 assignment
        runs), `createdAt` and `createdBy`, and the current job status in
        `jobInfo` while an assignment run is in progress. An area in Trash has
        `isDeleted: true`, plus `deletedAt` and `deletedBy`. `deletedBy` is the
        staff user when one moved the area while impersonating. For an area
        trashed before Terros recorded the move, both come from its last
        recorded change and may be approximate. `deleteOnCompletion: true`
        without `isDeleted` means the move is waiting for an unassign run to
        finish, and that area already has `deletedAt` and `deletedBy`. A trashed
        area keeps its definition and can be restored with `/area/update` by
        sending it back with `isDeleted: false` and `deleteOnCompletion: false`,
        which clears `deletedAt` and `deletedBy`. `NotFound` (\"Area not
        found\") means the ID is unknown, the area was permanently deleted
        (`/area/remove` with `archive: false`), or the area belongs to another
        company; Terros staff read a customer's areas by impersonating one of
        its users. A staff session that is not impersonating gets `NotFound` for
        another company's areas. Requires the `area:list` permission scoped to
        the area's team or users. Use `/area/list` instead to find areas by user
        or team."
      requestBody:
        content:
          application/json:
            example:
              areaId: Area.abc12345
            schema:
              type: object
              properties:
                areaId:
                  $ref: "#/components/schemas/AreaId"
              required:
                - areaId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                area:
                  areaId: Area.abc12345
                  createdAt: 1753228412133
                  createdBy: U.rep1
                  name: Downtown West
                  assignmentType: team
                  teamId: Team.sales-west
                  userIds:
                    - U.rep1
                    - U.rep2
                  color: "#4A90D9"
                  note: Primary residential territory for west side team
                  coordinates:
                    - latitude: 40.758
                      longitude: -111.891
                    - latitude: 40.758
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.891
                  filters:
                    states:
                      - UT
                    cities:
                      - Salt Lake City
                    zipCodes:
                      - "84101"
                      - "84102"
                    statusIds:
                      - AS.lead
                  assignmentConfig:
                    enabled: true
                    autoRunOnImport: true
                    order: 1
                  schedule:
                    - type: assign
                      at: 1753228412133
              schema:
                $ref: "#/components/schemas/__schema948"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/list:
    post:
      operationId: area-list-v1
      summary: List Areas
      tags:
        - Area
      description: "Lists areas visible to the current user within the caller's
        company; Terros staff read a customer's areas by impersonating one of
        its users. A staff session that is not impersonating gets an empty list,
        not an error, for another company's areas, whatever the filters. Filter
        by `userId` (areas assigned directly to that user), `teamIds` (areas
        assigned exactly to those teams) or `downlineTeamIds` (areas relevant to
        those teams or their downline). When no filter is provided, returns all
        areas the caller has permission to view — company admins and users with
        company-level `area:add` see all areas; other users see areas for their
        managed teams plus any unassigned areas. `archived: true` lists Trash
        (areas with `isDeleted: true`, each with `deletedAt` and `deletedBy`,
        which are approximate for areas trashed before Terros recorded the
        move); `archived: \"all\"` lists active and trashed areas together.
        Search, sort and pagination (`query`, `areaStates`, `boundingBox`,
        `createdDate`, `lastAssignmentDate`, `expirationDate`, `sortBy`,
        `sortOrder`, `size`, `sortTimestamp`, `stats`) use the paginated search:
        pass any of them, or `version: 2` (CLI: `--version 2`), to get a page of
        at most `size` areas (default 100) with `total` and a `sortTimestamp` to
        send back for the next page. Without them and without `version`, the
        legacy response returns every matching area in one list. Requires the
        `area:list` permission. Use `/area/get` instead when you already have
        the `areaId`."
      requestBody:
        content:
          application/json:
            example:
              version: 2
              size: 5
            schema:
              $ref: "#/components/schemas/__schema253"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                areas:
                  - areaId: Area.abc12345
                    createdAt: 1753228412133
                    createdBy: U.rep1
                    name: Downtown West
                    assignmentType: team
                    teamId: Team.sales-west
                    userIds:
                      - U.rep1
                      - U.rep2
                    color: "#4A90D9"
                    note: Primary residential territory for west side team
                    coordinates:
                      - latitude: 40.758
                        longitude: -111.891
                      - latitude: 40.758
                        longitude: -111.86
                      - latitude: 40.74
                        longitude: -111.86
                      - latitude: 40.74
                        longitude: -111.891
                    filters:
                      states:
                        - UT
                      cities:
                        - Salt Lake City
                      zipCodes:
                        - "84101"
                        - "84102"
                      statusIds:
                        - AS.lead
                    assignmentConfig:
                      enabled: true
                      autoRunOnImport: true
                      order: 1
                    schedule:
                      - type: assign
                        at: 1753228412133
                sortTimestamp: Area.abc12345
                total: 1
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  areas:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema949"
                  sortTimestamp:
                    $ref: "#/components/schemas/__schema934"
                  total:
                    $ref: "#/components/schemas/__schema941"
                required:
                  - type
                  - areas
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/add:
    post:
      operationId: area-add-v1
      summary: Add Area
      tags:
        - Area
      description: >-
        Creates a new area and returns the saved object. An area defines a
        geographic territory using polygon coordinates and optional filter
        criteria. The server automatically cleans invalid polygon geometries
        (e.g., self-intersections) before saving.


        **Coordinates** are an array of `{latitude, longitude}` objects forming
        an open polygon — do not repeat the first point at the end.


        **Assignment types:**

        - `user` — assigned to specific user(s)

        - `team` — assigned to a team

        - `draft` — not yet assigned


        **Filters** narrow which accounts within the polygon are eligible for
        assignment (by state, city, zip code, status, workflow stage, team,
        user, or custom fields). `filters.userIds` cannot include the "no owner"
        value `U.unassigned`: once the area assigns those accounts they stop
        matching it.


        **Schedule** entries allow timed assign, unassign, or reassign actions.


        Saving an area does not assign any accounts; call `/area/assign` to run
        the assignment.


        Requires the `area:add` permission scoped to the area's team or users.
      requestBody:
        content:
          application/json:
            example:
              name: Downtown West
              assignmentType: team
              teamId: Team.sales-west
              userIds:
                - U.rep1
                - U.rep2
              color: "#4A90D9"
              note: Primary residential territory for west side team
              coordinates:
                - latitude: 40.758
                  longitude: -111.891
                - latitude: 40.758
                  longitude: -111.86
                - latitude: 40.74
                  longitude: -111.86
                - latitude: 40.74
                  longitude: -111.891
              filters:
                states:
                  - UT
                cities:
                  - Salt Lake City
                zipCodes:
                  - "84101"
                  - "84102"
                statusIds:
                  - AS.lead
              assignmentConfig:
                enabled: true
                autoRunOnImport: true
                order: 1
              schedule:
                - type: assign
                  at: 1753228412133
            schema:
              type: object
              properties:
                areaType:
                  $ref: "#/components/schemas/__schema277"
                name:
                  $ref: "#/components/schemas/__schema278"
                coordinates:
                  $ref: "#/components/schemas/__schema279"
                assignmentType:
                  $ref: "#/components/schemas/__schema280"
                teamId:
                  $ref: "#/components/schemas/__schema281"
                userIds:
                  $ref: "#/components/schemas/__schema282"
                color:
                  $ref: "#/components/schemas/__schema283"
                note:
                  $ref: "#/components/schemas/__schema284"
                filters:
                  $ref: "#/components/schemas/__schema285"
                assignmentConfig:
                  $ref: "#/components/schemas/__schema286"
                schedule:
                  $ref: "#/components/schemas/__schema287"
              required:
                - assignmentType
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                area:
                  areaId: Area.abc12345
                  createdAt: 1753228412133
                  createdBy: U.rep1
                  name: Downtown West
                  assignmentType: team
                  teamId: Team.sales-west
                  userIds:
                    - U.rep1
                    - U.rep2
                  color: "#4A90D9"
                  note: Primary residential territory for west side team
                  coordinates:
                    - latitude: 40.758
                      longitude: -111.891
                    - latitude: 40.758
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.891
                  filters:
                    states:
                      - UT
                    cities:
                      - Salt Lake City
                    zipCodes:
                      - "84101"
                      - "84102"
                    statusIds:
                      - AS.lead
                  assignmentConfig:
                    enabled: true
                    autoRunOnImport: true
                    order: 1
                  schedule:
                    - type: assign
                      at: 1753228412133
              schema:
                $ref: "#/components/schemas/__schema948"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/update:
    post:
      operationId: area-update-v1
      summary: Update Area
      tags:
        - Area
      description: >-
        Updates an existing area and returns the updated object. Pass the full
        area object including its `areaId`. All mutable fields (coordinates,
        assignment type, team, users, filters, schedule, etc.) can be changed.
        The server re-validates and cleans coordinates on every update. Fields
        omitted from the request, such as `note`, `color`, or `filters`, are
        cleared, so start from the area returned by `/area/get`; read-only
        fields it returns (`createdAt`, `createdBy`, `deletedAt`, `deletedBy`,
        `runHistory`, `jobInfo`) are ignored. Sending an area from Trash back
        with `isDeleted: false` and `deleteOnCompletion: false` restores it.
        Updating an area does not reassign accounts; call `/area/assign` to
        apply the changes. A new `U.unassigned` ("no owner") value in
        `filters.userIds` is rejected, as on `/area/add`; an area that already
        has it may keep it.


        Requires the `area:add` permission scoped to the area's current team or
        users.
      requestBody:
        content:
          application/json:
            example:
              area:
                areaId: Area.abc12345
                createdAt: 1753228412133
                createdBy: U.rep1
                name: Downtown West (Updated)
                assignmentType: team
                teamId: Team.sales-west
                userIds:
                  - U.rep1
                  - U.rep2
                color: "#4A90D9"
                note: Primary residential territory for west side team
                coordinates:
                  - latitude: 40.758
                    longitude: -111.891
                  - latitude: 40.758
                    longitude: -111.86
                  - latitude: 40.74
                    longitude: -111.86
                  - latitude: 40.74
                    longitude: -111.891
                filters:
                  states:
                    - UT
                  cities:
                    - Salt Lake City
                  zipCodes:
                    - "84101"
                    - "84102"
                  statusIds:
                    - AS.lead
                assignmentConfig:
                  enabled: true
                  autoRunOnImport: true
                  order: 1
                schedule:
                  - type: assign
                    at: 1753228412133
            schema:
              type: object
              properties:
                area:
                  $ref: "#/components/schemas/__schema289"
              required:
                - area
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                area:
                  areaId: Area.abc12345
                  createdAt: 1753228412133
                  createdBy: U.rep1
                  name: Downtown West (Updated)
                  assignmentType: team
                  teamId: Team.sales-west
                  userIds:
                    - U.rep1
                    - U.rep2
                  color: "#4A90D9"
                  note: Primary residential territory for west side team
                  coordinates:
                    - latitude: 40.758
                      longitude: -111.891
                    - latitude: 40.758
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.86
                    - latitude: 40.74
                      longitude: -111.891
                  filters:
                    states:
                      - UT
                    cities:
                      - Salt Lake City
                    zipCodes:
                      - "84101"
                      - "84102"
                    statusIds:
                      - AS.lead
                  assignmentConfig:
                    enabled: true
                    autoRunOnImport: true
                    order: 1
                  schedule:
                    - type: assign
                      at: 1753228412133
              schema:
                $ref: "#/components/schemas/__schema948"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/remove:
    post:
      operationId: area-remove-v1
      summary: Remove Area
      tags:
        - Area
      description: >-
        Removes an area by its ID. By default (`archive` omitted or `true`) the
        area moves to Trash: its record is kept with `isDeleted: true`,
        `deletedAt` and `deletedBy`, `/area/get` still returns it, `/area/list`
        with `archived: true` lists it, and `/area/update` restores it (send it
        back with `isDeleted: false` and `deleteOnCompletion: false`). Send
        `archive: false` to delete it permanently instead; a permanently deleted
        area can no longer be read or restored. Either way, any scheduled
        assignments for this area will no longer run.


        This endpoint does not change the accounts inside the area: they keep
        their team and owner. The web app's Move to Trash does more for an area
        with account assignment enabled that is currently assigned: it first
        runs `/area/assign` with `runType: unassign`, which removes the team and
        owner the area assigned from those accounts, then moves the area to
        Trash once that run completes (`deleteOnCompletion: true` marks the
        wait). To do the same from the API, run `/area/assign` with `runType:
        unassign` before removing.


        Requires the `area:add` permission scoped to the area's team or users.
        When account assignment is enabled for the area, it also requires
        `area:add` for every team in the area's filters, or company-level
        `area:add` when the filters name no teams.
      requestBody:
        content:
          application/json:
            example:
              areaId: Area.abc12345
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                areaId:
                  $ref: "#/components/schemas/AreaId"
              required:
                - areaId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /area/assign:
    post:
      operationId: area-assign-v1
      summary: Run Area Assignment
      tags:
        - Area
      description: >-
        Triggers an assignment run for one or more areas. This is an
        **asynchronous** operation — it returns immediately with a success
        response while the assignment processes in the background.


        **Run types:**

        - `assign` — assigns accounts within each area's polygon and filters to
        the area's configured team/user

        - `unassign` — removes team/user assignments from accounts in the area
        and sets the area to draft

        - `reassign` — re-runs assignment, potentially changing account
        ownership


        Set `preserveDownlineAssignments` to keep accounts already assigned to a
        subteam of the target team with their current team and owner. It
        defaults to false, so reassignment and reset flows continue to replace
        the current assignment.


        Pass `areas` to run specific areas, or `areaListInput` to run all areas
        matching an area list filter set. Filter-based assignment is limited to
        10,000 matching areas. If an overlapping area is already running an
        assignment, the request will be rejected with an error identifying the
        conflicting area.


        Use `/area/get` to check the `jobInfo` field for assignment progress
        (`preparing`, `queued`, `running`, `completed`).


        Requires the `area:add` permission.
      requestBody:
        content:
          application/json:
            example:
              areaListInput:
                version: 2
                areaStates:
                  - assigned
              runType: assign
            schema:
              type: object
              properties:
                areas:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema289"
                areaListInput:
                  $ref: "#/components/schemas/__schema253"
                runType:
                  $ref: "#/components/schemas/__schema293"
                preserveDownlineAssignments:
                  type: boolean
              required:
                - runType
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /attachment/add:
    post:
      operationId: attachment-add-v1
      summary: Add Attachment
      tags:
        - Attachment
      description: >-
        Creates an attachment record and returns a pre-signed `uploadUrl` for
        the file. Use it to upload a file, such as an inspection PDF, and store
        it in an Attachment custom field. Requires the `attachment:manage`
        permission; if your API key is restricted to specific permissions,
        include `attachment:manage`. The authenticated user owns the attachment.


        1. Call this endpoint with the `filename` and `contentType` (for example
        `application/pdf`). Optionally pass the `size` in bytes and the
        `locationId` of the account the file belongs to.

        2. Upload the file with an HTTP `PUT` to `uploadUrl` within 1 hour. Send
        the file bytes as the raw body (not multipart form data) with a
        `Content-Type` header equal to the `contentType` you sent and an
        `If-None-Match: *` header; the upload is rejected without them. Call
        this endpoint again for each file.

        3. Store the returned `attachment.attachmentId` in the account's
        Attachment custom field with `/account/update`, for example
        `"customFieldsPatch": { "CF.abc123": "Attachment.abc123" }`. For a field
        that allows multiple files, set an array of attachment IDs.


        The attachment starts with `status` `pending`. After the upload, Terros
        checks the file's type from its contents, or from the `contentType` you
        declared when the contents have no recognizable signature (as with plain
        text, CSV, and JSON). Accepted: PDF; JPEG, PNG, GIF, WebP, AVIF, HEIC,
        TIFF, and BMP images; MP4, MOV, WebM, MPEG, and 3GP video; MP3, OGG,
        WAV, and AAC audio; Word, Excel, and PowerPoint files in the modern
        .docx, .xlsx, and .pptx formats; OpenDocument text and spreadsheets;
        RTF, plain text, CSV, and JSON; and ZIP, RAR, and 7z archives. An
        accepted file's status becomes `valid`. Anything else, including legacy
        .doc, .xls, and .ppt files and AVI video, is marked `corrupted` and
        cannot be downloaded. An attachment that does not become `valid` within
        1 hour, because no file was uploaded or the file was marked `corrupted`,
        expires and is deleted. Use `/attachment/get` to confirm the status is
        `valid` before relying on the attachment ID, and to get a fresh download
        URL.
      requestBody:
        content:
          application/json:
            example:
              attachment:
                filename: inspection.pdf
                contentType: application/pdf
                size: 1048576
                locationId: TLoc.test
            schema:
              type: object
              properties:
                attachment:
                  type: object
                  properties:
                    filename:
                      type: string
                    contentType:
                      type: string
                    size:
                      type: number
                    locationId:
                      $ref: "#/components/schemas/locationId"
                  required:
                    - filename
                    - contentType
              required:
                - attachment
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                attachment:
                  attachmentId: Attachment.abc123
                  userId: U.test
                  companyId: C.test
                  filename: inspection.pdf
                  contentType: application/pdf
                  size: 1048576
                  downloadUrl: https://s3.amazonaws.com/terros-attachments/proposal.pdf
                  status: pending
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                  createdBy: U.test
                  updatedBy: U.test
                  locationId: TLoc.test
                uploadUrl: https://s3.amazonaws.com/terros-attachments-temp/Attachment.abc123?X-Amz-Signature=...
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  attachment:
                    $ref: "#/components/schemas/__schema956"
                  uploadUrl:
                    type: string
                required:
                  - type
                  - attachment
                  - uploadUrl
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /attachment/get:
    post:
      operationId: attachment-get-v1
      summary: Get Attachment
      tags:
        - Attachment
      description: Retrieves an attachment's metadata (filename, content type, size,
        status) by its ID, including a signed download URL. The download URL is
        valid for 12 hours, so call this again to get a fresh URL rather than
        storing it. Requires the `attachment:list` permission for the user who
        owns the attachment.
      requestBody:
        content:
          application/json:
            example:
              attachmentId: Attachment.abc123
            schema:
              type: object
              properties:
                attachmentId:
                  $ref: "#/components/schemas/AttachmentId"
              required:
                - attachmentId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                attachment:
                  attachmentId: Attachment.abc123
                  userId: U.test
                  companyId: C.test
                  filename: proposal.pdf
                  contentType: application/pdf
                  size: 1048576
                  downloadUrl: https://s3.amazonaws.com/terros-attachments/proposal.pdf
                  status: valid
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                  createdBy: U.test
                  updatedBy: U.test
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  attachment:
                    $ref: "#/components/schemas/__schema956"
                required:
                  - type
                  - attachment
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/add:
    post:
      operationId: calendar-event-add-v1
      summary: Add Calendar Event
      tags:
        - Calendar
      description: Creates a new calendar event with the specified details including
        type, date, duration, and location. Omit `ownerId` to make the
        authenticated user the owner. Requires the `event:save` permission for
        the owner or attendee. Consultations created without an attendee may
        have a closer assigned automatically, depending on settings; if closer
        availability is enforced and no closer is available, the request fails
        unless `errorOnCloserUnavailable` is `false`. Use
        `/calendar/event/upsert` instead when syncing from an external system or
        when you do not know whether the event already exists.
      requestBody:
        content:
          application/json:
            example:
              event:
                eventType: Consultation
                title: Customer Meeting
                eventDate: 1672531200000
                duration: 60
                locationId: Loc:loc123
            schema:
              type: object
              properties:
                event:
                  type: object
                  properties:
                    importId:
                      $ref: "#/components/schemas/importId"
                    eventType:
                      $ref: "#/components/schemas/eventType"
                    title:
                      $ref: "#/components/schemas/calendarEventTitle"
                    sourceId:
                      $ref: "#/components/schemas/calendarEventSourceId"
                    eventDate:
                      $ref: "#/components/schemas/utcMilliseconds"
                    outcomeId:
                      $ref: "#/components/schemas/calendarEventOutcomeId"
                    dispositionId:
                      $ref: "#/components/schemas/__schema297"
                    duration:
                      $ref: "#/components/schemas/calendarEventDuration"
                    attachments:
                      $ref: "#/components/schemas/__schema298"
                    specialtyAttachments:
                      $ref: "#/components/schemas/__schema300"
                    accountId:
                      $ref: "#/components/schemas/calendarEventAccountId"
                    locationId:
                      $ref: "#/components/schemas/calendarEventLocationId"
                    location:
                      $ref: "#/components/schemas/__schema303"
                    ownerId:
                      $ref: "#/components/schemas/__schema304"
                    attendeeId:
                      $ref: "#/components/schemas/calendarEventAttendeeId"
                    dispatcherId:
                      $ref: "#/components/schemas/calendarEventDispatcherId"
                    occurredOwner:
                      $ref: "#/components/schemas/calendarEventOccurredOwner"
                    occurredAttendee:
                      $ref: "#/components/schemas/calendarEventOccurredAttendee"
                    interviewId:
                      $ref: "#/components/schemas/calendarEventInterviewId"
                    notes:
                      $ref: "#/components/schemas/calendarEventNotes"
                    previousEventId:
                      $ref: "#/components/schemas/calendarEventPreviousId"
                    syncedCalendarIds:
                      $ref: "#/components/schemas/__schema308"
                    syncedCalendarEvents:
                      $ref: "#/components/schemas/__schema310"
                    teamId:
                      $ref: "#/components/schemas/calendarEventTeamId"
                  required:
                    - eventType
                    - title
                    - eventDate
                    - duration
                  description: Calendar event data to create
                  example:
                    eventType: Consultation
                    title: Customer Meeting
                    eventDate: 1672531200000
                    duration: 60
                errorOnCloserUnavailable:
                  description: Whether to error if a closer is unavailable at the given
                    appointment time. Defaults to true
                  $ref: "#/components/schemas/__schema312"
              required:
                - event
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                event:
                  eventType: Consultation
                  title: Customer Meeting
                  eventDate: 1672531200000
                  duration: 60
                  locationId: Loc:loc123
                  eventId: Event:evt123
                  ownerId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  event:
                    description: Created calendar event
                    $ref: "#/components/schemas/__schema982"
                required:
                  - type
                  - event
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/get:
    post:
      operationId: calendar-event-get-v1
      summary: Get Calendar Event
      tags:
        - Calendar
      description: Retrieves a single calendar event by its ID, including owner,
        attendee, and team details, and whether the caller can delete it.
        Requires permission to read the event. Use `/calendar/event/list`
        instead to find events by date range, owner, team, or location. An event
        syncs to the external calendars of its owner and attendee; to see
        whether one of them has Google or Microsoft connected and which calendar
        it lands in, call `/oauth/list` as that user.
      requestBody:
        content:
          application/json:
            example:
              eventId: Event:evt123
            schema:
              type: object
              properties:
                eventId:
                  description: ID of the calendar event to retrieve
                  example: Event.evt123
                  $ref: "#/components/schemas/EventId"
              required:
                - eventId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                event:
                  eventType: Consultation
                  title: Customer Meeting
                  eventDate: 1672531200000
                  duration: 60
                  locationId: Loc:loc123
                  eventId: Event:evt123
                  ownerId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  event:
                    description: Calendar event with details (owner, attendee, teams, etc.)
                    $ref: "#/components/schemas/__schema998"
                required:
                  - type
                  - event
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/list:
    post:
      operationId: calendar-event-list-v1
      summary: List Calendar Events
      tags:
        - Calendar
      description: Lists calendar events within a date range, optionally filtered by
        owner, team, location, role, event type, or outcome. Without `companyId`
        or `teamIds`, returns events for `ownerId`, or for the authenticated
        user when `ownerId` is omitted. Pass `companyId` or `teamIds` for a
        broader view; results are limited to what the `event:read` permission
        allows. Use `/calendar/event/get` instead when you already have an event
        ID.
      requestBody:
        content:
          application/json:
            example:
              startTime: 1672531200000
              endTime: 1672617600000
            schema:
              type: object
              properties:
                startTime:
                  description: UTC time to start filtering by (milliseconds)
                  example: 1672531200000
                  $ref: "#/components/schemas/utcMilliseconds"
                endTime:
                  description: UTC time to end filtering by (milliseconds)
                  example: 1672617600000
                  $ref: "#/components/schemas/utcMilliseconds"
                actionIds:
                  description: Filter by the account latest workflow action within the requested
                    date range
                  example:
                    - A:no-show
                    - A:rescheduled
                  $ref: "#/components/schemas/__schema313"
                ownerId:
                  description: Filter by event owner user ID
                  example: U:owner123
                  $ref: "#/components/schemas/userId"
                locationId:
                  description: Filter by location ID
                  example: Loc:location123
                  $ref: "#/components/schemas/locationId"
                companyId:
                  description: Filter by company ID
                  example: C:company123
                  $ref: "#/components/schemas/companyId"
                teamId:
                  description: Filter by team ID (deprecated - use teamIds)
                  example: Team:sales
                  deprecated: true
                  $ref: "#/components/schemas/teamId"
                teamIds:
                  description: Filter by array of team IDs
                  example:
                    - Team:sales
                    - Team:support
                  $ref: "#/components/schemas/__schema314"
                roleIds:
                  description: Filter by array of role IDs
                  example:
                    - Role.manager
                    - Role.admin
                  $ref: "#/components/schemas/__schema315"
                occurred:
                  description: Filter by whether events occurred
                  $ref: "#/components/schemas/booleanFilter"
                closed:
                  description: Filter by whether events resulted in closed accounts
                  $ref: "#/components/schemas/booleanFilter"
                eventType:
                  description: Filter by event type
                  $ref: "#/components/schemas/eventType"
                filterByRoles:
                  description: Filter by calendar event user types (owner, attendee)
                  example: owner
                  $ref: "#/components/schemas/__schema316"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                events:
                  - eventType: Consultation
                    title: Customer Meeting
                    eventDate: 1672531200000
                    duration: 60
                    locationId: Loc:loc123
                    eventId: Event:evt123
                    ownerId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  events:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema998"
                    description: Array of calendar events with details
                required:
                  - type
                  - events
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/update:
    post:
      operationId: calendar-event-update-v1
      summary: Update Calendar Event
      tags:
        - Calendar
      description: Updates an existing calendar event, identified by `eventId`, with
        new information such as time, location, or attendee. Only the fields you
        provide are changed; set `attendeeId` to `null` to remove the attendee.
        Requires the `event:save` or `event:manage` permission, and changing the
        attendee requires `event:manage`. Use `/calendar/event/upsert` instead
        when you only have an external `sourceId` or do not know whether the
        event exists.
      requestBody:
        content:
          application/json:
            example:
              event:
                eventId: Event:evt123
                title: Updated Meeting Title
                duration: 90
            schema:
              type: object
              properties:
                event:
                  type: object
                  properties:
                    importId:
                      $ref: "#/components/schemas/__schema318"
                    eventType:
                      $ref: "#/components/schemas/__schema319"
                    title:
                      $ref: "#/components/schemas/__schema320"
                    sourceId:
                      $ref: "#/components/schemas/__schema321"
                    eventDate:
                      $ref: "#/components/schemas/__schema322"
                    outcomeId:
                      $ref: "#/components/schemas/__schema323"
                    dispositionId:
                      $ref: "#/components/schemas/__schema324"
                    duration:
                      $ref: "#/components/schemas/__schema325"
                    attachments:
                      $ref: "#/components/schemas/__schema326"
                    specialtyAttachments:
                      $ref: "#/components/schemas/__schema327"
                    accountId:
                      $ref: "#/components/schemas/__schema328"
                    locationId:
                      $ref: "#/components/schemas/__schema329"
                    location:
                      $ref: "#/components/schemas/__schema330"
                    ownerId:
                      $ref: "#/components/schemas/__schema331"
                    attendeeId:
                      $ref: "#/components/schemas/__schema332"
                    dispatcherId:
                      $ref: "#/components/schemas/__schema334"
                    occurredOwner:
                      $ref: "#/components/schemas/__schema335"
                    occurredAttendee:
                      $ref: "#/components/schemas/__schema336"
                    interviewId:
                      $ref: "#/components/schemas/__schema337"
                    notes:
                      $ref: "#/components/schemas/__schema338"
                    previousEventId:
                      $ref: "#/components/schemas/__schema339"
                    syncedCalendarIds:
                      $ref: "#/components/schemas/__schema340"
                    syncedCalendarEvents:
                      $ref: "#/components/schemas/__schema341"
                    teamId:
                      $ref: "#/components/schemas/__schema342"
                    companyId:
                      $ref: "#/components/schemas/__schema343"
                    outcomeHistory:
                      $ref: "#/components/schemas/__schema344"
                    modifiedBy:
                      $ref: "#/components/schemas/__schema346"
                    createdAt:
                      $ref: "#/components/schemas/__schema347"
                    createdBy:
                      $ref: "#/components/schemas/__schema348"
                    updatedAt:
                      $ref: "#/components/schemas/__schema349"
                    updatedBy:
                      $ref: "#/components/schemas/__schema350"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/__schema351"
                    version:
                      $ref: "#/components/schemas/__schema352"
                    eventId:
                      $ref: "#/components/schemas/EventId"
                    occurred:
                      $ref: "#/components/schemas/__schema353"
                    closed:
                      $ref: "#/components/schemas/__schema355"
                    reasonNotOccurred:
                      $ref: "#/components/schemas/__schema357"
                    fault:
                      $ref: "#/components/schemas/__schema359"
                    allDay:
                      $ref: "#/components/schemas/__schema361"
                    canDelete:
                      $ref: "#/components/schemas/__schema363"
                  required:
                    - eventId
                  description: Partial calendar event data to update (eventId is required)
                  example:
                    eventId: Event.evt123
                    title: Updated Meeting Title
                    duration: 90
                errorOnCloserUnavailable:
                  description: Whether to error if a closer is unavailable at the given
                    appointment time. Defaults to true
                  $ref: "#/components/schemas/__schema365"
              required:
                - event
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                event:
                  eventType: Consultation
                  title: Customer Meeting
                  eventDate: 1672531200000
                  duration: 60
                  locationId: Loc:loc123
                  eventId: Event:evt123
                  ownerId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  event:
                    description: Updated calendar event
                    $ref: "#/components/schemas/__schema982"
                required:
                  - type
                  - event
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/upsert:
    post:
      operationId: calendar-event-upsert-v1
      summary: Upsert Calendar Event
      tags:
        - Calendar
      description: >-
        Creates or updates a calendar event in a single call — no need to check
        whether the event already exists. This is the recommended endpoint for
        external integrations (e.g. Zapier, CRM sync) because it eliminates the
        if/else logic of calling add vs update.


        **Match priority** (first match wins):

        1. `eventId` — exact Terros event ID match

        2. `sourceId` — external system ID, with owner → account → company
        fallback

        3. Location + owner — if a location resolves and an event exists at that
        location for the same owner


        If no match is found, a new event is created. If a match is found, the
        provided fields are merged into the existing event (unset fields are
        left unchanged).


        **Tips:**

        - Always include `sourceId` when syncing from an external system — it
        ensures idempotent writes and lets Terros track the external record ID.

        - For Comeback events, include `previousEventId` pointing to the
        original Consultation.

        - `notes` is deprecated — use Workflow account notes for new
        integrations.


        **Defaults on create** (applied only when the field is omitted):

        - `eventType` → `Consultation`

        - `ownerId` → the authenticated user

        - `duration` → `60` minutes

        - `eventDate` → current time

        - `title` → `Untitled Event From Integration`


        **Update behavior** (when a match is found):

        - Only provided fields are updated — omitted fields keep their existing
        values.

        - `attendeeId` supports explicit `null` to clear the field. All other
        fields treat `null` and `undefined` the same (preserve existing).


        **Account location:**

        When `accountId` is set and `location` is omitted, the event takes the
        account's location, so it appears in that account's appointments. On
        update, an event that already has a location keeps it unless the upsert
        moves it from one account to a different account. A provided `location`
        always wins, and only a provided `location` is used for location + owner
        matching.


        **Outcome matching:**

        `outcomeId` is flexible — it can be:

        1. A Terros `EventOutcomeId` (exact match)

        2. An integration mapping string configured on the outcome

        3. A case-insensitive outcome name


        **User resolution:**

        `ownerId`, `attendeeId`, and `dispatcherId` each accept either a Terros
        `UserId` (e.g. `U:abc123`) or an email address. The system resolves
        emails to users within the authenticated company.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                event:
                  type: object
                  properties:
                    eventId:
                      $ref: "#/components/schemas/EventId"
                    sourceId:
                      $ref: "#/components/schemas/upsertCalendarEventSourceId"
                    eventType:
                      $ref: "#/components/schemas/upsertCalendarEventType"
                    title:
                      $ref: "#/components/schemas/upsertCalendarEventTitle"
                    eventDate:
                      $ref: "#/components/schemas/upsertCalendarEventDate"
                    outcomeId:
                      $ref: "#/components/schemas/upsertCalendarEventOutcomeId"
                    duration:
                      $ref: "#/components/schemas/upsertCalendarEventDuration"
                    accountId:
                      $ref: "#/components/schemas/accountId"
                    location:
                      type: object
                      properties:
                        latitude:
                          $ref: "#/components/schemas/__schema232"
                        longitude:
                          $ref: "#/components/schemas/__schema234"
                        locationId:
                          $ref: "#/components/schemas/__schema368"
                        oneLine:
                          $ref: "#/components/schemas/__schema369"
                        unitNbr:
                          $ref: "#/components/schemas/addressUnitNbr"
                      description: Location information for calendar events
                    ownerId:
                      $ref: "#/components/schemas/upsertCalendarEventOwnerId"
                    attendeeId:
                      $ref: "#/components/schemas/upsertCalendarEventAttendeeId"
                    dispatcherId:
                      $ref: "#/components/schemas/upsertCalendarEventDispatcherId"
                    occurredOwner:
                      $ref: "#/components/schemas/upsertCalendarEventOccurredOwner"
                    occurredAttendee:
                      $ref: "#/components/schemas/upsertCalendarEventOccurredAttendee"
                    notes:
                      $ref: "#/components/schemas/upsertCalendarEventNotes"
                    previousEventId:
                      $ref: "#/components/schemas/upsertCalendarEventPreviousId"
              required:
                - event
            examples:
              Create minimal event:
                value:
                  event:
                    sourceId: crm-12345
              Upsert by source ID:
                value:
                  event:
                    sourceId: crm-event-78901
                    eventType: Consultation
                    title: Customer Consultation
                    eventDate: 1672531200000
                    duration: 60
                    ownerId: U:setter123
                    attendeeId: U:closer456
                    accountId: Account:cust123
                    location:
                      latitude: 40.7128
                      longitude: -74.006
                      oneLine: 123 Main St, Salt Lake City, UT 84101
              Update outcome by event ID:
                value:
                  event:
                    eventId: Event:evt123
                    outcomeId: EventOutcome:sold123
                    occurredOwner: true
                    occurredAttendee: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                event:
                  eventType: Consultation
                  title: Customer Meeting
                  eventDate: 1672531200000
                  duration: 60
                  locationId: Loc:loc123
                  eventId: Event:evt123
                  ownerId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  event:
                    $ref: "#/components/schemas/__schema982"
                required:
                  - type
                  - event
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/event/remove:
    post:
      operationId: calendar-event-remove-v1
      summary: Remove Calendar Event
      tags:
        - Calendar
      description: Removes a calendar event by its ID. This action cannot be undone.
        Non-Consultation events require the `event:delete` permission.
        Consultation events require `event:manage`, unless the owner removes
        them within the time window allowed by company settings.
      requestBody:
        content:
          application/json:
            example:
              eventId: Event:evt123
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                eventId:
                  description: ID of the calendar event to remove
                  example: Event.evt123
                  $ref: "#/components/schemas/EventId"
              required:
                - eventId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /calendar/timeslots:
    post:
      operationId: calendar-timeslots-v1
      summary: List Closer Timeslots
      tags:
        - Calendar
      description: Lists closers and their open appointment timeslots, for finding a
        time to book a Consultation. Set `targetId` to a User ID for that closer
        only (fails if the user is not a closer), or to a Team ID for closers
        directly on that team; omit it to use closers from the authenticated
        user's teams. `startTime` defaults to the start of the current hour and
        `days` defaults to 7. Pass `locationId` to exclude closers whose service
        area does not cover the location.
      requestBody:
        content:
          application/json:
            example:
              targetId: Team.abc123
              startTime: 1672531200000
              days: 7
              locationId: Loc:loc123
            schema:
              type: object
              properties:
                targetId:
                  anyOf:
                    - $ref: "#/components/schemas/teamId"
                    - $ref: "#/components/schemas/userId"
                days:
                  type: number
                locationId:
                  $ref: "#/components/schemas/locationId"
                startTime:
                  $ref: "#/components/schemas/utcMilliseconds"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                closers:
                  - user:
                      userId: U:user123
                      firstName: John
                      lastName: Doe
                    timezone: America/Los_Angeles
                    times:
                      - startTime: 1672531200000
                        duration: 60
                    bookingPercent: 100
                    serviceArea:
                      type: radius
                      center:
                        latitude: 33.7
                        longitude: -117.8
                      radiusMeters: 50000
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  closers:
                    type: array
                    items:
                      type: object
                      properties:
                        user:
                          $ref: "#/components/schemas/tinyUserOutput"
                        timezone:
                          type: string
                          description: Closer's effective IANA timezone
                          example: America/Los_Angeles
                        times:
                          type: array
                          items:
                            type: object
                            properties:
                              startTime:
                                $ref: "#/components/schemas/utcMillisecondsOutput"
                              duration:
                                type: number
                                description: Duration in minutes
                            required:
                              - startTime
                              - duration
                            additionalProperties: false
                        bookingPercent:
                          type: number
                          description: Effective booking capacity preference used to calculate this closer
                            availability
                        serviceArea:
                          oneOf:
                            - $ref: "#/components/schemas/__schema999"
                            - $ref: "#/components/schemas/__schema1000"
                            - $ref: "#/components/schemas/__schema1001"
                          description: Resolved service-area policy for location checks against this
                            availability snapshot
                          type: object
                          discriminator:
                            propertyName: type
                            mapping:
                              unrestricted: "#/components/schemas/__schema999"
                              radius: "#/components/schemas/__schema1000"
                              unknown: "#/components/schemas/__schema1001"
                      required:
                        - user
                        - timezone
                        - times
                        - bookingPercent
                        - serviceArea
                      additionalProperties: false
                required:
                  - type
                  - closers
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /company/update:
    post:
      operationId: company-update-v1
      summary: Update Company
      tags:
        - Company
      description: Updates company details such as name, billing contact, time zone,
        and team level names for the company identified by `companyId`. Only the
        fields you provide are changed; omitted fields keep their current
        values. Requires the `company:update` permission. Changing
        `accessStatus` also requires the `company:add` permission.
      requestBody:
        content:
          application/json:
            example:
              company:
                companyId: C:company123
                name: Example Solar Corp
                billingEmail: accounts-payable@example.com
                timeZone: America/Los_Angeles
            schema:
              type: object
              properties:
                company:
                  type: object
                  properties:
                    accessStatus:
                      $ref: "#/components/schemas/accessStatus"
                    billingEmail:
                      type: string
                    billingMethod:
                      $ref: "#/components/schemas/billingMethod"
                    companyId:
                      $ref: "#/components/schemas/companyId"
                    highestTeamLevel:
                      $ref: "#/components/schemas/teamLevel"
                    industries:
                      type: array
                      items:
                        $ref: "#/components/schemas/companyIndustry"
                    levelNames:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties:
                        type: string
                    lowestTeamLevel:
                      $ref: "#/components/schemas/teamLevel"
                    name:
                      $ref: "#/components/schemas/__schema376"
                    parentCompanyId:
                      $ref: "#/components/schemas/companyId"
                    salesChannels:
                      type: array
                      items:
                        type: string
                    size:
                      $ref: "#/components/schemas/companySize"
                    timeZone:
                      type: string
                  required:
                    - companyId
              required:
                - company
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                company:
                  companyId: C:company123
                  name: Example Solar Corp
                  accessStatus: active
                  billingEmail: accounts-payable@example.com
                  billingMethod: stripe
                  size: 125
                  industries:
                    - solar
                  salesChannels:
                    - door_to_door
                    - inside_sales
                  highestTeamLevel: 4
                  lowestTeamLevel: 1
                  levelNames:
                    "1": Office
                    "2": Region
                    "3": Division
                    "4": Company
                  timeZone: America/Los_Angeles
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  company:
                    type: object
                    properties:
                      accessStatus:
                        $ref: "#/components/schemas/__schema1002"
                      billingEmail:
                        $ref: "#/components/schemas/__schema1003"
                      billingMethod:
                        $ref: "#/components/schemas/__schema1004"
                      companyId:
                        $ref: "#/components/schemas/companyId"
                      highestTeamLevel:
                        $ref: "#/components/schemas/__schema1005"
                      industries:
                        $ref: "#/components/schemas/__schema1006"
                      levelNames:
                        $ref: "#/components/schemas/__schema1007"
                      lowestTeamLevel:
                        $ref: "#/components/schemas/__schema1008"
                      name:
                        $ref: "#/components/schemas/__schema1009"
                      parentCompanyId:
                        $ref: "#/components/schemas/__schema1010"
                      salesChannels:
                        $ref: "#/components/schemas/__schema1011"
                      size:
                        $ref: "#/components/schemas/__schema1012"
                      timeZone:
                        $ref: "#/components/schemas/__schema1013"
                    required:
                      - accessStatus
                      - companyId
                      - name
                    additionalProperties: false
                required:
                  - type
                  - company
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/add:
    post:
      operationId: connect-app-add-v1
      summary: Add Connect App
      tags:
        - Connect
      description: Creates a Connect app owned by the authenticated user's current
        company, which must grant the `app:manage` permission. The new app
        always starts with `status` `development` (hidden from other companies),
        no permissions, and a draft version `1.0.0` ready for the scripts that
        `terros connect publish` uploads. `description` is a short markdown
        summary. Use the returned `appId` as `appId` in the app's `terros.json`,
        and `/connect/app/update` to change the app afterwards.
      requestBody:
        content:
          application/json:
            example:
              app:
                name: Salesforce
                description: Sync Terros accounts and events with **Salesforce**.
            schema:
              type: object
              properties:
                app:
                  type: object
                  properties:
                    name:
                      $ref: "#/components/schemas/__schema377"
                    description:
                      $ref: "#/components/schemas/__schema378"
                    documentation:
                      $ref: "#/components/schemas/__schema380"
                  required:
                    - name
                  description: Details of the app to create.
              required:
                - app
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                app:
                  appId: App.salesforce
                  companyId: C:company1
                  name: Salesforce
                  documentation: Sync Terros accounts and events with Salesforce.
                  status: development
                  currentVersion: 1.0.0
                  permissions: []
                  validationStatus: none
                  isDeleted: false
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                  description: Sync Terros accounts and events with **Salesforce**.
                  uploadAvatarUrl: https://uploads.example.com/avatars/App.salesforce?signature=example
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  app:
                    description: The created app object.
                    $ref: "#/components/schemas/__schema1042"
                required:
                  - type
                  - app
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/get:
    post:
      operationId: connect-app-get-v1
      summary: Get Connect App
      tags:
        - Connect
      description: Retrieves one Connect app by `appId` along with its versions.
        Published apps are visible to everyone; otherwise the `app:list`
        permission on the app's owning company is required. Only deployed
        versions are returned unless you have the `app:manage` permission on the
        owning company. Use `/connect/app/version/get` to get the scripts
        attached to a specific version.
      requestBody:
        content:
          application/json:
            example:
              appId: App.salesforce
            schema:
              type: object
              properties:
                appId:
                  $ref: "#/components/schemas/AppId"
                includeUploadUrls:
                  $ref: "#/components/schemas/includeUploadUrls"
              required:
                - appId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                app:
                  appId: App.salesforce
                  companyId: C:company1
                  name: Salesforce
                  documentation: Sync Terros accounts and events with Salesforce.
                  status: development
                  currentVersion: 1.0.0
                  permissions:
                    - account:list
                    - account:save
                  validationStatus: none
                  isDeleted: false
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                versions:
                  - versionId: AppVersion.salesforce100
                    appId: App.salesforce
                    appVersion: 1.0.0
                    status: draft
                    changelog: "Initial release: push new accounts to Salesforce as leads."
                    permissions:
                      - account:list
                      - account:save
                    cache:
                      enabled: true
                      ttlSeconds: 300
                    isDeleted: false
                    createdAt: 1753228412133
                    updatedAt: 1753228412133
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  app:
                    $ref: "#/components/schemas/__schema1042"
                  versions:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1043"
                    description: List of versions for the app.
                required:
                  - type
                  - app
                  - versions
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/list:
    post:
      operationId: connect-app-list-v1
      summary: List Connect Apps
      tags:
        - Connect
      description: Lists Connect apps. With no filter it returns the apps owned by the
        authenticated user's current company plus every published app, which are
        the apps that company can install. Pass `companyId` to list only that
        company's own apps, which requires the `app:list` permission on it.
        Filtering by `validationStatus` is for Terros staff only.
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                companyId:
                  description: Filter apps by company ID.
                  $ref: "#/components/schemas/companyId"
                validationStatus:
                  description: Filter apps by validation status.
                  $ref: "#/components/schemas/__schema383"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                apps:
                  - appId: App.salesforce
                    companyId: C:company1
                    name: Salesforce
                    documentation: Sync Terros accounts and events with Salesforce.
                    status: development
                    currentVersion: 1.0.0
                    permissions:
                      - account:list
                      - account:save
                    validationStatus: none
                    isDeleted: false
                    createdAt: 1753228412133
                    updatedAt: 1753228412133
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  apps:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1042"
                required:
                  - type
                  - apps
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/logs:
    post:
      operationId: connect-app-logs-v1
      summary: Get Connect App Logs
      tags:
        - Connect
      description: Retrieves the log lines one Connect script (`scriptId`) wrote while
        it ran, oldest first, for example to confirm that a new install's script
        ran. Pass `installId` to see only that install's company's runs, which
        requires the `install:manage` permission on the install's company.
        Passing `appId` instead returns runs across every company, optionally
        narrowed with `companyId`, and is for Terros staff only. Pass `filter`
        to return only lines containing that exact text (case-sensitive), for
        example an error message; it works with `installId`, `appId` and
        `companyId`, and with `startTime` and `endTime` to set the time range.
        Defaults to the last 30 days; page with `nextToken`. A filtered page can
        hold fewer than `limit` lines, or none, while `nextToken` is still set,
        so keep paging until it is absent.
      x-terros-readOnly: true
      requestBody:
        content:
          application/json:
            example:
              installId: AppInstall.example
              scriptId: AppScript.pushAccount
              filter: timed out
              limit: 100
            schema:
              type: object
              properties:
                installId:
                  description: Install whose logs to retrieve; always limited to its company.
                    Provide exactly one of installId or appId.
                  $ref: "#/components/schemas/AppInstallId"
                appId:
                  description: App whose logs to retrieve across companies. Provide exactly one of
                    installId or appId.
                  $ref: "#/components/schemas/AppId"
                scriptId:
                  description: ID of the script whose logs to retrieve.
                  $ref: "#/components/schemas/AppScriptId"
                companyId:
                  description: Only return logs for this company. Only valid with appId; defaults
                    to all companies.
                  $ref: "#/components/schemas/companyId"
                startTime:
                  description: Start of the time range in UTC epoch milliseconds. Defaults to 30
                    days ago.
                  $ref: "#/components/schemas/__schema384"
                endTime:
                  description: End of the time range in UTC epoch milliseconds. Defaults to now.
                  $ref: "#/components/schemas/__schema385"
                filter:
                  description: "Only return log lines that contain this exact text
                    (case-sensitive). Works with or without companyId. A
                    filtered page can hold fewer than limit lines, or none,
                    while nextToken is still set: keep paging until it is
                    absent."
                  $ref: "#/components/schemas/__schema386"
                limit:
                  description: Maximum number of events to return.
                  $ref: "#/components/schemas/__schema387"
                nextToken:
                  description: Pagination token from a previous response.
                  $ref: "#/components/schemas/__schema388"
              required:
                - scriptId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                logs:
                  - timestamp: 1753228412133
                    message: Pushed account to Salesforce
                    companyId: C:company1
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  logs:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1052"
                    description: Log events, oldest first.
                  nextToken:
                    description: Pagination token for the next page of results, if any.
                    $ref: "#/components/schemas/__schema1057"
                required:
                  - type
                  - logs
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/update:
    post:
      operationId: connect-app-update-v1
      summary: Update Connect App
      tags:
        - Connect
      description: "Updates a Connect app such as its `name`, `description` or
        `status`. Only `appId` is required: send just the fields to change, and
        every field left out keeps its stored value. The app's owning company
        cannot be changed: a `companyId` other than the app's current one is
        rejected with `InvalidRequest`. Use `/connect/app/copy` to copy an app
        into another company. Requires the `app:manage` permission on the app's
        owning company. Setting `status` to `published` requires an approved
        marketplace review and a deployed, non-archived current version. The
        response's `uploadAvatarUrl` is a temporary URL: upload the app's logo
        image to it with an HTTP `PUT` and the image's `Content-Type`."
      requestBody:
        content:
          application/json:
            example:
              app:
                appId: App.salesforce
                description: Sync Terros accounts and events with **Salesforce**.
                status: internal
            schema:
              type: object
              properties:
                app:
                  type: object
                  properties:
                    modifiedBy:
                      $ref: "#/components/schemas/__schema389"
                    createdAt:
                      $ref: "#/components/schemas/__schema390"
                    createdBy:
                      $ref: "#/components/schemas/__schema391"
                    updatedAt:
                      $ref: "#/components/schemas/__schema392"
                    updatedBy:
                      $ref: "#/components/schemas/__schema393"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/__schema394"
                    version:
                      $ref: "#/components/schemas/__schema395"
                    isDeleted:
                      $ref: "#/components/schemas/__schema396"
                    name:
                      $ref: "#/components/schemas/__schema397"
                    description:
                      $ref: "#/components/schemas/__schema398"
                    documentation:
                      $ref: "#/components/schemas/__schema399"
                    appId:
                      $ref: "#/components/schemas/__schema400"
                    companyId:
                      $ref: "#/components/schemas/__schema401"
                    company:
                      $ref: "#/components/schemas/__schema402"
                    status:
                      $ref: "#/components/schemas/__schema404"
                    currentVersion:
                      $ref: "#/components/schemas/__schema405"
                    permissions:
                      $ref: "#/components/schemas/__schema407"
                    avatarUrl:
                      $ref: "#/components/schemas/__schema409"
                    avatarBlurhash:
                      $ref: "#/components/schemas/__schema411"
                    uploadAvatarUrl:
                      $ref: "#/components/schemas/__schema413"
                    privacyPolicy:
                      $ref: "#/components/schemas/__schema415"
                    termsOfService:
                      $ref: "#/components/schemas/__schema417"
                    validationStatus:
                      $ref: "#/components/schemas/__schema419"
                    validationNote:
                      $ref: "#/components/schemas/__schema420"
                    submittedAt:
                      $ref: "#/components/schemas/__schema422"
                    submittedBy:
                      $ref: "#/components/schemas/__schema423"
                    reviewedAt:
                      $ref: "#/components/schemas/__schema424"
                    reviewedBy:
                      $ref: "#/components/schemas/__schema425"
                  required:
                    - appId
                  description: "Fields of the app to change. Only `appId` is required; fields left
                    out keep their stored values. The owning company cannot be
                    changed: a `companyId` other than the app's current one is
                    rejected."
              required:
                - app
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                app:
                  appId: App.salesforce
                  companyId: C:company1
                  name: Salesforce
                  documentation: Sync Terros accounts and events with Salesforce.
                  status: internal
                  currentVersion: 1.0.0
                  permissions:
                    - account:list
                    - account:save
                  validationStatus: none
                  isDeleted: false
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                  description: Sync Terros accounts and events with **Salesforce**.
                  uploadAvatarUrl: https://uploads.example.com/avatars/App.salesforce?signature=example
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  app:
                    $ref: "#/components/schemas/__schema1042"
                required:
                  - type
                  - app
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/version/get:
    post:
      operationId: connect-app-version-get-v1
      summary: Get Connect App Version
      tags:
        - Connect
      description: Retrieves one Connect app version, identified by `appId` and
        `appVersion`, along with the scripts attached to that version. Users
        with the `app:manage` permission on the owning company can see any
        version; others can only see deployed versions of apps they can view.
        Use `/connect/app/get` to list all versions of an app.
      requestBody:
        content:
          application/json:
            example:
              appId: App.salesforce
              appVersion: 1.0.0
            schema:
              type: object
              properties:
                appId:
                  description: ID of the app.
                  $ref: "#/components/schemas/AppId"
                appVersion:
                  description: Version string to retrieve.
                  $ref: "#/components/schemas/__schema406"
              required:
                - appId
                - appVersion
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                appVersion:
                  versionId: AppVersion.salesforce100
                  appId: App.salesforce
                  appVersion: 1.0.0
                  status: draft
                  changelog: "Initial release: push new accounts to Salesforce as leads."
                  permissions:
                    - account:list
                    - account:save
                  cache:
                    enabled: true
                    ttlSeconds: 300
                  isDeleted: false
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
                scripts:
                  - scriptId: AppScript.pushAccount
                    appId: App.salesforce
                    appVersion: 1.0.0
                    name: Push Account to Salesforce
                    description: Set **statusMapping** to map each Terros account status to a
                      Salesforce lead status.
                    type: outgoing
                    dataType: Account
                    configSchema:
                      - name: statusMapping
                        type: mapping
                        description: Maps Terros account statuses to Salesforce lead statuses.
                        dataType: Account
                    authSchema:
                      accessToken: OAuth access token
                    permissions:
                      - account:list
                      - account:save
                    slug: push-account
                    isDeleted: false
                    createdAt: 1753228412133
                    updatedAt: 1753228412133
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  appVersion:
                    description: The requested version object.
                    $ref: "#/components/schemas/__schema1043"
                  scripts:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1058"
                    description: List of scripts associated with this version.
                required:
                  - type
                  - appVersion
                  - scripts
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /connect/app/version/update:
    post:
      operationId: connect-app-version-update-v1
      summary: Update Connect App Version
      tags:
        - Connect
      description: Updates a Connect app version. Draft versions can be freely edited;
        setting `status` to `deployed` makes the version and its scripts live
        and, if it is the newest version, makes it the app's current version.
        After deployment the only allowed change is setting `status` to
        `deprecated`, which is not allowed for the current version of a
        published app. Requires the `app:manage` permission on the app's owning
        company.
      requestBody:
        content:
          application/json:
            example:
              appVersion:
                appId: App.salesforce
                appVersion: 1.0.0
                status: deployed
            schema:
              type: object
              properties:
                appVersion:
                  type: object
                  properties:
                    modifiedBy:
                      $ref: "#/components/schemas/__schema132"
                    createdAt:
                      $ref: "#/components/schemas/auditPropsCreatedAt"
                    createdBy:
                      $ref: "#/components/schemas/auditPropsCreatedBy"
                    updatedAt:
                      $ref: "#/components/schemas/auditPropsUpdatedAt"
                    updatedBy:
                      $ref: "#/components/schemas/auditPropsUpdatedBy"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                    version:
                      $ref: "#/components/schemas/auditPropsVersion"
                    isDeleted:
                      $ref: "#/components/schemas/isDeleted"
                    appId:
                      $ref: "#/components/schemas/AppId"
                    appVersion:
                      $ref: "#/components/schemas/__schema406"
                    status:
                      type: string
                      enum:
                        - draft
                        - deployed
                        - deprecated
                    changelog:
                      description: Markdown description of what changed
                      $ref: "#/components/schemas/__schema426"
                    permissions:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema408"
                    cache:
                      type: object
                      properties:
                        enabled:
                          type: boolean
                        ttlSeconds:
                          type: number
                      required:
                        - enabled
                        - ttlSeconds
                    deployedAt:
                      $ref: "#/components/schemas/utcMilliseconds"
                    versionId:
                      $ref: "#/components/schemas/AppVersionId"
                  required:
                    - appId
                    - appVersion
              required:
                - appVersion
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                appVersion:
                  versionId: AppVersion.salesforce100
                  appId: App.salesforce
                  appVersion: 1.0.0
                  status: deployed
                  changelog: "Initial release: push new accounts to Salesforce as leads."
                  permissions:
                    - account:list
                    - account:save
                  cache:
                    enabled: true
                    ttlSeconds: 300
                  isDeleted: false
                  createdAt: 1753228412133
                  updatedAt: 1753228412133
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  appVersion:
                    description: The updated version object.
                    $ref: "#/components/schemas/__schema1043"
                required:
                  - type
                  - appVersion
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /contact/list:
    post:
      deprecated: true
      operationId: contact-list-v1
      tags:
        - Contact
      summary: List Contacts
      description: >-
        Retrieves contacts (recorded visits to a location, each with a
        disposition) filtered by date range, teams, users, roles, dispositions,
        city, state, zip code, or polygon. `size` sets the page size (10–1000);
        pass the returned `sortTimestamp` to fetch the next page.  
                Deprecated if using [Workflows](https://help.terros.com/en/articles/13518490-workflows-migration-web). Use `/activity/list` instead to list workflow actions.
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                startTime:
                  $ref: "#/components/schemas/__schema246"
                endTime:
                  $ref: "#/components/schemas/__schema247"
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
                dispositionIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema96"
                userIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/userId"
                roleIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/RoleId"
                cities:
                  type: array
                  items:
                    type: string
                states:
                  type: array
                  items:
                    type: string
                zipCodes:
                  type: array
                  items:
                    type: string
                propertyCoordinates:
                  type: array
                  items:
                    $ref: "#/components/schemas/latlng"
                pitch:
                  type: boolean
                sortTimestamp:
                  $ref: "#/components/schemas/__schema192"
                sortBy:
                  type: string
                  enum:
                    - distance
                    - timestamp
                sortOrder:
                  type: string
                  enum:
                    - asc
                    - desc
                query:
                  type: string
                size:
                  type: number
                  minimum: 10
                  maximum: 1000
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                contacts: []
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  contacts:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1074"
                  sortTimestamp:
                    $ref: "#/components/schemas/__schema934"
                  total:
                    $ref: "#/components/schemas/__schema941"
                required:
                  - type
                  - contacts
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /customField/add:
    post:
      operationId: custom-field-add-v1
      summary: Add Custom Field
      tags:
        - Custom Field
      description: Creates a custom field definition for accounts, teams, or users in
        the authenticated company. Requires the `customField:save` permission on
        the company (or on the relevant workflows when `workflowIds` is set).
        Calculation fields are validated before saving. To set a field's value
        on a record, update that account, team, or user instead.
      requestBody:
        content:
          application/json:
            example:
              unsaved:
                tableType: Account
                fieldType: multipleChoice
                label: Lead Source
                description: How this account was sourced.
                short: Source
                required: true
                options:
                  - Door Knock
                  - Referral
                  - Website
                workflowIds:
                  - WF.workflow123
            schema:
              type: object
              properties:
                unsaved:
                  $ref: "#/components/schemas/__schema427"
              required:
                - unsaved
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                customField:
                  tableType: Account
                  fieldType: multipleChoice
                  label: Lead Source
                  description: How this account was sourced.
                  short: Source
                  required: true
                  options:
                    - Door Knock
                    - Referral
                    - Website
                  workflowIds:
                    - WF.workflow123
                  fieldId: CF.leadSource
                  createdAt: 1716249600000
                  updatedAt: 1716249600000
                  version: 1
              schema:
                $ref: "#/components/schemas/__schema1077"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /customField/get:
    post:
      operationId: custom-field-get-v1
      summary: Get Custom Field
      tags:
        - Custom Field
      description: Retrieves a single custom field definition by `fieldId`, including
        its type, label, format, options, and role-based visibility. Use
        `/customField/list` to discover field IDs for an entity type.
      requestBody:
        content:
          application/json:
            example:
              fieldId: CF.leadSource
            schema:
              type: object
              properties:
                fieldId:
                  $ref: "#/components/schemas/CFId"
              required:
                - fieldId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                customField:
                  tableType: Account
                  fieldType: multipleChoice
                  label: Lead Source
                  description: How this account was sourced.
                  short: Source
                  required: true
                  options:
                    - Door Knock
                    - Referral
                    - Website
                  workflowIds:
                    - WF.workflow123
                  fieldId: CF.leadSource
                  createdAt: 1716249600000
                  updatedAt: 1716249600000
                  version: 1
              schema:
                $ref: "#/components/schemas/__schema1077"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /customField/list:
    post:
      operationId: custom-field-list-v1
      summary: List Custom Fields
      tags:
        - Custom Field
      description: Lists custom field definitions in the authenticated company for one
        `tableType` (`Account`, `Team`, or `User`), sorted by display order.
        Account fields are limited to those available for `workflowId`, or to
        workflows visible to you when `workflowId` is omitted. Fields restricted
        to roles you do not have are excluded, as are archived fields unless
        `showArchived` is set. Use `/customField/get` for a single field by ID.
      requestBody:
        content:
          application/json:
            example:
              tableType: Account
              workflowId: WF.workflow123
              showArchived: false
            schema:
              type: object
              properties:
                showArchived:
                  $ref: "#/components/schemas/showArchived"
                tableType:
                  $ref: "#/components/schemas/__schema428"
                workflowId:
                  $ref: "#/components/schemas/WFId"
              required:
                - tableType
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                customFields:
                  - tableType: Account
                    fieldType: multipleChoice
                    label: Lead Source
                    description: How this account was sourced.
                    short: Source
                    required: true
                    options:
                      - Door Knock
                      - Referral
                      - Website
                    workflowIds:
                      - WF.workflow123
                    fieldId: CF.leadSource
                    createdAt: 1716249600000
                    updatedAt: 1716249600000
                    version: 1
                  - tableType: Account
                    fieldType: calculation
                    label: Projected Revenue
                    calculation:
                      operation: multiplication
                      params:
                        - CF.dealValue
                        - 0.25
                    format:
                      prefix: $
                      decimalPlaces: 2
                    fieldId: CF.projectedRevenue
                    createdAt: 1716249600000
                    updatedAt: 1716249600000
                    version: 1
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  customFields:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1078"
                required:
                  - type
                  - customFields
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /customField/remove:
    post:
      operationId: custom-field-remove-v1
      summary: Remove Custom Field
      tags:
        - Custom Field
      description: Archives a custom field by default. Only recently created custom
        fields can be permanently deleted by setting `archive` to `false`.
        Requires the `customField:save` permission on the company. To restore an
        archived field, use `/customField/update` with `isDeleted` set to
        `false`.
      requestBody:
        content:
          application/json:
            example:
              fieldId: CF.leadSource
              archive: true
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                fieldId:
                  $ref: "#/components/schemas/CFId"
              required:
                - fieldId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /customField/update:
    post:
      operationId: custom-field-update-v1
      summary: Update Custom Field
      tags:
        - Custom Field
      description: Updates a custom field definition, such as its label, description,
        format, options, workflows, order, or view and edit roles. Fields that
        are omitted keep their current values. Requires the `customField:save`
        permission on the company (or on the relevant workflows when
        `workflowIds` is set). This changes the field definition, not the values
        stored on records.
      requestBody:
        content:
          application/json:
            example:
              customField:
                tableType: Account
                fieldType: multipleChoice
                label: Original Lead Source
                description: How this account was sourced.
                short: Source
                required: true
                options:
                  - Door Knock
                  - Referral
                  - Website
                workflowIds:
                  - WF.workflow123
                fieldId: CF.leadSource
                createdAt: 1716249600000
                updatedAt: 1716249600000
                version: 1
            schema:
              type: object
              properties:
                customField:
                  allOf:
                    - $ref: "#/components/schemas/__schema427"
                    - type: object
                      properties:
                        modifiedBy:
                          $ref: "#/components/schemas/__schema132"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAt"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAt"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                        version:
                          $ref: "#/components/schemas/auditPropsVersion"
                    - type: object
                      properties:
                        isDeleted:
                          $ref: "#/components/schemas/isDeleted"
                    - type: object
                      properties:
                        fieldId:
                          $ref: "#/components/schemas/CFId"
                      required:
                        - fieldId
              required:
                - customField
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                customField:
                  tableType: Account
                  fieldType: multipleChoice
                  label: Original Lead Source
                  description: How this account was sourced.
                  short: Source
                  required: true
                  options:
                    - Door Knock
                    - Referral
                    - Website
                  workflowIds:
                    - WF.workflow123
                  fieldId: CF.leadSource
                  createdAt: 1716249600000
                  updatedAt: 1716249600000
                  version: 1
              schema:
                $ref: "#/components/schemas/__schema1077"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /disposition/list:
    post:
      deprecated: true
      operationId: disposition-list-v1
      summary: List Dispositions
      tags:
        - Disposition
      description: >-
        Retrieves the dispositions (outcomes such as "Not Home") that can be
        recorded at a location, sorted by display order. Pass `dispositionIds`
        to fetch specific dispositions, or `scopeId` (a company, team, or user
        ID) to list dispositions defined for that scope; omit both to get the
        dispositions that apply to the authenticated user. A team scope must be
        in the caller's downline and a user scope must be the caller.  
              Deprecated if using [Workflows](./workflow). Use `/workflow/get` instead to read a workflow's stages and actions.
      requestBody:
        content:
          application/json:
            example:
              scopeId: C:abc123
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                dispositionIds:
                  description: Only return dispositions matching these IDs
                  $ref: "#/components/schemas/__schema446"
                scopeId:
                  $ref: "#/components/schemas/__schema447"
                fromStatusId:
                  $ref: "#/components/schemas/accountStatusId"
                noFilter:
                  type: boolean
                parentOnly:
                  description: show dispositions for parent accounts only
                  $ref: "#/components/schemas/__schema448"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                dispositions:
                  - scope: user
                    scopeId: U:user123
                    dispositionId: Disposition.1
                    name: Not Home
                    order: 1
                    color: "#FF0000"
                    code: NotHome
                    pitch: true
                    icon: door-closed
                    createAccount: true
                    accountStatusId: AS.notHome
                    scheduleAppointment: true
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  dispositions:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            scope:
                              type: string
                              const: legacy
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            modifiedBy:
                              $ref: "#/components/schemas/__schema807"
                            createdAt:
                              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                            createdBy:
                              $ref: "#/components/schemas/auditPropsCreatedBy"
                            updatedAt:
                              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                            updatedBy:
                              $ref: "#/components/schemas/auditPropsUpdatedBy"
                            lastUpdateProcess:
                              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                            version:
                              $ref: "#/components/schemas/auditPropsVersionOutput"
                            name:
                              $ref: "#/components/schemas/dispositionName"
                            order:
                              $ref: "#/components/schemas/dispositionOrder"
                            color:
                              $ref: "#/components/schemas/dispositionColor"
                            code:
                              $ref: "#/components/schemas/dispositionCode"
                            interaction:
                              $ref: "#/components/schemas/dispositionInteraction"
                            pitch:
                              $ref: "#/components/schemas/dispositionPitch"
                            icon:
                              $ref: "#/components/schemas/__schema1102"
                            createAccount:
                              $ref: "#/components/schemas/dispositionCreateAccount"
                            accountStatusId:
                              $ref: "#/components/schemas/dispositionAccountStatusId"
                            fromStatusId:
                              $ref: "#/components/schemas/dispositionFromStatusId"
                            showIfNoStatusId:
                              $ref: "#/components/schemas/dispositionShowIfNoStatusId"
                            scheduleAppointment:
                              $ref: "#/components/schemas/dispositionScheduleAppointment"
                            occurred:
                              $ref: "#/components/schemas/dispositionOccurred"
                            closed:
                              $ref: "#/components/schemas/dispositionClosed"
                            fault:
                              $ref: "#/components/schemas/dispositionFault"
                            parentOnly:
                              $ref: "#/components/schemas/dispositionParentOnly"
                            eventDateType:
                              $ref: "#/components/schemas/dispositionEventDateType"
                            dispositionId:
                              $ref: "#/components/schemas/__schema907"
                          required:
                            - scope
                            - name
                            - order
                            - color
                            - icon
                            - scheduleAppointment
                            - dispositionId
                          additionalProperties: false
                        - type: object
                          properties:
                            scope:
                              type: string
                              const: company
                            scopeId:
                              $ref: "#/components/schemas/companyId"
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            modifiedBy:
                              $ref: "#/components/schemas/__schema807"
                            createdAt:
                              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                            createdBy:
                              $ref: "#/components/schemas/auditPropsCreatedBy"
                            updatedAt:
                              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                            updatedBy:
                              $ref: "#/components/schemas/auditPropsUpdatedBy"
                            lastUpdateProcess:
                              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                            version:
                              $ref: "#/components/schemas/auditPropsVersionOutput"
                            name:
                              $ref: "#/components/schemas/dispositionName"
                            order:
                              $ref: "#/components/schemas/dispositionOrder"
                            color:
                              $ref: "#/components/schemas/dispositionColor"
                            code:
                              $ref: "#/components/schemas/dispositionCode"
                            interaction:
                              $ref: "#/components/schemas/dispositionInteraction"
                            pitch:
                              $ref: "#/components/schemas/dispositionPitch"
                            icon:
                              $ref: "#/components/schemas/__schema1102"
                            createAccount:
                              $ref: "#/components/schemas/dispositionCreateAccount"
                            accountStatusId:
                              $ref: "#/components/schemas/dispositionAccountStatusId"
                            fromStatusId:
                              $ref: "#/components/schemas/dispositionFromStatusId"
                            showIfNoStatusId:
                              $ref: "#/components/schemas/dispositionShowIfNoStatusId"
                            scheduleAppointment:
                              $ref: "#/components/schemas/dispositionScheduleAppointment"
                            occurred:
                              $ref: "#/components/schemas/dispositionOccurred"
                            closed:
                              $ref: "#/components/schemas/dispositionClosed"
                            fault:
                              $ref: "#/components/schemas/dispositionFault"
                            parentOnly:
                              $ref: "#/components/schemas/dispositionParentOnly"
                            eventDateType:
                              $ref: "#/components/schemas/dispositionEventDateType"
                            dispositionId:
                              $ref: "#/components/schemas/__schema907"
                          required:
                            - scope
                            - scopeId
                            - name
                            - order
                            - color
                            - icon
                            - scheduleAppointment
                            - dispositionId
                          additionalProperties: false
                        - type: object
                          properties:
                            scope:
                              type: string
                              const: team
                            scopeId:
                              $ref: "#/components/schemas/teamId"
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            modifiedBy:
                              $ref: "#/components/schemas/__schema807"
                            createdAt:
                              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                            createdBy:
                              $ref: "#/components/schemas/auditPropsCreatedBy"
                            updatedAt:
                              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                            updatedBy:
                              $ref: "#/components/schemas/auditPropsUpdatedBy"
                            lastUpdateProcess:
                              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                            version:
                              $ref: "#/components/schemas/auditPropsVersionOutput"
                            name:
                              $ref: "#/components/schemas/dispositionName"
                            order:
                              $ref: "#/components/schemas/dispositionOrder"
                            color:
                              $ref: "#/components/schemas/dispositionColor"
                            code:
                              $ref: "#/components/schemas/dispositionCode"
                            interaction:
                              $ref: "#/components/schemas/dispositionInteraction"
                            pitch:
                              $ref: "#/components/schemas/dispositionPitch"
                            icon:
                              $ref: "#/components/schemas/__schema1102"
                            createAccount:
                              $ref: "#/components/schemas/dispositionCreateAccount"
                            accountStatusId:
                              $ref: "#/components/schemas/dispositionAccountStatusId"
                            fromStatusId:
                              $ref: "#/components/schemas/dispositionFromStatusId"
                            showIfNoStatusId:
                              $ref: "#/components/schemas/dispositionShowIfNoStatusId"
                            scheduleAppointment:
                              $ref: "#/components/schemas/dispositionScheduleAppointment"
                            occurred:
                              $ref: "#/components/schemas/dispositionOccurred"
                            closed:
                              $ref: "#/components/schemas/dispositionClosed"
                            fault:
                              $ref: "#/components/schemas/dispositionFault"
                            parentOnly:
                              $ref: "#/components/schemas/dispositionParentOnly"
                            eventDateType:
                              $ref: "#/components/schemas/dispositionEventDateType"
                            dispositionId:
                              $ref: "#/components/schemas/__schema907"
                          required:
                            - scope
                            - scopeId
                            - name
                            - order
                            - color
                            - icon
                            - scheduleAppointment
                            - dispositionId
                          additionalProperties: false
                        - type: object
                          properties:
                            scope:
                              type: string
                              const: user
                            scopeId:
                              $ref: "#/components/schemas/userId"
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            modifiedBy:
                              $ref: "#/components/schemas/__schema807"
                            createdAt:
                              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                            createdBy:
                              $ref: "#/components/schemas/auditPropsCreatedBy"
                            updatedAt:
                              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                            updatedBy:
                              $ref: "#/components/schemas/auditPropsUpdatedBy"
                            lastUpdateProcess:
                              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                            version:
                              $ref: "#/components/schemas/auditPropsVersionOutput"
                            name:
                              $ref: "#/components/schemas/dispositionName"
                            order:
                              $ref: "#/components/schemas/dispositionOrder"
                            color:
                              $ref: "#/components/schemas/dispositionColor"
                            code:
                              $ref: "#/components/schemas/dispositionCode"
                            interaction:
                              $ref: "#/components/schemas/dispositionInteraction"
                            pitch:
                              $ref: "#/components/schemas/dispositionPitch"
                            icon:
                              $ref: "#/components/schemas/__schema1102"
                            createAccount:
                              $ref: "#/components/schemas/dispositionCreateAccount"
                            accountStatusId:
                              $ref: "#/components/schemas/dispositionAccountStatusId"
                            fromStatusId:
                              $ref: "#/components/schemas/dispositionFromStatusId"
                            showIfNoStatusId:
                              $ref: "#/components/schemas/dispositionShowIfNoStatusId"
                            scheduleAppointment:
                              $ref: "#/components/schemas/dispositionScheduleAppointment"
                            occurred:
                              $ref: "#/components/schemas/dispositionOccurred"
                            closed:
                              $ref: "#/components/schemas/dispositionClosed"
                            fault:
                              $ref: "#/components/schemas/dispositionFault"
                            parentOnly:
                              $ref: "#/components/schemas/dispositionParentOnly"
                            eventDateType:
                              $ref: "#/components/schemas/dispositionEventDateType"
                            dispositionId:
                              $ref: "#/components/schemas/__schema907"
                          required:
                            - scope
                            - scopeId
                            - name
                            - order
                            - color
                            - icon
                            - scheduleAppointment
                            - dispositionId
                          additionalProperties: false
                required:
                  - type
                  - dispositions
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /evaluation/add:
    post:
      operationId: evaluation-add-v1
      summary: Add Evaluation
      tags:
        - Evaluation
      description: "Requests a new pending evaluation for a user. Omit `userId` to
        create one for the authenticated user. A user can have only one pending
        evaluation: requesting your own returns the existing pending evaluation,
        while requesting one for another user who already has one fails. The
        user must belong to a team. Requires the `evaluation:add` permission for
        the user."
      requestBody:
        content:
          application/json:
            example:
              userId: U:123
            schema:
              type: object
              properties:
                userId:
                  description: leave blank to create an evaluation for yourself
                  $ref: "#/components/schemas/userId"
                accountId:
                  $ref: "#/components/schemas/accountId"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                evaluation:
                  evaluationId: Eval.123
                  evalState: Pending
                  possible: 10
                  eventDate: 9007199254740991
                  evalDate: 9007199254740991
                  teamId: Team.123
                  categories: []
                  createdAt: 1793992789035
                  createdBy: U:123
                  updatedAt: 1793992789035
                  updatedBy: U:123
                  user:
                    userId: U:123
                    firstName: John
                    lastName: Doe
                  uploadUrl: https://uploadurl
                  downloadUrl: https://downloadurl
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  evaluation:
                    $ref: "#/components/schemas/__schema1109"
                required:
                  - type
                  - evaluation
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /evaluation/get:
    post:
      operationId: evaluation-get-v1
      summary: Get Evaluation
      tags:
        - Evaluation
      description: Retrieves a single evaluation by its ID, including its state,
        categories, and recording URLs. Requires the `evaluation:list`
        permission for the evaluated user or the evaluator. Use
        `/evaluation/list` instead to find evaluations for a user.
      requestBody:
        content:
          application/json:
            example:
              evaluationId: Eval.123
            schema:
              type: object
              properties:
                evaluationId:
                  $ref: "#/components/schemas/EvalId"
              required:
                - evaluationId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                evaluation:
                  evaluationId: Eval.123
                  evalState: Pending
                  possible: 10
                  eventDate: 9007199254740991
                  evalDate: 9007199254740991
                  teamId: Team.123
                  categories: []
                  createdAt: 1793992789035
                  createdBy: U:123
                  updatedAt: 1793992789035
                  updatedBy: U:123
                  user:
                    userId: U:123
                    firstName: John
                    lastName: Doe
                  uploadUrl: https://uploadurl
                  downloadUrl: https://downloadurl
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  evaluation:
                    $ref: "#/components/schemas/__schema1109"
                required:
                  - type
                  - evaluation
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /evaluation/list:
    post:
      operationId: evaluation-list-v1
      summary: List Evaluations
      tags:
        - Evaluation
      description: "Lists evaluations relevant to a user: evaluations of the user,
        evaluations assigned to the user as evaluator, and evaluations for teams
        the user directly manages. Omit `userId` to use the authenticated user.
        Archived evaluations are excluded. Requires the `evaluation:list`
        permission for the user. Returns summary records; use `/evaluation/get`
        for full details."
      requestBody:
        content:
          application/json:
            example:
              userId: U:123
            schema:
              type: object
              properties:
                userId:
                  $ref: "#/components/schemas/userId"
                startDate:
                  description: "Not applied yet: the list is not filtered by date. Pass UTC epoch
                    milliseconds, as other evaluation dates use."
                  $ref: "#/components/schemas/__schema449"
                endDate:
                  description: "Not applied yet: the list is not filtered by date. Pass UTC epoch
                    milliseconds, as other evaluation dates use."
                  $ref: "#/components/schemas/__schema450"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                evaluations: []
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  evaluations:
                    type: array
                    items:
                      type: object
                      properties:
                        evaluationId:
                          $ref: "#/components/schemas/EvalId"
                        teamId:
                          $ref: "#/components/schemas/evaluationTeamId"
                        evalState:
                          $ref: "#/components/schemas/evaluationEvalState"
                        eventDate:
                          $ref: "#/components/schemas/evaluationEventDateOutput"
                        evalDate:
                          $ref: "#/components/schemas/evaluationEvalDateOutput"
                        user:
                          $ref: "#/components/schemas/tinyUserOutput"
                        evaluator:
                          $ref: "#/components/schemas/evaluationEvaluatorOutput"
                        score:
                          $ref: "#/components/schemas/evaluationScoreOutput"
                        possible:
                          $ref: "#/components/schemas/evaluationPossible"
                        locationId:
                          $ref: "#/components/schemas/__schema1119"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                      required:
                        - evaluationId
                        - evalState
                        - user
                        - possible
                      additionalProperties: false
                required:
                  - type
                  - evaluations
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /evaluation/remove:
    post:
      operationId: evaluation-remove-v1
      summary: Remove Evaluation
      tags:
        - Evaluation
      description: Removes an evaluation by its ID. By default the evaluation is
        archived; set `archive` to `false` to delete it permanently. Requires
        the `evaluation:delete` permission for the evaluated user or the
        evaluator.
      requestBody:
        content:
          application/json:
            example:
              evaluationId: Eval.123
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                evaluationId:
                  $ref: "#/components/schemas/EvalId"
              required:
                - evaluationId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /evaluation/update:
    post:
      operationId: evaluation-update-v1
      summary: Update Evaluation
      tags:
        - Evaluation
      description: Updates an evaluation, for example to change its state, evaluator,
        or categories. Send the complete evaluation object (as returned by
        `/evaluation/get`) with your changes, because it replaces the stored
        evaluation. Requires the `evaluation:add` permission for the evaluated
        user or the evaluator.
      requestBody:
        content:
          application/json:
            example:
              evaluation:
                evaluationId: Eval.123
                evalState: Pending
                possible: 10
                categories: []
                user:
                  userId: U:123
                  firstName: John
                  lastName: Doe
            schema:
              type: object
              properties:
                evaluation:
                  type: object
                  properties:
                    isDeleted:
                      $ref: "#/components/schemas/isDeleted"
                    modifiedBy:
                      $ref: "#/components/schemas/__schema132"
                    createdAt:
                      $ref: "#/components/schemas/auditPropsCreatedAt"
                    createdBy:
                      $ref: "#/components/schemas/auditPropsCreatedBy"
                    updatedAt:
                      $ref: "#/components/schemas/auditPropsUpdatedAt"
                    updatedBy:
                      $ref: "#/components/schemas/auditPropsUpdatedBy"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                    version:
                      $ref: "#/components/schemas/auditPropsVersion"
                    evaluationId:
                      $ref: "#/components/schemas/EvalId"
                    evalState:
                      $ref: "#/components/schemas/evaluationEvalState"
                    user:
                      $ref: "#/components/schemas/tinyUser"
                    teamId:
                      $ref: "#/components/schemas/evaluationTeamId"
                    possible:
                      $ref: "#/components/schemas/evaluationPossible"
                    categories:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema451"
                    selfAssessment:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema451"
                    eventDate:
                      $ref: "#/components/schemas/evaluationEventDate"
                    evaluator:
                      $ref: "#/components/schemas/evaluationEvaluator"
                    evalDate:
                      $ref: "#/components/schemas/evaluationEvalDate"
                    score:
                      $ref: "#/components/schemas/evaluationScore"
                    comment:
                      $ref: "#/components/schemas/evaluationComment"
                    downloadUrl:
                      $ref: "#/components/schemas/evaluationDownloadUrl"
                    uploadUrl:
                      $ref: "#/components/schemas/evaluationUploadUrl"
                    locationId:
                      description: The location ID where the pitch was recorded
                      $ref: "#/components/schemas/locationId"
                    location:
                      $ref: "#/components/schemas/__schema458"
                    accountId:
                      $ref: "#/components/schemas/evaluationAccountId"
                    feedback:
                      type: array
                      items:
                        type: object
                        properties:
                          prompt:
                            type: string
                          feedback:
                            type: string
                        required:
                          - prompt
                          - feedback
                  required:
                    - evaluationId
                    - evalState
                    - user
                    - possible
                    - categories
              required:
                - evaluation
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                evaluation:
                  evaluationId: Eval.123
                  evalState: PendingScore
                  possible: 10
                  eventDate: 9007199254740991
                  evalDate: 9007199254740991
                  teamId: Team.123
                  categories: []
                  createdAt: 1793992789035
                  createdBy: U:123
                  updatedAt: 1793992789035
                  updatedBy: U:123
                  user:
                    userId: U:123
                    firstName: John
                    lastName: Doe
                  uploadUrl: https://uploadurl
                  downloadUrl: https://downloadurl
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  evaluation:
                    $ref: "#/components/schemas/__schema1109"
                required:
                  - type
                  - evaluation
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /export/add:
    post:
      operationId: export-add-v1
      summary: Add Export
      tags:
        - Export
      description: >-
        Creates a new export job for accounts, calendar events, users, tasks, or
        activities and returns it immediately with `exportId` and `status`
        (`New`). The export is processed asynchronously. Poll /export/get with
        the returned `exportId` to check the status, then use /export/download
        to retrieve the files once completed. Requires the `export:manage`
        permission; exported records are limited to the teams that permission
        covers.


        **Formats.** Each export file holds up to 50,000 records. `json` files
        are a single valid JSON array. `jsonl` files contain one JSON object per
        line, with no surrounding array and no separating commas. `csv` files
        start with a header row.


        See the `fields` request property for field selection and optional
        fields.
      requestBody:
        content:
          application/json:
            example:
              export:
                type: Account
                format: csv
                compression: none
                filter: {}
            schema:
              type: object
              properties:
                export:
                  type: object
                  properties:
                    name:
                      description: Optional user-defined name for the export
                      $ref: "#/components/schemas/__schema461"
                    type:
                      type: string
                      enum:
                        - CalendarEvent
                        - Account
                        - User
                        - Task
                        - Activity
                      description: Supported entities for export
                    format:
                      default: json
                      description: Format of the export files. `json` writes each file as one JSON
                        array of records. `jsonl` (JSON Lines) writes one JSON
                        object per line with no surrounding array, which is
                        easier to stream. `csv` writes a header row followed by
                        one row per record.
                      $ref: "#/components/schemas/__schema462"
                    compression:
                      description: Compression method for the export file
                      $ref: "#/components/schemas/__schema463"
                    range:
                      description: Optional date range for the export. If not provided, the entire
                        data set will be exported
                      $ref: "#/components/schemas/__schema464"
                    filter:
                      type: object
                      properties:
                        areaIds:
                          description: Filter account export to the specified areas
                          $ref: "#/components/schemas/__schema465"
                        areaCoordinates:
                          description: Filter account export to accounts within these area boundaries
                          $ref: "#/components/schemas/__schema466"
                        workflowId:
                          description: Filter accounts by the specified workflow ID
                          $ref: "#/components/schemas/WFId"
                        teamIds:
                          description: Filter exported data to these teams (set by downline scope)
                          $ref: "#/components/schemas/__schema467"
                        userIds:
                          description: Filter exported activity/contact data to these users
                          $ref: "#/components/schemas/__schema468"
                        workflowActionIds:
                          description: Filter workflow activity export to these action IDs
                          $ref: "#/components/schemas/__schema469"
                        cities:
                          description: Filter workflow activity export to these cities
                          $ref: "#/components/schemas/__schema470"
                        states:
                          description: Filter workflow activity export to these states
                          $ref: "#/components/schemas/__schema471"
                        zipCodes:
                          description: Filter workflow activity export to these ZIP codes
                          $ref: "#/components/schemas/__schema472"
                        dispositionIds:
                          description: Filter legacy contact activity export to these disposition IDs
                          $ref: "#/components/schemas/__schema473"
                        statusIds:
                          description: Filter account export to these statuses
                          $ref: "#/components/schemas/__schema474"
                        stageIds:
                          description: Filter account export to these workflow stages
                          $ref: "#/components/schemas/__schema475"
                        searchByCurrentStage:
                          description: Whether to filter account export to only accounts currently in the
                            selected stages, rather than accounts that ever
                            passed through them. The default value is true
                          $ref: "#/components/schemas/__schema476"
                        roleIds:
                          description: Filter exported users, or account owners/closers, to these roles
                          $ref: "#/components/schemas/__schema477"
                        coordinates:
                          description: Filter account export to accounts within this polygon
                          $ref: "#/components/schemas/__schema478"
                        advancedCustomFields:
                          description: Filter account export to these custom field values
                          $ref: "#/components/schemas/__schema156"
                    fields:
                      description: >-
                        Optional list of field keys to include in the export
                        (standard field keys or custom field IDs). Only
                        supported for the Account export type. If omitted, all
                        fields are included.


                        Account exports can also include these fields. They are
                        enabled per company on request; contact Terros support
                        to turn them on. For companies without them enabled,
                        requesting one of these keys is accepted but the field
                        is left out of the export.


                        - `lastModifiedBy`: user ID of the most recent modifier
                        of the account

                        - `updatedAt`: when the account was last updated, in UTC
                        milliseconds

                        - `lastUpdateProcess`: name of the process that last
                        updated the account. This value is informational and is
                        subject to change without notice; do not build logic
                        that depends on specific values.

                        - `importId`: ID of the import that created the account

                        - `ownerHistory`: history of account owners, in the same
                        shape as the Account API

                        - `teamHistory`: history of account teams, in the same
                        shape as the Account API

                        - `workflowHistory`: when enabled, selecting
                        `workflowHistory` (or omitting `fields`) also includes
                        the workflow stages and actions the account has
                        progressed through, in the same shape as the Account API


                        In CSV files these columns come after any status, stage,
                        and custom field columns, so existing column positions
                        do not change. Array values are written as a JSON string
                        in a single cell.
                      $ref: "#/components/schemas/__schema479"
                  required:
                    - type
                    - filter
              required:
                - export
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                export:
                  exportId: Export.export123
                  type: Account
                  format: csv
                  compression: none
                  filter: {}
                  companyId: C:company123
                  total: 500
                  processed: 0
                  status: New
                  updatedAt: 1672531200000
                  expiresAt: 1672531200
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  export:
                    $ref: "#/components/schemas/__schema1129"
                required:
                  - type
                  - export
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /export/get:
    post:
      operationId: export-get-v1
      summary: Get Export
      tags:
        - Export
      description: Get one export by its ID, including its current status and
        progress. Returns the same export object as /export/list. Use this to
        check whether an export you created with /export/add has completed
        before calling /export/download. Requires the `export:manage` permission
        for the export. Returns a `NotFound` error when the export does not
        exist, belongs to another company, or is outside the caller's
        `export:manage` scope.
      requestBody:
        content:
          application/json:
            example:
              exportId: Export.export123
            schema:
              type: object
              properties:
                exportId:
                  $ref: "#/components/schemas/ExportId"
              required:
                - exportId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                export:
                  exportId: Export.export123
                  type: Account
                  format: csv
                  compression: none
                  filter: {}
                  companyId: C:company123
                  total: 500
                  processed: 0
                  status: New
                  updatedAt: 1672531200000
                  expiresAt: 1672531200
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  export:
                    $ref: "#/components/schemas/__schema1129"
                required:
                  - type
                  - export
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /export/list:
    post:
      operationId: export-list-v1
      summary: List Exports
      tags:
        - Export
      description: Lists exports for the current user's company, most recently updated
        first, including each export's status and progress. Only exports the
        caller can manage (`export:manage` permission) are returned. Use
        /export/get instead when you already have an export ID.
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              $ref: "#/components/schemas/__schema480"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                exports:
                  - exportId: Export.export123
                    type: Account
                    format: csv
                    compression: none
                    filter: {}
                    companyId: C:company123
                    total: 500
                    processed: 0
                    status: New
                    updatedAt: 1672531200000
                    expiresAt: 1672531200
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  exports:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1129"
                required:
                  - type
                  - exports
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /export/download:
    post:
      operationId: export-download-v1
      x-terros-readOnly: true
      summary: Download Export
      tags:
        - Export
      description: Retrieve pre-signed download URLs for a completed export. Large
        exports may be split across multiple files (up to 50,000 records each),
        each with its own URL. `urls` is empty when the export matched no
        records. File names end in `.json`, `.jsonl`, or `.csv` to match the
        export format, plus `.gz` when gzip compression is used. Each URL
        downloads its file as an attachment under that file name. Requires the
        `export:manage` permission for the export.
      requestBody:
        content:
          application/json:
            example:
              exportId: Export.export123
            schema:
              type: object
              properties:
                exportId:
                  $ref: "#/components/schemas/ExportId"
              required:
                - exportId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                urls:
                  - https://s3.amazonaws.com/terros-exports/Export.export123/part-1.csv?X-Amz-Signature=...
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  urls:
                    type: array
                    items:
                      type: string
                required:
                  - type
                  - urls
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /export/remove:
    post:
      operationId: export-remove-v1
      summary: Remove Export
      tags:
        - Export
      description: Permanently delete an export record and its associated files.
        Succeeds without error if the export no longer exists. Requires the
        `export:manage` permission for the export.
      requestBody:
        content:
          application/json:
            example:
              exportId: Export.export123
            schema:
              type: object
              properties:
                exportId:
                  $ref: "#/components/schemas/ExportId"
              required:
                - exportId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /externalLink/get:
    post:
      operationId: externalLink-get-v1
      summary: Get External Link
      tags:
        - External Link
      description: Gets one external link by ID, including its label, URL, stored
        company or team `scopeId`, and any current record metadata returned by
        the API. Requires `externalLink:list` for the stored scope. A link
        outside the caller's permission scope remains unavailable. Use
        `/externalLink/list` to discover links currently visible to the caller.
      requestBody:
        content:
          application/json:
            example:
              externalLinkId: ExternalLink.example
            schema:
              type: object
              properties:
                externalLinkId:
                  $ref: "#/components/schemas/ExternalLinkId"
              required:
                - externalLinkId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                externalLink:
                  externalLinkId: ExternalLink.example
                  label: Sales resources
                  url: https://example.com/resources
                  description: Resources for the sales team
                  scopeId: Team.example
                  order: 1
                  userId: U.example
                  companyId: C.example
                  updatedAt: 1725000000000
                  version: 2
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  externalLink:
                    $ref: "#/components/schemas/__schema1151"
                required:
                  - type
                  - externalLink
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /externalLink/list:
    post:
      operationId: externalLink-list-v1
      summary: List External Links
      tags:
        - External Link
      description: "Lists external links in the caller's current company, including
        each link's label, URL, stored company or team `scopeId`, and any
        current record metadata returned by the API. By default, effective
        visibility follows the existing scope rules: company-scoped links and
        team-scoped links in the caller's upline are returned. Set `fetchAll` to
        return every link in the current company; this requires
        `externalLink:manage` for that company. The request accepts no company
        argument and cannot inspect another company."
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                showArchived:
                  $ref: "#/components/schemas/showArchived"
                fetchAll:
                  description: If true, return all external links in the caller's current company.
                    Requires `externalLink:manage` for that company.
                  $ref: "#/components/schemas/__schema481"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                externalLinks:
                  - externalLinkId: ExternalLink.example
                    label: Sales resources
                    url: https://example.com/resources
                    description: Resources for the sales team
                    scopeId: Team.example
                    order: 1
                    userId: U.example
                    companyId: C.example
                    updatedAt: 1725000000000
                    version: 2
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  externalLinks:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1151"
                required:
                  - type
                  - externalLinks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /game/get:
    post:
      operationId: game-get-v1
      summary: Get game
      tags:
        - Game
      description: Retrieves one game and its participants. The owner may retrieve
        their game, and an active (not removed) participant may retrieve a
        published, active, or finished game. Other callers require `game:list`
        permission scoped to the owner or company. The response includes the
        game type, owner and company scope, participant settings, and
        participants visible through this read.
      requestBody:
        content:
          application/json:
            example:
              gameId: Game.example
            schema:
              type: object
              properties:
                gameId:
                  $ref: "#/components/schemas/GameId"
                termRenderer:
                  $ref: "#/components/schemas/__schema482"
                includeUploadUrls:
                  $ref: "#/components/schemas/includeUploadUrls"
              required:
                - gameId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                game:
                  gameId: Game.example
                  companyId: C.example
                  ownerId: U.owner-example
                  name: Summer Sales Challenge
                  startDate: 1782864000000
                  endDate: 1785456000000
                  status: published
                  gameType: ladder
                  currentRound: 1
                  awards: []
                  criteria: []
                  settings:
                    participantType: user
                participants:
                  - type: user
                    participantId: U.participant-example
                    firstName: Alex
                    lastName: Example
                    pointsUpdatedAt: 1782864000000
                    isDeleted: false
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  game:
                    $ref: "#/components/schemas/__schema1152"
                  participants:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1204"
                    description: The participants of the game
                required:
                  - type
                  - game
                  - participants
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /game/list:
    post:
      operationId: game-list-v1
      summary: List games
      tags:
        - Game
      description: "Lists games in the authenticated user’s company that the caller
        may view. Owners see their games, active participants see non-draft
        games they participate in, and other non-draft games require `game:list`
        permission scoped to the game owner or company. Filter by date range or
        archived state. Results include each game’s type, owner and company
        scope, and participant settings; use `/game/get` for participants. Not a
        pure read, by design: as intended housekeeping for abandoned drafts, it
        permanently deletes the caller’s own matched `draft` games that were
        never edited after creation and are more than a month old, with their
        participant records, and omits them from the results. It never deletes
        other users’ games or non-draft games."
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                startTime:
                  $ref: "#/components/schemas/__schema246"
                endTime:
                  $ref: "#/components/schemas/__schema247"
                archived:
                  $ref: "#/components/schemas/archived"
                termRenderer:
                  $ref: "#/components/schemas/__schema482"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                games:
                  - gameId: Game.example
                    companyId: C.example
                    ownerId: U.owner-example
                    name: Summer Sales Challenge
                    startDate: 1782864000000
                    endDate: 1785456000000
                    status: published
                    gameType: ladder
                    currentRound: 1
                    awards: []
                    criteria: []
                    settings:
                      participantType: user
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  games:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1152"
                required:
                  - type
                  - games
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /import/add:
    post:
      operationId: import-add-v1
      summary: Add Import
      tags:
        - Import
      description: "Initiates a new import job and returns a pre-signed URL to upload
        the file. Use CSV for most entities, or KML/KMZ for Area. Upload Area
        files with Content-Type: application/octet-stream; upload CSV files with
        Content-Type: text/csv. After upload, processing begins automatically.
        CSV files support at most 500 columns, including unmapped columns.
        Account imports reject files with more than 5,000 rows missing latitude
        or longitude, regardless of disableGeocoding. Records are split into
        batches and processed through a shared queue with controlled
        parallelism. Splitting files does not increase worker capacity, and
        completion times can vary with workload. Requires the import permission
        for the entity (for example `account:import`, `user:import`, or
        `area:add` for Area). Track progress with /import/get or /import/list.
        See [Importing Data](/docs/info/import#file-limits-and-sizing) for
        sizing guidance and processing behavior."
      requestBody:
        content:
          application/json:
            example:
              entity: Account
              name: Q1 Account Import
              disableGeocoding: false
              addMissingUsers: false
              createCustomLocations: false
            schema:
              type: object
              properties:
                entity:
                  $ref: "#/components/schemas/__schema483"
                name:
                  $ref: "#/components/schemas/__schema484"
                disableGeocoding:
                  $ref: "#/components/schemas/__schema485"
                addMissingUsers:
                  $ref: "#/components/schemas/__schema487"
                createCustomLocations:
                  $ref: "#/components/schemas/__schema489"
                cleanupLocation:
                  $ref: "#/components/schemas/__schema491"
                notifyUsers:
                  $ref: "#/components/schemas/__schema493"
                skipDuplicates:
                  $ref: "#/components/schemas/__schema495"
                assignAreasOnExisting:
                  $ref: "#/components/schemas/__schema497"
                workflowId:
                  $ref: "#/components/schemas/__schema499"
                columnMapping:
                  $ref: "#/components/schemas/__schema500"
                contentLength:
                  $ref: "#/components/schemas/__schema503"
                contentType:
                  $ref: "#/components/schemas/__schema504"
              required:
                - entity
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                url: https://s3.amazonaws.com/terros-imports/imports/Import:import123/upload.csv?X-Amz-Signature=...
                importData:
                  importId: Import:import123
                  entity: Account
                  name: Q1 Account Import
                  importStatus: Completed
                  ownerId: U:user123
                  companyId: C:company123
                  headers:
                    - firstName
                    - lastName
                    - address
                    - city
                    - state
                    - zip
                  successes: 150
                  errors: 3
                  skipped: 0
                  totalMessages: 153
                  updatedAt: 1672531200000
                  completedAt: 1672531200000
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  url:
                    type: string
                    format: uri
                  importData:
                    $ref: "#/components/schemas/__schema1208"
                required:
                  - type
                  - url
                  - importData
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /import/get:
    post:
      operationId: import-get-v1
      summary: Get Import
      tags:
        - Import
      description: Retrieve the status and details of a single import by its ID,
        including success, error, and skipped counts. For failed rows, use
        /import/errors. Address-resolution failures distinguish invalid supplied
        coordinates from addresses not found in the lookups used by the import.
        Use this to poll an import you started with /import/add. Use
        /import/list instead to browse or find imports when you do not have the
        ID. Requires the import permission for the entity, scoped to the import
        owner.
      requestBody:
        content:
          application/json:
            example:
              importId: Import:import123
            schema:
              type: object
              properties:
                importId:
                  $ref: "#/components/schemas/ImportId"
              required:
                - importId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                log:
                  importId: Import:import123
                  entity: Account
                  name: Q1 Account Import
                  importStatus: Completed
                  ownerId: U:user123
                  companyId: C:company123
                  headers:
                    - firstName
                    - lastName
                    - address
                    - city
                    - state
                    - zip
                  successes: 150
                  errors: 3
                  skipped: 0
                  totalMessages: 153
                  updatedAt: 1672531200000
                  completedAt: 1672531200000
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  log:
                    $ref: "#/components/schemas/__schema1208"
                required:
                  - type
                  - log
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /import/list:
    post:
      operationId: import-list-v1
      summary: List Imports
      tags:
        - Import
      description: Retrieve a page of imports for the current company, newest first.
        Pass the previous response cursor to fetch the next page. `size`
        defaults to 100 (maximum 1,000). Archived imports are excluded unless
        archived is set. Only imports the caller has the import permission for
        are returned. Use /import/get instead when you already have an import
        ID.
      requestBody:
        content:
          application/json:
            example:
              size: 30
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                companyId:
                  $ref: "#/components/schemas/companyId"
                size:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 1000
                cursor:
                  type: object
                  propertyNames:
                    $ref: "#/components/schemas/__schema505"
                  additionalProperties:
                    $ref: "#/components/schemas/__schema506"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                logs:
                  - importId: Import:import123
                    entity: Account
                    name: Q1 Account Import
                    importStatus: Completed
                    ownerId: U:user123
                    companyId: C:company123
                    headers:
                      - firstName
                      - lastName
                      - address
                      - city
                      - state
                      - zip
                    successes: 150
                    errors: 3
                    skipped: 0
                    totalMessages: 153
                    updatedAt: 1672531200000
                    completedAt: 1672531200000
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  logs:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1208"
                  cursor:
                    type: object
                    propertyNames:
                      $ref: "#/components/schemas/__schema1221"
                    additionalProperties:
                      $ref: "#/components/schemas/__schema1222"
                required:
                  - type
                  - logs
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /import/errors:
    post:
      operationId: import-errors-v1
      x-terros-readOnly: true
      summary: Get Import Errors
      tags:
        - Import
      description: Retrieve the error records for an import. Each record contains a
        pre-signed URL to download the raw error data for that row. When a row
        has no coordinate columns and its address cannot be resolved, the stored
        row error names the address lookups that ran and explains that a new
        address can take up to about a quarter to appear in First American
        address data; adding latitude and longitude and re-importing with the
        same settings places the pin at those coordinates. Rows with missing or
        invalid values in supplied coordinate columns instead identify those
        columns. Use this when /import/get or /import/list reports errors for an
        import. Requires the import permission for the entity, scoped to the
        import owner.
      requestBody:
        content:
          application/json:
            example:
              importId: Import:import123
            schema:
              type: object
              properties:
                importId:
                  $ref: "#/components/schemas/ImportId"
              required:
                - importId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                records:
                  - key: imports/Import:import123/errors/row-42.json
                    signedUrl: https://s3.amazonaws.com/terros-imports/imports/Import:import123/errors/row-42.json?X-Amz-Signature=...
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        signedUrl:
                          type: string
                      required:
                        - key
                        - signedUrl
                      additionalProperties: false
                required:
                  - type
                  - records
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /import/cleanup:
    post:
      operationId: import-cleanup-v1
      x-terros-destructive: true
      summary: Cleanup Import
      tags:
        - Import
      description: Rolls back and removes all records that were created by the
        specified import. Use this to undo an import that contained incorrect
        data. The rollback runs asynchronously after the request returns.
        Requires the import permission for the entity, scoped to the import
        owner.
      requestBody:
        content:
          application/json:
            example:
              entity: Account
              importId: Import:import123
              fullRun: true
            schema:
              type: object
              properties:
                entity:
                  type: string
                  enum:
                    - Account
                    - Area
                    - CalendarEvent
                    - Contact
                    - Task
                    - User
                importId:
                  $ref: "#/components/schemas/ImportId"
                fullRun:
                  type: boolean
              required:
                - entity
                - importId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /location/disposition:
    post:
      deprecated: true
      operationId: location-disposition-v1
      summary: Disposition Location
      tags:
        - Location
      externalDocs:
        description: Workflows are the preferred way to manage dispositions.
        url: https://docs.terros.com/workflows/overview
      description: >-
        Records a disposition (such as "Not Home") at a location and returns the
        updated location. Get valid disposition IDs from `/disposition/list`.  
              Deprecated if using [Workflows](https://help.terros.com/en/articles/13518490-workflows-migration-web). With Workflows, use `/account/update` with a `workflowActionId` instead.
      requestBody:
        content:
          application/json:
            example:
              dispositionId: Disposition.1
              pitch: true
              method: door
              teamId: Team.1
              setterId: U.1
              location:
                line1: 123 Main St
                locality: Anytown
                countrySubd: US
                postal1: "12345"
                latlng:
                  latitude: 23.9
                  longitude: 120.1
            schema:
              type: object
              properties:
                dispositionId:
                  $ref: "#/components/schemas/__schema96"
                locationId:
                  $ref: "#/components/schemas/locationId"
                pitch:
                  type: boolean
                method:
                  $ref: "#/components/schemas/contactMethod"
                deviceLocation:
                  $ref: "#/components/schemas/latlng"
                bypassDuplicateCheck:
                  type: boolean
                contactId:
                  $ref: "#/components/schemas/ContactId"
                teamId:
                  $ref: "#/components/schemas/teamId"
                location:
                  $ref: "#/components/schemas/__schema37"
                setterId:
                  $ref: "#/components/schemas/userId"
                customFields:
                  $ref: "#/components/schemas/__schema7"
              required:
                - dispositionId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                location:
                  locationId: TLoc.1
                  disposition: Disposition.1
                  line1: 123 Main St
                  line2: ""
                  locality: Anytown
                  oneLine: 123 Main St, Anytown, CA 12345
                  country: US
                  countrySubd: CA
                  postal1: "12345"
                  latlng:
                    latitude: 23.9
                    longitude: 120.1
                  contacts:
                    - contactId: Contact:123
                      disposition: Disposition.1
                      pitch: true
                      method: door
                      contactDate: 1786226400000
                      contactDay: 2025-06-05T00:00:00.000Z
                      latitude: 23.9
                      longitude: 120.1
                      line1: 123 Main St
                      line2: ""
                      locationId: TLoc.1
                      pk: Contact:123
                      sk: SK
                      locationCoordinates:
                        latitude: 23.9
                        longitude: 120.1
                      distanceFromProperty: 123
                      setterId: U.112
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  location:
                    type: object
                    properties:
                      country:
                        $ref: "#/components/schemas/addressCountry"
                      countrySubd:
                        $ref: "#/components/schemas/addressCountrySubd"
                      line1:
                        $ref: "#/components/schemas/addressLine1"
                      line2:
                        $ref: "#/components/schemas/addressLine2"
                      locality:
                        $ref: "#/components/schemas/addressLocality"
                      oneLine:
                        $ref: "#/components/schemas/addressOneLine"
                      postal1:
                        $ref: "#/components/schemas/addressPostal1"
                      postal2:
                        $ref: "#/components/schemas/addressPostal2Output"
                      postal3:
                        $ref: "#/components/schemas/addressPostal3Output"
                      unitNbr:
                        $ref: "#/components/schemas/addressUnitNbrOutput"
                      unitType:
                        $ref: "#/components/schemas/addressUnitTypeOutput"
                      locationId:
                        $ref: "#/components/schemas/locationIdOutput"
                      altId:
                        type: string
                      addressMasterId:
                        $ref: "#/components/schemas/__schema1121"
                      latlng:
                        $ref: "#/components/schemas/latlngOutput"
                      altLatLngs:
                        $ref: "#/components/schemas/__schema1127"
                      fields:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema1125"
                      attributes:
                        type: object
                        properties:
                          permitCount:
                            description: The unfiltered count of permits
                            $ref: "#/components/schemas/__schema1223"
                          permits:
                            $ref: "#/components/schemas/__schema1224"
                          paceLienCount:
                            type: number
                          paceLiens:
                            type: array
                            items:
                              type: object
                              properties:
                                paceId:
                                  type: string
                                authorityName:
                                  type: string
                                recordingDate:
                                  type: number
                                isBankrupt:
                                  type: boolean
                              additionalProperties: false
                          invLienCount:
                            type: number
                          invLiens:
                            type: array
                            items:
                              type: object
                              properties:
                                transactionId:
                                  type: string
                                recordingDate:
                                  type: number
                                party1Name:
                                  type: string
                                party2Name:
                                  type: string
                                isBankrupt:
                                  type: boolean
                              additionalProperties: false
                          wirecenterOperator:
                            type: string
                          occupantType:
                            type: string
                            enum:
                              - Renter
                              - Owner
                          pool:
                            type: boolean
                          trust:
                            type: boolean
                          company:
                            type: boolean
                          parcelNumber:
                            type: string
                          geoQuality:
                            type: string
                          vestingRelation:
                            type: string
                          neighborhoodCode:
                            type: string
                          zonedCodeLocal:
                            type: string
                          metropolitanDiv:
                            type: string
                          minorCivilDiv:
                            type: string
                          minorCivilDivName:
                            type: string
                          minorCivilDivCode:
                            type: string
                          yearBuilt:
                            type: number
                          yearBuiltEffective:
                            type: number
                          homeSize:
                            type: number
                          lotSize:
                            type: number
                          areaGross:
                            type: number
                          areaLotDepth:
                            type: number
                          areaLotWidth:
                            type: number
                          parkingSpaces:
                            type: number
                          lastOwnershipTransferDate:
                            $ref: "#/components/schemas/__schema1227"
                          roofMaterial:
                            type: string
                          roofConstruction:
                            type: string
                          heatingFuel:
                            type: string
                          foundation:
                            type: string
                          lastUpdated:
                            type: number
                          bathCount:
                            type: number
                          bathPartialCount:
                            type: number
                          bedroomCount:
                            type: number
                          roomCount:
                            type: number
                          storyCount:
                            type: number
                          unitCount:
                            type: number
                          buildingCount:
                            type: number
                          sales:
                            type: object
                            properties:
                              deed:
                                $ref: "#/components/schemas/__schema1228"
                              latest:
                                $ref: "#/components/schemas/__schema1228"
                              prior:
                                $ref: "#/components/schemas/__schema1228"
                            additionalProperties: false
                          valuations:
                            type: object
                            properties:
                              market:
                                $ref: "#/components/schemas/__schema1229"
                              assessed:
                                $ref: "#/components/schemas/__schema1229"
                            additionalProperties: false
                          taxExemptions:
                            type: array
                            items:
                              type: string
                          utilities:
                            type: object
                            properties:
                              securityAlarm:
                                type: boolean
                              mobileHomeHookup:
                                type: boolean
                            additionalProperties: false
                        additionalProperties: false
                      residents:
                        $ref: "#/components/schemas/__schema1123"
                      titleOwners:
                        $ref: "#/components/schemas/__schema1128"
                      msa:
                        $ref: "#/components/schemas/__schema1230"
                      cbsa:
                        $ref: "#/components/schemas/__schema1230"
                      propertyTypeId:
                        type:
                          - string
                          - number
                      notes:
                        type: array
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: number
                            note:
                              type: string
                            ownerId:
                              $ref: "#/components/schemas/userId"
                          required:
                            - timestamp
                            - note
                            - ownerId
                          additionalProperties: false
                      disposition:
                        $ref: "#/components/schemas/__schema907"
                      addressParts:
                        $ref: "#/components/schemas/__schema1126"
                      parcel:
                        oneOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: Polygon
                              coordinates:
                                type: array
                                items:
                                  type: array
                                  items:
                                    $ref: "#/components/schemas/__schema1231"
                            required:
                              - type
                              - coordinates
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                const: MultiPolygon
                              coordinates:
                                type: array
                                items:
                                  type: array
                                  items:
                                    type: array
                                    items:
                                      $ref: "#/components/schemas/__schema1231"
                            required:
                              - type
                              - coordinates
                            additionalProperties: false
                        type: object
                      modifiedBy:
                        $ref: "#/components/schemas/__schema807"
                      createdAt:
                        $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                      createdBy:
                        $ref: "#/components/schemas/auditPropsCreatedBy"
                      updatedAt:
                        $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                      updatedBy:
                        $ref: "#/components/schemas/auditPropsUpdatedBy"
                      lastUpdateProcess:
                        $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                      version:
                        $ref: "#/components/schemas/auditPropsVersionOutput"
                      contacts:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema1074"
                      account:
                        description: Most recent account associated with the location
                        $ref: "#/components/schemas/__schema923"
                      accounts:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema923"
                      events:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema982"
                      evaluations:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema1109"
                      primaryResidents:
                        type: array
                        items:
                          $ref: "#/components/schemas/tinyResidentOutput"
                      conversations:
                        type: array
                        items:
                          type: object
                          properties:
                            modifiedBy:
                              $ref: "#/components/schemas/__schema807"
                            createdAt:
                              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                            createdBy:
                              $ref: "#/components/schemas/auditPropsCreatedBy"
                            updatedAt:
                              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                            updatedBy:
                              $ref: "#/components/schemas/auditPropsUpdatedBy"
                            lastUpdateProcess:
                              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                            version:
                              $ref: "#/components/schemas/auditPropsVersionOutput"
                            convoId:
                              $ref: "#/components/schemas/ConvoId"
                            duration:
                              type: number
                              description: Duration of the conversation in seconds
                            convoDate:
                              $ref: "#/components/schemas/utcMillisecondsOutput"
                            status:
                              type: string
                              enum:
                                - Processing
                                - Transcribed
                                - TranscribeFailed
                                - GradingSkipped
                                - Graded
                                - GradingFailed
                                - Flagged
                            violations:
                              description: Compliance and related issues found in this conversation. Returned
                                by conversation/get and conversation/list for
                                callers with company-level conversation:manage;
                                omitted otherwise.
                              $ref: "#/components/schemas/__schema1232"
                            recordingId:
                              $ref: "#/components/schemas/RecordingId"
                            ownerId:
                              $ref: "#/components/schemas/userId"
                            owner:
                              $ref: "#/components/schemas/tinyUserOutput"
                            companyId:
                              $ref: "#/components/schemas/companyId"
                            latlng:
                              $ref: "#/components/schemas/latlngOutput"
                            locationId:
                              $ref: "#/components/schemas/locationIdOutput"
                            geo200Company:
                              type: string
                              pattern: ^(Geo200:)-?\d+(?:\.\d+)?(,)-?\d+(?:\.\d+)?(\|)C((\.)|(:))[\s\S]{0,}$
                            accountId:
                              $ref: "#/components/schemas/accountId"
                            account:
                              type: object
                              properties:
                                accountId:
                                  $ref: "#/components/schemas/accountId"
                                statusId:
                                  $ref: "#/components/schemas/__schema825"
                                workflowId:
                                  $ref: "#/components/schemas/__schema815"
                                workflowStageId:
                                  $ref: "#/components/schemas/__schema821"
                                workflowStageName:
                                  $ref: "#/components/schemas/__schema900"
                                workflowActionId:
                                  $ref: "#/components/schemas/__schema822"
                                workflowActionName:
                                  $ref: "#/components/schemas/__schema902"
                              required:
                                - accountId
                              additionalProperties: false
                            workflowId:
                              $ref: "#/components/schemas/WFId"
                            workflowStageId:
                              $ref: "#/components/schemas/SId"
                            workflowActionId:
                              $ref: "#/components/schemas/AId"
                            workflowLastActionDate:
                              $ref: "#/components/schemas/utcMillisecondsOutput"
                            transcript:
                              type: array
                              items:
                                type: object
                                properties:
                                  speaker:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  text:
                                    type: string
                                  start:
                                    type: number
                                    minimum: 0
                                  end:
                                    type: number
                                    minimum: 0
                                required:
                                  - speaker
                                  - text
                                  - start
                                  - end
                                additionalProperties: false
                            isPitch:
                              type: boolean
                            downloadUrl:
                              type: string
                            originalRubricId:
                              description: >-
                                The ID of the rubric used to originally grade
                                the conversation.
                                                  Do not use for displaying the grade.
                              $ref: "#/components/schemas/RubricId"
                            rubric:
                              type: array
                              items:
                                type: object
                                properties:
                                  code:
                                    $ref: "#/components/schemas/__schema1111"
                                  title:
                                    type: string
                                  questions:
                                    type: array
                                    items:
                                      $ref: "#/components/schemas/__schema1240"
                                    description: The questions for the category
                                  skillShare:
                                    description: Is this category eligible for skill share?
                                    $ref: "#/components/schemas/__schema1243"
                                  autoShareThreshold:
                                    description: The threshold score for automatic skill share
                                    $ref: "#/components/schemas/__schema1244"
                                required:
                                  - code
                                  - title
                                  - questions
                                additionalProperties: false
                            assigneeId:
                              description: The ID of the user assigned to evaluate the conversation
                              $ref: "#/components/schemas/userId"
                            assignee:
                              $ref: "#/components/schemas/tinyUserOutput"
                            feedback:
                              description: List of Feedback provided for the conversation
                              $ref: "#/components/schemas/__schema1245"
                            feedbackSummary:
                              type: array
                              items:
                                type: string
                            skillShare:
                              description: Conversations with these categories are shareable
                              $ref: "#/components/schemas/__schema1246"
                            aiSkillShare:
                              description: Whether or not the skill share came from AI
                              $ref: "#/components/schemas/__schema1247"
                            skillShareValidAfter:
                              description: Timestamp after which this conversation is available in Skill Share
                              $ref: "#/components/schemas/utcMillisecondsOutput"
                            scoreSummary:
                              description: Bullet points summarizing the feedback
                              $ref: "#/components/schemas/__schema1248"
                            notes:
                              description: Additional notes about the conversation
                              $ref: "#/components/schemas/__schema1249"
                            categoryTimestamps:
                              description: List of timestamps for each category mentioned in the conversation
                              $ref: "#/components/schemas/__schema1250"
                            transcriptStats:
                              description: Statistics about each speaker in the conversation
                              $ref: "#/components/schemas/__schema1251"
                            expiresAt:
                              $ref: "#/components/schemas/utcSeconds"
                            address:
                              description: Full address of the conversation location, decorated field
                              $ref: "#/components/schemas/__schema1252"
                            score:
                              description: AI score as a percentage from 0 to 100, decorated field. Missing
                                when the conversation is not graded.
                              $ref: "#/components/schemas/__schema1253"
                          required:
                            - convoId
                            - duration
                            - convoDate
                            - status
                            - ownerId
                            - companyId
                          additionalProperties: false
                    required:
                      - country
                      - countrySubd
                      - line1
                      - line2
                      - locality
                      - oneLine
                      - postal1
                      - locationId
                      - latlng
                    additionalProperties: false
                required:
                  - type
                  - location
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /location/query:
    post:
      operationId: location-query-v1
      summary: Query premium locations
      tags:
        - Location
      description: >
        Searches premium property data for locations that match a date range and
        optional geographic filters. Use this to find new prospects, such as
        recent move-ins or homes with recent permits; use `/account/list` or
        `/search` instead to find existing accounts.


        Supported query types are `new_move_ins` and `permits`. New move-in
        results are sorted by latest deed recording date. Permit results are
        sorted by `addressMasterId`.


        **Entitlements required:** `new_move_ins` queries require the
        `new_move_ins` entitlement. `permits` queries require the `permits`
        entitlement, plus the entitlement for each requested permit type.


        Each response returns up to 1,000 locations. If the response includes a
        `cursor`, send it with the same filter to fetch the next page.


        **Permit status mapping:** the `permitStatuses` filter accepts
        generalized statuses, each of which expands to one or more raw permit
        statuses:


        | Generalized status | Raw statuses |

        | --- | --- |

        | `submitted` | `applied`, `filed`, `triage`, `plancheck` |

        | `approved` | `approved`, `issued`, `reinstated` |

        | `completed` | `complete`, `final` |

        | `cancelled` | `rejected`, `revoked`, `canceled`, `suspended`,
        `withdrawn`, `expired` |

        | `any` | all statuses (no filter applied) |
      requestBody:
        content:
          application/json:
            example:
              filter:
                type: permits
                permitTypes:
                  - solar
                startTime: 1717200000000
                endTime: 1719791999999
                states:
                  - CA
                permitStatuses:
                  - approved
                  - completed
                omits:
                  permitInstallers:
                    - Example Installer
            schema:
              type: object
              properties:
                filter:
                  oneOf:
                    - type: object
                      properties:
                        boundingBox:
                          $ref: "#/components/schemas/__schema168"
                        states:
                          $ref: "#/components/schemas/__schema149"
                        zipCodes:
                          $ref: "#/components/schemas/__schema151"
                        startTime:
                          $ref: "#/components/schemas/__schema189"
                        endTime:
                          $ref: "#/components/schemas/__schema189"
                        sortOrder:
                          $ref: "#/components/schemas/__schema507"
                        type:
                          type: string
                          enum:
                            - new_move_ins
                          description: Search for recently transferred homes.
                      required:
                        - startTime
                        - endTime
                        - type
                    - type: object
                      properties:
                        boundingBox:
                          $ref: "#/components/schemas/__schema168"
                        states:
                          $ref: "#/components/schemas/__schema149"
                        zipCodes:
                          $ref: "#/components/schemas/__schema151"
                        startTime:
                          $ref: "#/components/schemas/__schema189"
                        endTime:
                          $ref: "#/components/schemas/__schema189"
                        sortOrder:
                          $ref: "#/components/schemas/__schema507"
                        type:
                          type: string
                          enum:
                            - permits
                          description: Search for properties with permits.
                        permitType:
                          description: Permit type to search for. Locations matching ANY type are
                            returned.
                          deprecated: true
                          $ref: "#/components/schemas/__schema509"
                        permitTypes:
                          description: Permit types to search for. Locations matching ANY type are
                            returned.
                          $ref: "#/components/schemas/__schema510"
                        permitStatuses:
                          description: Permit statuses to include.
                          $ref: "#/components/schemas/__schema511"
                        permitInstallers:
                          description: Installer or contractor names to include.
                          $ref: "#/components/schemas/__schema513"
                        omits:
                          type: object
                          properties:
                            states:
                              $ref: "#/components/schemas/__schema149"
                            zipCodes:
                              $ref: "#/components/schemas/__schema151"
                            permitInstallers:
                              $ref: "#/components/schemas/__schema514"
                            permitStatuses:
                              $ref: "#/components/schemas/__schema516"
                          description: Exclusion filters.
                      required:
                        - startTime
                        - endTime
                        - type
                  type: object
                cursor:
                  $ref: "#/components/schemas/__schema193"
              required:
                - filter
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                locations:
                  - locationId: FA.123456789
                    oneLine: 123 Main St, San Francisco, CA 94103
                    residents:
                      - firstName: Jane
                        lastName: Doe
                    attributes:
                      permits:
                        - label: solar
                          contractorName: Example Solar
                          latestStatusDate: 1718841600000
                          latestStatus: issued
                cursor:
                  - "123456789"
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  locations:
                    type: array
                    items:
                      type: object
                      properties:
                        locationId:
                          $ref: "#/components/schemas/locationIdOutput"
                        oneLine:
                          $ref: "#/components/schemas/addressOneLine"
                        attributes:
                          description: Query-specific attributes. New move-ins include
                            lastOwnershipTransferDate; permit results include
                            permits.
                          $ref: "#/components/schemas/__schema1254"
                        residents:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1255"
                          description: Resident data information
                      required:
                        - locationId
                        - oneLine
                      additionalProperties: false
                  cursor:
                    $ref: "#/components/schemas/__schema935"
                required:
                  - type
                  - locations
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /oauth/list:
    post:
      operationId: oauth-list-v1
      summary: List Calendar Connections
      tags:
        - Calendar
      description: "Lists the authenticated user's external calendar connections: for
        each connected provider (Google Calendar or Microsoft Outlook), the ID
        of the calendar in that account that Terros writes the user's events to,
        and `invalid`, which means a Google sync has failed since the user last
        connected (it does not mean sync stopped). An empty `connections` array
        means no external calendar is connected, so events are not synced
        anywhere. Use it to answer whether a user's events reach Google or
        Microsoft and which calendar they land in; the event itself comes from
        `/calendar/event/get`. There is no `userId` parameter: to see another
        user's connections, make the request as that user (impersonating them
        needs `user:login`). Access tokens are never returned. `calendarId` is
        absent until the first event syncs, and the calendar's name is not
        stored."
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              $ref: "#/components/schemas/__schema480"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                connections:
                  - provider: google
                    enabled: true
                    scope: https://www.googleapis.com/auth/calendar
                    calendarId: abc123@group.calendar.google.com
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  connections:
                    type: array
                    items:
                      type: object
                      properties:
                        provider:
                          type: string
                          enum:
                            - google
                            - microsoft
                          description: "External calendar provider the user connected: `google` (Google
                            Calendar) or `microsoft` (Outlook)."
                          example: google
                        enabled:
                          type: boolean
                          description: "Always true for a stored connection: disconnecting removes the
                            connection instead of disabling it, so this does not
                            show whether events sync."
                          example: true
                        scope:
                          description: OAuth scopes the user granted, space separated.
                          example: https://www.googleapis.com/auth/calendar
                          $ref: "#/components/schemas/__schema1256"
                        calendarId:
                          description: ID of the calendar in the user's provider account that Terros
                            writes their events to. Terros creates this calendar
                            on the first event sync after connecting, so it is
                            absent until then. The calendar's name is not
                            stored; look the ID up in the user's Google or
                            Microsoft calendar list.
                          example: abc123@group.calendar.google.com
                          $ref: "#/components/schemas/__schema1257"
                        invalid:
                          description: "True when a Google sync hit a non-retryable error since the user
                            last connected: the calendar was deleted, access was
                            revoked, or Google rejected an event. It stays set
                            until the user reconnects, even when later syncs
                            succeed, and it does not stop Terros from syncing.
                            Microsoft connections are never flagged, so absence
                            alone does not prove a Microsoft connection works."
                          example: false
                          $ref: "#/components/schemas/__schema1258"
                      required:
                        - provider
                        - enabled
                      additionalProperties: false
                required:
                  - type
                  - connections
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /permission/list:
    post:
      operationId: permission-list-v1
      summary: List Permissions
      tags:
        - Permission
      description: Lists effective permission scopes, inherited overrides, and scopes
        available to grant for an entity or role. Omit `entityId` to list the
        current user's permissions. Listing another entity requires the
        `user:manage` permission; listing a role requires the `role:manage`
        permission. Use this to inspect or audit what an entity can do; use
        `/permission/check` instead when you only need a yes/no answer for one
        permission.
      requestBody:
        content:
          application/json:
            example:
              entityId: U:user123
            schema:
              type: object
              properties:
                entityId:
                  description: Defaults to current user
                  $ref: "#/components/schemas/__schema518"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                list:
                  account:save:
                    primaryScope:
                      entity: company
                      source: U:user123
                    allScopes:
                      - entity: company
                        source: U:user123
                    allOverrides:
                      - entityId: U:user123
                        permissionType: account:save
                        scope: company
                    overridable:
                      - none
                      - self
                      - downline
                      - company
                map:
                  account:save:
                    - entity: company
                      source: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  list:
                    type: object
                    propertyNames:
                      $ref: "#/components/schemas/__schema1025"
                    additionalProperties:
                      type: object
                      properties:
                        primaryScope:
                          $ref: "#/components/schemas/__schema1259"
                        allScopes:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1259"
                        allOverrides:
                          type: array
                          items:
                            type: object
                            properties:
                              modifiedBy:
                                $ref: "#/components/schemas/__schema807"
                              createdAt:
                                $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                              createdBy:
                                $ref: "#/components/schemas/auditPropsCreatedBy"
                              updatedAt:
                                $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                              updatedBy:
                                $ref: "#/components/schemas/auditPropsUpdatedBy"
                              lastUpdateProcess:
                                $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                              version:
                                $ref: "#/components/schemas/auditPropsVersionOutput"
                              entityId:
                                $ref: "#/components/schemas/__schema1260"
                              permissionType:
                                $ref: "#/components/schemas/__schema1025"
                              scope:
                                anyOf:
                                  - $ref: "#/components/schemas/__schema1262"
                                  - type: string
                                    const: inherit
                            required:
                              - entityId
                              - permissionType
                              - scope
                            additionalProperties: false
                        overridable:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1262"
                        inherits:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1259"
                      required:
                        - allScopes
                        - overridable
                      additionalProperties: false
                    required:
                      - account:save
                      - account:add
                      - account:manage
                      - account:import
                      - account:list
                      - accountStatus:list
                      - accountStatus:save
                      - accountRule:save
                      - aiChat:list
                      - apikey:manage
                      - companyCard:save
                      - userCard:save
                      - company:add
                      - company:delete
                      - company:read
                      - company:update
                      - company:list
                      - customField:list
                      - customField:save
                      - app:list
                      - app:manage
                      - install:manage
                      - event:outcome:save
                      - event:outcome:list
                      - export:manage
                      - reportConfig:manage
                      - ratio:list
                      - ratio:save
                      - webhook:manage
                      - workflow:list
                      - workflow:manage
                      - quiz:manage
                      - quiz:list
                      - stats:list
                      - area:add
                      - area:list
                      - contact:list
                      - contact:add
                      - contact:delete
                      - contact:import
                      - disposition:save
                      - location:add
                      - location:manage
                      - tag:manage
                      - attachment:manage
                      - attachment:list
                      - event:read
                      - event:save
                      - event:delete
                      - event:import
                      - event:manage
                      - availability:list
                      - availability:update
                      - availability:manage
                      - pitch:record
                      - pitch:delete
                      - evaluation:add
                      - evaluation:delete
                      - evaluation:list
                      - message:archive
                      - message:delete
                      - message:send
                      - message:send:group
                      - plan:add
                      - plan:delete
                      - plan:list
                      - plan:manage
                      - widget:manage
                      - widget:list
                      - dashboard:manage
                      - dashboard:list
                      - program:manage
                      - program:list
                      - question:manage
                      - task:list
                      - task:update
                      - task:manage
                      - task:import
                      - team:add
                      - team:list
                      - team:update
                      - team:archive
                      - role:manage
                      - role:list
                      - user:import
                      - user:login
                      - user:list
                      - user:add
                      - user:manage
                      - user:update
                      - user:developer
                      - admin:assign
                      - game:list
                      - game:save
                      - rubric:list
                      - rubric:manage
                      - conversation:manage
                      - conversation:list
                      - compliance:manage
                      - externalLink:manage
                      - externalLink:list
                      - view:manage
                      - shorts:manage
                  map:
                    $ref: "#/components/schemas/__schema1263"
                required:
                  - type
                  - list
                  - map
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /permission/check:
    post:
      operationId: permission-check-v1
      summary: Check Permission
      tags:
        - Permission
      description: Checks whether the authenticated user has a specific
        `permissionType` on a target entity and returns `hasPermission`. For
        several targets, `match` defaults to `any`; use `all` to require
        permission on every non-empty target. An empty target list fails closed
        in either mode. Use this before attempting an action to see if it will
        be allowed; use `/permission/list` to see the full set of permissions
        and scopes for a user or role.
      requestBody:
        content:
          application/json:
            example:
              permissionType: account:save
              targetId: U:user123
              match: any
            schema:
              type: object
              properties:
                permissionType:
                  $ref: "#/components/schemas/__schema408"
                targetId:
                  anyOf:
                    - $ref: "#/components/schemas/__schema447"
                    - type: array
                      items:
                        $ref: "#/components/schemas/__schema447"
                match:
                  description: Defaults to any; use all to require every target
                  $ref: "#/components/schemas/__schema519"
              required:
                - permissionType
                - targetId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                hasPermission: true
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  hasPermission:
                    type: boolean
                required:
                  - type
                  - hasPermission
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /permission/update:
    post:
      operationId: permission-update-v1
      summary: Update Permission
      tags:
        - Permission
      description: Enables, disables, or changes a permission override for an entity
        or role. Use `none` to disable the permission and `default` to remove
        its override. Managing entity permissions requires the `user:manage`
        permission; managing role permissions requires the `role:manage`
        permission. You can only grant scopes that your own permissions allow
        you to grant. Use `/permission/list` first to see current scopes and
        which scopes can be granted (`overridable`).
      requestBody:
        content:
          application/json:
            example:
              entityId: U:user123
              permissionType: account:save
              scope: none
            schema:
              type: object
              properties:
                entityId:
                  $ref: "#/components/schemas/__schema518"
                permissionType:
                  $ref: "#/components/schemas/__schema408"
                scope:
                  type: string
                  enum:
                    - none
                    - self
                    - downline
                    - withinRestrictions
                    - company
                    - default
              required:
                - entityId
                - permissionType
                - scope
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /program/get:
    post:
      operationId: program-get-v1
      summary: Get program
      tags:
        - Program
      description: Retrieves the specified program with its auto-enrollment rules
        (`triggers`), tasks, and enrollment counts by status.         Requires
        the `program:list` permission; filtering enrollment counts with
        `teamIds` also requires `stats:list`.         `canPermanentlyDelete`
        tells this caller whether permanent deletion is allowed; otherwise
        archive the program.         List the enrolled users with
        `/program/user/list`.
      requestBody:
        content:
          application/json:
            example:
              programId: Program.123-4aBc_d
            schema:
              type: object
              properties:
                programId:
                  $ref: "#/components/schemas/ProgramId"
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
              required:
                - programId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                program:
                  programId: Program.123-4aBc_d
                  companyId: C:company123
                  ownerId: U:user123
                  name: Manager Training
                  description: Onboarding videos for new managers.
                  status: active
                  triggers:
                    - type: role
                      roleId: Role.123-4aBc_d
                  tasks: []
                  totalDays: 30
                  completion: taskCompletion
                  enrollments:
                    active: 12
                    pending: 1
                    completed: 40
                    dropped: 3
                  canPermanentlyDelete: false
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  program:
                    type: object
                    properties:
                      modifiedBy:
                        $ref: "#/components/schemas/__schema807"
                      createdAt:
                        $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                      createdBy:
                        $ref: "#/components/schemas/auditPropsCreatedBy"
                      updatedAt:
                        $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                      updatedBy:
                        $ref: "#/components/schemas/auditPropsUpdatedBy"
                      lastUpdateProcess:
                        $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                      version:
                        $ref: "#/components/schemas/auditPropsVersionOutput"
                      isDeleted:
                        $ref: "#/components/schemas/isDeletedOutput"
                      name:
                        $ref: "#/components/schemas/__schema1264"
                      description:
                        $ref: "#/components/schemas/__schema1265"
                      trigger:
                        $ref: "#/components/schemas/__schema1266"
                      triggers:
                        $ref: "#/components/schemas/__schema1267"
                      teamIds:
                        $ref: "#/components/schemas/__schema1268"
                      tasks:
                        $ref: "#/components/schemas/__schema1270"
                      companyId:
                        $ref: "#/components/schemas/companyId"
                      status:
                        $ref: "#/components/schemas/__schema1286"
                      totalDays:
                        $ref: "#/components/schemas/__schema1287"
                      completion:
                        $ref: "#/components/schemas/__schema1289"
                      startWeekday:
                        $ref: "#/components/schemas/__schema1290"
                      fromStatusId:
                        $ref: "#/components/schemas/__schema1293"
                      accountStatusId:
                        $ref: "#/components/schemas/__schema1294"
                      workflowActionId:
                        $ref: "#/components/schemas/__schema1295"
                      ownerId:
                        $ref: "#/components/schemas/userId"
                      programId:
                        $ref: "#/components/schemas/ProgramId"
                      archivedAt:
                        $ref: "#/components/schemas/__schema1296"
                      activatedAt:
                        $ref: "#/components/schemas/__schema1298"
                      pausedAt:
                        $ref: "#/components/schemas/__schema1300"
                      enrollments:
                        $ref: "#/components/schemas/__schema1302"
                      averageCompletion:
                        $ref: "#/components/schemas/__schema1303"
                      canPermanentlyDelete:
                        type: boolean
                        description: Whether this caller can permanently delete the program
                    required:
                      - name
                      - tasks
                      - companyId
                      - status
                      - ownerId
                      - programId
                      - enrollments
                      - canPermanentlyDelete
                    additionalProperties: false
                required:
                  - type
                  - program
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /program/list:
    post:
      operationId: program-list-v1
      summary: List programs
      tags:
        - Program
      description: "Lists the current company's programs (the impersonated user's
        company when impersonating) with their         auto-enrollment rules.
        Requires the `program:list` permission. With         company-wide
        `program:manage`, every program is listed. Otherwise a program is listed
        when you created it,         when its teams or its team auto-enrollment
        rules reach your team hierarchy (a program with no teams
        is         company-wide unless all its rules are team rules), or when a
        user on your teams or below them is enrolled         (pending, active or
        completed) or was dropped after starting. Enrollment counts and
        `averageCompletion`         are included only for a caller with
        `program:manage`. Without `program:manage`, each program is
        still         listed with zero enrollment counts and no
        `averageCompletion`. For a caller with `program:manage`,         counts
        include every enrolled user, and filtering them with `teamIds` also
        requires `stats:list` for those         teams. Set
        `scopeEnrollmentsToVisibleTeams` to count only users who are not deleted
        and are on teams you can         see with `stats:list`, which this
        option then requires: company-wide `stats:list` counts every team, or
        only         `teamIds` when given; narrower `stats:list` counts only
        your visible teams (zero when you have none), and         `teamIds`
        outside them is an error. In a company that uses its own team-visibility
        rules for reports, those         rules decide the visible teams instead
        of `stats:list`: requested `teamIds` outside them are dropped
        (zero         counts when none remain), a company admin with no visible
        teams gets company-wide counts, and any other user         who is not on
        a team gets a not-authorized error. With
        `scopeEnrollmentsToVisibleTeams` and `program:manage`,         each
        program also         returns `averageCompletion`: the average task
        completion of those same counted users, over the active ones         and
        over all of them."
      requestBody:
        content:
          application/json:
            example:
              scopeEnrollmentsToVisibleTeams: true
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
                scopeEnrollmentsToVisibleTeams:
                  type: boolean
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                programs:
                  - programId: Program.123-4aBc_d
                    companyId: C:company123
                    ownerId: U:user123
                    name: Manager Training
                    description: Onboarding videos for new managers.
                    status: active
                    triggers:
                      - type: role
                        roleId: Role.123-4aBc_d
                    tasks: []
                    totalDays: 30
                    completion: taskCompletion
                    enrollments:
                      active: 12
                      pending: 1
                      completed: 40
                      dropped: 3
                    averageCompletion:
                      active: 0.42
                      total: 0.61
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  programs:
                    type: array
                    items:
                      type: object
                      properties:
                        modifiedBy:
                          $ref: "#/components/schemas/__schema807"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                        version:
                          $ref: "#/components/schemas/auditPropsVersionOutput"
                        isDeleted:
                          $ref: "#/components/schemas/isDeletedOutput"
                        name:
                          $ref: "#/components/schemas/__schema1264"
                        description:
                          $ref: "#/components/schemas/__schema1265"
                        trigger:
                          $ref: "#/components/schemas/__schema1266"
                        triggers:
                          $ref: "#/components/schemas/__schema1267"
                        teamIds:
                          $ref: "#/components/schemas/__schema1268"
                        tasks:
                          $ref: "#/components/schemas/__schema1270"
                        companyId:
                          $ref: "#/components/schemas/companyId"
                        status:
                          $ref: "#/components/schemas/__schema1286"
                        totalDays:
                          $ref: "#/components/schemas/__schema1287"
                        completion:
                          $ref: "#/components/schemas/__schema1289"
                        startWeekday:
                          $ref: "#/components/schemas/__schema1290"
                        fromStatusId:
                          $ref: "#/components/schemas/__schema1293"
                        accountStatusId:
                          $ref: "#/components/schemas/__schema1294"
                        workflowActionId:
                          $ref: "#/components/schemas/__schema1295"
                        ownerId:
                          $ref: "#/components/schemas/userId"
                        programId:
                          $ref: "#/components/schemas/ProgramId"
                        archivedAt:
                          $ref: "#/components/schemas/__schema1296"
                        activatedAt:
                          $ref: "#/components/schemas/__schema1298"
                        pausedAt:
                          $ref: "#/components/schemas/__schema1300"
                        enrollments:
                          $ref: "#/components/schemas/__schema1302"
                        averageCompletion:
                          $ref: "#/components/schemas/__schema1303"
                      required:
                        - name
                        - tasks
                        - companyId
                        - status
                        - ownerId
                        - programId
                        - enrollments
                      additionalProperties: false
                required:
                  - type
                  - programs
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /program/user/detail:
    post:
      operationId: programUser-detail-v1
      summary: Get program enrollment progress
      tags:
        - Program
      description: "Retrieves a user's progress in one program: the enrollment, every
        task assigned to them in it with a derived         status (completed,
        late, missed, overdue, or open) and the day it is listed under in their
        time zone, summary         counts and completion percentage, and
        progress toward each of the program's tasks. In a
        task-completion         program, completion is measured against every
        task the program will assign. In a timeline program, it
        is         measured against every task assigned so far, including open
        ones, so a user is at 100% only once every         assigned task is
        done. Defaults to the current user; another user requires the
        `task:list` permission for         them. Use `/program/user/get` for the
        enrollment alone."
      requestBody:
        content:
          application/json:
            example:
              programId: Program.123-4aBc_d
            schema:
              type: object
              properties:
                programId:
                  $ref: "#/components/schemas/ProgramId"
                userId:
                  description: User whose enrollment to read, defaults to the current user
                  $ref: "#/components/schemas/userId"
              required:
                - programId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                programUser:
                  programId: Program.123-4aBc_d
                  userId: U:user123
                  startDate: 1767225600000
                  status: active
                  lastUpdateProcess: entity-role-member-program-enrollment
                  user:
                    userId: U:user123
                    firstName: John
                    lastName: Smith
                  program:
                    programId: Program.123-4aBc_d
                    name: Manager Training
                    ownerId: U:user123
                    totalDays: 30
                    completion: taskCompletion
                timezone: America/Denver
                summary:
                  counts:
                    completed: 21
                    late: 5
                    missed: 8
                    overdue: 5
                    open: 3
                  allowsLateCompletion: false
                  assigned: 42
                  total: 60
                  completionRate: 43
                  currentDay: 12
                  totalDays: 30
                  startDate: 1767225600000
                tasks:
                  - task:
                      taskId: Task.123
                      ownerId: U:user123
                      programId: Program.123-4aBc_d
                      originTaskId: PT.123
                      type: SalesActivity
                      subject: Pitch 20 houses
                      status: Created
                      required: false
                      priority: 1
                      actions: []
                      criteria:
                        type: activity
                        activityId: pitch
                        count: 20
                      progress: 13
                      openSince: 1768201200000
                      dueDate: 1768262400000
                      expiration: 0
                    derivedStatus: open
                    bucketDate: 2026-01-12
                programTasks:
                  - programTaskId: PT.123
                    subject: Pitch 20 houses
                    body: Knock and pitch 20 doors in your assigned area.
                    completed: 213
                    target: 600
                    counts:
                      completed: 9
                      late: 1
                      missed: 1
                      overdue: 0
                      open: 1
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  programUser:
                    $ref: "#/components/schemas/__schema1304"
                  timezone:
                    type: string
                    description: The user's time zone, which bucketDate and currentDay use
                  summary:
                    $ref: "#/components/schemas/__schema1311"
                  tasks:
                    type: array
                    items:
                      type: object
                      properties:
                        task:
                          $ref: "#/components/schemas/__schema1315"
                        derivedStatus:
                          type: string
                          enum:
                            - completed
                            - late
                            - missed
                            - overdue
                            - open
                          description: "completed: done on or before its due date. late: done after its
                            due date. missed: can no longer be completed,
                            because it is past due with late completion off,
                            past its expiration, or was unfinished when the
                            enrollment ended. overdue: past due and still
                            completable. open: not yet due."
                        bucketDate:
                          type: string
                          format: date
                          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                          description: "Day the task is listed under, in the user's time zone
                            (yyyy-MM-dd): the completion day when completed or
                            late, the day it became missed, the due day when
                            overdue, and today when open. A deadline at exactly
                            midnight counts as the day that ended."
                      required:
                        - task
                        - derivedStatus
                        - bucketDate
                      additionalProperties: false
                  programTasks:
                    type: array
                    items:
                      type: object
                      properties:
                        programTaskId:
                          $ref: "#/components/schemas/PTId"
                        subject:
                          type: string
                        body:
                          type: string
                        completed:
                          type: number
                          description: Progress toward target, such as houses pitched so far
                        target:
                          type: number
                          description: Sum of each task's target count (1 when it has none) across the
                            tasks assigned so far and those still scheduled
                        counts:
                          $ref: "#/components/schemas/__schema1312"
                      required:
                        - programTaskId
                        - subject
                        - body
                        - completed
                        - target
                        - counts
                      additionalProperties: false
                required:
                  - type
                  - programUser
                  - timezone
                  - summary
                  - tasks
                  - programTasks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /program/user/get:
    post:
      operationId: programUser-get-v1
      summary: Get program enrollment
      tags:
        - Program
      description: Retrieves a user's enrollment in the specified program, including
        its status and dates. Defaults to the         current user; another user
        requires the `program:list` permission. `lastUpdateProcess` names the
        process that         last wrote the enrollment, such as an automatic
        enrollment rule; `modifiedBy` is its audit history of
        who         changed it and when, with each entry's `updateProcess` when
        known.
      requestBody:
        content:
          application/json:
            example:
              programId: Program.123-4aBc_d
              userId: U:user123
            schema:
              type: object
              properties:
                programId:
                  $ref: "#/components/schemas/ProgramId"
                userId:
                  $ref: "#/components/schemas/userId"
              required:
                - programId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                user:
                  programId: Program.123-4aBc_d
                  userId: U:user123
                  startDate: 1767225600000
                  status: active
                  lastUpdateProcess: entity-role-member-program-enrollment
                  user:
                    userId: U:user123
                    firstName: John
                    lastName: Smith
                  program:
                    programId: Program.123-4aBc_d
                    name: Manager Training
                    ownerId: U:user123
                    totalDays: 30
                    completion: taskCompletion
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  user:
                    $ref: "#/components/schemas/__schema1304"
                required:
                  - type
                  - user
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /program/user/list:
    post:
      operationId: programUser-list-v1
      summary: List program enrollments
      tags:
        - Program
      description: Lists the users enrolled in the specified program with each
        enrollment's status, optionally filtered by         `status` or
        `userId`. Without `programId`, lists the programs the given user, or the
        current user, is enrolled         in, which requires the `user:list`
        permission for that user, including yourself. With `programId` and
        no         `userId`, results are limited to your downline unless you
        have company-wide `program:manage` permission. With         `programId`
        and a `userId`, returns that user's enrollment if you have `user:list`
        for them; otherwise         results are scoped to your own enrollment
        instead of returning an error. With `programId`, page with
        `size`         and `sortTimestamp`. `lastUpdateProcess` names the
        process that last wrote each enrollment, such as an         automatic
        enrollment rule; `modifiedBy` is its audit history of who changed it and
        when. Without         `programId`, each enrollment also has its
        `summary`, the same progress summary `/program/user/detail` returns.
      requestBody:
        content:
          application/json:
            example:
              programId: Program.123-4aBc_d
              status: active
            schema:
              type: object
              properties:
                programId:
                  $ref: "#/components/schemas/ProgramId"
                userId:
                  $ref: "#/components/schemas/userId"
                status:
                  $ref: "#/components/schemas/__schema520"
                query:
                  type: string
                sortBy:
                  type: string
                  enum:
                    - name
                    - startDate
                    - completionDate
                  description: Field to sort program users by. Omit for the default id order.
                sortOrder:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: Sort direction.
                sortTimestamp:
                  description: Page cursor. Null in the first position is a missing start or
                    completion date from an older client and is read as 0 when
                    sorting descending, or 253402300799999 when sorting
                    ascending.
                  $ref: "#/components/schemas/__schema521"
                size:
                  type: number
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                users:
                  - programId: Program.123-4aBc_d
                    userId: U:user123
                    startDate: 1767225600000
                    status: active
                    lastUpdateProcess: entity-role-member-program-enrollment
                    user:
                      userId: U:user123
                      firstName: John
                      lastName: Smith
                    program:
                      programId: Program.123-4aBc_d
                      name: Manager Training
                      ownerId: U:user123
                      totalDays: 30
                      completion: taskCompletion
                total: 1
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        modifiedBy:
                          $ref: "#/components/schemas/__schema807"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                        version:
                          $ref: "#/components/schemas/auditPropsVersionOutput"
                        userId:
                          $ref: "#/components/schemas/userId"
                        programId:
                          $ref: "#/components/schemas/ProgramId"
                        startDate:
                          $ref: "#/components/schemas/__schema1305"
                        completionDate:
                          $ref: "#/components/schemas/__schema1306"
                        status:
                          $ref: "#/components/schemas/__schema1307"
                        droppedDate:
                          $ref: "#/components/schemas/__schema1308"
                        user:
                          $ref: "#/components/schemas/tinyUserOutput"
                        program:
                          $ref: "#/components/schemas/__schema1310"
                        summary:
                          description: The enrollment's progress, the same summary /program/user/detail
                            returns. Only present when listing one user's
                            enrollments without programId
                          $ref: "#/components/schemas/__schema1311"
                      required:
                        - userId
                        - programId
                        - startDate
                        - status
                        - user
                        - program
                      additionalProperties: false
                  total:
                    type: number
                  sortTimestamp:
                    description: Pass to get the next page. A user with no start date or completion
                      date is 0 when sorting descending, or 253402300799999
                      (9999-12-31) when sorting ascending, followed by the id.
                    $ref: "#/components/schemas/__schema935"
                required:
                  - type
                  - users
                  - total
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /ratio/add:
    post:
      operationId: ratio-add-v1
      summary: Add a Custom Stat
      tags:
        - Ratio
      description: "Creates a ratio, percentage, or advanced formula custom stat,
        which reports then offer as a column. `ratio` and `percentage` stats
        divide `numerator` by `denominator`; `formula` stats evaluate `formula`
        with the `$` variables mapped in `scopes`. Each input is a numeric
        report KPI or another custom stat's `ratioId`: call /report/column and
        use the `value` of a column whose `type` is `number`, such as
        `contact.pitches` or `meetingAttendance.count`. A formula must parse,
        and a stat cannot reference itself directly or through other stats.
        `scopeId` is the company, team, or user the stat belongs to; omit it to
        use the caller's company. Requires the `ratio:save` permission for that
        scope."
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ratio:
                  $ref: "#/components/schemas/__schema524"
              required:
                - ratio
            examples:
              percentage:
                summary: Percentage of two KPIs
                value:
                  ratio:
                    name: Sit rate
                    type: percentage
                    numerator: event.sits
                    denominator: contact.pitches
                    workflowId: WF.salesWorkflow
              formula:
                summary: Formula over KPIs, for a team
                value:
                  ratio:
                    name: Weighted activity
                    type: formula
                    formula: $pitches * 2 + $meetings
                    scopes:
                      $pitches: contact.pitches
                      $meetings: meetingAttendance.count
                    formatter: round
                    accumulator: sum
                    scopeId: Team:team123
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                ratio:
                  ratioId: Ratio.sitRate
                  scopeId: C:company123
                  workflowId: WF.salesWorkflow
                  name: Sit rate
                  description: Sits per pitch
                  type: percentage
                  numerator: event.sits
                  denominator: contact.pitches
                  modifiedBy:
                    - userId: U:user123
                      timestamp: 1760000000000
                      updateProcess: settings
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  ratio:
                    $ref: "#/components/schemas/__schema1326"
                required:
                  - type
                  - ratio
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /ratio/get:
    post:
      operationId: ratio-get-v1
      summary: Get a Custom Stat
      tags:
        - Ratio
      description: Returns one ratio or advanced formula custom stat's complete stored
        definition, including its inputs, formula, scope and workflow filters,
        formatting, and modification history. Requires the `ratio:list`
        permission for the stat's scope.
      requestBody:
        content:
          application/json:
            example:
              ratioId: Ratio.sitRate
            schema:
              type: object
              properties:
                ratioId:
                  $ref: "#/components/schemas/RatioId"
              required:
                - ratioId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                ratio:
                  ratioId: Ratio.sitRate
                  scopeId: C:company123
                  workflowId: WF.salesWorkflow
                  name: Sit rate
                  description: Sits per pitch
                  type: percentage
                  numerator: event.sits
                  denominator: contact.pitches
                  modifiedBy:
                    - userId: U:user123
                      timestamp: 1760000000000
                      updateProcess: settings
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  ratio:
                    $ref: "#/components/schemas/__schema1326"
                required:
                  - type
                  - ratio
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /ratio/list:
    post:
      operationId: ratio-list-v1
      summary: List Custom Stats
      tags:
        - Ratio
      description: Lists ratio and advanced formula custom stats with their complete
        stored definitions and modification history. `scopeId` matches only
        stats stored at exactly that company, team, or user scope; it does not
        include inherited scopes. Omit it to use the caller's company.
        `workflowId` includes global stats without a workflow and stats assigned
        to exactly that workflow. Omit it to include all workflows. Requires the
        `ratio:list` permission for the requested scope.
      requestBody:
        content:
          application/json:
            example:
              scopeId: C:company123
              workflowId: WF.salesWorkflow
            schema:
              type: object
              properties:
                scopeId:
                  description: Only return custom stats stored at exactly this company, team, or
                    user scope. Defaults to the caller's company.
                  $ref: "#/components/schemas/__schema447"
                workflowId:
                  description: Only return global custom stats and custom stats assigned to
                    exactly this workflow.
                  $ref: "#/components/schemas/WFId"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                ratios:
                  - ratioId: Ratio.sitRate
                    scopeId: C:company123
                    workflowId: WF.salesWorkflow
                    name: Sit rate
                    description: Sits per pitch
                    type: percentage
                    numerator: event.sits
                    denominator: contact.pitches
                    modifiedBy:
                      - userId: U:user123
                        timestamp: 1760000000000
                        updateProcess: settings
                  - ratioId: Ratio.weightedActivity
                    scopeId: C:company123
                    name: Weighted activity
                    type: formula
                    formula: $pitches * 2 + $meetings
                    scopes:
                      $pitches: contact.pitches
                      $meetings: meetingAttendance.count
                    formatter: round
                    accumulator: sum
                    modifiedBy:
                      - userId: U:user123
                        timestamp: 1760000000000
                        updateProcess: settings
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  ratios:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1326"
                required:
                  - type
                  - ratios
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /ratio/remove:
    post:
      operationId: ratio-remove-v1
      summary: Remove a Custom Stat
      tags:
        - Ratio
      description: Deletes a custom stat, so reports no longer offer it as a column.
        Requires the `ratio:save` permission for the stat's stored scope.
      requestBody:
        content:
          application/json:
            example:
              ratioId: Ratio.sitRate
            schema:
              type: object
              properties:
                ratioId:
                  $ref: "#/components/schemas/RatioId"
              required:
                - ratioId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /ratio/update:
    post:
      operationId: ratio-update-v1
      summary: Update a Custom Stat
      tags:
        - Ratio
      description: "Replaces an existing custom stat with the definition sent, so send
        every field you want to keep: start from /ratio/get. `ratio` and
        `percentage` stats divide `numerator` by `denominator`; `formula` stats
        evaluate `formula` with the `$` variables mapped in `scopes`. Each input
        is a numeric report KPI or another custom stat's `ratioId`: call
        /report/column and use the `value` of a column whose `type` is `number`,
        such as `contact.pitches` or `meetingAttendance.count`. A formula must
        parse, and a stat cannot reference itself directly or through other
        stats. `ratioId` and `scopeId` are required; a different `scopeId` moves
        the stat to that company, team, or user. Requires the `ratio:save`
        permission for both the stat's stored scope and the requested
        `scopeId`."
      requestBody:
        content:
          application/json:
            example:
              ratio:
                ratioId: Ratio.weightedActivity
                scopeId: C:company123
                name: Weighted activity
                type: formula
                formula: $pitches + $meetings * 3
                scopes:
                  $pitches: contact.pitches
                  $meetings: meetingAttendance.count
                formatter: round
                accumulator: sum
                modifiedBy:
                  - userId: U:user123
                    timestamp: 1760000000000
                    updateProcess: settings
            schema:
              type: object
              properties:
                ratio:
                  allOf:
                    - type: object
                      properties:
                        modifiedBy:
                          $ref: "#/components/schemas/__schema132"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAt"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAt"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                        version:
                          $ref: "#/components/schemas/auditPropsVersion"
                        ratioId:
                          $ref: "#/components/schemas/RatioId"
                        scopeId:
                          description: Company, team, or user the custom stat belongs to.
                          $ref: "#/components/schemas/__schema447"
                      required:
                        - ratioId
                        - scopeId
                    - $ref: "#/components/schemas/__schema524"
              required:
                - ratio
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                ratio:
                  ratioId: Ratio.weightedActivity
                  scopeId: C:company123
                  name: Weighted activity
                  type: formula
                  formula: $pitches + $meetings * 3
                  scopes:
                    $pitches: contact.pitches
                    $meetings: meetingAttendance.count
                  formatter: round
                  accumulator: sum
                  modifiedBy:
                    - userId: U:user123
                      timestamp: 1760000000000
                      updateProcess: settings
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  ratio:
                    $ref: "#/components/schemas/__schema1326"
                required:
                  - type
                  - ratio
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /report/column:
    post:
      operationId: report-column-v1
      summary: Get report columns
      tags:
        - Report
      description: "Retrieve available report column definitions and leaderboard
        columns based on workflow, program, and column type filters. Call this
        first to discover valid KPI `value`s and accumulators for /report/kpi
        and /report/time. Omit `columnTypes` to return all column types. A
        `workflowId` or `workflowIds` value the caller cannot access fails with
        `InvalidRequest` and message `Unauthorized workflow IDs: ...`."
      requestBody:
        content:
          application/json:
            example:
              columnTypes:
                - group
                - number
            schema:
              type: object
              properties:
                workflowId:
                  deprecated: true
                  description: "Deprecated: use workflowIds instead."
                  $ref: "#/components/schemas/WFId"
                ignoreConfig:
                  description: Includes workflow metrics disabled in reporting configuration.
                  $ref: "#/components/schemas/__schema538"
                workflowIds:
                  description: Omit to include all authorized workflows.
                  $ref: "#/components/schemas/__schema539"
                programIds:
                  description: Omit for completion rates from all visible programs; provide IDs
                    for all metrics from selected programs.
                  $ref: "#/components/schemas/__schema540"
                columnTypes:
                  description: Omit to return all column types.
                  $ref: "#/components/schemas/__schema541"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                columns:
                  - label: Group By
                    description: Group the report by user, team, company, or timestamp
                    type: group
                    value: groupBy
                    width: 160
                    order: 0
                    default: true
                  - label: Days Worked
                    description: Number of days with activity
                    type: number
                    value: action.daysWorked
                    width: 100
                    order: 1
                    accumulator: sum
                    accountFilterScope:
                      - location
                      - customField
                      - assignment
                  - label: Hours Worked
                    description: Number of distinct clock hours with activity (a count of hours, not
                      elapsed time)
                    type: number
                    value: action.hoursWorked
                    width: 100
                    order: 1
                    accumulator: sum
                    accountFilterScope:
                      - location
                      - customField
                      - assignment
                leaderboardColumns:
                  - label: Days Worked
                    description: Number of days with activity
                    type: number
                    value: action.daysWorked
                    width: 100
                    order: 1
                    accumulator: sum
                    accountFilterScope:
                      - location
                      - customField
                      - assignment
                    score: 100
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  columns:
                    type: array
                    items:
                      type: object
                      properties:
                        label:
                          $ref: "#/components/schemas/__schema1340"
                        description:
                          $ref: "#/components/schemas/__schema1341"
                        type:
                          $ref: "#/components/schemas/__schema1342"
                        value:
                          $ref: "#/components/schemas/__schema1343"
                        width:
                          $ref: "#/components/schemas/__schema1345"
                        order:
                          $ref: "#/components/schemas/__schema1346"
                        accumulator:
                          $ref: "#/components/schemas/__schema1347"
                        formatters:
                          $ref: "#/components/schemas/__schema1348"
                        tieBreakers:
                          $ref: "#/components/schemas/__schema1349"
                        group:
                          $ref: "#/components/schemas/__schema1350"
                        default:
                          $ref: "#/components/schemas/__schema1351"
                        variant:
                          $ref: "#/components/schemas/__schema1352"
                        aliases:
                          $ref: "#/components/schemas/__schema1353"
                        accountFilterScope:
                          $ref: "#/components/schemas/__schema1354"
                      required:
                        - label
                        - description
                        - type
                        - value
                        - width
                        - order
                      additionalProperties: false
                  leaderboardColumns:
                    type: array
                    items:
                      type: object
                      properties:
                        label:
                          $ref: "#/components/schemas/__schema1340"
                        description:
                          $ref: "#/components/schemas/__schema1341"
                        type:
                          $ref: "#/components/schemas/__schema1342"
                        value:
                          $ref: "#/components/schemas/__schema1343"
                        width:
                          $ref: "#/components/schemas/__schema1345"
                        order:
                          $ref: "#/components/schemas/__schema1346"
                        accumulator:
                          $ref: "#/components/schemas/__schema1347"
                        formatters:
                          $ref: "#/components/schemas/__schema1348"
                        tieBreakers:
                          $ref: "#/components/schemas/__schema1349"
                        group:
                          $ref: "#/components/schemas/__schema1350"
                        default:
                          $ref: "#/components/schemas/__schema1351"
                        variant:
                          $ref: "#/components/schemas/__schema1352"
                        aliases:
                          $ref: "#/components/schemas/__schema1353"
                        accountFilterScope:
                          $ref: "#/components/schemas/__schema1354"
                        score:
                          type: number
                      required:
                        - label
                        - description
                        - type
                        - value
                        - width
                        - order
                        - score
                      additionalProperties: false
                required:
                  - type
                  - columns
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /report/kpi:
    post:
      operationId: report-kpi-v1
      summary: Get KPIs
      tags:
        - Report
      description: |-
        Build a tabular KPI report. `version: 2` (CLI: `--version 2`) is required because it selects the current table response; the published request schema does not expose the legacy shape. Use `/report/time` instead to chart one KPI over time. Report permissions apply to every requested KPI, and results are limited to teams the caller may view.

        Set `grouping` (CLI: `--grouping`) to one of `{"type":"user"}`, `{"type":"company"}`, `{"type":"team","level":1}`, `{"type":"time","period":"hour|day|week|month|quarter|year"}`, `{"type":"manager","level":1}` (level optional), `{"type":"state"}`, `{"type":"city"}`, `{"type":"zip"}`, `{"type":"customField","customFieldId":"CF.xxxxxxxx"}`, or `{"type":"programTask"}`. Calendar groups use the querying user's timezone. Grouping chooses the rows but does not itself add a label cell. Add `{"value":"groupBy"}` to `kpis` (normally first): its row cell is a user, team, company, or task object when the group key is such an ID, the bucket-start epoch milliseconds for time, or otherwise the scalar group value. Its `totalRow` cell is `"Total"`. Without `groupBy`, rows contain only metric cells and no group label.

        Pass `kpis` (CLI: `--kpis`) as an ordered array of `{"value":"...","accumulator":"..."}` objects. Run `terros report column` and copy the returned `value` and `accumulator`; availability depends on permissions, reporting configuration, and selected workflows/programs. Important forms include `setter|S.xxxxxxxx|count`, `closer|S.xxxxxxxx|count`, `action|A.xxxxxxxx|count`, custom-field values such as `cf|setter|count|CF.xxxxxxxx|S.xxxxxxxx`, saved ratios such as `Ratio.xxxxxxxx` (and legacy `ratio|<numerator>|<denominator>`), and user fields `user.firstAccessDate`, `user.lastAccessDate`, `user.count`, and `user.teams`. Use `terros workflow get` to inspect accessible stage/action IDs and `terros customField list` for custom-field IDs; do not invent IDs. Action summaries such as `action.daysWorked`, `action.hoursWorked`, `action.headcount`, and `action.accounts` are also supported when returned by `terros report column`.

        Setter and closer counts count accounts that entered the named stage and attribute them to the account's setter or closer. They use the stage-entry date, not the account last-action date, and do not mean "currently in this stage" unless `searchByCurrentStatus: true` is supplied. Copy the accumulator from `terros report column`: `sum` adds row values and suits additive metrics such as action occurrences; `distinct` or `query` runs a separate company-grouped query for totals that must not be derived by adding rows, such as distinct account counts and ratios recalculated at total scope.

        Recorder-on time: request `recording.activeMinutes` for integer minutes rounded to the nearest minute after summing sessions in each cell. It includes wall-clock elapsed time since `startedAt` for open sessions, recalculated on each request. An open session whose `updatedAt` is more than 2 hours old is treated as stale and adds 0. Completed sessions use `recordedDurationMs` when available, otherwise `endedAt - startedAt`. Request `recording.activeSeconds` for the unrounded seconds total when displaying `<1 min` for positive totals below 60 seconds (rounded minutes alone cannot distinguish these from zero). Use accumulator `query` to round once at total scope. `recording.activeHours` retains its legacy completed-session whole-hour behavior, and `conversation.activeHours` is unchanged. The existing recording retention/report window is unchanged.

        CLI example: `terros report kpi --version 2 --grouping '{"type":"user"}' --kpis '[{"value":"groupBy"},{"value":"recording.activeMinutes","accumulator":"query"},{"value":"recording.activeSeconds","accumulator":"query"}]'`. The CLI returns the same numeric values and units as the API.

        Date fields are inclusive instants when a KPI supports date filtering. They filter the date field for that KPI: for example, workflow actions use their action timestamp, account-created/assigned/status KPIs use the corresponding account date, and setter/closer stage counts use stage-entry time—not account last-action time. User access/count fields ignore this report date range, so the dates do not have one universal account-creation or last-action meaning across all KPI types. On the account-history path, which serves setter/closer stage counts and account custom-field and ratio KPIs, `startDate` and `endDate` are independently optional: start-only applies a lower bound, end-only applies an upper bound, both apply a closed range, and neither applies no date filter. UTC epoch milliseconds (a number below 100000000000 is read as epoch seconds), or an ISO 8601 string. A string ending in `Z` or a `±HH:MM`, `±HHMM` or `±HH` offset after its time, such as `2026-01-15T10:00:00+0700`, is that instant; one without a time zone, such as `2026-01-15`, is read as America/Los_Angeles time. Zone-less strings use America/Los_Angeles, not the querying user's timezone. Equal start/end values select only that instant, not a whole day. For one calendar day, send its start and inclusive end, for example `2026-01-01T00:00:00.000Z` through `2026-01-01T23:59:59.999Z`.

        The response arrays align positionally with `kpis`: `rows[rowIndex][kpiIndex]` and `totalRow[kpiIndex]` are values for `kpis[kpiIndex]`. Join `kpis[kpiIndex].value` to `columns` or `leaderboardColumns` from `terros report column` for its label, description, type, and formatters. Ratios are calculated per row and are not additive, so a ratio's `totalRow` cell is `null` when no supported accumulator defines a total; `avg` averages row ratios, while `distinct`/`query` recalculates the ratio from total-scope inputs. Location (`states`, `cities`, `zipCodes`, `polygon`), custom field (`customFields`) and assignment (`users`) filters narrow only the columns whose `accountFilterScope` from `terros report column` lists them. While one of those filters is set, a saved or legacy ratio whose inputs disagree on whether it applies returns `null` in every row and in `totalRow`.

        Example (synthetic IDs, one UTC day):
        `terros report kpi --version 2 --grouping '{"type":"user"}' --kpis '[{"value":"groupBy"},{"value":"action|A.xxxxxxxx|count","accumulator":"sum"},{"value":"setter|S.xxxxxxxx|count","accumulator":"distinct"}]' --filter.startDate '2026-01-01T00:00:00.000Z' --filter.endDate '2026-01-01T23:59:59.999Z'`

        For that example, `rows[i][0]` is the user object and `totalRow[0]` is `"Total"`; indexes 1 and 2 hold the action and setter counts, with a summed and separately queried total respectively.
      requestBody:
        content:
          application/json:
            example:
              version: 2
              grouping:
                type: user
              kpis:
                - value: groupBy
                - value: action|A.xxxxxxxx|count
                  accumulator: sum
                - value: setter|S.xxxxxxxx|count
                  accumulator: distinct
              filter:
                startDate: 2026-01-01T00:00:00.000Z
                endDate: 2026-01-01T23:59:59.999Z
            schema:
              type: object
              properties:
                version:
                  $ref: "#/components/schemas/__schema542"
                kpis:
                  $ref: "#/components/schemas/__schema543"
                filter:
                  $ref: "#/components/schemas/__schema547"
                grouping:
                  $ref: "#/components/schemas/__schema570"
                showArchived:
                  $ref: "#/components/schemas/__schema584"
                hideSystemUsers:
                  $ref: "#/components/schemas/__schema586"
                includeUsersWithNoData:
                  $ref: "#/components/schemas/__schema588"
                searchByCurrentStatus:
                  $ref: "#/components/schemas/__schema589"
              required:
                - version
                - kpis
                - grouping
              description: Current KPI table request. Version 2 returns positional rows and
                totalRow values aligned with the ordered kpis array.
              example:
                version: 2
                grouping:
                  type: user
                kpis:
                  - value: groupBy
                  - value: action|A.xxxxxxxx|count
                    accumulator: sum
                  - value: setter|S.xxxxxxxx|count
                    accumulator: distinct
                filter:
                  startDate: 2026-01-01T00:00:00.000Z
                  endDate: 2026-01-01T23:59:59.999Z
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                format: table
                rows:
                  - - userId: U.xxxxxxxx
                      lastName: Doe
                      firstName: John
                      preferredName: Jo
                      avatarUrl: https://avatars.terros.com/U.xxxxxxxx
                      lastAccess: 1738871843803
                    - 29
                    - 5
                  - - userId: U.yyyyyyyy
                      lastName: Smith
                      firstName: Jane
                    - 18
                    - 3
                totalRow:
                  - Total
                  - 47
                  - 8
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  format:
                    type: string
                    const: table
                  rows:
                    type: array
                    items:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema1356"
                  totalRow:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1356"
                required:
                  - type
                  - format
                  - rows
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /report/records:
    post:
      operationId: report-records-v1
      summary: List the records behind a KPI
      tags:
        - Report
      description: >-
        List the records one /report/kpi value counts, with who each was
        credited to and why. Use it to explain a number from `terros report
        kpi`: pass one KPI `value` as `kpi` (CLI: `--kpi`), the same `filter`,
        `grouping`, and `searchByCurrentStatus`, and the row's key as `groupKey`
        (for a user grouping, the user ID). It applies the same permissions,
        team limits, and filters as /report/kpi, so for count KPIs `total`
        equals the KPI value. `records` lists only what you could already list:
        an account you can view through /account/list, a task you can list
        through /task/list, and recordings only for Terros users, as
        /recording/list allows. The rest are counted in `withheld`. So a caller
        with narrow list permissions, such as a rep with `self` account access,
        does not see an account that was credited to them but has since been
        reassigned. An admin, or anyone whose account:list covers the accounts,
        gets the full record set with nothing withheld.


        Supported KPIs: workflow stage counts (`account|S.xxxxxxxx|count`,
        `actor|…`, `setter|…`, `closer|…`), action counts
        (`action|A.xxxxxxxx|count`, `action.count`), `task.overdue`,
        `recording.activeHours` (each record's `value` is its seconds), and
        `recording.activeUsers` (one active recording per user, so `total` is
        the distinct-user count). Other KPIs return an InvalidRequest error.


        Setter and closer counts credit whoever was setter or closer when the
        account entered the stage, so an account reassigned after it closed
        still counts for the closer at the time, and one handed to another
        closer before it closed counts for that closer. Each stage record is one
        stage entry: an account that entered the stage twice in the range
        appears twice, as it counts twice in the KPI.


        Records come back oldest first (overdue tasks by when they were opened),
        up to `limit` (default 500, maximum 10000); `total` is always the full
        count. Visibility is checked on the first `limit` matches only. When
        more match, `truncated` is true (raise `limit` to read them), `withheld`
        is a lower bound, and hidden records among those matches can leave
        `records` shorter than `limit`.


        Example (synthetic IDs):

        `terros report records --kpi 'closer|S.xxxxxxxx|count' --grouping
        '{"type":"user"}' --groupKey U.xxxxxxxx --filter.users '["U.xxxxxxxx"]'
        --filter.startDate 2026-01-01 --filter.endDate 2026-12-31`
      requestBody:
        content:
          application/json:
            example:
              kpi: closer|S.xxxxxxxx|count
              grouping:
                type: user
              groupKey: U.xxxxxxxx
              filter:
                users:
                  - U.xxxxxxxx
                startDate: 2026-01-01T00:00:00.000Z
                endDate: 2026-12-31T23:59:59.999Z
            schema:
              type: object
              properties:
                kpi:
                  type: string
                  description: "One KPI value, as passed in `kpis[].value` to /report/kpi, for
                    example `closer|S.xxxxxxxx|count`. Supported: workflow stage
                    counts (`account|`, `actor|`, `setter|`, `closer|` with
                    `count`), action counts (`action|A.xxxxxxxx|count`,
                    `action.count`), `task.overdue`, `recording.activeHours`,
                    and `recording.activeUsers`."
                  example: closer|S.xxxxxxxx|count
                filter:
                  $ref: "#/components/schemas/__schema548"
                grouping:
                  description: The /report/kpi grouping. With `groupKey`, selects the row whose
                    records to return.
                  example:
                    type: user
                  $ref: "#/components/schemas/__schema583"
                groupKey:
                  description: "The row key, for example the user ID for a user grouping or the
                    team ID for a team grouping. Omit to return the records
                    behind the whole column total. Not supported for time or
                    customField groupings: narrow the filter instead."
                  example: U.xxxxxxxx
                  $ref: "#/components/schemas/__schema591"
                searchByCurrentStatus:
                  description: "Same as /report/kpi: counts only accounts currently in the
                    workflow stage."
                  $ref: "#/components/schemas/__schema592"
                limit:
                  default: 500
                  description: Maximum records to return, oldest first. Defaults to 500, up to
                    10000; `total` is always the full count, and `truncated` is
                    true when more matched.
                  $ref: "#/components/schemas/__schema593"
              required:
                - kpi
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                total: 1
                records:
                  - recordId: Account.xxxxxxxx|S.xxxxxxxx|1772472600000|3
                    recordType: workflowStage
                    accountId: Account.xxxxxxxx
                    stageId: S.xxxxxxxx
                    userIds:
                      - U.xxxxxxxx
                    role: closer
                    timestamp: 2026-03-02T17:30:00.000Z
                    reason: closer at time of Closed
                withheld: 0
                truncated: false
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  total:
                    type: number
                    description: Number of records behind the KPI. For count KPIs it equals the
                      /report/kpi value.
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        recordId:
                          type: string
                          description: ID of the indexed record the KPI counted.
                        recordType:
                          type: string
                          enum:
                            - workflowStage
                            - workflowAction
                            - task
                            - recording
                        accountId:
                          $ref: "#/components/schemas/accountId"
                        stageId:
                          $ref: "#/components/schemas/SId"
                        actionId:
                          $ref: "#/components/schemas/AId"
                        userIds:
                          type: array
                          items:
                            $ref: "#/components/schemas/userId"
                          description: Users the record was credited to.
                        role:
                          type: string
                          enum:
                            - account
                            - actor
                            - setter
                            - closer
                            - owner
                            - user
                          description: Why the users were credited. For setter and closer, it is the
                            setter or closer at the time of the stage entry, not
                            the current one.
                        timestamp:
                          description: When the counted event happened (ISO 8601).
                          $ref: "#/components/schemas/__schema1366"
                        value:
                          description: What the record adds to a summed KPI, such as recording seconds.
                          $ref: "#/components/schemas/__schema1367"
                        reason:
                          type: string
                          description: Readable summary, for example "closer at time of Closed".
                      required:
                        - recordId
                        - recordType
                        - userIds
                        - role
                        - reason
                      additionalProperties: false
                  withheld:
                    type: number
                    description: "Records left out of `records` because you cannot list their
                      account, task, or recording through /account/list,
                      /task/list, or /recording/list. They still count in
                      `total`. When `truncated` is true this is a lower bound:
                      it counts only the hidden records among the first `limit`
                      matches."
                  truncated:
                    type: boolean
                    description: True when `limit` cut off the matching records. Only the first
                      `limit` matches, oldest first, are checked, so `withheld`
                      is a lower bound and `records` can hold fewer than `limit`
                      even though later matches you can see exist. Raise `limit`
                      or narrow the filter to see them.
                required:
                  - type
                  - total
                  - records
                  - withheld
                  - truncated
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /report/time:
    post:
      operationId: report-time-v1
      summary: Get KPI over time
      tags:
        - Report
      description: Returns one KPI by calendar interval (in the caller's timezone) and
        group, with interval, group, and overall totals. Use it for trend charts
        of a single metric; use /report/kpi instead for many KPIs in one table
        without a time breakdown. Pick the KPI from /report/column. Requires
        report permissions for the KPI, and results are limited to the teams the
        caller can view.
      requestBody:
        content:
          application/json:
            example:
              column:
                value: contact.pitches
                accumulator: sum
              interval: month
              grouping:
                type: team
                level: 1
              filter:
                startDate: 1735718400000
                endDate: 1740815999999
                teams:
                  - Team.sales-west
            schema:
              type: object
              properties:
                column:
                  $ref: "#/components/schemas/__schema594"
                interval:
                  $ref: "#/components/schemas/__schema595"
                grouping:
                  $ref: "#/components/schemas/__schema596"
                filter:
                  $ref: "#/components/schemas/__schema597"
                options:
                  $ref: "#/components/schemas/__schema598"
              required:
                - column
                - interval
                - grouping
              description: Single-KPI trend report. Average-per-period,
                timeline/status-transition, and days-since KPIs are not
                semantically supported.
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                intervals:
                  - key: "1735718400000"
                    value: 1735718400000
                    label: 2025-01-01T00:00:00.000-08:00
                  - key: "1738396800000"
                    value: 1738396800000
                    label: 2025-02-01T00:00:00.000-08:00
                groups:
                  - key: Team.sales-west
                    value:
                      teamId: Team.sales-west
                      name: Sales West
                      level: 1
                values:
                  - - 42
                  - - 51
                intervalTotals:
                  - 42
                  - 51
                groupTotals:
                  - 93
                total: 93
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  intervals:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1368"
                    description: Ordered calendar buckets.
                  groups:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1368"
                    description: Ordered breakdown groups.
                  values:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1369"
                    description: Matrix indexed by interval, then group.
                  intervalTotals:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1370"
                    description: Totals aligned with intervals.
                  groupTotals:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1370"
                    description: Totals aligned with groups.
                  total:
                    description: Total across all intervals and groups.
                    $ref: "#/components/schemas/__schema1370"
                required:
                  - type
                  - intervals
                  - groups
                  - values
                  - intervalTotals
                  - groupTotals
                  - total
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /role/get:
    post:
      operationId: role-get-v1
      summary: Get Role
      tags:
        - Role
      description: "Retrieves one role. Set `includeHolders: true` to also get its
        holders, one entry per user and team the role is applied on (no team for
        a direct assignment), the matching `members`, and, for callers with the
        `role:manage` permission, the role's permission scopes. `extended: true`
        alone returns only `members`, read from the search index. Requires the
        `role:list` permission in the role's company. Use `/role/list` to find a
        role ID by name, and `/user/get` to see every role one user holds and on
        which team."
      requestBody:
        content:
          application/json:
            example:
              roleId: Role.teamLeader
              includeHolders: true
            schema:
              type: object
              properties:
                roleId:
                  $ref: "#/components/schemas/RoleId"
                extended:
                  description: Include the members
                  $ref: "#/components/schemas/__schema599"
                includeHolders:
                  description: Include the members, each holder with the team the role is applied
                    on, and (with role:manage) the role's permissions
                  $ref: "#/components/schemas/__schema600"
              required:
                - roleId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                role:
                  roleId: Role.teamLeader
                  companyId: C:company123
                  name: Team Leader
                  roleType: manager
                  assignment: team
                members:
                  - userId: U:user123
                    firstName: Jane
                    lastName: Doe
                holders:
                  - user:
                      userId: U:user123
                      firstName: Jane
                      lastName: Doe
                  - user:
                      userId: U:user123
                      firstName: Jane
                      lastName: Doe
                    teamId: Team:east
                    teamName: East Office
                permissions:
                  account:manage:
                    - entity: company
                      source: Role.teamLeader
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  role:
                    type: object
                    properties:
                      isDeleted:
                        $ref: "#/components/schemas/isDeletedOutput"
                      modifiedBy:
                        $ref: "#/components/schemas/__schema807"
                      createdAt:
                        $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                      createdBy:
                        $ref: "#/components/schemas/auditPropsCreatedBy"
                      updatedAt:
                        $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                      updatedBy:
                        $ref: "#/components/schemas/auditPropsUpdatedBy"
                      lastUpdateProcess:
                        $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                      version:
                        $ref: "#/components/schemas/auditPropsVersionOutput"
                      name:
                        $ref: "#/components/schemas/__schema859"
                      roleType:
                        $ref: "#/components/schemas/__schema858"
                      description:
                        $ref: "#/components/schemas/__schema1372"
                      assignment:
                        $ref: "#/components/schemas/__schema1373"
                      roleId:
                        $ref: "#/components/schemas/RoleId"
                      companyId:
                        $ref: "#/components/schemas/companyId"
                      canAssign:
                        $ref: "#/components/schemas/__schema1374"
                    required:
                      - name
                      - roleId
                      - companyId
                    additionalProperties: false
                  members:
                    description: Active users holding the role. With `includeHolders`, only those
                      the source memberships confirm, matching `holders`; with
                      only `extended`, straight from the search index
                    $ref: "#/components/schemas/__schema1376"
                  holders:
                    description: One entry per user and team the role is applied on; no team for a
                      direct assignment
                    $ref: "#/components/schemas/__schema1377"
                  permissions:
                    description: The role's permission scopes; returned only to callers with
                      role:manage
                    $ref: "#/components/schemas/__schema1263"
                required:
                  - type
                  - role
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /role/list:
    post:
      operationId: role-list-v1
      summary: List Roles
      tags:
        - Role
      description: "Lists every role in a company, including roles nobody holds. Set
        `includeHolders: true` to also get each role's `holderCount` (active
        users who hold it directly or on any team; it can lag an assignment
        change by a few seconds) and `autoEnrollPrograms` (active programs that
        enroll a user when they are assigned the role). Archived roles can still
        have holders and continue granting scopes. Set `showArchived: true` and
        `includeHolders: true` to list archived roles with their holder counts;
        set `showArchived: all` to return both active and archived roles. Omit
        `companyId` for your own company. Requires the `role:list` permission.
        Use this to check whether a role exists by name; use `/role/get` with
        `includeHolders: true` to see who holds a role."
      requestBody:
        content:
          application/json:
            example:
              companyId: C:company123
              includeHolders: true
            schema:
              type: object
              properties:
                showArchived:
                  $ref: "#/components/schemas/showArchived"
                companyId:
                  $ref: "#/components/schemas/companyId"
                includeHolders:
                  description: Include each role's holderCount and autoEnrollPrograms
                  $ref: "#/components/schemas/__schema601"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                roles:
                  - roleId: Role.teamLeader
                    companyId: C:company123
                    name: Team Leader
                    roleType: manager
                    assignment: team
                    holderCount: 2
                    autoEnrollPrograms:
                      - programId: Program.leaderOnboarding
                        name: Leader Onboarding
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  roles:
                    type: array
                    items:
                      type: object
                      properties:
                        isDeleted:
                          $ref: "#/components/schemas/isDeletedOutput"
                        modifiedBy:
                          $ref: "#/components/schemas/__schema807"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                        version:
                          $ref: "#/components/schemas/auditPropsVersionOutput"
                        name:
                          $ref: "#/components/schemas/__schema859"
                        roleType:
                          $ref: "#/components/schemas/__schema858"
                        description:
                          $ref: "#/components/schemas/__schema1372"
                        assignment:
                          $ref: "#/components/schemas/__schema1373"
                        roleId:
                          $ref: "#/components/schemas/RoleId"
                        companyId:
                          $ref: "#/components/schemas/companyId"
                        canAssign:
                          $ref: "#/components/schemas/__schema1374"
                        holderCount:
                          description: "With `includeHolders`: active users holding the role directly or
                            on any team, from the search index, so it can lag an
                            assignment change by a few seconds"
                          $ref: "#/components/schemas/__schema1380"
                        autoEnrollPrograms:
                          description: "With `includeHolders`: active programs that enroll a user when
                            they are assigned this role"
                          $ref: "#/components/schemas/__schema1381"
                      required:
                        - name
                        - roleId
                        - companyId
                      additionalProperties: false
                required:
                  - type
                  - roles
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /search:
    post:
      operationId: universal-search-v1
      summary: Universal Search
      tags:
        - Search
      description: Free-text search by name or address across the accounts, calendar
        events, teams, and users visible to the authenticated user, plus address
        suggestions for locations. Use `scopes` to limit the entity types
        searched; when omitted, all scopes except `Location` are searched.
        `Company` results are only returned to Terros staff. Pass `bias` to
        prefer address suggestions near a coordinate. Results are short
        summaries, capped at 40 per request (plus any location results). Their
        identifiers are `accountId`, `eventId`, `companyId`, `teamId`, `userId`,
        or, when `type` is `Location`, `placeId`; follow up with `/account/get`
        or the corresponding endpoint for full details. For a Location result,
        `placeId` is either a supported Terros location ID (`TLoc.`, `FA.`,
        `LocNew.`, `Can.`, or `PR.`) or an external address autocomplete
        identifier. Exchange an external identifier for structured address
        details and a matched Terros location ID before using it with endpoints
        that require `locationId`. Legacy `Loc:` values pass schema validation,
        but the current location reader does not resolve them and returns
        NotFound. Use `/account/list` instead for structured account filters and
        pagination, and `/user/search` or `/user/list` for user-specific
        filters.
      requestBody:
        content:
          application/json:
            example:
              query: Jane Doe
              scopes:
                - User
                - Account
              archived: false
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                query:
                  type: string
                  minLength: 1
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                      - Account
                      - Calendar
                      - Company
                      - Team
                      - User
                      - Location
                bias:
                  $ref: "#/components/schemas/latlng"
                companyIds:
                  description: Only applies to User and Team search scopes.
                  $ref: "#/components/schemas/__schema602"
              required:
                - query
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                results:
                  - type: User
                    userId: U:jane-doe
                    companyId: C:example-solar
                    avatarUrl: https://avatars.terros.com/U%3Ajane-doe
                    description: Jane Doe
                    subtitle: Example Solar
                    isDeleted: false
                  - type: Account
                    accountId: Account:jane-doe
                    description: Jane Doe
                    subtitle: 123 Main St, Irvine, CA, 92614
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  results:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            type:
                              type: string
                              const: Account
                            accountId:
                              $ref: "#/components/schemas/accountId"
                            ownerId:
                              $ref: "#/components/schemas/userId"
                            workflowId:
                              $ref: "#/components/schemas/WFId"
                            workflowStageId:
                              $ref: "#/components/schemas/SId"
                            workflowActionId:
                              $ref: "#/components/schemas/AId"
                            teamId:
                              $ref: "#/components/schemas/teamId"
                          required:
                            - description
                            - type
                            - accountId
                          additionalProperties: false
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            type:
                              type: string
                              const: Calendar
                            eventId:
                              $ref: "#/components/schemas/EventId"
                          required:
                            - description
                            - type
                            - eventId
                          additionalProperties: false
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            type:
                              type: string
                              const: Company
                            companyId:
                              $ref: "#/components/schemas/companyId"
                            avatarUrl:
                              type: string
                            avatarBlurhash:
                              type: string
                            state:
                              $ref: "#/components/schemas/accessStatus"
                          required:
                            - description
                            - type
                            - companyId
                            - avatarUrl
                            - state
                          additionalProperties: false
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            type:
                              type: string
                              const: Team
                            teamId:
                              $ref: "#/components/schemas/teamId"
                            avatarUrl:
                              type: string
                            avatarBlurhash:
                              type: string
                          required:
                            - description
                            - type
                            - teamId
                            - avatarUrl
                          additionalProperties: false
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            isDeleted:
                              $ref: "#/components/schemas/isDeletedOutput"
                            type:
                              type: string
                              const: User
                            userId:
                              $ref: "#/components/schemas/userId"
                            color:
                              type: string
                            companyId:
                              type: string
                              pattern: ^C((\.)|(:))[\s\S]{0,}$
                              description: The user's company. `subtitle` holds the company name.
                              example: C.123-4aBc_d
                              $ref: "#/components/schemas/companyId"
                            avatarUrl:
                              type: string
                            avatarBlurhash:
                              type: string
                          required:
                            - description
                            - type
                            - userId
                            - companyId
                            - avatarUrl
                          additionalProperties: false
                        - type: object
                          properties:
                            description:
                              $ref: "#/components/schemas/__schema1382"
                            subtitle:
                              $ref: "#/components/schemas/__schema1383"
                            type:
                              type: string
                              const: Location
                            placeId:
                              type: string
                              description: The Location result identifier. A value beginning with `TLoc.`,
                                `FA.`, `LocNew.`, `Can.`, or `PR.` is already a
                                supported Terros location ID. Otherwise it is an
                                external address autocomplete identifier that
                                must be exchanged for structured address details
                                and a matched Terros location ID. Legacy `Loc:`
                                values pass schema validation, but the current
                                location reader does not resolve them and
                                returns NotFound.
                          required:
                            - description
                            - type
                            - placeId
                          additionalProperties: false
                      type: object
                required:
                  - type
                  - results
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /task/get:
    post:
      operationId: task-get-v1
      summary: Get task
      tags:
        - Task
      description: Retrieves a single task by its ID. Requires the `task:list`
        permission for the task owner or the user who assigned it. Use
        `/task/list` or `/task/management` instead to find tasks.
      requestBody:
        content:
          application/json:
            example:
              taskId: Task.123
            schema:
              type: object
              properties:
                taskId:
                  $ref: "#/components/schemas/TaskId"
              required:
                - taskId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                task:
                  ownerId: U:user123
                  type: ExternalLink
                  subject: Complete the external integration
                  required: true
                  actions: []
                  priority: 1
                  criteria:
                    type: externalLink
                    label: Click on me!
                    url: https://example.com
                    completeWhen: external
                  taskId: Task.123
                  status: Created
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  task:
                    $ref: "#/components/schemas/__schema1315"
                required:
                  - type
                  - task
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /task/list:
    post:
      operationId: task-list-v1
      summary: List tasks
      tags:
        - Task
      description: Lists tasks assigned to a single user, sorted by priority (highest
        first), within an optional date range. Omit `ownerId` to use the
        authenticated user; `endDate` defaults to now. Requires the `task:list`
        permission for the owner. Use `/task/management` instead to search tasks
        across multiple owners, teams, programs, or statuses.
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                ownerId:
                  $ref: "#/components/schemas/userId"
                fromId:
                  description: List tasks from this user
                  deprecated: true
                  $ref: "#/components/schemas/userId"
                startDate:
                  description: The start date from when tasks should be retrieved, in UTC epoch
                    milliseconds
                  $ref: "#/components/schemas/__schema603"
                endDate:
                  description: The end date from when tasks should be retrieved, in UTC epoch
                    milliseconds
                  $ref: "#/components/schemas/__schema604"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                tasks:
                  - ownerId: U:user123
                    type: ExternalLink
                    subject: Complete the external integration
                    required: true
                    actions: []
                    priority: 1
                    criteria:
                      type: externalLink
                      label: Click on me!
                      url: https://example.com
                      completeWhen: external
                    taskId: Task.123
                    status: Created
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  tasks:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1315"
                required:
                  - type
                  - tasks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /task/update:
    post:
      operationId: task-update-v1
      summary: Update task
      tags:
        - Task
      description: >-
        Updates one or more tasks, identified by `taskId` and/or `taskIds`. Only
        the fields you provide are changed. Requires the `task:update` or
        `task:manage` permission for the task owners.  


        To mark an external task as completed, update `status` to `Completed`
        and `completedAt` to the time the task was completed (`completedAt`
        defaults to now when omitted). Without `task:manage`, a task can only be
        marked completed if it is closable by its owner or you assigned it.
      requestBody:
        content:
          application/json:
            example:
              task:
                taskId: Task.123
                status: Completed
                completedAt: 1793992789035
            schema:
              type: object
              properties:
                task:
                  type: object
                  properties:
                    isDeleted:
                      $ref: "#/components/schemas/isDeleted"
                    modifiedBy:
                      $ref: "#/components/schemas/__schema132"
                    createdAt:
                      $ref: "#/components/schemas/auditPropsCreatedAt"
                    createdBy:
                      $ref: "#/components/schemas/auditPropsCreatedBy"
                    updatedAt:
                      $ref: "#/components/schemas/auditPropsUpdatedAt"
                    updatedBy:
                      $ref: "#/components/schemas/auditPropsUpdatedBy"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                    version:
                      $ref: "#/components/schemas/auditPropsVersion"
                    ownerId:
                      $ref: "#/components/schemas/userId"
                    targetId:
                      $ref: "#/components/schemas/userId"
                    type:
                      type: string
                      enum:
                        - AcknowledgeEvaluation
                        - Birthday
                        - CalendarEvent
                        - ConfirmAppointment
                        - ConfirmEventOutcome
                        - ConfirmManagerInterview
                        - Custom
                        - ExternalLink
                        - ConfirmShadowDay
                        - ConversionFromPitchToLead
                        - FixIntegrationMapping
                        - GradeEvaluation
                        - GameInvitations
                        - GameRaffles
                        - GamePickPrizes
                        - MilestoneAllTimeApprove
                        - MilestoneAllTimeInstall
                        - MilestoneAllTimeLead
                        - MilestoneAllTimePitch
                        - MilestoneFirstPitch
                        - MilestoneLastMonthApprove
                        - MilestoneLastMonthInstall
                        - MilestoneLastMonthLead
                        - MilestoneLastMonthPitch
                        - MilestoneThisQuarterApprove
                        - MilestoneThisQuarterInstall
                        - MilestoneThisQuarterLead
                        - MilestoneThisQuarterPitch
                        - SalesActivity
                        - SalesTraining
                        - ScheduleInterview
                        - SetCloserSettings
                        - SendMessage
                        - SubmitQuarterlyPlan
                        - SubmitWeeklyPlan
                        - ReauthorizeGoogle
                        - RecordConversation
                        - RecordEvaluation
                        - ResubmitRejectedPlan
                        - ReviewSubmittedPlan
                        - TakeQuiz
                        - TimeSinceLastApprove
                        - TimeSinceLastLead
                        - TimeSinceLastPitch
                        - UpdateCloserAvailability
                        - UploadProfilePicture
                        - WatchVideo
                        - WorkAnniversary
                        - WorkflowTasks
                    subject:
                      type: string
                      description: short sentence case title for this task
                    body:
                      description: longer explanation for this task (what, why, and how). Displays
                        below the title so don't repeat that.
                      $ref: "#/components/schemas/__schema605"
                    dueDate:
                      description: When the task is due, in UTC epoch milliseconds
                      $ref: "#/components/schemas/__schema606"
                    required:
                      type: boolean
                      description: must this task be completed today?
                    rejectable:
                      description: "can this task be rejected? (default: true)"
                      $ref: "#/components/schemas/__schema607"
                    closable:
                      description: can this task be marked as completed by the user?
                      $ref: "#/components/schemas/__schema608"
                    actions:
                      type: array
                      items:
                        type: object
                        properties:
                          label:
                            type: string
                          link:
                            type: string
                          value:
                            type:
                              - string
                              - number
                              - boolean
                        required:
                          - label
                    priority:
                      type: number
                      description: priority to describe the importance (and urgency) of a task
                    originTaskId:
                      anyOf:
                        - $ref: "#/components/schemas/MTId"
                        - $ref: "#/components/schemas/PTId"
                    programId:
                      $ref: "#/components/schemas/ProgramId"
                    criteria:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              const: activity
                            activityId:
                              $ref: "#/components/schemas/__schema609"
                            count:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                          required:
                            - type
                            - activityId
                            - count
                        - type: object
                          properties:
                            type:
                              type: string
                              const: workflow
                            count:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                            stageOrActionId:
                              anyOf:
                                - $ref: "#/components/schemas/SId"
                                - $ref: "#/components/schemas/AId"
                          required:
                            - type
                            - count
                            - stageOrActionId
                        - type: object
                          properties:
                            type:
                              type: string
                              const: video
                            videoId:
                              $ref: "#/components/schemas/__schema612"
                            tags:
                              type: array
                              items:
                                type: string
                            description:
                              type: string
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              type: string
                              const: videoChat
                            description:
                              type: string
                            target:
                              anyOf:
                                - $ref: "#/components/schemas/__schema613"
                                - $ref: "#/components/schemas/userId"
                              description: The target for the video chat (any manager or a specific user),
                                manager by default if not specified
                            createResponseTask:
                              description: Whether to create a task for the user to respond to the message
                              $ref: "#/components/schemas/__schema614"
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              type: string
                              const: shadow
                            target:
                              type: string
                              enum:
                                - manager
                                - team
                            completeWhen:
                              type: string
                              enum:
                                - scheduled
                                - happened
                            count:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                          required:
                            - type
                            - target
                            - completeWhen
                        - type: object
                          properties:
                            type:
                              type: string
                              const: evaluation
                            evaluator:
                              type: string
                              enum:
                                - manager
                                - self
                            completeWhen:
                              description: When the evaluation should be marked as complete, default to graded
                              $ref: "#/components/schemas/__schema615"
                            count:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              type: string
                              const: convo
                            completeWhen:
                              type: string
                              enum:
                                - recorded
                                - reviewedFeedback
                                - selfAssessed
                                - submittedForFeedback
                                - managerFeedback
                            count:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              type: string
                              const: externalLink
                            label:
                              type: string
                            url:
                              type: string
                            completeWhen:
                              type: string
                              enum:
                                - clicked
                                - external
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - type
                            - url
                            - completeWhen
                        - type: object
                          properties:
                            type:
                              type: string
                              const: quiz
                            quizId:
                              $ref: "#/components/schemas/QuizId"
                          required:
                            - type
                            - quizId
                      type: object
                    nextTaskId:
                      deprecated: true
                      $ref: "#/components/schemas/TaskId"
                    nextTaskIds:
                      type: array
                      items:
                        $ref: "#/components/schemas/TaskId"
                    openSince:
                      description: When the task opened, in UTC epoch milliseconds
                      $ref: "#/components/schemas/__schema616"
                    expiration:
                      anyOf:
                        - description: minutes after the due that the task can still be completed, 0 for
                            expires at due date
                          $ref: "#/components/schemas/__schema617"
                        - type: string
                          const: programEndDate
                          description: expires at the end of the program
                    taskId:
                      $ref: "#/components/schemas/TaskId"
                    from:
                      description: populated asynchronously from fromId during transformation
                      $ref: "#/components/schemas/tinyUser"
                    owner:
                      description: populated asynchronously from ownerId during transformation
                      $ref: "#/components/schemas/tinyUser"
                    status:
                      $ref: "#/components/schemas/__schema619"
                    completedAt:
                      description: When the task was completed, in UTC epoch milliseconds
                      $ref: "#/components/schemas/__schema620"
                    ownerFeedback:
                      type: string
                    snoozeUntil:
                      description: When the snooze ends, in UTC epoch milliseconds
                      $ref: "#/components/schemas/__schema621"
                    progress:
                      description: For tasks that have criteria to complete (i.e. Pitch 3 houses) the
                        progress is how many have been completed
                      $ref: "#/components/schemas/__schema622"
                    taskIds:
                      type: array
                      items:
                        $ref: "#/components/schemas/TaskId"
              required:
                - task
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                task:
                  ownerId: U:user123
                  type: ExternalLink
                  subject: Complete the external integration
                  required: true
                  actions: []
                  priority: 1
                  criteria:
                    type: externalLink
                    label: Click on me!
                    url: https://example.com
                    completeWhen: external
                  taskId: Task.123
                  status: Created
                tasks:
                  - ownerId: U:user123
                    type: ExternalLink
                    subject: Complete the external integration
                    required: true
                    actions: []
                    priority: 1
                    criteria:
                      type: externalLink
                      label: Click on me!
                      url: https://example.com
                      completeWhen: external
                    taskId: Task.123
                    status: Created
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  task:
                    $ref: "#/components/schemas/__schema1315"
                  tasks:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1315"
                required:
                  - type
                  - task
                  - tasks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /task/management:
    post:
      operationId: task-management-v1
      x-terros-readOnly: true
      summary: Manage tasks
      tags:
        - Task
      description: Searches tasks across owners, assigners, teams, programs, statuses,
        and other criteria for administrative task management. Requires the
        `task:manage` permission for the company or the requested owners,
        assigners, and teams. Use `/task/list` instead to get a single user's
        own tasks.
      requestBody:
        content:
          application/json:
            example:
              teamIds:
                - Team.abc123
              statuses:
                - Created
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                ownerIds:
                  type: array
                  items:
                    anyOf:
                      - $ref: "#/components/schemas/userId"
                fromIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/userId"
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
                startDate:
                  $ref: "#/components/schemas/utcMilliseconds"
                endDate:
                  $ref: "#/components/schemas/utcMilliseconds"
                programIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/ProgramId"
                criteriaTypes:
                  type: array
                  items:
                    type: string
                    enum:
                      - activity
                      - workflow
                      - video
                      - videoChat
                      - shadow
                      - evaluation
                      - convo
                      - externalLink
                      - quiz
                statuses:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema619"
                quizIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/QuizId"
                activityIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema609"
                stageOrActionIds:
                  type: array
                  items:
                    anyOf:
                      - $ref: "#/components/schemas/SId"
                      - $ref: "#/components/schemas/AId"
                videoIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/__schema612"
                query:
                  type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                tasks:
                  - ownerId: U:user123
                    type: ExternalLink
                    subject: Complete the external integration
                    required: true
                    actions: []
                    priority: 1
                    criteria:
                      type: externalLink
                      label: Click on me!
                      url: https://example.com
                      completeWhen: external
                    taskId: Task.123
                    status: Created
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  tasks:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1315"
                required:
                  - type
                  - tasks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /task/remove:
    post:
      operationId: task-remove-v1
      summary: Remove task
      tags:
        - Task
      description: Removes one or more tasks, identified by `taskId` and/or `taskIds`.
        By default tasks are archived; set `archive` to `false` to delete them
        permanently. Requires the `task:update` permission for the task owners.
      requestBody:
        content:
          application/json:
            example:
              taskId: Task.123
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                taskId:
                  $ref: "#/components/schemas/TaskId"
                taskIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/TaskId"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/list:
    post:
      operationId: list-teams-v1
      summary: List Teams
      tags:
        - Team
      description: "Lists the teams visible to the authenticated user in their
        company, with each team's place in the org tree: its parent (`parentId`)
        and all ancestors (`parentTeamIds`), its direct children
        (`childTeamIds`), whether it is a leaf (`isLeaf`), and its `level` with
        the company's name for that level (`levelName`). Users with company-wide
        team access see every team; others see only their downline or
        visibility-restricted teams, and under impersonation the impersonated
        user's. Children and leaves are computed from the teams the caller can
        see, so a team whose child teams are all hidden from the caller is a
        leaf for that caller. Archived teams are excluded unless `showArchived`
        is set. Set `leaves` to list only leaf teams, the bottom of the org
        chart, and `underTeamId` to list only the teams below one team (combine
        them for the leaves under a team). To report on the lowest teams a user
        sees, find the user (for example with `/search`), make the request as
        that user (impersonating them needs `user:login`), list with `leaves`,
        then report on a returned `teamId`. Use `/team/get` for a single team's
        members and child teams, or `/team/downline` to list the users under a
        team."
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                showArchived:
                  $ref: "#/components/schemas/showArchived"
                companyId:
                  $ref: "#/components/schemas/companyId"
                underTeamId:
                  description: Only return teams below this team, at any depth. The team itself is
                    not included.
                  $ref: "#/components/schemas/teamId"
                leaves:
                  description: "Only return leaf teams: those with no child teams visible to the
                    caller."
                  $ref: "#/components/schemas/__schema623"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                teams:
                  - teamId: Team.NFL
                    name: National Football League
                    description: Professional American football league consisting of 32 teams.
                    level: 4
                    parentTeamIds: []
                    childTeamIds:
                      - Team.AFC
                    isLeaf: false
                    levelName: League
                  - teamId: Team.AFC
                    name: American Football Conference
                    description: One of the two conferences in the National Football League.
                    level: 3
                    parentTeamIds:
                      - Team.NFL
                    childTeamIds:
                      - Team.AFCWest
                    isLeaf: false
                    levelName: Conference
                  - teamId: Team.AFCWest
                    name: AFC West
                    description: Western division of the American Football Conference.
                    level: 2
                    parentTeamIds:
                      - Team.AFC
                      - Team.NFL
                    childTeamIds:
                      - Team.Broncros
                      - Team.Chiefs
                      - Team.Raiders
                      - Team.Chargers
                    isLeaf: false
                    levelName: Division
                  - teamId: Team.Broncros
                    name: Broncros
                    description: Professional American football team based in Denver, Colorado.
                    level: 1
                    parentTeamIds:
                      - Team.AFCWest
                      - Team.AFC
                      - Team.NFL
                    officeAddress: 1701 Wynkoop St, Denver, CO 80202
                    officeLocation:
                      latitude: 39.7561
                      longitude: -104.9942
                    childTeamIds: []
                    isLeaf: true
                  - teamId: Team.Chiefs
                    name: Chiefs
                    description: Professional American football team based in Kansas City, Missouri.
                    level: 1
                    parentTeamIds:
                      - Team.AFCWest
                      - Team.AFC
                      - Team.NFL
                    officeAddress: 1 Arrowhead Dr, Kansas City, MO 64129
                    officeLocation:
                      latitude: 39.049
                      longitude: -94.4839
                    childTeamIds: []
                    isLeaf: true
                  - teamId: Team.Raiders
                    name: Raiders
                    description: Professional American football team based in Las Vegas, Nevada.
                    level: 1
                    parentTeamIds:
                      - Team.AFCWest
                      - Team.AFC
                      - Team.NFL
                    officeAddress: 3333 Al Davis Way, Las Vegas, NV 89118
                    officeLocation:
                      latitude: 36.0908
                      longitude: -115.1831
                    childTeamIds: []
                    isLeaf: true
                  - teamId: Team.Chargers
                    name: Chargers
                    description: Professional American football team based in Los Angeles,
                      California.
                    level: 1
                    parentTeamIds:
                      - Team.AFCWest
                      - Team.AFC
                      - Team.NFL
                    officeAddress: 1020 Pro Player Way, Inglewood, CA 90301
                    officeLocation:
                      latitude: 33.9533
                      longitude: -118.3392
                    childTeamIds: []
                    isLeaf: true
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  teams:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1384"
                required:
                  - type
                  - teams
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/get:
    post:
      operationId: get-team-v1
      summary: Get Team Details
      tags:
        - Team
      description: Retrieves a single team by `teamId`, along with its active members
        (with their team roles) and its direct child teams. The team carries the
        same org-tree fields as `/team/list` (`childTeamIds`, `isLeaf`,
        `levelName`), computed from the teams the caller can list. `childTeams`
        lists every direct child of the team, so it can include children that
        `childTeamIds` leaves out because the caller cannot list them. Requires
        the `team:list` permission on the team. Use `/team/list` to discover
        team IDs, or `/team/downline` to get every user on the team and all of
        its sub-teams.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.AFC
            schema:
              type: object
              properties:
                teamId:
                  $ref: "#/components/schemas/teamId"
                includeUploadUrls:
                  $ref: "#/components/schemas/includeUploadUrls"
              required:
                - teamId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                team:
                  teamId: Team.AFC
                  name: American Football Conference
                  description: One of the two conferences in the National Football League.
                  level: 3
                  parentTeamIds:
                    - Team.NFL
                  childTeamIds:
                    - Team.AFCWest
                    - Team.AFCEast
                  isLeaf: false
                  levelName: Conference
                childTeams:
                  - teamId: Team.AFCWest
                    name: AFC West
                    level: 2
                  - teamId: Team.AFCEast
                    name: AFC East
                    level: 2
                members: []
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  team:
                    $ref: "#/components/schemas/__schema1384"
                  childTeams:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema989"
                  members:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1391"
                required:
                  - type
                  - team
                  - childTeams
                  - members
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/add:
    post:
      operationId: add-team-v1
      summary: Add Team
      tags:
        - Team
      description: Creates a new team, optionally nested under a parent team via
        `parentId`. Requires the `team:add` permission on the parent team (or on
        the company for a top-level team). Fails if a team with the same name
        already exists under the same parent, or if the company uses
        manager-based teams.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.Broncros
              name: Broncros
              level: 1
              description: Professional American football team based in Denver, Colorado.
            schema:
              type: object
              properties:
                customFields:
                  $ref: "#/components/schemas/__schema6"
                teamId:
                  description: Unique team identifier, generated by the system if not provided
                  example: Team:team123
                  $ref: "#/components/schemas/teamId"
                name:
                  $ref: "#/components/schemas/teamName"
                parentId:
                  $ref: "#/components/schemas/parentTeamId"
                level:
                  $ref: "#/components/schemas/teamLevel"
                externalId:
                  $ref: "#/components/schemas/teamExternalId"
                description:
                  $ref: "#/components/schemas/teamDescription"
              required:
                - name
                - level
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                team:
                  teamId: Team.Broncros
                  name: Broncros
                  description: Professional American football team based in Denver, Colorado.
                  level: 1
                  parentTeamIds:
                    - Team.AFCWest
                    - Team.AFC
                    - Team.NFL
                  officeAddress: 1701 Wynkoop St, Denver, CO 80202
                  officeLocation:
                    latitude: 39.7561
                    longitude: -104.9942
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  team:
                    $ref: "#/components/schemas/__schema1443"
                required:
                  - type
                  - team
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/update:
    post:
      operationId: update-team-v1
      summary: Update Team
      tags:
        - Team
      description: Updates an existing team's properties, such as its name,
        description, parent team, office address, or meeting times. Omitted
        fields are unchanged. Set `officeAddress` or `officeLocation` to `null`
        to clear it; an empty `officeAddress` leaves the saved address
        unchanged. Requires the `team:update` permission on the team; changing
        `restrictVisibility` also requires `company:update`. Fields listed in
        the company's `lockedTeamFields` preference can be changed only by
        callers with `user:manage` on the team. Locking `officeAddress` also
        locks `officeLocation`. A request from anyone else that changes a locked
        field is rejected and nothing is saved. Locking `avatar` instead
        withholds `uploadAvatarUrl` from `/team/get` from anyone without
        `user:manage` on the team. A team cannot be moved under one of its own
        sub-teams. To change who is on the team, use the `/team/member/*`
        endpoints instead.
      requestBody:
        content:
          application/json:
            example:
              team:
                teamId: Team.Broncros
                name: Updated Broncos
            schema:
              type: object
              properties:
                team:
                  type: object
                  properties:
                    isDeleted:
                      $ref: "#/components/schemas/isDeleted"
                    modifiedBy:
                      $ref: "#/components/schemas/__schema132"
                    createdAt:
                      $ref: "#/components/schemas/auditPropsCreatedAt"
                    createdBy:
                      $ref: "#/components/schemas/auditPropsCreatedBy"
                    updatedAt:
                      $ref: "#/components/schemas/auditPropsUpdatedAt"
                    updatedBy:
                      $ref: "#/components/schemas/auditPropsUpdatedBy"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                    version:
                      $ref: "#/components/schemas/auditPropsVersion"
                    customFields:
                      $ref: "#/components/schemas/__schema6"
                    name:
                      $ref: "#/components/schemas/teamName"
                    parentId:
                      anyOf:
                        - $ref: "#/components/schemas/teamId"
                        - type: "null"
                    level:
                      $ref: "#/components/schemas/teamLevel"
                    externalId:
                      $ref: "#/components/schemas/teamExternalId"
                    description:
                      $ref: "#/components/schemas/teamDescription"
                    teamId:
                      $ref: "#/components/schemas/teamId"
                    timeZone:
                      $ref: "#/components/schemas/teamTimezone"
                    officeLocation:
                      anyOf:
                        - $ref: "#/components/schemas/teamOfficeLocation"
                        - type: "null"
                    officeAddress:
                      anyOf:
                        - $ref: "#/components/schemas/teamOfficeAddress"
                        - type: "null"
                    meetingTimes:
                      $ref: "#/components/schemas/teamMeetingTimes"
                    isCloserBoundary:
                      $ref: "#/components/schemas/teamIsCloserBoundary"
                    restrictVisibility:
                      $ref: "#/components/schemas/teamRestrictVisibility"
                    avatarBlurhash:
                      $ref: "#/components/schemas/teamAvatarBlurhash"
                    avatarUrl:
                      $ref: "#/components/schemas/teamAvatarUrl"
                    parentTeamIds:
                      $ref: "#/components/schemas/teamParentIds"
                    uploadAvatarUrl:
                      $ref: "#/components/schemas/teamUploadAvatarUrl"
                  required:
                    - teamId
              required:
                - team
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                team:
                  teamId: Team.Broncros
                  name: Updated Broncos
                  description: Professional American football team based in Denver, Colorado.
                  level: 1
                  parentTeamIds:
                    - Team.AFCWest
                    - Team.AFC
                    - Team.NFL
                  officeAddress: 1701 Wynkoop St, Denver, CO 80202
                  officeLocation:
                    latitude: 39.7561
                    longitude: -104.9942
                childTeams: []
                members:
                  - user:
                      firstName: John
                      lastName: Smith
                      email: john.smith@company.com
                      phone: "5551234567"
                      title: Sales Representative
                      timeZone: America/Los_Angeles
                      userId: U:user123
                      companyId: C:company123
                    membership: ""
                    roleIds:
                      - Role.M4N4G3R
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  team:
                    $ref: "#/components/schemas/__schema1443"
                  childTeams:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema989"
                  members:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1391"
                required:
                  - type
                  - team
                  - childTeams
                  - members
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/remove:
    post:
      operationId: remove-team-v1
      summary: Remove Team
      tags:
        - Team
      description: "Archives a team by default, which requires the `team:archive`
        permission on the team; `archive: false` permanently deletes it instead
        and is restricted to Tantalim users. The team must have no active
        members and no active sub-teams, so remove members with
        `/team/member/remove` and archive or move sub-teams first. Not available
        when the company uses manager-based teams."
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.Broncros
            schema:
              type: object
              properties:
                archive:
                  $ref: "#/components/schemas/archive"
                teamId:
                  $ref: "#/components/schemas/teamId"
              required:
                - teamId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/downline:
    post:
      operationId: get-team-downline-v1
      x-terros-readOnly: true
      summary: Get Team Downline
      tags:
        - Team
      description: "Lists every user in the downline of a team: members of the team
        itself and of all of its sub-teams, at any depth. Pass a company ID as
        `entityId` to list all users in the company. Archived users are excluded
        unless `archived` is set. Requires the `user:list` permission on the
        team or company. Use `/team/get` for only the direct members of a team,
        or `/team/list` to list the teams themselves."
      requestBody:
        content:
          application/json:
            example:
              entityId: Team.AFCWest
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                entityId:
                  anyOf:
                    - $ref: "#/components/schemas/teamId"
                    - $ref: "#/components/schemas/companyId"
              required:
                - entityId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                users:
                  - userId: U:user123
                    firstName: John
                    lastName: Smith
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  users:
                    type: array
                    items:
                      $ref: "#/components/schemas/tinyUserOutput"
                required:
                  - type
                  - users
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/member/add:
    post:
      operationId: add-team-member-v1
      summary: Add Team Member
      tags:
        - Team
      description: Adds a user to a team with the given team `roleIds`, or overwrites
        their existing membership on that team. If the company does not allow
        users to belong to multiple teams, the user is removed from their
        previous teams unless the deprecated `keepExisting` flag is true.
        Requires the `team:update` permission on the team. Use
        `/team/member/update` to change only some fields of an existing
        membership, such as roles or the locked flag.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.Broncos
              userId: U:user123
              roleIds:
                - Role.S4L3S_R3P
              locked: false
            schema:
              type: object
              properties:
                teamId:
                  $ref: "#/components/schemas/teamId"
                userId:
                  $ref: "#/components/schemas/userId"
                locked:
                  $ref: "#/components/schemas/__schema635"
                roleIds:
                  $ref: "#/components/schemas/__schema636"
                lastInterviewDate:
                  $ref: "#/components/schemas/__schema637"
                lastShadowDate:
                  $ref: "#/components/schemas/__schema639"
                keepExisting:
                  type: boolean
              required:
                - teamId
                - userId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/member/update:
    post:
      operationId: update-team-member-v1
      summary: Update Team Member
      tags:
        - Team
      description: Updates an existing team membership, such as the member's team
        `roleIds`, `locked` flag, or last interview and shadow dates. Fields
        that are omitted keep their current values. Requires the `team:update`
        permission on the team, except when users update their own membership
        without changing roles or the locked flag. Use `/team/member/add` to put
        a user on a new team.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.Broncos
              userId: U:user123
              roleIds:
                - Role.M4N4G3R
              locked: true
              lastInterviewDate: 1640995200000
              lastShadowDate: 1641081600000
            schema:
              type: object
              properties:
                teamId:
                  $ref: "#/components/schemas/teamId"
                userId:
                  $ref: "#/components/schemas/userId"
                locked:
                  $ref: "#/components/schemas/__schema635"
                roleIds:
                  $ref: "#/components/schemas/__schema636"
                lastInterviewDate:
                  $ref: "#/components/schemas/__schema637"
                lastShadowDate:
                  $ref: "#/components/schemas/__schema639"
              required:
                - teamId
                - userId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /team/member/remove:
    post:
      operationId: remove-team-member-v1
      summary: Remove Team Member
      tags:
        - Team
      description: Removes a user from a team. Requires the `team:update` permission
        on the team. If the company has visibility restrictions enabled, a user
        cannot be removed from their last team. This does not archive the user;
        use `/user/remove` for that.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.Broncos
              userId: U:user123
            schema:
              type: object
              properties:
                teamId:
                  $ref: "#/components/schemas/teamId"
                userId:
                  $ref: "#/components/schemas/userId"
              required:
                - teamId
                - userId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/add:
    post:
      operationId: user-add-v1
      summary: Add User
      tags:
        - User
      description: Creates a new user in the authenticated company and optionally adds
        them to teams via `teamMemberships` and assigns `directRoles`. Only
        Terros staff can set `user.companyId` to another company. Requires the
        `user:add` permission on the company or on one of the teams the user is
        added to. To add an existing user to a team, use `/team/member/add`
        instead.
      requestBody:
        content:
          application/json:
            example:
              user:
                firstName: John
                lastName: Smith
                email: john.smith@company.com
                phone: "5551234567"
                title: Sales Representative
                timeZone: America/Los_Angeles
            schema:
              type: object
              properties:
                user:
                  type: object
                  properties:
                    isDeleted:
                      $ref: "#/components/schemas/isDeleted"
                    importId:
                      $ref: "#/components/schemas/importId"
                    phone:
                      $ref: "#/components/schemas/userPhone"
                    firstName:
                      $ref: "#/components/schemas/userFirstName"
                    lastName:
                      $ref: "#/components/schemas/userLastName"
                    preferredName:
                      $ref: "#/components/schemas/userPreferredName"
                    email:
                      $ref: "#/components/schemas/userEmail"
                    timeZone:
                      $ref: "#/components/schemas/userTimeZone"
                    clientUserId:
                      $ref: "#/components/schemas/userClientUserId"
                    title:
                      $ref: "#/components/schemas/userTitle"
                    closerStatus:
                      $ref: "#/components/schemas/userCloserStatus"
                    companyId:
                      $ref: "#/components/schemas/__schema641"
                    managerId:
                      $ref: "#/components/schemas/userManagerId"
                    hasManager:
                      $ref: "#/components/schemas/userHasManager"
                    selfReportedManager:
                      $ref: "#/components/schemas/__schema643"
                    primaryTeam:
                      $ref: "#/components/schemas/__schema644"
                    betaProgram:
                      $ref: "#/components/schemas/userBetaProgram"
                    language:
                      $ref: "#/components/schemas/userLanguage"
                    secondaryLanguages:
                      $ref: "#/components/schemas/userSecondaryLanguages"
                    color:
                      $ref: "#/components/schemas/userColor"
                    superuserScore:
                      $ref: "#/components/schemas/userSuperuserScore"
                    customFields:
                      $ref: "#/components/schemas/__schema652"
                    accountId:
                      $ref: "#/components/schemas/__schema653"
                    whitelist:
                      $ref: "#/components/schemas/userWhitelist"
                    closer:
                      $ref: "#/components/schemas/__schema655"
                    userId:
                      $ref: "#/components/schemas/__schema668"
                  required:
                    - firstName
                    - lastName
                    - email
                  description: User data to create
                teamMemberships:
                  description: Optional team membership to assign the user to
                  example:
                    teamId: Team.sales
                    roleIds:
                      - Role.manager
                  $ref: "#/components/schemas/__schema669"
                directRoles:
                  description: Optional roles to assign the user to
                  example:
                    - Role.admin
                  $ref: "#/components/schemas/__schema670"
                teamId:
                  deprecated: true
                  description: Optional team ID to assign the user to - use teamMembership instead
                  example: Team.sales
                  $ref: "#/components/schemas/teamId"
                roleId:
                  deprecated: true
                  description: Optional role ID to assign the user to - use teamMembership or
                    directRoles instead
                  example: Role.admin
                  $ref: "#/components/schemas/RoleId"
              required:
                - user
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                user:
                  firstName: John
                  lastName: Smith
                  email: john.smith@company.com
                  phone: "5551234567"
                  title: Sales Representative
                  timeZone: America/Los_Angeles
                  userId: U:user123
                  companyId: C:company123
                password: TempPass123!
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  user:
                    $ref: "#/components/schemas/userProfileData"
                  password:
                    type: string
                required:
                  - type
                  - user
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/get:
    post:
      operationId: user-get-v1
      summary: Get User
      tags:
        - User
      description: Retrieves a single user, including their team memberships, primary
        team, and closer status. `userId` may be a User ID, email, account ID,
        or clientUserId; omit `userId` to get the authenticated user. Requires
        the `user:list` permission for the target user. Use `/user/profile` when
        you also need company details and roles, `/user/list` for many users, or
        `/user/search` to find users by name.
      requestBody:
        content:
          application/json:
            example:
              userId: U:user123
            schema:
              type: object
              properties:
                userId:
                  description: User ID, email, or clientUserId. Defaults to current user if not
                    provided
                  example: U:user123
                  $ref: "#/components/schemas/__schema141"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                user:
                  firstName: John
                  lastName: Smith
                  email: john.smith@company.com
                  phone: "5551234567"
                  title: Sales Representative
                  timeZone: America/Los_Angeles
                  userId: U:user123
                  companyId: C:company123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  user:
                    $ref: "#/components/schemas/userData"
                  roleAssignments:
                    description: The user's roles, one entry per team each is applied on, plus their
                      direct roles
                    $ref: "#/components/schemas/__schema1459"
                required:
                  - type
                  - user
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/profile:
    post:
      operationId: user-profile-v1
      summary: Get User Profile
      tags:
        - User
      description: Retrieves a user's full profile along with their company, including
        avatar, team memberships, roles, and closer status. `userId` may be a
        User ID, email, account ID, or clientUserId; omit `userId` to get the
        authenticated user's own profile (which also includes their permission
        map). Requires the `user:list` permission for the target user. Use
        `/user/get` when you only need the user record.
      requestBody:
        content:
          application/json:
            example:
              userId: U:user123
            schema:
              type: object
              properties:
                userId:
                  description: User ID, email, or clientUserId. Defaults to current user if not
                    provided
                  example: U:user123
                  $ref: "#/components/schemas/__schema671"
                includeUploadUrls:
                  $ref: "#/components/schemas/includeUploadUrls"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                user:
                  firstName: John
                  lastName: Smith
                  email: john.smith@company.com
                  phone: "5551234567"
                  title: Sales Representative
                  timeZone: America/Los_Angeles
                  userId: U:user123
                  companyId: C:company123
                  avatarUrl: https://example.com/avatar.jpg
                  biography: Experienced sales professional...
                company:
                  companyId: C:company123
                  name: Example Corp
                  kind: sandbox
                  accessStatus: active
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  user:
                    $ref: "#/components/schemas/userProfileData"
                  company:
                    type: object
                    properties:
                      modifiedBy:
                        $ref: "#/components/schemas/__schema807"
                      createdAt:
                        $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                      createdBy:
                        $ref: "#/components/schemas/auditPropsCreatedBy"
                      updatedAt:
                        $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                      updatedBy:
                        $ref: "#/components/schemas/auditPropsUpdatedBy"
                      lastUpdateProcess:
                        $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                      version:
                        $ref: "#/components/schemas/auditPropsVersionOutput"
                      name:
                        $ref: "#/components/schemas/__schema1009"
                      legalName:
                        $ref: "#/components/schemas/__schema1460"
                      kind:
                        $ref: "#/components/schemas/__schema1357"
                      accessStatus:
                        $ref: "#/components/schemas/__schema1002"
                      internalOwnerId:
                        $ref: "#/components/schemas/__schema1365"
                      billingEmail:
                        $ref: "#/components/schemas/__schema1003"
                      billingMethod:
                        $ref: "#/components/schemas/__schema1004"
                      maxUsers:
                        $ref: "#/components/schemas/__schema1361"
                      parentCompanyId:
                        $ref: "#/components/schemas/__schema1010"
                      salesforceAccountId:
                        $ref: "#/components/schemas/__schema1363"
                      size:
                        $ref: "#/components/schemas/__schema1012"
                      industries:
                        $ref: "#/components/schemas/__schema1006"
                      salesChannels:
                        $ref: "#/components/schemas/__schema1011"
                      demoOwnerId:
                        $ref: "#/components/schemas/__schema1461"
                      isDeleted:
                        $ref: "#/components/schemas/isDeletedOutput"
                      companyId:
                        $ref: "#/components/schemas/companyId"
                      accessOverride:
                        $ref: "#/components/schemas/__schema1462"
                      highestTeamLevel:
                        $ref: "#/components/schemas/__schema1005"
                      lowestTeamLevel:
                        $ref: "#/components/schemas/__schema1008"
                      levelNames:
                        $ref: "#/components/schemas/__schema1007"
                      timeZone:
                        $ref: "#/components/schemas/__schema1013"
                      avatarUrl:
                        $ref: "#/components/schemas/companyAvatarUrl"
                      avatarBlurhash:
                        $ref: "#/components/schemas/companyAvatarBlurhash"
                      uploadAvatarUrl:
                        $ref: "#/components/schemas/__schema1463"
                      iconUrl:
                        $ref: "#/components/schemas/__schema1465"
                      iconBlurhash:
                        $ref: "#/components/schemas/__schema1466"
                      uploadIconUrl:
                        $ref: "#/components/schemas/__schema1467"
                      demoState:
                        $ref: "#/components/schemas/__schema1358"
                      activeUserCount:
                        $ref: "#/components/schemas/__schema1362"
                    required:
                      - name
                      - kind
                      - accessStatus
                      - companyId
                    additionalProperties: false
                    description: Company information associated with the user
                required:
                  - type
                  - user
                  - company
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/remove:
    post:
      operationId: user-remove-v1
      summary: Remove User
      tags:
        - User
      description: "Archives one user (`userId`) or several users (`userIds`).
        Archived users can be restored with `/user/update`. Requires the
        `user:manage` permission. Bulk removal always archives and only applies
        to users in your company; for a single user, `archive: false`
        permanently deletes instead, which is restricted to Tantalim users and
        unavailable in production. You cannot remove your own account or
        whitelisted users."
      requestBody:
        content:
          application/json:
            example:
              userId: U:user123
              archive: true
            schema:
              $ref: "#/components/schemas/userRemoveInput"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/update:
    post:
      operationId: user-update-v1
      summary: Update User
      tags:
        - User
      description: "Updates fields on an existing user. Partial updates are supported:
        only the fields provided in `user` are changed, and `user.userId`
        defaults to the authenticated user when omitted. Send `startDate: null`
        to clear the start date. Requires the `user:update` permission for the
        target user, and archiving or restoring a user (`isDeleted`) also
        requires `user:manage`. Fields listed in the company `lockedUserFields`
        preference can be changed only by callers with `user:manage` on the
        user, and changing your own locked fields needs company-wide
        `user:manage`. A request from anyone else that changes a locked field is
        rejected and nothing is saved. Locking `avatar` instead withholds
        `uploadAvatarUrl` from `/user/profile` under the same rule. To change
        team membership or roles on a team, use `/team/member/add` or
        `/team/member/update` instead."
      requestBody:
        content:
          application/json:
            example:
              user:
                firstName: John
                lastName: Smith
                email: john.smith@company.com
                phone: "5551234567"
                title: Sales Representative
                timeZone: America/Los_Angeles
                userId: U:user123
                companyId: C:company123
            schema:
              $ref: "#/components/schemas/userUpdateInput"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                user:
                  firstName: John
                  lastName: Smith
                  email: john.smith@company.com
                  phone: "5551234567"
                  title: Sales Representative
                  timeZone: America/Los_Angeles
                  userId: U:user123
                  companyId: C:company123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  user:
                    $ref: "#/components/schemas/userProfileData"
                required:
                  - type
                  - user
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/list:
    post:
      operationId: user-list-v1
      summary: List Users
      tags:
        - User
      description: Lists users visible to the authenticated user. Provide `userIds` to
        fetch specific users from the database, `teamId` to list users on that
        team and its downline teams, or neither to list all users you can see in
        the company. Without `userIds`, role data comes from the search index
        and can be stale; `/user/get` is the source of truth for one user's role
        assignments. Archived users are excluded unless `showArchived` is set.
        Requires the `user:list` permission. Use `/user/search` to find users by
        name, or `/user/get` for full details on one user.
      requestBody:
        content:
          application/json:
            example:
              teamId: Team.test
            schema:
              $ref: "#/components/schemas/userListInput"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                users:
                  - firstName: John
                    lastName: Smith
                    email: john.smith@company.com
                    phone: "5551234567"
                    title: Sales Representative
                    timeZone: America/Los_Angeles
                    userId: U:user123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  users:
                    type: array
                    items:
                      $ref: "#/components/schemas/smallUserOutput"
                    description: Array of user information
                required:
                  - type
                  - users
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/search:
    post:
      operationId: user-search-v1
      summary: Search Users
      tags:
        - User
      description: Searches users visible to the authenticated user by name or phone
        number, with optional company, team, closer status, archive, downline,
        and result-size filters. Returns up to 20 users by default and excludes
        archived users unless `archived` is set. Without `companyId` it searches
        only your own company, so use `/search` to find users in other
        companies. Use this to find a user ID from a name; use `/user/list` to
        list every user on a team or company, or `/search` to search across
        multiple entity types at once.
      requestBody:
        content:
          application/json:
            example:
              query: John Smith
              teamIds:
                - Team:team123
              options:
                size: 20
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                companyId:
                  $ref: "#/components/schemas/companyId"
                query:
                  type: string
                teamIds:
                  type: array
                  items:
                    $ref: "#/components/schemas/teamId"
                closerStatus:
                  type: array
                  items:
                    $ref: "#/components/schemas/closerStatus"
                options:
                  type: object
                  properties:
                    downline:
                      description: When enabled, show the first 20 users from your downline
                      $ref: "#/components/schemas/__schema691"
                    size:
                      description: Number of users to return
                      $ref: "#/components/schemas/__schema692"
              required:
                - query
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                users:
                  - userId: U:user123
                    firstName: John
                    lastName: Smith
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  users:
                    type: array
                    items:
                      $ref: "#/components/schemas/tinyUserOutput"
                    description: List of users matching the search criteria
                required:
                  - type
                  - users
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /user/unlock:
    post:
      operationId: user-unlock-v1
      summary: Clear User Sign-in Lockout
      tags:
        - User
      description: Clears the lockout a user gets after too many failed sign-in
        attempts, from every IP address, so they can sign in again right away.
        Requires the `user:manage` permission for the user. Use it when a user
        reports being locked out. It does not change their password, and it
        succeeds even when the user is not locked out.
      requestBody:
        content:
          application/json:
            example:
              userId: U:user123
            schema:
              type: object
              properties:
                userId:
                  type: string
                  pattern: ^U((\.)|(:))[\s\S]{0,}$
                  description: User whose sign-in lockout to clear
                  example: U.1
                  $ref: "#/components/schemas/userId"
              required:
                - userId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/add:
    post:
      operationId: webhook-add-v1
      summary: Add webhook
      tags:
        - Webhook
      description: "Adds a webhook for the current company (the impersonated user's
        company when impersonating) that         sends changes to its `entity`
        records to `url`. `add`, `update` and `remove` choose which changes are
        sent.         `statusIds` is only allowed for `Account` webhooks. An
        `Account` webhook with no `workflowId` gets every account, in any
        workflow or none, narrowed only by the   `statusIds`, `workflowStageIds`
        and `workflowActionIds` it sets. With a `workflowId`, it gets accounts
        in that   workflow (narrowed by `workflowStageIds` and
        `workflowActionIds`) and accounts in no workflow (narrowed
        by   `statusIds`). Requires the `webhook:manage` permission in the
        webhook's company (the current company for add and list). Webhooks with
        `entity` `Company` can only be added or changed by Terros staff. `url`
        must use HTTPS, and must not point at an internal host name (such as
        `localhost` or a `.local` or `.internal`   name) or at a private,
        loopback or link-local IPv4 or IPv6 address, checked when the webhook is
        added or changed. `headers` are stored with the webhook but never
        returned by any webhook endpoint, because they can hold the   receiver's
        credentials. Webhook deliveries do not currently send
        them.         Deliveries for a webhook with no `target` (a plain URL
        webhook) and a signing secret are signed. Webhooks with a   built-in
        `target` (`CONNECT`, `ENERFLO`, `SERVICETITAN`, `SALESFORCE` or
        `JOBNIMBUS`) are not. A signed delivery's   `Terros-Signature` header
        holds `t=<unix seconds>,v1=<hex HMAC-SHA256>` of `<t>.<raw request
        body>` keyed with   the webhook's signing secret, so a receiver can
        check where a request came from. Retries and redrives are signed   again
        with a fresh `t`. You choose the secret: send `signingSecret` to set it.
        It is stored and never returned by   any endpoint, so keep your own
        copy. Webhooks added without one are not signed.         A new webhook
        can take up to 5 minutes to start receiving deliveries."
      requestBody:
        content:
          application/json:
            example:
              webhook:
                entity: Account
                url: https://hooks.example.com/terros/accounts
                name: CRM account sync
                add: true
                update: true
                remove: false
                failureRecipients:
                  - ops@example.com
              signingSecret: whsec_k3Jx9v2QmZ7bLwA1pTn8RyUe5HcGd0SfVoIaXqMtNzE
            schema:
              type: object
              properties:
                webhook:
                  type: object
                  properties:
                    entity:
                      $ref: "#/components/schemas/__schema693"
                    url:
                      $ref: "#/components/schemas/__schema694"
                    target:
                      $ref: "#/components/schemas/__schema695"
                    headers:
                      $ref: "#/components/schemas/__schema696"
                    name:
                      $ref: "#/components/schemas/__schema697"
                    description:
                      $ref: "#/components/schemas/__schema698"
                    add:
                      $ref: "#/components/schemas/__schema699"
                    update:
                      $ref: "#/components/schemas/__schema700"
                    remove:
                      $ref: "#/components/schemas/__schema701"
                    params:
                      $ref: "#/components/schemas/__schema702"
                    statusIds:
                      $ref: "#/components/schemas/__schema703"
                    workflowId:
                      $ref: "#/components/schemas/__schema704"
                    workflowStageIds:
                      $ref: "#/components/schemas/__schema705"
                    workflowActionIds:
                      $ref: "#/components/schemas/__schema706"
                    failureRecipients:
                      $ref: "#/components/schemas/__schema707"
                  required:
                    - entity
                    - url
                signingSecret:
                  description: Secret that signs this webhook's deliveries, 16 to 256 characters.
                    It is stored and never returned by any endpoint, so keep
                    your own copy. Omit it to leave the webhook unsigned.
                  $ref: "#/components/schemas/__schema708"
              required:
                - webhook
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                webhook:
                  entity: Account
                  url: https://hooks.example.com/terros/accounts
                  name: CRM account sync
                  add: true
                  update: true
                  remove: false
                  failureRecipients:
                    - ops@example.com
                  webhookId: Webhook.123-4aBc_d
                  createdAt: 1784224980123
                  updatedAt: 1784224980123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  webhook:
                    $ref: "#/components/schemas/__schema1469"
                required:
                  - type
                  - webhook
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/list:
    post:
      operationId: webhook-list-v1
      summary: List webhooks
      tags:
        - Webhook
      description: "Lists the current company's webhooks (the impersonated user's
        company when impersonating).         Requires the `webhook:manage`
        permission in the webhook's company (the current company for add and
        list). Webhooks with `entity` `Company` can only be added or changed by
        Terros staff. `Company` webhooks are listed for any caller with that
        permission. Every listed         `url` passed the URL rule when it was
        saved: `url` must use HTTPS, and must not point at an internal host name
        (such as `localhost` or a `.local` or `.internal`   name) or at a
        private, loopback or link-local IPv4 or IPv6 address, checked when the
        webhook is added or changed. `headers` are stored with the webhook but
        never returned by any webhook endpoint, because they can hold
        the   receiver's credentials. Webhook deliveries do not currently send
        them. The list shows saved changes at once, but         deliveries can
        lag them by up to 5 minutes. Use `/webhook/history` to see whether
        deliveries worked."
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              $ref: "#/components/schemas/__schema480"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                webhooks:
                  - entity: Account
                    url: https://hooks.example.com/terros/accounts
                    name: CRM account sync
                    add: true
                    update: true
                    remove: false
                    failureRecipients:
                      - ops@example.com
                    webhookId: Webhook.123-4aBc_d
                    createdAt: 1784224980123
                    updatedAt: 1784224980123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  webhooks:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1469"
                required:
                  - type
                  - webhooks
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/update:
    post:
      operationId: webhook-update-v1
      summary: Update webhook
      tags:
        - Webhook
      description: "Changes a webhook. Send the webhook from `/webhook/list` with your
        changes: `name` and         `description` are cleared when omitted,
        other omitted fields keep their current values, `target:
        null`         clears the target, and `entity` cannot be changed. Omit
        `headers` to keep the stored ones.         Deliveries for a webhook with
        no `target` (a plain URL webhook) and a signing secret are signed.
        Webhooks with a   built-in `target` (`CONNECT`, `ENERFLO`,
        `SERVICETITAN`, `SALESFORCE` or `JOBNIMBUS`) are not. A signed
        delivery's   `Terros-Signature` header holds `t=<unix seconds>,v1=<hex
        HMAC-SHA256>` of `<t>.<raw request body>` keyed with   the webhook's
        signing secret, so a receiver can check where a request came from.
        Retries and redrives are signed   again with a fresh `t`. You choose the
        secret: send `signingSecret` to set it. It is stored and never returned
        by   any endpoint, so keep your own copy. Webhooks added without one are
        not signed. Send `signingSecret` to set or replace the secret, which is
        also how to start signing a webhook         added without one; omit it
        to keep the current secret.         An `Account` webhook with no
        `workflowId` gets every account, in any workflow or none, narrowed only
        by the   `statusIds`, `workflowStageIds` and `workflowActionIds` it
        sets. With a `workflowId`, it gets accounts in that   workflow (narrowed
        by `workflowStageIds` and `workflowActionIds`) and accounts in no
        workflow (narrowed by   `statusIds`). Requires the `webhook:manage`
        permission in the webhook's company (the current company for add and
        list). Webhooks with `entity` `Company` can only be added or changed by
        Terros staff. `url` must use HTTPS, and must not point at an internal
        host name (such as `localhost` or a `.local` or `.internal`   name) or
        at a private, loopback or link-local IPv4 or IPv6 address, checked when
        the webhook is added or changed. Changes can take up to 5 minutes to
        affect deliveries."
      requestBody:
        content:
          application/json:
            example:
              webhook:
                entity: Account
                url: https://hooks.example.com/terros/accounts
                name: CRM account sync
                add: true
                update: true
                remove: true
                failureRecipients:
                  - ops@example.com
                webhookId: Webhook.123-4aBc_d
                createdAt: 1784224980123
                updatedAt: 1784224980123
              signingSecret: whsec_k3Jx9v2QmZ7bLwA1pTn8RyUe5HcGd0SfVoIaXqMtNzE
            schema:
              type: object
              properties:
                webhook:
                  type: object
                  properties:
                    modifiedBy:
                      $ref: "#/components/schemas/__schema132"
                    createdAt:
                      $ref: "#/components/schemas/auditPropsCreatedAt"
                    createdBy:
                      $ref: "#/components/schemas/auditPropsCreatedBy"
                    updatedAt:
                      $ref: "#/components/schemas/auditPropsUpdatedAt"
                    updatedBy:
                      $ref: "#/components/schemas/auditPropsUpdatedBy"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
                    version:
                      $ref: "#/components/schemas/auditPropsVersion"
                    entity:
                      $ref: "#/components/schemas/__schema693"
                    url:
                      $ref: "#/components/schemas/__schema694"
                    target:
                      $ref: "#/components/schemas/__schema695"
                    headers:
                      $ref: "#/components/schemas/__schema696"
                    name:
                      $ref: "#/components/schemas/__schema697"
                    description:
                      $ref: "#/components/schemas/__schema698"
                    add:
                      $ref: "#/components/schemas/__schema699"
                    update:
                      $ref: "#/components/schemas/__schema700"
                    remove:
                      $ref: "#/components/schemas/__schema701"
                    params:
                      $ref: "#/components/schemas/__schema702"
                    statusIds:
                      $ref: "#/components/schemas/__schema703"
                    workflowId:
                      $ref: "#/components/schemas/__schema704"
                    workflowStageIds:
                      $ref: "#/components/schemas/__schema705"
                    workflowActionIds:
                      $ref: "#/components/schemas/__schema706"
                    failureRecipients:
                      $ref: "#/components/schemas/__schema707"
                    webhookId:
                      $ref: "#/components/schemas/WebhookId"
                  required:
                    - entity
                    - url
                    - webhookId
                signingSecret:
                  description: Sets or replaces the secret that signs this webhook's deliveries,
                    16 to 256 characters. Omit it to keep the current secret. It
                    is stored and never returned by any endpoint.
                  $ref: "#/components/schemas/__schema708"
              required:
                - webhook
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                webhook:
                  entity: Account
                  url: https://hooks.example.com/terros/accounts
                  name: CRM account sync
                  add: true
                  update: true
                  remove: true
                  failureRecipients:
                    - ops@example.com
                  webhookId: Webhook.123-4aBc_d
                  createdAt: 1784224980123
                  updatedAt: 1784224980123
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  webhook:
                    $ref: "#/components/schemas/__schema1469"
                required:
                  - type
                  - webhook
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/remove:
    post:
      operationId: webhook-remove-v1
      summary: Remove webhook
      tags:
        - Webhook
      description: Permanently deletes a webhook; it cannot be restored. Requires the
        `webhook:manage` permission in the webhook's company (the current
        company for add and list). Unlike adding or changing
        one,         removing a `Company` webhook does not require Terros staff.
        Removal checks no URL; the HTTPS and         blocked-host URL rule
        applies only when a webhook is added or changed. Deliveries can continue
        for up to 5         minutes after removal.
      requestBody:
        content:
          application/json:
            example:
              webhookId: Webhook.123-4aBc_d
            schema:
              type: object
              properties:
                webhookId:
                  $ref: "#/components/schemas/WebhookId"
              required:
                - webhookId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                required:
                  - type
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/history:
    post:
      operationId: webhook-history-v1
      summary: List webhook deliveries
      tags:
        - Webhook
      x-terros-readOnly: true
      description: "Lists a webhook's deliveries, newest first, up to 1,000: each
        row's `webhookDate` (when it was         sent), `status` and, for a
        failure, `webhookError`. Deliveries are kept for 30 days. Filter by
        delivery time         with `startTime` and `endTime`. Payloads contain
        customer data and are left out unless `includePayload`         is
        `true`. Requires the `webhook:manage` permission in the webhook's
        company (the current company for add and list). Reading a `Company`
        webhook's history does not require Terros staff. Deliveries         only
        go to `url`s that passed the HTTPS and blocked-host URL rule on
        `/webhook/add` and         `/webhook/update`. A webhook added or changed
        in the last 5 minutes may not have deliveries yet,
        because         changes can take up to 5 minutes to affect deliveries."
      requestBody:
        content:
          application/json:
            example:
              webhookId: Webhook.123-4aBc_d
            schema:
              type: object
              properties:
                startTime:
                  $ref: "#/components/schemas/__schema246"
                endTime:
                  $ref: "#/components/schemas/__schema247"
                webhookId:
                  $ref: "#/components/schemas/WebhookId"
                includePayload:
                  description: Set to `true` to include each delivery's full `payload`. Omit for a
                    summary without payloads.
                  $ref: "#/components/schemas/__schema709"
              required:
                - webhookId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                history:
                  - webhookId: Webhook.123-4aBc_d
                    webhookDate: 1784224980123
                    status: failure
                    webhookError: Failed to call webhook Service Unavailable
                    expiresAt: 1786816980
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  history:
                    type: array
                    items:
                      type: object
                      properties:
                        modifiedBy:
                          $ref: "#/components/schemas/__schema807"
                        createdAt:
                          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
                        createdBy:
                          $ref: "#/components/schemas/auditPropsCreatedBy"
                        updatedAt:
                          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
                        updatedBy:
                          $ref: "#/components/schemas/auditPropsUpdatedBy"
                        lastUpdateProcess:
                          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
                        version:
                          $ref: "#/components/schemas/auditPropsVersionOutput"
                        expiresAt:
                          $ref: "#/components/schemas/utcSeconds"
                        payload:
                          $ref: "#/components/schemas/__schema1470"
                        webhookId:
                          $ref: "#/components/schemas/WebhookId"
                        webhookDate:
                          type: number
                        status:
                          type: string
                          enum:
                            - success
                            - failure
                        webhookError:
                          type: string
                      required:
                        - expiresAt
                        - webhookId
                        - webhookDate
                        - status
                      additionalProperties: false
                required:
                  - type
                  - history
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /webhook/sample:
    post:
      operationId: webhook-sample-v1
      summary: Get sample webhook payloads
      tags:
        - Webhook
      x-terros-readOnly: true
      description: Returns sample payloads for `entity` (or every entity when
        omitted), to build a receiver before         adding a webhook with
        `/webhook/add`. The samples are made up, not your data. Any signed-in
        user can call it,         without the `webhook:manage` permission that
        adding the webhook needs; `Company` samples require
        Terros         staff, like `Company` webhooks. Real deliveries go only
        to a `url` that passed the HTTPS and blocked-host         URL rule, and
        can take up to 5 minutes to start after the webhook is added or changed.
      requestBody:
        content:
          application/json:
            example:
              entity: Screenshot
            schema:
              type: object
              properties:
                entity:
                  $ref: "#/components/schemas/__schema693"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  webhookPayloads:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1470"
                required:
                  - type
                  - webhookPayloads
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /workflow/add:
    post:
      operationId: workflow-add-v1
      summary: Add Workflow
      tags:
        - Workflow
      description: Creates a workflow definition for the caller's company. Workflows
        define stages and actions used to track pipeline progress. Requires the
        `workflow:manage` permission on the company or on one of the teams in
        `visibleTo`. To change an existing workflow, use `/workflow/update`
        instead.
      requestBody:
        content:
          application/json:
            example:
              workflow:
                name: Sales Pipeline
                stages:
                  - stageId: S.Prospect
                    name: Prospect
                    order: 0
                    icon: home
                    color: "#64748B"
                    scope: company
                    actionIds:
                      - A.Knocked
                  - stageId: S.Pitched
                    name: Pitched
                    order: 1
                    icon: presentation
                    color: "#2563EB"
                    scope: company
                    actionIds:
                      - A.Sold
                  - stageId: S.Sold
                    name: Sold
                    order: 2
                    icon: check
                    color: "#16A34A"
                    scope: company
                    actionIds: []
                actions:
                  - actionId: A.Knocked
                    toStageId: S.Pitched
                    fromStages:
                      - S.Prospect
                    name: Knocked
                    icon: door-open
                    color: "#2563EB"
                  - actionId: A.Sold
                    toStageId: S.Sold
                    fromStages:
                      - S.Pitched
                    name: Sold
                    icon: badge-check
                    color: "#16A34A"
                visibleTo:
                  - C:company1
                entity: account
            schema:
              type: object
              properties:
                workflow:
                  type: object
                  properties:
                    companyId:
                      $ref: "#/components/schemas/companyId"
                    name:
                      $ref: "#/components/schemas/__schema710"
                    stages:
                      $ref: "#/components/schemas/__schema711"
                    actions:
                      $ref: "#/components/schemas/__schema744"
                    integrationMappings:
                      $ref: "#/components/schemas/__schema755"
                    migrationMappings:
                      $ref: "#/components/schemas/__schema757"
                    isMigrated:
                      $ref: "#/components/schemas/__schema759"
                    visibleTo:
                      $ref: "#/components/schemas/__schema761"
                    entity:
                      $ref: "#/components/schemas/__schema762"
                    removeEntitlements:
                      $ref: "#/components/schemas/__schema763"
                    preferences:
                      $ref: "#/components/schemas/__schema764"
                  required:
                    - name
                    - stages
                    - actions
              required:
                - workflow
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                workflow:
                  workflowId: WF.salesPipeline
                  companyId: C:company1
                  name: Sales Pipeline
                  stages:
                    - stageId: S.Prospect
                      name: Prospect
                      order: 0
                      icon: home
                      color: "#64748B"
                      scope: company
                      actionIds:
                        - A.Knocked
                    - stageId: S.Pitched
                      name: Pitched
                      order: 1
                      icon: presentation
                      color: "#2563EB"
                      scope: company
                      actionIds:
                        - A.Sold
                    - stageId: S.Sold
                      name: Sold
                      order: 2
                      icon: check
                      color: "#16A34A"
                      scope: company
                      actionIds: []
                  actions:
                    - actionId: A.Knocked
                      toStageId: S.Pitched
                      fromStages:
                        - S.Prospect
                      name: Knocked
                      icon: door-open
                      color: "#2563EB"
                    - actionId: A.Sold
                      toStageId: S.Sold
                      fromStages:
                        - S.Pitched
                      name: Sold
                      icon: badge-check
                      color: "#16A34A"
                  visibleTo:
                    - C:company1
                  entity: account
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  workflow:
                    $ref: "#/components/schemas/__schema1484"
                required:
                  - type
                  - workflow
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /workflow/get:
    post:
      operationId: workflow-get-v1
      summary: Get Workflow
      tags:
        - Workflow
      description: >-
        Retrieves one workflow by `workflowId`, including its stages, actions,
        visibility, and preferences. The workflow must be visible to you
        (through one of your teams or roles, your company, or because it has no
        visibility restriction) unless it is the company's only active workflow
        or you have company-wide `workflow:manage` permission. Terros staff can
        get any company's workflow. `rollback` summarizes account rollback:
        whether it is enabled, its target and protected stages, default stage,
        and allowed roles. Use `/workflow/list` to discover workflow IDs.


        Checkpoints and pre-actions:

        - `actions[].checkpoints` (legacy): `{ [stageId]: { behavior: "always" |
        "ask" | "never" } }`. Before the action, the account passes through
        these stages as stage-only history entries; nobody is credited for them.

        - `actions[].hooks.pre`: `[{ type: "action", actionId, behavior:
        "always" | "ask" }]`. The listed actions are recorded just before this
        one, each with its own conditions checked and its own stats credited to
        the user. The app runs "always" pre-actions automatically and offers
        "ask" ones.

        - To migrate an action, for each checkpoint stage in stage order with
        behavior "always" or "ask", add a pre-action with the same behavior
        whose `actionId` is the action that moves accounts into that stage (its
        `toStageId`), then remove `checkpoints`. A "never" checkpoint has no
        pre-action. Preview with `dryRun` first.

        - `isMigrated`: whether the company's legacy setup (account statuses,
        dispositions, event outcomes) has been fully migrated to this workflow.
        It says nothing about checkpoints or pre-actions.

        - `migrationMappings`: `[{ sourceStage, targetId }]`, mapping a legacy
        account status, disposition, event outcome, or metric ID to the stage or
        action that replaced it. Imports, CRM syncs, plans, programs, and
        reports still read it, so keep it.
      requestBody:
        content:
          application/json:
            example:
              workflowId: WF.salesPipeline
            schema:
              type: object
              properties:
                workflowId:
                  $ref: "#/components/schemas/WFId"
              required:
                - workflowId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                workflow:
                  workflowId: WF.salesPipeline
                  companyId: C:company1
                  name: Sales Pipeline
                  stages:
                    - stageId: S.Prospect
                      name: Prospect
                      order: 0
                      icon: home
                      color: "#64748B"
                      scope: company
                      actionIds:
                        - A.Knocked
                    - stageId: S.Pitched
                      name: Pitched
                      order: 1
                      icon: presentation
                      color: "#2563EB"
                      scope: company
                      actionIds:
                        - A.Sold
                    - stageId: S.Sold
                      name: Sold
                      order: 2
                      icon: check
                      color: "#16A34A"
                      scope: company
                      actionIds: []
                  actions:
                    - actionId: A.Knocked
                      toStageId: S.Pitched
                      fromStages:
                        - S.Prospect
                      name: Knocked
                      icon: door-open
                      color: "#2563EB"
                    - actionId: A.Sold
                      toStageId: S.Sold
                      fromStages:
                        - S.Pitched
                      name: Sold
                      icon: badge-check
                      color: "#16A34A"
                  visibleTo:
                    - C:company1
                  entity: account
                rollback:
                  enabled: true
                  targetStageIds:
                    - S.Prospect
                  protectedStageIds:
                    - S.Sold
                  defaultStageId: S.Prospect
                  roleIds:
                    - Role.manager
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  workflow:
                    $ref: "#/components/schemas/__schema1484"
                  rollback:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                        description: Whether `preferences.rollback.enabled` is set
                      targetStageIds:
                        type: array
                        items:
                          $ref: "#/components/schemas/SId"
                        description: 'Active stages with `rollback: "target"`'
                      protectedStageIds:
                        type: array
                        items:
                          $ref: "#/components/schemas/SId"
                        description: 'Active stages with `rollback: "protected"`'
                      defaultStageId:
                        description: Fallback target stage
                        $ref: "#/components/schemas/SId"
                      roleIds:
                        type: array
                        items:
                          $ref: "#/components/schemas/RoleId"
                        description: Roles allowed to roll back accounts
                    required:
                      - enabled
                      - targetStageIds
                      - protectedStageIds
                      - roleIds
                    additionalProperties: false
                required:
                  - type
                  - workflow
                  - rollback
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /workflow/list:
    post:
      operationId: workflow-list-v1
      summary: List Workflows
      tags:
        - Workflow
      description: Lists the workflows in the authenticated company. Workflows visible
        to you (through your teams or roles, your company, or because they have
        no visibility restriction) are returned in `workflows` and the rest in
        `readonly`; users with company-wide `workflow:manage` permission see all
        of them in `workflows`. Archived workflows are excluded unless
        `archived` is set. Terros staff signed in as themselves can set
        `companyId` to list another company's workflows; anyone else gets a
        `NotAuthorized` error, and an unknown `companyId` gets `NotFound`. Use
        `/workflow/get` for a single workflow by ID.
      requestBody:
        content:
          application/json:
            example:
              archived: false
            schema:
              type: object
              properties:
                archived:
                  $ref: "#/components/schemas/archived"
                companyId:
                  $ref: "#/components/schemas/companyId"
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                workflows:
                  - workflowId: WF.salesPipeline
                    companyId: C:company1
                    name: Sales Pipeline
                    stages:
                      - stageId: S.Prospect
                        name: Prospect
                        order: 0
                        icon: home
                        color: "#64748B"
                        scope: company
                        actionIds:
                          - A.Knocked
                      - stageId: S.Pitched
                        name: Pitched
                        order: 1
                        icon: presentation
                        color: "#2563EB"
                        scope: company
                        actionIds:
                          - A.Sold
                      - stageId: S.Sold
                        name: Sold
                        order: 2
                        icon: check
                        color: "#16A34A"
                        scope: company
                        actionIds: []
                    actions:
                      - actionId: A.Knocked
                        toStageId: S.Pitched
                        fromStages:
                          - S.Prospect
                        name: Knocked
                        icon: door-open
                        color: "#2563EB"
                      - actionId: A.Sold
                        toStageId: S.Sold
                        fromStages:
                          - S.Pitched
                        name: Sold
                        icon: badge-check
                        color: "#16A34A"
                    visibleTo:
                      - C:company1
                    entity: account
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  workflows:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1484"
                  readonly:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1484"
                required:
                  - type
                  - workflows
                  - readonly
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /workflow/remove:
    post:
      operationId: workflow-remove-v1
      summary: Remove Workflow
      tags:
        - Workflow
      description: Archives a workflow by default; set `archive` to `false` to
        permanently delete it, which is only allowed once all of its stages have
        been removed. Archived workflows no longer appear in default list
        results. Requires the `workflow:manage` permission on the company or on
        one of the teams the workflow is visible to.
      requestBody:
        content:
          application/json:
            example:
              workflowId: WF.salesPipeline
              archive: true
            schema:
              type: object
              properties:
                workflowId:
                  $ref: "#/components/schemas/WFId"
                archive:
                  $ref: "#/components/schemas/archive"
              required:
                - workflowId
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
              schema:
                $ref: "#/components/schemas/__schema955"
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
  /workflow/update:
    post:
      operationId: workflow-update-v1
      summary: Update Workflow
      tags:
        - Workflow
      description: >-
        Updates an existing workflow definition. Send `workflow.workflowId` plus
        only the fields to change; omitted fields keep their saved value.
        `workflow.stages` and `workflow.actions` replace the saved lists when
        sent, so send every stage or action, typically edited from
        `/workflow/get`. Setting a stage’s `aiConfig.flagRecordings` to true
        flags recordings made at a location with an account in that stage and
        ignores AI classification (`aiConfig.enabled`) for that stage; omitted
        or false is off. To change some actions only, send them in
        `changedActions` instead: each replaces the saved action with the same
        `actionId`. Set `dryRun` to validate and see `changes` (each changed
        field with its `before` and `after`) without saving; the response always
        includes `changes`. `isMigrated` cannot be changed here. Requires the
        `workflow:manage` permission on the company or on one of the teams the
        workflow is visible to; changing `visibleTo` on a versioned workflow
        requires company-wide permission. Use `/workflow/add` to create a new
        workflow.


        Checkpoints and pre-actions:

        - `actions[].checkpoints` (legacy): `{ [stageId]: { behavior: "always" |
        "ask" | "never" } }`. Before the action, the account passes through
        these stages as stage-only history entries; nobody is credited for them.

        - `actions[].hooks.pre`: `[{ type: "action", actionId, behavior:
        "always" | "ask" }]`. The listed actions are recorded just before this
        one, each with its own conditions checked and its own stats credited to
        the user. The app runs "always" pre-actions automatically and offers
        "ask" ones.

        - To migrate an action, for each checkpoint stage in stage order with
        behavior "always" or "ask", add a pre-action with the same behavior
        whose `actionId` is the action that moves accounts into that stage (its
        `toStageId`), then remove `checkpoints`. A "never" checkpoint has no
        pre-action. Preview with `dryRun` first.

        - `isMigrated`: whether the company's legacy setup (account statuses,
        dispositions, event outcomes) has been fully migrated to this workflow.
        It says nothing about checkpoints or pre-actions.

        - `migrationMappings`: `[{ sourceStage, targetId }]`, mapping a legacy
        account status, disposition, event outcome, or metric ID to the stage or
        action that replaced it. Imports, CRM syncs, plans, programs, and
        reports still read it, so keep it.
      requestBody:
        content:
          application/json:
            example:
              workflow:
                workflowId: WF.salesPipeline
              changedActions:
                - actionId: A.Sold
                  toStageId: S.Sold
                  fromStages:
                    - S.Pitched
                  name: Sold
                  icon: badge-check
                  color: "#16A34A"
                  hooks:
                    pre:
                      - type: action
                        actionId: A.Knocked
                        behavior: ask
              dryRun: true
            schema:
              type: object
              properties:
                workflow:
                  type: object
                  properties:
                    modifiedBy:
                      $ref: "#/components/schemas/__schema772"
                    createdAt:
                      $ref: "#/components/schemas/__schema773"
                    createdBy:
                      $ref: "#/components/schemas/__schema774"
                    updatedAt:
                      $ref: "#/components/schemas/__schema775"
                    updatedBy:
                      $ref: "#/components/schemas/__schema776"
                    lastUpdateProcess:
                      $ref: "#/components/schemas/__schema777"
                    version:
                      $ref: "#/components/schemas/__schema778"
                    isDeleted:
                      $ref: "#/components/schemas/__schema779"
                    companyId:
                      $ref: "#/components/schemas/__schema780"
                    name:
                      $ref: "#/components/schemas/__schema781"
                    stages:
                      $ref: "#/components/schemas/__schema782"
                    actions:
                      $ref: "#/components/schemas/__schema783"
                    integrationMappings:
                      $ref: "#/components/schemas/__schema784"
                    migrationMappings:
                      $ref: "#/components/schemas/__schema785"
                    isMigrated:
                      $ref: "#/components/schemas/__schema786"
                    visibleTo:
                      $ref: "#/components/schemas/__schema787"
                    entity:
                      $ref: "#/components/schemas/__schema788"
                    removeEntitlements:
                      $ref: "#/components/schemas/__schema789"
                    preferences:
                      $ref: "#/components/schemas/__schema790"
                    workflowId:
                      $ref: "#/components/schemas/__schema791"
                  required:
                    - workflowId
                  description: "`workflowId` plus the fields to change; omitted fields keep their
                    saved value"
                changedActions:
                  description: Saved actions to replace by `actionId`, leaving every other action
                    as saved. Cannot be combined with `workflow.actions`.
                  $ref: "#/components/schemas/__schema792"
                dryRun:
                  description: Validate and return the changes without saving
                  $ref: "#/components/schemas/__schema793"
              required:
                - workflow
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                type: success
                workflow:
                  workflowId: WF.salesPipeline
                  companyId: C:company1
                  name: Sales Pipeline
                  stages:
                    - stageId: S.Prospect
                      name: Prospect
                      order: 0
                      icon: home
                      color: "#64748B"
                      scope: company
                      actionIds:
                        - A.Knocked
                    - stageId: S.Pitched
                      name: Pitched
                      order: 1
                      icon: presentation
                      color: "#2563EB"
                      scope: company
                      actionIds:
                        - A.Sold
                    - stageId: S.Sold
                      name: Sold
                      order: 2
                      icon: check
                      color: "#16A34A"
                      scope: company
                      actionIds: []
                  actions:
                    - actionId: A.Knocked
                      toStageId: S.Pitched
                      fromStages:
                        - S.Prospect
                      name: Knocked
                      icon: door-open
                      color: "#2563EB"
                    - actionId: A.Sold
                      toStageId: S.Sold
                      fromStages:
                        - S.Pitched
                      name: Sold
                      icon: badge-check
                      color: "#16A34A"
                      hooks:
                        pre:
                          - type: action
                            actionId: A.Knocked
                            behavior: ask
                  visibleTo:
                    - C:company1
                  entity: account
                changes:
                  - path: actions[A.Sold].checkpoints
                    before:
                      S.Pitched:
                        behavior: ask
                  - path: actions[A.Sold].hooks
                    after:
                      pre:
                        - type: action
                          actionId: A.Knocked
                          behavior: ask
                dryRun: true
              schema:
                type: object
                properties:
                  type:
                    $ref: "#/components/schemas/responseSuccessType"
                  workflow:
                    description: The saved workflow, or with `dryRun` the workflow that would be
                      saved
                    $ref: "#/components/schemas/__schema1484"
                  changes:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: "`name`, `stages[S.id]`, `stages[S.id].field`, `actions[A.id]` or
                            `actions[A.id].field`"
                        before: {}
                        after: {}
                      required:
                        - path
                      additionalProperties: false
                  dryRun:
                    type: boolean
                required:
                  - type
                  - workflow
                  - changes
                additionalProperties: false
        default:
          description: Error
          content:
            application/json:
              example:
                type: error
                error: NotAuthorized
                message: You do not have permission to perform this action.
                retry: false
              schema:
                $ref: "#/components/schemas/responseError"
        4XX:
          $ref: "#/components/responses/Error4XX"
webhooks:
  Account:
    post:
      operationId: webhook-account
      tags:
        - Account
      summary: Account Webhooks
      description: >
        This webhook is triggered when an action is taken on an account.


        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookRemoveAction"
                        data:
                          type: object
                          properties:
                            id:
                              $ref: "#/components/schemas/accountId"
                          required:
                            - id
                      required:
                        - action
                        - data
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookAddUpdateAction"
                        data:
                          type: object
                          properties:
                            createdAt:
                              $ref: "#/components/schemas/auditDatesCreatedAt"
                            updatedAt:
                              $ref: "#/components/schemas/auditDatesUpdatedAt"
                            accountStatus:
                              type: string
                              enum:
                                - Lead
                                - Set
                                - Sit
                                - Closed
                                - Approved
                                - Permit Submitted
                                - Permit Approved
                                - Installed
                                - Archived
                                - Do Not Contact
                            status:
                              deprecated: true
                              $ref: "#/components/schemas/__schema796"
                            workflowState:
                              $ref: "#/components/schemas/__schema797"
                            owner:
                              $ref: "#/components/schemas/smallUser"
                            closer:
                              $ref: "#/components/schemas/smallUser"
                            address:
                              $ref: "#/components/schemas/__schema458"
                            dealSize:
                              deprecated: true
                              $ref: "#/components/schemas/__schema798"
                            rescheduleCount:
                              deprecated: true
                              $ref: "#/components/schemas/__schema799"
                            resident:
                              $ref: "#/components/schemas/tinyResident"
                            note:
                              type: string
                            notes:
                              type: array
                              items:
                                type: object
                                properties:
                                  timestamp:
                                    $ref: "#/components/schemas/utcMilliseconds"
                                  text:
                                    $ref: "#/components/schemas/__schema101"
                                  userId:
                                    $ref: "#/components/schemas/userId"
                                  noteId:
                                    $ref: "#/components/schemas/NoteId"
                                required:
                                  - timestamp
                                  - text
                                  - userId
                                  - noteId
                            externalLeadId:
                              description: External lead ID from another system
                              $ref: "#/components/schemas/__schema800"
                            customFieldMap:
                              $ref: "#/components/schemas/__schema7"
                            id:
                              $ref: "#/components/schemas/accountId"
                          required:
                            - createdAt
                            - updatedAt
                            - id
                      required:
                        - action
                        - data
                  type: object
                - type: object
                  properties:
                    entity:
                      type: string
                      const: Account
                  required:
                    - entity
            examples:
              Account Created:
                value:
                  entity: Account
                  action: add
                  data:
                    id: Account.123
                    createdAt: "1718301586851"
                    updatedAt: "1718301586851"
                    status:
                      name: Lead
                      statusId: AS.sf8s9sd
                    workflowState:
                      actionId: A.123
                      stageId: S.456
                      workflowId: WF.abc
                    externalLeadId: "1234"
                    owner:
                      userId: U.123
                      firstName: Max
                      lastName: Mustermann
                      email: max@example.com
                      clientUserId: SR123
                    resident:
                      firstName: John
                      lastName: Doe
                      email: johndoe@example.com
                      phone: "1234567890"
                    address:
                      locationId: TLoc.123
                      latlng:
                        latitude: 37.7749
                        longitude: -122.4194
                      line1: 123 Main St
                      line2: Irvine, CA 92618
                      countrySubd: CA
                      locality: Irvine
                      postal1: "92618"
                    note: Sample note
                    notes:
                      - noteId: Note.123
                        text: Sample note
                        timestamp: 1718301586851
                        userId: U.123
              Account Updated:
                value:
                  entity: Account
                  action: update
                  data:
                    id: Account.123
                    createdAt: "1718301586851"
                    updatedAt: "1718301586851"
                    status:
                      name: Lead
                      statusId: AS.sf8s9sd
                    workflowState:
                      actionId: A.123
                      stageId: S.456
                      workflowId: WF.abc
                    externalLeadId: "1234"
                    owner:
                      userId: U.123
                      firstName: Max
                      lastName: Mustermann
                      email: max@example.com
                      clientUserId: SR123
                    resident:
                      firstName: John
                      lastName: Doe
                      email: johndoe@example.com
                      phone: "1234567890"
                    address:
                      locationId: TLoc.123
                      latlng:
                        latitude: 37.7749
                        longitude: -122.4194
                      line1: 123 Main St
                      line2: Irvine, CA 92618
                      countrySubd: CA
                      locality: Irvine
                      postal1: "92618"
                    note: Sample note
                    notes:
                      - noteId: Note.123
                        text: Sample note
                        timestamp: 1718301586851
                        userId: U.123
              Account Removed:
                value:
                  entity: Account
                  action: remove
                  data:
                    id: Account.123
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
  Calendar:
    post:
      operationId: webhook-calendar
      tags:
        - Calendar
      summary: Calendar Webhooks
      description: >
        This webhook is triggered when an action is taken on a calendar event.


        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookRemoveAction"
                        data:
                          type: object
                          properties:
                            id:
                              $ref: "#/components/schemas/EventId"
                            sourceId:
                              $ref: "#/components/schemas/__schema801"
                          required:
                            - id
                      required:
                        - action
                        - data
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookAddUpdateAction"
                        data:
                          type: object
                          properties:
                            createdAt:
                              $ref: "#/components/schemas/auditDatesCreatedAt"
                            updatedAt:
                              $ref: "#/components/schemas/auditDatesUpdatedAt"
                            owner:
                              $ref: "#/components/schemas/smallUser"
                            eventDate:
                              type: string
                            account:
                              type: object
                              properties:
                                accountId:
                                  $ref: "#/components/schemas/accountId"
                                statusId:
                                  $ref: "#/components/schemas/accountStatusId"
                                workflowState:
                                  $ref: "#/components/schemas/__schema797"
                                residents:
                                  type: array
                                  items:
                                    $ref: "#/components/schemas/tinyResident"
                                externalLeadId:
                                  description: External lead ID from another system
                                  $ref: "#/components/schemas/__schema803"
                              required:
                                - accountId
                                - residents
                            duration:
                              type: number
                            title:
                              type: string
                            eventType:
                              $ref: "#/components/schemas/eventType"
                            address:
                              $ref: "#/components/schemas/__schema458"
                            note:
                              type: string
                            attendee:
                              $ref: "#/components/schemas/smallUser"
                            occurred:
                              type: boolean
                            resident:
                              $ref: "#/components/schemas/tinyResident"
                            status:
                              type: string
                            closed:
                              type: boolean
                            id:
                              $ref: "#/components/schemas/EventId"
                            sourceId:
                              $ref: "#/components/schemas/__schema801"
                          required:
                            - createdAt
                            - updatedAt
                            - eventDate
                            - duration
                            - title
                            - eventType
                            - id
                      required:
                        - action
                        - data
                  type: object
                - type: object
                  properties:
                    entity:
                      type: string
                      const: Event
                  required:
                    - entity
            examples:
              Event Created:
                value:
                  entity: Event
                  action: add
                  data:
                    id: Event:evt123
                    title: Customer Meeting
                    eventDate: "1672531200000"
                    duration: 60
                    eventType: Consultation
                    createdAt: undefined
                    updatedAt: undefined
              Event Updated:
                value:
                  entity: Event
                  action: update
                  data:
                    id: Event:evt123
                    title: Customer Meeting
                    eventDate: "1672531200000"
                    duration: 60
                    eventType: Consultation
                    createdAt: undefined
                    updatedAt: undefined
              Event Removed:
                value:
                  entity: Event
                  action: remove
                  data:
                    id: Event:evt123
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
  Evaluation:
    post:
      operationId: webhook-evaluation
      summary: Evaluation Webhooks
      tags:
        - Evaluation
      description: >
        This webhook is triggered when an action is taken on an evaluation.


        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookRemoveAction"
                        data:
                          type: object
                          properties:
                            id:
                              $ref: "#/components/schemas/EvalId"
                          required:
                            - id
                      required:
                        - action
                        - data
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookAddUpdateAction"
                        data:
                          type: object
                          properties:
                            createdAt:
                              $ref: "#/components/schemas/auditDatesCreatedAt"
                            updatedAt:
                              $ref: "#/components/schemas/auditDatesUpdatedAt"
                            user:
                              $ref: "#/components/schemas/smallUser"
                            evaluator:
                              $ref: "#/components/schemas/smallUser"
                            evalState:
                              $ref: "#/components/schemas/evaluationEvalState"
                            requestDate:
                              type: string
                            eventDate:
                              type: string
                            evalDate:
                              type: string
                            possible:
                              type: number
                            score:
                              type: number
                            comment:
                              type: string
                            categories:
                              type: array
                              items:
                                $ref: "#/components/schemas/__schema451"
                            address:
                              $ref: "#/components/schemas/__schema458"
                            id:
                              $ref: "#/components/schemas/EvalId"
                          required:
                            - createdAt
                            - updatedAt
                            - user
                            - evalState
                            - requestDate
                            - possible
                            - id
                      required:
                        - action
                        - data
                  type: object
                - type: object
                  properties:
                    entity:
                      type: string
                      const: Evaluation
                  required:
                    - entity
            examples:
              Evaluation Created:
                value:
                  entity: Evaluation
                  action: add
                  data:
                    id: Eval.123
                    requestDate: 2025-01-01T00:00:00Z
                    user:
                      userId: U:123
                      firstName: John
                      lastName: Doe
                      email: jdoe@example.com
                    evalState: Pending
                    possible: 10
                    createdAt: "1793992789035"
                    updatedAt: "1793992789035"
              Evaluation Updated:
                value:
                  entity: Evaluation
                  action: update
                  data:
                    id: Eval.123
                    requestDate: 2025-01-01T00:00:00Z
                    user:
                      userId: U:123
                      firstName: John
                      lastName: Doe
                      email: jdoe@example.com
                    evalState: Pending
                    possible: 10
                    createdAt: "1793992789035"
                    updatedAt: "1793992789035"
              Evaluation Removed:
                value:
                  entity: Evaluation
                  action: remove
                  data:
                    id: Eval.123
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
  Screenshot:
    post:
      operationId: webhook-screenshot
      tags:
        - Screenshot
      summary: Screenshot Webhook
      description: >
        Notifies your company when a user reports taking a screenshot.
                Configure a webhook in Integrations → Webhooks with entity Screenshot and Add enabled.
                Managing webhooks requires webhook:manage permission. Update and Remove do not trigger this webhook.
                The payload identifies the user and company, with sessionId and device included when available.
                No screenshot image is included. createdAt and updatedAt contain the same notification timestamp.
                Delivery can occur more than once; use data.id to deduplicate notifications.

        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                entity:
                  type: string
                  const: Screenshot
                action:
                  type: string
                  const: add
                data:
                  type: object
                  properties:
                    device:
                      type: string
                    userId:
                      $ref: "#/components/schemas/userId"
                    companyId:
                      $ref: "#/components/schemas/companyId"
                    sessionId:
                      description: ID of the app session in which the screenshot was taken
                      $ref: "#/components/schemas/__schema804"
                    id:
                      $ref: "#/components/schemas/ScreenshotId"
                    createdAt:
                      type: string
                      format: date-time
                      pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    updatedAt:
                      type: string
                      format: date-time
                      pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  required:
                    - userId
                    - companyId
                    - id
                    - createdAt
                    - updatedAt
              required:
                - entity
                - action
                - data
            examples:
              Screenshot Reported:
                value:
                  entity: Screenshot
                  action: add
                  data:
                    id: Screenshot.12345678-1234-1234-1234-123456789abc
                    userId: U.sample123
                    companyId: C.sample123
                    sessionId: sample-session
                    device: iPhone15,4
                    createdAt: 2026-10-05T17:30:00.000Z
                    updatedAt: 2026-10-05T17:30:00.000Z
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
  Team:
    post:
      operationId: webhook-team
      tags:
        - Team
      summary: Team Webhooks
      description: >
        This webhook is triggered when an action is taken on a team.


        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookRemoveAction"
                        data:
                          type: object
                          properties:
                            id:
                              $ref: "#/components/schemas/teamId"
                          required:
                            - id
                      required:
                        - action
                        - data
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookAddUpdateAction"
                        data:
                          type: object
                          properties:
                            createdAt:
                              $ref: "#/components/schemas/auditDatesCreatedAt"
                            updatedAt:
                              $ref: "#/components/schemas/auditDatesUpdatedAt"
                            name:
                              type: string
                            description:
                              type: string
                            externalId:
                              description: Team ID in your external system
                              $ref: "#/components/schemas/__schema805"
                            parentId:
                              $ref: "#/components/schemas/teamId"
                            level:
                              $ref: "#/components/schemas/teamLevel"
                            restrictVisibility:
                              type: boolean
                            isCloserBoundary:
                              type: boolean
                            timeZone:
                              type: string
                            officeAddress:
                              type: string
                            officeLocation:
                              $ref: "#/components/schemas/latlng"
                            meetingTimes:
                              type: array
                              items:
                                $ref: "#/components/schemas/__schema629"
                            customFields:
                              $ref: "#/components/schemas/__schema7"
                            members:
                              type: array
                              items:
                                $ref: "#/components/schemas/tinyUser"
                            id:
                              $ref: "#/components/schemas/teamId"
                          required:
                            - createdAt
                            - updatedAt
                            - name
                            - level
                            - id
                      required:
                        - action
                        - data
                  type: object
                - type: object
                  properties:
                    entity:
                      type: string
                      const: Team
                  required:
                    - entity
            examples:
              Team Created:
                value:
                  action: add
                  entity: Team
                  data:
                    id: Team.Broncros
                    name: Broncros
                    level: 1
                    officeAddress: 1701 Wynkoop St, Denver, CO 80202
                    officeLocation:
                      latitude: 39.7561
                      longitude: -104.9942
                    parentId: Team.AFCWest
                    description: Professional American football team based in Denver, Colorado.
                    createdAt: 2026-11-06T19:19:49.027Z
                    updatedAt: 2026-11-06T19:19:49.030Z
                    members: []
              Team Updated:
                value:
                  action: update
                  entity: Team
                  data:
                    id: Team.Broncros
                    name: Broncros
                    level: 1
                    officeAddress: 1701 Wynkoop St, Denver, CO 80202
                    officeLocation:
                      latitude: 39.7561
                      longitude: -104.9942
                    parentId: Team.AFCWest
                    description: Professional American football team based in Denver, Colorado.
                    createdAt: 2026-11-06T19:19:49.027Z
                    updatedAt: 2026-11-06T19:19:49.030Z
                    members:
                      - userId: U:user123
                        lastName: Smith
                        firstName: John
                        email: john.smith@company.com
                        phone: "5551234567"
                        title: Sales Representative
                        timeZone: America/Los_Angeles
                        companyId: C:company123
              Team Removed:
                value:
                  action: remove
                  entity: Team
                  data:
                    id: Team.Broncros
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
  User:
    post:
      operationId: webhook-user
      summary: User Webhook
      tags:
        - User
      description: >
        This webhook is triggered when an action is taken on a user.


        The requestBody contains the webhook payload.


        **Delivery behavior:**

        - Timeout: **10 seconds** — your endpoint must respond within 10 seconds
        or the delivery is marked as failed.

        - Retry: Failed deliveries are retried up to 2 times (3 total attempts),
        with a backoff of approximately 5 seconds before the second attempt and
        10 seconds before the third.

        - Success: Your endpoint must return a 2xx status code. Non-2xx
        responses and redirects count as failed attempts.

        - Failure notifications: If configured, failure recipients receive an
        email alert on delivery errors.

        - History: Each delivery's final result (success or failure) is retained
        for 30 days.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookRemoveAction"
                        data:
                          type: object
                          properties:
                            id:
                              $ref: "#/components/schemas/userId"
                          required:
                            - id
                      required:
                        - action
                        - data
                    - type: object
                      properties:
                        action:
                          $ref: "#/components/schemas/webhookAddUpdateAction"
                        data:
                          type: object
                          properties:
                            createdAt:
                              $ref: "#/components/schemas/auditDatesCreatedAt"
                            updatedAt:
                              $ref: "#/components/schemas/auditDatesUpdatedAt"
                            firstName:
                              type: string
                            lastName:
                              type: string
                            email:
                              type: string
                            phone:
                              type: string
                            clientUserId:
                              description: User ID in your external system
                              $ref: "#/components/schemas/__schema806"
                            preferredName:
                              type: string
                            timeZone:
                              type: string
                            closerStatus:
                              $ref: "#/components/schemas/closerStatus"
                            isDeleted:
                              type: boolean
                            customFields:
                              $ref: "#/components/schemas/__schema7"
                            id:
                              $ref: "#/components/schemas/userId"
                          required:
                            - createdAt
                            - updatedAt
                            - firstName
                            - lastName
                            - email
                            - id
                      required:
                        - action
                        - data
                  type: object
                - type: object
                  properties:
                    entity:
                      type: string
                      const: User
                  required:
                    - entity
            examples:
              User Created:
                value:
                  entity: User
                  action: add
                  data:
                    id: U:user123
                    email: john.smith@company.com
                    firstName: John
                    lastName: Smith
                    createdAt: "1793992789027"
                    updatedAt: "1793992789027"
              User Updated:
                value:
                  entity: User
                  action: update
                  data:
                    id: U:user123
                    email: john.smith@company.com
                    firstName: John
                    lastName: Smith
                    createdAt: "1793992789027"
                    updatedAt: "1793992789027"
              User Removed:
                value:
                  entity: User
                  action: remove
                  data:
                    id: U:user123
      responses:
        "200":
          $ref: "#/components/responses/WebhookResponse"
components:
  schemas:
    apiVersion:
      description: API version number.
      $ref: "#/components/schemas/__schema1"
    apiClearLocalCache:
      description: If true, clears local cache before processing the request.
      $ref: "#/components/schemas/__schema2"
    apiSkipDistributedCache:
      description: If true, skips reading from the distributed cache.
      $ref: "#/components/schemas/__schema3"
    apiFakeError:
      description: If set, forces the API to return the specified error.
      $ref: "#/components/schemas/__schema4"
    apiEcho:
      description: If true, echoes the request in the response.
      $ref: "#/components/schemas/__schema5"
    AttachmentId:
      type: string
      pattern: ^Attachment((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Attachment.` or `Attachment:` prefix followed by a
        unique suffix, e.g. `Attachment.123-4aBc_d`"
      example: Attachment.123-4aBc_d
    importId:
      description: ID of the import that created this entity
      $ref: "#/components/schemas/ImportId"
    ImportId:
      type: string
      pattern: ^Import((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Import.` or `Import:` prefix followed by a unique
        suffix, e.g. `Import.123-4aBc_d`"
      example: Import.123-4aBc_d
    WFId:
      type: string
      pattern: ^WF\.[\s\S]{0,}$
      description: "Terros ID: `WF.` prefix followed by a unique suffix, e.g.
        `WF.123-4aBc_d`"
      example: WF.123-4aBc_d
    SId:
      type: string
      pattern: ^S\.[\s\S]{0,}$
      description: "Terros ID: `S.` prefix followed by a unique suffix, e.g. `S.123-4aBc_d`"
      example: S.123-4aBc_d
    AId:
      type: string
      pattern: ^A\.[\s\S]{0,}$
      description: "Terros ID: `A.` prefix followed by a unique suffix, e.g. `A.123-4aBc_d`"
      example: A.123-4aBc_d
    userId:
      description: "Unique identifier for the user: `U.` or `U:` prefix followed by a
        unique suffix, e.g. `U.123-4aBc_d`"
      title: User ID
      $ref: "#/components/schemas/UId"
    UId:
      type: string
      pattern: ^U((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `U.` or `U:` prefix followed by a unique suffix, e.g.
        `U.123-4aBc_d`"
      example: U.123-4aBc_d
    utcMilliseconds:
      title: Timestamp
      description: A timestamp in UTC milliseconds
      example: 1784224980123
      $ref: "#/components/schemas/__schema17"
    latlng:
      type: object
      properties:
        latitude:
          $ref: "#/components/schemas/latitude"
        longitude:
          $ref: "#/components/schemas/longitude"
      required:
        - latitude
        - longitude
      title: Latitude and Longitude
      description: Geographical coordinates
    latitude:
      type: number
      minimum: -90
      maximum: 90
      title: Latitude
      description: Geographical latitude
      example: 33.7
    longitude:
      type: number
      minimum: -180
      maximum: 180
      title: Longitude
      description: Geographical longitude
      example: -117.8
    accountId:
      description: "Unique identifier for the account: `Account.` or `Account:` prefix
        followed by a unique suffix, e.g. `Account.123-4aBc_d`"
      title: Account ID
      $ref: "#/components/schemas/AccountId"
    AccountId:
      type: string
      pattern: ^Account((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Account.` or `Account:` prefix followed by a unique
        suffix, e.g. `Account.123-4aBc_d`"
      example: Account.123-4aBc_d
    accountStatusId:
      description: "Unique identifier for the account status: `AS.` prefix followed by
        a unique suffix, e.g. `AS.123-4aBc_d`"
      title: Account Status ID
      deprecated: true
      $ref: "#/components/schemas/ASId"
    ASId:
      type: string
      pattern: ^AS\.[\s\S]{0,}$
      description: "Terros ID: `AS.` prefix followed by a unique suffix, e.g.
        `AS.123-4aBc_d`"
      example: AS.123-4aBc_d
    locationId:
      anyOf:
        - $ref: "#/components/schemas/CanId"
        - $ref: "#/components/schemas/LocNewId"
        - $ref: "#/components/schemas/__schema35"
        - $ref: "#/components/schemas/TLocId"
        - $ref: "#/components/schemas/FAId"
        - $ref: "#/components/schemas/PRId"
      title: Location ID
      description: Unique identifier for the location. Usually a Terros location ID
        such as `TLoc.123-4aBc_d`. Custom locations use `LocNew.`, and other
        address sources use `Can.`, `FA.`, `PR.`, or legacy `Loc:` prefixes.
      example: TLoc.123-4aBc_d
    CanId:
      type: string
      pattern: ^Can\.[\s\S]{0,}$
      description: "Terros ID: `Can.` prefix followed by a unique suffix, e.g.
        `Can.123-4aBc_d`"
      example: Can.123-4aBc_d
    LocNewId:
      type: string
      pattern: ^LocNew((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `LocNew.` or `LocNew:` prefix followed by a unique
        suffix, e.g. `LocNew.123-4aBc_d`"
      example: LocNew.123-4aBc_d
    TLocId:
      type: string
      pattern: ^TLoc((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `TLoc.` or `TLoc:` prefix followed by a unique suffix,
        e.g. `TLoc.123-4aBc_d`"
      example: TLoc.123-4aBc_d
    FAId:
      type: string
      pattern: ^FA\.[\s\S]{0,}$
      description: "Terros ID: `FA.` prefix followed by a unique suffix, e.g.
        `FA.123-4aBc_d`"
      example: FA.123-4aBc_d
    PRId:
      type: string
      pattern: ^PR\.[\s\S]{0,}$
      description: "Terros ID: `PR.` prefix followed by a unique suffix, e.g.
        `PR.123-4aBc_d`"
      example: PR.123-4aBc_d
    addressCountrySubd:
      type: string
      description: Two-letter state or province subdivision code
      example: CA
    addressLine1:
      type: string
      description: Street address, including house number and street name
      example: 1234 Main St
    addressLocality:
      type: string
      description: City, town, or locality name
      example: Irvine
    addressPostal1:
      type: string
      description: Primary postal or ZIP code
      example: "92780"
    addressPostal2:
      description: Secondary postal code segment, such as the four-digit suffix of a ZIP+4
      example: "1234"
      $ref: "#/components/schemas/__schema38"
    addressPostal3:
      description: Tertiary postal code segment, used by some non-US postal systems
      $ref: "#/components/schemas/__schema39"
    addressUnitNbr:
      description: Unit, apartment, or suite number for the address
      example: 5B
      $ref: "#/components/schemas/__schema40"
    addressUnitType:
      description: Optional import column for the unit type, such as Unit, Apt, or
        Suite. Persisted with the location data and unused for matching.
      example: Unit
      $ref: "#/components/schemas/__schema41"
    addressLine2:
      type: string
      description: Second line of the address, typically containing city, state, and
        postal code
      example: Irvine, CA 92780
    addressOneLine:
      type: string
      description: Full address on a single line
      example: 1234 Main St, Irvine, CA 92780
    userClientUserId:
      description: External client system user ID
      example: EMP001
      $ref: "#/components/schemas/__schema47"
    userFirstName:
      type: string
      description: User's first name
      example: John
    userLastName:
      type: string
      description: User's last name
      example: Smith
    userPreferredName:
      description: User's preferred name
      example: Johnny
      $ref: "#/components/schemas/__schema48"
    userAvatarBlurhash:
      description: BlurHash for user's avatar
      $ref: "#/components/schemas/__schema49"
    userAvatarUrl:
      description: URL to user's avatar image
      $ref: "#/components/schemas/__schema50"
    userLastAccess:
      description: Timestamp of last access
      example: 1672531200000
      $ref: "#/components/schemas/__schema51"
    userIsDeleted:
      description: Whether the user is deleted
      $ref: "#/components/schemas/__schema52"
    tinyUserColor:
      description: Preferred color for area assignment
      $ref: "#/components/schemas/__schema53"
    userEmail:
      type: string
      description: User's email address
      example: john.smith@company.com
    userPhone:
      description: User's phone number
      example: "5551234567"
      $ref: "#/components/schemas/__schema54"
    userTitle:
      description: User's job title
      example: Sales Representative
      $ref: "#/components/schemas/__schema55"
    userTimeZone:
      description: User's timezone
      example: America/Los_Angeles
      $ref: "#/components/schemas/__schema56"
    teamId:
      description: "Unique identifier for the team: `Team.` or `Team:` prefix followed
        by a unique suffix, e.g. `Team.123-4aBc_d`"
      title: Team ID
      $ref: "#/components/schemas/TeamId"
    TeamId:
      type: string
      pattern: ^Team((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Team.` or `Team:` prefix followed by a unique suffix,
        e.g. `Team.123-4aBc_d`"
      example: Team.123-4aBc_d
    userCloserStatus:
      description: User's sales closing ability status
      example: Can_Close
      $ref: "#/components/schemas/closerStatus"
    closerStatus:
      type: string
      enum:
        - None
        - Needs_Help
        - Can_Close
        - Can_Help
        - Closer_Only
    RoleId:
      type: string
      pattern: ^Role\.[\s\S]{0,}$
      description: "Terros ID: `Role.` prefix followed by a unique suffix, e.g.
        `Role.123-4aBc_d`"
      example: Role.123-4aBc_d
    companyId:
      description: "Unique identifier for the company: `C.` or `C:` prefix followed by
        a unique suffix, e.g. `C.123-4aBc_d`"
      title: Company ID
      $ref: "#/components/schemas/CId"
    CId:
      type: string
      pattern: ^C((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `C.` or `C:` prefix followed by a unique suffix, e.g.
        `C.123-4aBc_d`"
      example: C.123-4aBc_d
    userCreatedDate:
      description: When the user was created, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/__schema61"
    tinyResident:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/__schema65"
        firstName:
          $ref: "#/components/schemas/__schema66"
        lastName:
          $ref: "#/components/schemas/__schema67"
        email:
          $ref: "#/components/schemas/__schema68"
        phone:
          $ref: "#/components/schemas/__schema70"
        phone2:
          $ref: "#/components/schemas/__schema73"
        businessName:
          $ref: "#/components/schemas/__schema74"
        age:
          $ref: "#/components/schemas/__schema79"
        creditScore:
          $ref: "#/components/schemas/__schema80"
        hasAge:
          $ref: "#/components/schemas/__schema81"
        hasCreditScore:
          $ref: "#/components/schemas/__schema82"
      title: Tiny Resident
      description: Minimal resident information
    languageCode:
      type: string
      enum:
        - ar
        - zh
        - en
        - fa
        - fr
        - hi
        - ja
        - ko
        - pa
        - ru
        - es
        - tl
        - vi
      title: Language Code
      description: ISO 639-1 language code
    contactMethod:
      type: string
      enum:
        - door
        - phone
      description: The method of contact for the contact.
    ContactId:
      type: string
      pattern: ^Contact((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Contact.` or `Contact:` prefix followed by a unique
        suffix, e.g. `Contact.123-4aBc_d`"
      example: Contact.123-4aBc_d
    DispositionId:
      type: string
      pattern: ^Disposition((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Disposition.` or `Disposition:` prefix followed by a
        unique suffix, e.g. `Disposition.123-4aBc_d`"
      example: Disposition.123-4aBc_d
    NoteId:
      type: string
      pattern: ^Note\.[\s\S]{0,}$
      description: "Terros ID: `Note.` prefix followed by a unique suffix, e.g.
        `Note.123-4aBc_d`"
      example: Note.123-4aBc_d
    TagId:
      type: string
      pattern: ^Tag\.[\s\S]{0,}$
      description: "Terros ID: `Tag.` prefix followed by a unique suffix, e.g.
        `Tag.123-4aBc_d`"
      example: Tag.123-4aBc_d
    CFId:
      type: string
      pattern: ^CF\.[\s\S]{0,}$
      description: "Terros ID: `CF.` prefix followed by a unique suffix, e.g.
        `CF.123-4aBc_d`"
      example: CF.123-4aBc_d
    auditPropsCreatedAt:
      deprecated: true
      $ref: "#/components/schemas/utcMilliseconds"
    auditPropsCreatedBy:
      deprecated: true
      $ref: "#/components/schemas/userId"
    auditPropsUpdatedAt:
      $ref: "#/components/schemas/utcMilliseconds"
    auditPropsUpdatedBy:
      deprecated: true
      $ref: "#/components/schemas/userId"
    auditPropsLastUpdateProcess:
      $ref: "#/components/schemas/__schema133"
    auditPropsVersion:
      $ref: "#/components/schemas/__schema134"
    teamName:
      type: string
      description: Friendly name of the team
      example: Team MAP
    AreaId:
      type: string
      pattern: ^Area((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Area.` or `Area:` prefix followed by a unique suffix,
        e.g. `Area.123-4aBc_d`"
      example: Area.123-4aBc_d
    archived:
      description: Whether to include archived items. If "all", include archived items
        as well as non-archived items.
      $ref: "#/components/schemas/__schema275"
    isDeleted:
      description: Indicates if the item is deleted
      $ref: "#/components/schemas/__schema290"
    archive:
      description: Set to false to hard delete database record
      $ref: "#/components/schemas/__schema294"
    eventType:
      type: string
      enum:
        - Consultation
        - Comeback
        - Interview
        - GeneralVisit
        - Shadow
        - Team
      description: Type of calendar event
      example: Consultation
    calendarEventTitle:
      type: string
      description: Event title
      example: Customer Consultation
    calendarEventSourceId:
      description: External client system event ID
      $ref: "#/components/schemas/__schema295"
    calendarEventOutcomeId:
      description: ID for the Outcome of the event
      $ref: "#/components/schemas/__schema296"
    OId:
      type: string
      pattern: ^O\.[\s\S]{0,}$
      description: "Terros ID: `O.` prefix followed by a unique suffix, e.g. `O.123-4aBc_d`"
      example: O.123-4aBc_d
    calendarEventDuration:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
      description: Duration of event in minutes
      example: 60
    calendarEventAccountId:
      description: Associated account ID
      example: Account:cust123
      $ref: "#/components/schemas/accountId"
    calendarEventLocationId:
      description: Location ID
      example: Location:home123
      $ref: "#/components/schemas/locationId"
    calendarEventAttendeeId:
      description: "Event attendee user ID. Examples: Consultation: closer is
        attendee, Shadow: manager is attendee, Interview: rep is attendee"
      example: U:attendee123
      $ref: "#/components/schemas/userId"
    calendarEventDispatcherId:
      description: Dispatcher user ID
      example: U:dispatcher123
      $ref: "#/components/schemas/userId"
    calendarEventOccurredOwner:
      description: Whether the owner attended the event
      $ref: "#/components/schemas/__schema305"
    calendarEventOccurredAttendee:
      description: Whether the attendee attended the event
      $ref: "#/components/schemas/__schema306"
    calendarEventInterviewId:
      description: Associated interview ID
      example: Interview:int123
      $ref: "#/components/schemas/InterviewId"
    InterviewId:
      type: string
      pattern: ^Interview((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Interview.` or `Interview:` prefix followed by a
        unique suffix, e.g. `Interview.123-4aBc_d`"
      example: Interview.123-4aBc_d
    calendarEventNotes:
      description: Event notes. If using Workflows this will be migrated to account notes.
      example: Customer was very interested in the product
      deprecated: true
      $ref: "#/components/schemas/__schema307"
    calendarEventPreviousId:
      description: Previous related event ID
      example: Event:prev123
      $ref: "#/components/schemas/EventId"
    EventId:
      type: string
      pattern: ^Event((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Event.` or `Event:` prefix followed by a unique
        suffix, e.g. `Event.123-4aBc_d`"
      example: Event.123-4aBc_d
    calendarEventTeamId:
      description: Associated team ID
      example: Team:sales
      $ref: "#/components/schemas/teamId"
    booleanFilter:
      type: string
      enum:
        - "true"
        - "false"
        - undefined
        - defined
      description: Boolean filter values
      example: "true"
    calendarEventOccurred:
      description: Whether this event occurred
      $ref: "#/components/schemas/__schema354"
    calendarEventClosed:
      description: Whether the account was closed during this event
      $ref: "#/components/schemas/__schema356"
    calendarEventReasonNotOccurred:
      description: Reason the event did not occur (does not necessarily indicate that
        the event did not occur)
      example: Customer rescheduled
      $ref: "#/components/schemas/__schema358"
    calendarEventFault:
      description: Fault information for the event
      example: setter
      $ref: "#/components/schemas/__schema360"
    calendarEventAllDay:
      description: Whether this is an all-day event
      $ref: "#/components/schemas/__schema362"
    calendarEventCanDelete:
      description: Whether the current user can delete this event
      $ref: "#/components/schemas/__schema364"
    upsertCalendarEventSourceId:
      description: External client system event ID
      $ref: "#/components/schemas/__schema366"
    upsertCalendarEventType:
      type: string
      description: "Event type. Valid values: Consultation, Comeback, Interview,
        GeneralVisit, Shadow, Team. If omitted on create, defaults to
        Consultation."
      example: Consultation
    upsertCalendarEventTitle:
      type: string
      description: Event title
      example: Customer Consultation
    upsertCalendarEventDate:
      description: Event date as ISO 8601 string or UTC milliseconds. If omitted on
        create, defaults to current time.
      example: 1672531200000
      $ref: "#/components/schemas/__schema189"
    upsertCalendarEventOutcomeId:
      description: Event outcome. Accepts an EventOutcomeId, an integration mapping
        string, or a case-insensitive outcome name.
      $ref: "#/components/schemas/__schema367"
    upsertCalendarEventDuration:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
      description: Duration of event in minutes
      example: 60
    upsertCalendarEventOwnerId:
      description: Event owner. Accepts a UserId or email address. If omitted on
        create, defaults to the authenticated user.
      $ref: "#/components/schemas/__schema370"
    upsertCalendarEventAttendeeId:
      description: Event attendee. Accepts a UserId or email address. Set to null to
        explicitly clear on update.
      $ref: "#/components/schemas/__schema371"
    upsertCalendarEventDispatcherId:
      description: Dispatcher. Accepts a UserId or email address.
      $ref: "#/components/schemas/__schema372"
    upsertCalendarEventOccurredOwner:
      description: Whether the owner attended the event
      $ref: "#/components/schemas/__schema373"
    upsertCalendarEventOccurredAttendee:
      description: Whether the attendee attended the event
      $ref: "#/components/schemas/__schema374"
    upsertCalendarEventNotes:
      description: Event notes
      example: Customer was very interested in the product
      $ref: "#/components/schemas/__schema375"
    upsertCalendarEventPreviousId:
      description: Previous related event ID
      example: Event:prev123
      $ref: "#/components/schemas/EventId"
    accessStatus:
      type: string
      enum:
        - active
        - suspended
    billingMethod:
      type: string
      enum:
        - stripe
        - none
    teamLevel:
      type: integer
      minimum: 1
      maximum: 9007199254740991
      description: Level of the team in the hierarchy
      example: 3
    companyIndustry:
      type: string
      enum:
        - solar
        - pest
        - alarm
        - roofing
        - fiber
        - insurance
        - home_improvement
        - windows
        - satellite_tv
        - retail
        - other
        - solar_cleaning
    companyName:
      type: string
      minLength: 1
      description: Company's name
      example: Acme Corporation
    companySize:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    AppId:
      type: string
      pattern: ^App\.[\s\S]{0,}$
      description: "Terros ID: `App.` prefix followed by a unique suffix, e.g.
        `App.123-4aBc_d`"
      example: App.123-4aBc_d
    includeUploadUrls:
      description: "Include presigned upload URLs for the images you may edit. Pass
        true when you are about to upload. For now an omitted flag still returns
        them, but that is deprecated: it will soon mean false."
      $ref: "#/components/schemas/__schema382"
    AppInstallId:
      type: string
      pattern: ^AppInstall\.[\s\S]{0,}$
      description: "Terros ID: `AppInstall.` prefix followed by a unique suffix, e.g.
        `AppInstall.123-4aBc_d`"
      example: AppInstall.123-4aBc_d
    AppScriptId:
      type: string
      pattern: ^AppScript\.[\s\S]{0,}$
      description: "Terros ID: `AppScript.` prefix followed by a unique suffix, e.g.
        `AppScript.123-4aBc_d`"
      example: AppScript.123-4aBc_d
    appAvatarUrl:
      $ref: "#/components/schemas/__schema410"
    appAvatarBlurhash:
      $ref: "#/components/schemas/__schema412"
    AppVersionId:
      type: string
      pattern: ^AppVersion\.[\s\S]{0,}$
      description: "Terros ID: `AppVersion.` prefix followed by a unique suffix, e.g.
        `AppVersion.123-4aBc_d`"
      example: AppVersion.123-4aBc_d
    showArchived:
      description: If "all", include archived records. If true, include only archived
        records.
      $ref: "#/components/schemas/__schema275"
    EvalId:
      type: string
      pattern: ^Eval((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Eval.` or `Eval:` prefix followed by a unique suffix,
        e.g. `Eval.123-4aBc_d`"
      example: Eval.123-4aBc_d
    evaluationEvalState:
      type: string
      enum:
        - Pending
        - Recorded
        - PendingScore
        - Rejected
        - Complete
        - Acknowledged
      description: The state of the evaluation
    tinyUser:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema228"
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrl"
        lastAccess:
          $ref: "#/components/schemas/userLastAccess"
        isDeleted:
          $ref: "#/components/schemas/userIsDeleted"
        color:
          $ref: "#/components/schemas/tinyUserColor"
      required:
        - userId
        - firstName
        - lastName
      title: Tiny User
      description: Minimal user information for display purposes
    evaluationTeamId:
      $ref: "#/components/schemas/teamId"
    evaluationPossible:
      type: number
      description: The total possible score for the evaluation
    evaluationEventDate:
      description: When the behavior occurred (the recording was submitted), in UTC
        epoch milliseconds. This could be EMPTY_DATE if this is a Pending
        evaluation.
      $ref: "#/components/schemas/__schema452"
    evaluationEvaluator:
      description: The user who conducted (or will conduct) this eval
      $ref: "#/components/schemas/tinyUser"
    evaluationEvalDate:
      description: When the evaluation was graded, in UTC epoch milliseconds
      $ref: "#/components/schemas/__schema453"
    evaluationScore:
      $ref: "#/components/schemas/__schema454"
    evaluationComment:
      description: If the evaluation was rejected, this is the reason
      $ref: "#/components/schemas/__schema455"
    evaluationDownloadUrl:
      $ref: "#/components/schemas/__schema456"
    evaluationUploadUrl:
      $ref: "#/components/schemas/__schema457"
    evaluationAccountId:
      description: The account associated with the evaluation
      $ref: "#/components/schemas/accountId"
    ExportId:
      type: string
      pattern: ^Export\.[\s\S]{0,}$
      description: "Terros ID: `Export.` prefix followed by a unique suffix, e.g.
        `Export.123-4aBc_d`"
      example: Export.123-4aBc_d
    ExternalLinkId:
      type: string
      pattern: ^ExternalLink\.[\s\S]{0,}$
      description: "Terros ID: `ExternalLink.` prefix followed by a unique suffix,
        e.g. `ExternalLink.123-4aBc_d`"
      example: ExternalLink.123-4aBc_d
    GameId:
      type: string
      pattern: ^Game\.[\s\S]{0,}$
      description: "Terros ID: `Game.` prefix followed by a unique suffix, e.g.
        `Game.123-4aBc_d`"
      example: Game.123-4aBc_d
    ColumnMapping:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema501"
      additionalProperties:
        $ref: "#/components/schemas/__schema502"
      description: Maps CSV column names (keys) to the expected header names the
        parser should read them as (values).
    ProgramId:
      type: string
      pattern: ^Program\.[\s\S]{0,}$
      description: "Terros ID: `Program.` prefix followed by a unique suffix, e.g.
        `Program.123-4aBc_d`"
      example: Program.123-4aBc_d
    RatioId:
      type: string
      pattern: ^Ratio\.[\s\S]{0,}$
      description: "Terros ID: `Ratio.` prefix followed by a unique suffix, e.g.
        `Ratio.123-4aBc_d`"
      example: Ratio.123-4aBc_d
    TaskId:
      type: string
      pattern: ^Task((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Task.` or `Task:` prefix followed by a unique suffix,
        e.g. `Task.123-4aBc_d`"
      example: Task.123-4aBc_d
    MTId:
      type: string
      pattern: ^MT\.[\s\S]{0,}$
      description: "Terros ID: `MT.` prefix followed by a unique suffix, e.g.
        `MT.123-4aBc_d`"
      example: MT.123-4aBc_d
    PTId:
      type: string
      pattern: ^PT\.[\s\S]{0,}$
      description: "Terros ID: `PT.` prefix followed by a unique suffix, e.g.
        `PT.123-4aBc_d`"
      example: PT.123-4aBc_d
    QuizId:
      type: string
      pattern: ^Quiz\.[\s\S]{0,}$
      description: "Terros ID: `Quiz.` prefix followed by a unique suffix, e.g.
        `Quiz.123-4aBc_d`"
      example: Quiz.123-4aBc_d
    parentTeamId:
      description: ID of the parent team
      example: Team:parent
      $ref: "#/components/schemas/teamId"
    teamExternalId:
      description: External ID of the team
      example: "12345"
      $ref: "#/components/schemas/__schema624"
    teamDescription:
      description: Description of the team
      example: This is a team.
      $ref: "#/components/schemas/__schema625"
    teamTimezone:
      description: Timezone the team operates in
      example: America/Los_Angeles
      $ref: "#/components/schemas/__schema626"
    teamOfficeLocation:
      description: Location of the team
      example:
        lat: 33.7
        lng: -117.8
      $ref: "#/components/schemas/latlng"
    teamOfficeAddress:
      description: Street address of the team
      example: 1234 Main St, Irvine, CA 92780
      $ref: "#/components/schemas/__schema627"
    teamMeetingTimes:
      description: Legacy scheduled meeting times for the team; new meeting
        configuration clients use /meeting/list
      example:
        - day: 1
          start: 600
          end: 660
      $ref: "#/components/schemas/__schema628"
    meetingTimeDay:
      type: number
      minimum: 1
      maximum: 7
      description: Day of the week (1-7)
      example: 1
    meetingTimeStart:
      type: number
      minimum: 0
      maximum: 1439
      description: Meeting start time in minutes since start of day
      example: 600
    meetingTimeEnd:
      type: number
      minimum: 0
      maximum: 1439
      description: Meeting end time in minutes since start of day
      example: 660
    teamIsCloserBoundary:
      description: If true, closer search will not propagate to parent teams.
      $ref: "#/components/schemas/__schema630"
    teamRestrictVisibility:
      description: If true, team is not visible to other teams.
      $ref: "#/components/schemas/__schema631"
    teamAvatarBlurhash:
      description: Blurhash representation of the team avatar.
      $ref: "#/components/schemas/__schema632"
    teamAvatarUrl:
      description: URL of the team avatar.
      $ref: "#/components/schemas/__schema633"
    teamParentIds:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
      description: Team IDs in the team's hierarchy.
    teamUploadAvatarUrl:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema634"
    userManagerId:
      description: User ID of the user's manager
      example: U:manager123
      $ref: "#/components/schemas/userId"
    userHasManager:
      description: Whether the user reports having a manager
      example: true
      $ref: "#/components/schemas/__schema642"
    selfReportedManager:
      type: object
      properties:
        managerId:
          $ref: "#/components/schemas/selfReportedManagerId"
        updatedAt:
          $ref: "#/components/schemas/selfReportedManagerUpdatedAt"
      required:
        - updatedAt
      title: Self Reported Manager
      description: Manager selection reported directly by the user
    selfReportedManagerId:
      description: User ID of the user's self-reported manager
      example: U:manager123
      $ref: "#/components/schemas/userId"
    selfReportedManagerUpdatedAt:
      description: When the self-reported manager was last updated, in UTC epoch
        milliseconds
      $ref: "#/components/schemas/utcMilliseconds"
    primaryTeam:
      type: object
      properties:
        teamId:
          $ref: "#/components/schemas/__schema645"
        staleAfter:
          $ref: "#/components/schemas/__schema646"
      required:
        - teamId
        - staleAfter
      title: Primary Team
      description: Primary team assignment for a user
    userBetaProgram:
      description: Whether the user is enrolled in the Terros Beta program
      example: true
      $ref: "#/components/schemas/__schema647"
    userLanguage:
      description: User's preferred language
      example: en_US
      $ref: "#/components/schemas/__schema648"
    userSecondaryLanguages:
      description: Languages spoken by user
      example: en
      $ref: "#/components/schemas/__schema649"
    userColor:
      description: UI color theme for the user
      example: "#3B82F6"
      $ref: "#/components/schemas/__schema650"
    userSuperuserScore:
      description: Score indicating superuser status, used for internal ranking
      example: 42.12
      $ref: "#/components/schemas/__schema651"
    userWhitelist:
      description: Whether the user is whitelisted, not allowing them to be archived
      example: false
      $ref: "#/components/schemas/__schema654"
    userRemoveInput:
      anyOf:
        - $ref: "#/components/schemas/userRemoveSingleInput"
        - $ref: "#/components/schemas/userRemoveBulkInput"
      title: User Remove Input
      description: Input schema for removing users (single or bulk)
    userRemoveSingleInput:
      type: object
      properties:
        archive:
          $ref: "#/components/schemas/archive"
        userId:
          $ref: "#/components/schemas/__schema141"
      required:
        - userId
      title: User Remove Single Input
      description: Input schema for removing a single user
    userRemoveBulkInput:
      type: object
      properties:
        archive:
          $ref: "#/components/schemas/archive"
        userIds:
          $ref: "#/components/schemas/__schema672"
      required:
        - userIds
      title: User Remove Bulk Input
      description: Input schema for removing multiple users
    userUpdateInput:
      type: object
      properties:
        user:
          $ref: "#/components/schemas/__schema673"
      required:
        - user
      title: User Update Input
      description: Input schema for updating user information
    addressCountry:
      type: string
      enum:
        - US
        - CA
        - PR
      description: Two-letter ISO country code (US, CA, or PR)
      example: US
    userBiography:
      description: User's biography or personal description
      example: Experienced sales professional...
      $ref: "#/components/schemas/__schema682"
    userStartDate:
      description: User's employment start date, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/__schema685"
    userListInput:
      type: object
      properties:
        showArchived:
          $ref: "#/components/schemas/showArchived"
        companyId:
          $ref: "#/components/schemas/__schema686"
        teamId:
          $ref: "#/components/schemas/__schema687"
        userIds:
          $ref: "#/components/schemas/__schema688"
      title: User List Input
      description: Input schema for listing users with optional filters
    WebhookId:
      type: string
      pattern: ^Webhook((\.)|(:))[\s\S]{0,}$
      description: "Terros ID: `Webhook.` or `Webhook:` prefix followed by a unique
        suffix, e.g. `Webhook.123-4aBc_d`"
      example: Webhook.123-4aBc_d
    webhookRemoveAction:
      type: string
      const: remove
    webhookAddUpdateAction:
      anyOf:
        - $ref: "#/components/schemas/__schema794"
        - $ref: "#/components/schemas/__schema795"
    auditDatesCreatedAt:
      type: string
    auditDatesUpdatedAt:
      type: string
    smallUser:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema228"
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrl"
        lastAccess:
          $ref: "#/components/schemas/userLastAccess"
        isDeleted:
          $ref: "#/components/schemas/userIsDeleted"
        color:
          $ref: "#/components/schemas/tinyUserColor"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhone"
        title:
          $ref: "#/components/schemas/userTitle"
        timeZone:
          $ref: "#/components/schemas/userTimeZone"
        teamIds:
          $ref: "#/components/schemas/__schema57"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema59"
        memberOf:
          $ref: "#/components/schemas/__schema229"
        companyId:
          $ref: "#/components/schemas/__schema60"
        createdDate:
          $ref: "#/components/schemas/userCreatedDate"
      required:
        - userId
        - firstName
        - lastName
        - email
      title: Small User
      description: User information with basic contact details
    ScreenshotId:
      type: string
      pattern: ^Screenshot\.[\s\S]{0,}$
      description: "Terros ID: `Screenshot.` prefix followed by a unique suffix, e.g.
        `Screenshot.123-4aBc_d`"
      example: Screenshot.123-4aBc_d
    __schema0:
      $ref: "#/components/schemas/apiVersion"
    __schema1:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    __schema2:
      type: boolean
    __schema3:
      type: boolean
    __schema4:
      type: string
    __schema5:
      type: boolean
    __schema6:
      $ref: "#/components/schemas/__schema7"
    __schema7:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema8"
      additionalProperties:
        anyOf:
          - $ref: "#/components/schemas/__schema9"
          - type: array
            items:
              $ref: "#/components/schemas/__schema9"
    __schema8:
      type: string
      pattern: ^CF\.[\s\S]{0,}$
      description: A unique identifier for the custom field set
      example: CF.123-4aBc_d
    __schema9:
      anyOf:
        - $ref: "#/components/schemas/__schema10"
        - $ref: "#/components/schemas/__schema11"
        - $ref: "#/components/schemas/__schema12"
        - $ref: "#/components/schemas/AttachmentId"
        - $ref: "#/components/schemas/__schema13"
    __schema10:
      type: string
    __schema11:
      type: number
    __schema12:
      type: boolean
    __schema13:
      type: "null"
    __schema14:
      description: Workflow ID that is associated with the account
      $ref: "#/components/schemas/WFId"
    __schema15:
      description: List of workflow stages and actions that the account has progressed
        through
      $ref: "#/components/schemas/__schema16"
    __schema16:
      type: array
      items:
        type: object
        properties:
          stageId:
            $ref: "#/components/schemas/SId"
          actionId:
            $ref: "#/components/schemas/AId"
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
          latlng:
            description: Location where the action was taken
            $ref: "#/components/schemas/latlng"
          sourceStatus:
            description: External status from source system at the time of action
            $ref: "#/components/schemas/__schema18"
          source:
            description: Set when the entry was written by a bulk process (e.g. rollback)
              that must not earn new stage credit
            $ref: "#/components/schemas/__schema19"
        required:
          - stageId
          - userId
          - timestamp
    __schema17:
      type: number
    __schema18:
      type: string
    __schema19:
      type: string
      enum:
        - rollback
    __schema20:
      $ref: "#/components/schemas/SId"
    __schema21:
      $ref: "#/components/schemas/AId"
    __schema22:
      $ref: "#/components/schemas/latlng"
    __schema23:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema24:
      $ref: "#/components/schemas/accountId"
    __schema25:
      example: AS.test
      $ref: "#/components/schemas/accountStatusId"
    __schema26:
      description: Optional label for the system this account came from. Stored on the
        account. Not required to match or look up an account by sourceId.
      example: Statra
      $ref: "#/components/schemas/__schema27"
    __schema27:
      type: string
    __schema28:
      description: Raw status from the source system
      $ref: "#/components/schemas/__schema29"
    __schema29:
      type: string
    __schema30:
      description: "External identifier for the account within your company. sourceId
        is a single-part key: matching and lookup use sourceId alone.
        accountSource is not part of the key and is not required."
      $ref: "#/components/schemas/__schema31"
    __schema31:
      type: string
    __schema32:
      description: Alternate external lead identifier
      $ref: "#/components/schemas/__schema33"
    __schema33:
      type: string
    __schema34:
      $ref: "#/components/schemas/locationId"
    __schema35:
      type: string
      pattern: ^Loc:[\s\S]{0,}$
      description: "Terros ID: `Loc:` prefix followed by a unique suffix, e.g.
        `Loc:123-4aBc_d`"
      example: Loc:123-4aBc_d
    __schema36:
      $ref: "#/components/schemas/__schema37"
    __schema37:
      type: object
      properties:
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        line1:
          $ref: "#/components/schemas/addressLine1"
        locality:
          $ref: "#/components/schemas/addressLocality"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        postal2:
          $ref: "#/components/schemas/addressPostal2"
        postal3:
          $ref: "#/components/schemas/addressPostal3"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbr"
        unitType:
          $ref: "#/components/schemas/addressUnitType"
        line2:
          $ref: "#/components/schemas/__schema42"
        oneLine:
          $ref: "#/components/schemas/__schema43"
        latlng:
          $ref: "#/components/schemas/latlng"
      required:
        - countrySubd
        - line1
        - locality
        - postal1
        - latlng
    __schema38:
      type: string
    __schema39:
      type: string
    __schema40:
      type: string
    __schema41:
      type: string
    __schema42:
      $ref: "#/components/schemas/addressLine2"
    __schema43:
      $ref: "#/components/schemas/addressOneLine"
    __schema44:
      description: User ID of the account owner
      example: U.test
      $ref: "#/components/schemas/userId"
    __schema45:
      description: Details of the account owner
      $ref: "#/components/schemas/__schema46"
    __schema46:
      type: object
      properties:
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrl"
        lastAccess:
          $ref: "#/components/schemas/userLastAccess"
        isDeleted:
          $ref: "#/components/schemas/userIsDeleted"
        color:
          $ref: "#/components/schemas/tinyUserColor"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhone"
        title:
          $ref: "#/components/schemas/userTitle"
        timeZone:
          $ref: "#/components/schemas/userTimeZone"
        teamIds:
          $ref: "#/components/schemas/__schema57"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema59"
        companyId:
          $ref: "#/components/schemas/__schema60"
        createdDate:
          $ref: "#/components/schemas/userCreatedDate"
      required:
        - firstName
        - lastName
        - email
    __schema47:
      type: string
    __schema48:
      type: string
    __schema49:
      type: string
    __schema50:
      type: string
    __schema51:
      type: number
    __schema52:
      type: boolean
    __schema53:
      type: string
    __schema54:
      type: string
    __schema55:
      type: string
    __schema56:
      type: string
    __schema57:
      description: List of team IDs the user belongs to
      $ref: "#/components/schemas/__schema58"
    __schema58:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema59:
      type: array
      items:
        type: object
        properties:
          roleId:
            $ref: "#/components/schemas/RoleId"
          roleType:
            anyOf:
              - type: string
                enum:
                  - admin
                  - manager
                  - recruit
              - type: "null"
          name:
            type: string
            minLength: 1
        required:
          - roleId
          - name
    __schema60:
      $ref: "#/components/schemas/companyId"
    __schema61:
      type: number
    __schema62:
      description: User ID of the account closer
      $ref: "#/components/schemas/userId"
    __schema63:
      description: Details of the account closer
      $ref: "#/components/schemas/__schema46"
    __schema64:
      description: Primary resident information
      $ref: "#/components/schemas/tinyResident"
    __schema65:
      type: string
    __schema66:
      type: string
    __schema67:
      type: string
    __schema68:
      anyOf:
        - type: string
          format: email
          pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        - $ref: "#/components/schemas/__schema69"
    __schema69:
      type: string
      const: ""
    __schema70:
      anyOf:
        - $ref: "#/components/schemas/__schema71"
        - $ref: "#/components/schemas/__schema69"
    __schema71:
      title: Phone Number
      description: Phone number as 10 digits (formatting will be applied when displayed)
      example: "1234567890"
      $ref: "#/components/schemas/__schema72"
    __schema72:
      type: string
      minLength: 1
    __schema73:
      anyOf:
        - $ref: "#/components/schemas/__schema71"
        - $ref: "#/components/schemas/__schema69"
    __schema74:
      type: string
    __schema75:
      $ref: "#/components/schemas/__schema76"
    __schema76:
      type: string
      enum:
        - PASS
        - FAIL
        - NO_HIT
    __schema77:
      $ref: "#/components/schemas/__schema78"
    __schema78:
      type: string
      pattern: ^Si:[\s\S]{0,}$
      description: "Terros ID: `Si:` prefix followed by a unique suffix, e.g.
        `Si:123-4aBc_d`"
      example: Si:123-4aBc_d
    __schema79:
      type: number
      minimum: 0
    __schema80:
      type: object
      properties:
        gte:
          type: number
        lte:
          type: number
      required:
        - gte
        - lte
    __schema81:
      type: boolean
    __schema82:
      type: boolean
    __schema83:
      description: Secondary resident information
      $ref: "#/components/schemas/tinyResident"
    __schema84:
      description: Primary language spoken for the customer or household
      $ref: "#/components/schemas/languageCode"
    __schema85:
      description: Number of times appointment was rescheduled (deprecated)
      deprecated: true
      $ref: "#/components/schemas/__schema86"
    __schema86:
      type: number
    __schema87:
      description: Estimated deal size (deprecated)
      deprecated: true
      $ref: "#/components/schemas/__schema88"
    __schema88:
      type: number
    __schema89:
      description: Appointment date as UTC milliseconds
      $ref: "#/components/schemas/utcMilliseconds"
    __schema90:
      description: Flag indicating if this is a test record
      $ref: "#/components/schemas/__schema91"
    __schema91:
      type: boolean
    __schema92:
      description: ID of team this account belongs to
      $ref: "#/components/schemas/teamId"
    __schema93:
      description: List of account contacts
      $ref: "#/components/schemas/__schema94"
    __schema94:
      type: array
      items:
        $ref: "#/components/schemas/__schema95"
    __schema95:
      type: object
      properties:
        timestamp:
          $ref: "#/components/schemas/utcMilliseconds"
        method:
          $ref: "#/components/schemas/contactMethod"
        userId:
          $ref: "#/components/schemas/userId"
        contactId:
          $ref: "#/components/schemas/ContactId"
        dispositionId:
          $ref: "#/components/schemas/__schema96"
        deviceLocation:
          $ref: "#/components/schemas/latlng"
        isPitch:
          type: boolean
      required:
        - timestamp
        - method
        - userId
        - dispositionId
    __schema96:
      anyOf:
        - $ref: "#/components/schemas/DispositionId"
        - $ref: "#/components/schemas/__schema97"
      deprecated: true
      description: Deprecated when using Workflows
    __schema97:
      type: string
      enum:
        - NotHome
        - Comeback
        - NotNow
        - NotQualified
        - PartialPitch
        - NewAccount
        - Competitor
        - Custom1
        - Custom2
        - Custom3
    __schema98:
      description: List of account notes
      $ref: "#/components/schemas/__schema99"
    __schema99:
      type: array
      items:
        $ref: "#/components/schemas/__schema100"
    __schema100:
      type: object
      properties:
        timestamp:
          $ref: "#/components/schemas/utcMilliseconds"
        text:
          $ref: "#/components/schemas/__schema101"
        userId:
          $ref: "#/components/schemas/userId"
        noteId:
          $ref: "#/components/schemas/__schema102"
      required:
        - timestamp
        - text
        - userId
    __schema101:
      type: string
    __schema102:
      $ref: "#/components/schemas/NoteId"
    __schema103:
      description: Flag indicating if this is a parent account
      $ref: "#/components/schemas/__schema104"
    __schema104:
      type: boolean
    __schema105:
      description: Parent account identifier
      $ref: "#/components/schemas/accountId"
    __schema106:
      description: List of tags associated with the account
      $ref: "#/components/schemas/__schema107"
    __schema107:
      type: array
      items:
        type: object
        properties:
          tagId:
            $ref: "#/components/schemas/TagId"
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
          userId:
            $ref: "#/components/schemas/userId"
        required:
          - tagId
          - timestamp
          - userId
    __schema108:
      $ref: "#/components/schemas/__schema109"
    __schema109:
      type: object
      properties:
        pre:
          $ref: "#/components/schemas/__schema110"
        post:
          $ref: "#/components/schemas/__schema112"
      description: Hooks to execute around the main action. Include hooks with
        behavior="always" or those with behavior="ask" the user has opted in to.
    __schema110:
      type: array
      items:
        type: object
        properties:
          type:
            $ref: "#/components/schemas/__schema111"
          actionId:
            $ref: "#/components/schemas/AId"
        required:
          - type
          - actionId
    __schema111:
      type: string
      enum:
        - action
    __schema112:
      type: array
      items:
        $ref: "#/components/schemas/__schema113"
    __schema113:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: launch
            behavior:
              $ref: "#/components/schemas/__schema114"
            launcher:
              type: object
              properties:
                baseUrl:
                  $ref: "#/components/schemas/__schema115"
                pathParams:
                  $ref: "#/components/schemas/__schema116"
                params:
                  $ref: "#/components/schemas/__schema118"
                openMode:
                  $ref: "#/components/schemas/__schema127"
                completionUrlPattern:
                  $ref: "#/components/schemas/__schema128"
              required:
                - baseUrl
                - params
                - openMode
          required:
            - type
            - behavior
            - launcher
        - type: object
          properties:
            type:
              type: string
              const: user
            behavior:
              type: string
              const: always
            action:
              type: string
              enum:
                - create
                - archive
          required:
            - type
            - behavior
            - action
      type: object
    __schema114:
      type: string
      enum:
        - ask
        - always
    __schema115:
      type: string
      format: uri
    __schema116:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            pattern: ^[A-Za-z][A-Za-z0-9_]*$
          source:
            $ref: "#/components/schemas/__schema117"
          fallbackValue:
            type: string
            minLength: 1
        required:
          - name
          - source
          - fallbackValue
    __schema117:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: field
            field:
              type: string
              enum:
                - residentFirstName
                - residentLastName
                - residentFullName
                - residentPhone
                - residentEmail
                - residentPrescreenDecision
                - residentIndividualId
                - addressFull
                - addressLine1
                - addressCity
                - addressState
                - addressZip
                - latitude
                - longitude
                - accountId
                - locationId
                - deviceLatitude
                - deviceLongitude
                - userFullName
                - userEmail
                - userClientUserId
                - userId
                - userToken
                - returnUrl
          required:
            - type
            - field
        - type: object
          properties:
            type:
              type: string
              const: customField
            customFieldId:
              $ref: "#/components/schemas/CFId"
          required:
            - type
            - customFieldId
        - type: object
          properties:
            type:
              type: string
              const: static
            value:
              type: string
          required:
            - type
            - value
      type: object
    __schema118:
      type: array
      items:
        type: object
        properties:
          name:
            $ref: "#/components/schemas/__schema119"
          source:
            $ref: "#/components/schemas/__schema120"
          whenEmpty:
            $ref: "#/components/schemas/__schema124"
          fallbackValue:
            $ref: "#/components/schemas/__schema126"
        required:
          - name
          - source
          - whenEmpty
    __schema119:
      type: string
      minLength: 1
    __schema120:
      anyOf:
        - $ref: "#/components/schemas/__schema117"
        - type: object
          properties:
            type:
              $ref: "#/components/schemas/__schema121"
            properties:
              $ref: "#/components/schemas/__schema122"
          required:
            - type
            - properties
    __schema121:
      type: string
      const: object
    __schema122:
      type: array
      items:
        type: object
        properties:
          name:
            $ref: "#/components/schemas/__schema123"
          source:
            $ref: "#/components/schemas/__schema120"
          whenEmpty:
            $ref: "#/components/schemas/__schema124"
          fallbackValue:
            $ref: "#/components/schemas/__schema125"
        required:
          - name
          - source
          - whenEmpty
    __schema123:
      type: string
      minLength: 1
    __schema124:
      type: string
      enum:
        - exclude
        - emptyString
        - fallback
        - require
    __schema125:
      type: string
    __schema126:
      type: string
    __schema127:
      type: string
      enum:
        - external
        - inAppBrowser
        - embedded
    __schema128:
      description: Client-side completion URL prefix. Navigated URLs starting with
        this value complete the launcher.
      $ref: "#/components/schemas/__schema129"
    __schema129:
      type: string
    __schema130:
      oneOf:
        - type: object
          properties:
            op:
              type: string
              const: add
            account:
              type: object
              properties:
                customFields:
                  $ref: "#/components/schemas/__schema6"
                importId:
                  $ref: "#/components/schemas/importId"
                workflowId:
                  $ref: "#/components/schemas/__schema14"
                workflowHistory:
                  $ref: "#/components/schemas/__schema15"
                workflowStageId:
                  $ref: "#/components/schemas/__schema20"
                workflowActionId:
                  $ref: "#/components/schemas/__schema21"
                deviceLocation:
                  $ref: "#/components/schemas/__schema22"
                checkpoints:
                  $ref: "#/components/schemas/__schema23"
                accountId:
                  $ref: "#/components/schemas/__schema24"
                statusId:
                  $ref: "#/components/schemas/__schema25"
                accountSource:
                  $ref: "#/components/schemas/__schema26"
                sourceStatus:
                  $ref: "#/components/schemas/__schema28"
                sourceId:
                  $ref: "#/components/schemas/__schema30"
                externalLeadId:
                  $ref: "#/components/schemas/__schema32"
                locationId:
                  $ref: "#/components/schemas/__schema34"
                location:
                  $ref: "#/components/schemas/__schema36"
                ownerId:
                  $ref: "#/components/schemas/__schema44"
                owner:
                  $ref: "#/components/schemas/__schema45"
                closerId:
                  $ref: "#/components/schemas/__schema62"
                closer:
                  $ref: "#/components/schemas/__schema63"
                resident:
                  $ref: "#/components/schemas/__schema64"
                resident2:
                  $ref: "#/components/schemas/__schema83"
                language:
                  $ref: "#/components/schemas/__schema84"
                rescheduleCount:
                  $ref: "#/components/schemas/__schema85"
                dealSize:
                  $ref: "#/components/schemas/__schema87"
                appointmentDate:
                  $ref: "#/components/schemas/__schema89"
                test:
                  $ref: "#/components/schemas/__schema90"
                teamId:
                  $ref: "#/components/schemas/__schema92"
                contacts:
                  $ref: "#/components/schemas/__schema93"
                notes:
                  $ref: "#/components/schemas/__schema98"
                isParent:
                  $ref: "#/components/schemas/__schema103"
                parentAccountId:
                  $ref: "#/components/schemas/__schema105"
                tags:
                  $ref: "#/components/schemas/__schema106"
              description: The account object to add.
          required:
            - op
            - account
        - type: object
          properties:
            op:
              type: string
              const: update
            account:
              $ref: "#/components/schemas/__schema131"
          required:
            - op
            - account
        - type: object
          properties:
            op:
              type: string
              const: remove
            accountId:
              type: string
              pattern: ^Account((\.)|(:))[\s\S]{0,}$
              description: The unique identifier of the account to remove.
              example: Account.123-4aBc_d
              $ref: "#/components/schemas/accountId"
            cascade:
              $ref: "#/components/schemas/__schema146"
          required:
            - op
            - accountId
      type: object
    __schema131:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema132"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAt"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAt"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcess"
        version:
          $ref: "#/components/schemas/auditPropsVersion"
        customFields:
          $ref: "#/components/schemas/__schema6"
        importId:
          $ref: "#/components/schemas/importId"
        workflowId:
          $ref: "#/components/schemas/__schema14"
        workflowHistory:
          $ref: "#/components/schemas/__schema15"
        workflowStageId:
          description: Current workflow stage ID that the account is in
          $ref: "#/components/schemas/SId"
        workflowActionId:
          description: Current workflow action ID that the account is in
          $ref: "#/components/schemas/AId"
        deviceLocation:
          $ref: "#/components/schemas/__schema22"
        checkpoints:
          type: array
          items:
            $ref: "#/components/schemas/SId"
        statusId:
          $ref: "#/components/schemas/__schema25"
        accountSource:
          $ref: "#/components/schemas/__schema26"
        sourceStatus:
          $ref: "#/components/schemas/__schema28"
        sourceId:
          $ref: "#/components/schemas/__schema30"
        externalLeadId:
          $ref: "#/components/schemas/__schema32"
        locationId:
          $ref: "#/components/schemas/__schema34"
        location:
          $ref: "#/components/schemas/__schema36"
        ownerId:
          anyOf:
            - $ref: "#/components/schemas/userId"
            - type: "null"
        owner:
          $ref: "#/components/schemas/__schema45"
        closerId:
          $ref: "#/components/schemas/__schema62"
        closer:
          $ref: "#/components/schemas/__schema63"
        resident:
          $ref: "#/components/schemas/__schema64"
        resident2:
          $ref: "#/components/schemas/__schema83"
        language:
          $ref: "#/components/schemas/__schema84"
        rescheduleCount:
          $ref: "#/components/schemas/__schema85"
        dealSize:
          $ref: "#/components/schemas/__schema87"
        appointmentDate:
          $ref: "#/components/schemas/__schema89"
        test:
          $ref: "#/components/schemas/__schema90"
        teamId:
          anyOf:
            - $ref: "#/components/schemas/teamId"
            - type: "null"
        isParent:
          $ref: "#/components/schemas/__schema103"
        parentAccountId:
          $ref: "#/components/schemas/__schema105"
        tags:
          $ref: "#/components/schemas/__schema106"
        statusHistory:
          type: array
          items:
            $ref: "#/components/schemas/__schema135"
          deprecated: true
        workflowStageName:
          description: Name of the current workflow stage, resolved from the workflow
            definition
          $ref: "#/components/schemas/__schema136"
        workflowActionName:
          description: Name of the current workflow action, resolved from the workflow
            definition
          $ref: "#/components/schemas/__schema137"
        homeowner:
          description: Homeowner resident information, included for convenience but may be
            incomplete
          $ref: "#/components/schemas/tinyResident"
        expiresAt:
          $ref: "#/components/schemas/utcMilliseconds"
        lastActionDate:
          $ref: "#/components/schemas/utcMilliseconds"
        recruitId:
          description: UserId of the recruit who was assigned to the account
          $ref: "#/components/schemas/userId"
        ownerHistory:
          description: History of account owners
          $ref: "#/components/schemas/__schema138"
        closerHistory:
          description: History of account closers
          $ref: "#/components/schemas/__schema138"
        teamHistory:
          description: History of account teams
          $ref: "#/components/schemas/__schema139"
        assignmentDate:
          description: When the latest area assignment run that touched this account
            started, in UTC epoch milliseconds; matches that run in the area run
            history
          $ref: "#/components/schemas/utcMilliseconds"
        editable:
          description: Whether the current user can edit this account. Decorated
            per-request, not stored.
          $ref: "#/components/schemas/__schema140"
        customFieldsPatch:
          description: Custom field values to change, keyed by field ID. Unlike
            `customFields`, which replaces the whole map, fields left out keep
            their stored values, and `null` clears one field. Send one or the
            other, not both.
          $ref: "#/components/schemas/__schema7"
        actorId:
          description: UserId, email, or clientUserId of the actor performing the update.
            Overrides the automatically resolved user on workflow history items.
          $ref: "#/components/schemas/__schema141"
        hooks:
          $ref: "#/components/schemas/__schema109"
        contacts:
          description: List of contacts to add or update for the account.
          $ref: "#/components/schemas/__schema142"
        notes:
          description: List of notes to add or update for the account.
          $ref: "#/components/schemas/__schema143"
        deletedContacts:
          description: List of IDs of contacts to delete from the account.
          $ref: "#/components/schemas/__schema144"
        deletedNotes:
          description: IDs of notes to permanently delete from the account. `/account/get`
            returns each note with its `noteId`, author, date and text. To
            delete notes on several accounts, send one `update` operation per
            account to `/account/batch`.
          $ref: "#/components/schemas/__schema145"
        accountId:
          type: string
          pattern: ^Account((\.)|(:))[\s\S]{0,}$
          description: The unique identifier of the account to update.
          example: Account.123-4aBc_d
          $ref: "#/components/schemas/accountId"
      required:
        - accountId
    __schema132:
      type: array
      items:
        type: object
        properties:
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
          updateProcess:
            type: string
        required:
          - userId
          - timestamp
    __schema133:
      type: string
    __schema134:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    __schema135:
      type: object
      properties:
        statusId:
          $ref: "#/components/schemas/accountStatusId"
        sourceStatus:
          type: string
        statusChangedDate:
          $ref: "#/components/schemas/utcMilliseconds"
      required:
        - statusId
        - statusChangedDate
    __schema136:
      type: string
    __schema137:
      type: string
    __schema138:
      type: array
      items:
        type: object
        properties:
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
        required:
          - userId
          - timestamp
    __schema139:
      type: array
      items:
        type: object
        properties:
          teamId:
            $ref: "#/components/schemas/teamId"
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
        required:
          - teamId
          - timestamp
    __schema140:
      type: boolean
    __schema141:
      type: string
      description: User ID, email, accountId, or clientUserId
    __schema142:
      type: array
      items:
        $ref: "#/components/schemas/__schema95"
    __schema143:
      type: array
      items:
        $ref: "#/components/schemas/__schema100"
    __schema144:
      type: array
      items:
        $ref: "#/components/schemas/ContactId"
    __schema145:
      type: array
      items:
        $ref: "#/components/schemas/NoteId"
    __schema146:
      description: When true, permanently deletes calendar events and attachment files
        associated with the account before removing it. Defaults to false.
      $ref: "#/components/schemas/__schema147"
    __schema147:
      type: boolean
    __schema148:
      type: array
      items:
        type: string
    __schema149:
      description: Two letter state code
      $ref: "#/components/schemas/__schema150"
    __schema150:
      type: array
      items:
        type: string
    __schema151:
      description: 5 digit postal code
      $ref: "#/components/schemas/__schema152"
    __schema152:
      type: array
      items:
        type: string
    __schema153:
      type: array
      items:
        $ref: "#/components/schemas/__schema154"
    __schema154:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/CFId"
        value:
          $ref: "#/components/schemas/__schema9"
      required:
        - id
        - value
    __schema155:
      $ref: "#/components/schemas/__schema156"
    __schema156:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema8"
      additionalProperties:
        oneOf:
          - type: object
            properties:
              type:
                type: string
                const: range
              range:
                $ref: "#/components/schemas/__schema157"
            required:
              - type
              - range
          - type: object
            properties:
              type:
                type: string
                const: multipleChoice
              values:
                minItems: 1
                type: array
                items:
                  $ref: "#/components/schemas/__schema9"
            required:
              - type
              - values
          - type: object
            properties:
              type:
                type: string
                const: exists
              exists:
                type: boolean
            required:
              - type
              - exists
        type: object
    __schema157:
      type: object
      properties:
        gte:
          type: number
        lte:
          type: number
    __schema158:
      type: array
      items:
        $ref: "#/components/schemas/accountStatusId"
    __schema159:
      $ref: "#/components/schemas/WFId"
    __schema160:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema161:
      description: Whether statusIds/workflowStageIds match only the current stage.
        When false, matches accounts that have ever been in the stage. Defaults
        to true.
      $ref: "#/components/schemas/__schema162"
    __schema162:
      type: boolean
    __schema163:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema164:
      type: array
      items:
        $ref: "#/components/schemas/TagId"
    __schema165:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema166:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema167:
      type: array
      items:
        $ref: "#/components/schemas/latlng"
    __schema168:
      $ref: "#/components/schemas/__schema169"
    __schema169:
      type: object
      properties:
        top:
          $ref: "#/components/schemas/latlng"
        bottom:
          $ref: "#/components/schemas/latlng"
      required:
        - top
        - bottom
    __schema170:
      type: string
      pattern: ^Q:-?\d+:-?\d+,-?\d+$
      description: Map tile (quadrant) ID in the form
        `Q:<zoomLevel>:<xIndex>,<yIndex>`, e.g. `Q:14:2816,6542`
      example: Q:14:2816,6542
    __schema171:
      $ref: "#/components/schemas/__schema157"
    __schema172:
      $ref: "#/components/schemas/__schema157"
    __schema173:
      $ref: "#/components/schemas/__schema174"
    __schema174:
      type: object
      properties:
        gte:
          description: Earliest time, inclusive, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema175"
        lte:
          description: Latest time, inclusive, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema176"
    __schema175:
      type: number
    __schema176:
      type: number
    __schema177:
      $ref: "#/components/schemas/__schema174"
    __schema178:
      $ref: "#/components/schemas/__schema174"
    __schema179:
      $ref: "#/components/schemas/companyId"
    __schema180:
      oneOf:
        - type: object
          properties:
            actionType:
              type: string
              const: updateStatus
            statusId:
              type: string
              pattern: ^AS\.[\s\S]{0,}$
              description: Status ID to set on matched accounts.
              example: AS.123-4aBc_d
              $ref: "#/components/schemas/accountStatusId"
          required:
            - actionType
            - statusId
        - type: object
          properties:
            actionType:
              type: string
              const: updateStage
            stageId:
              description: Workflow stage ID to move matched accounts to.
              $ref: "#/components/schemas/SId"
          required:
            - actionType
            - stageId
        - type: object
          properties:
            actionType:
              type: string
              const: updateCustomField
            fieldId:
              description: Custom field ID to update on matched accounts.
              $ref: "#/components/schemas/CFId"
            value:
              description: Value to set. Use null to clear the field.
              $ref: "#/components/schemas/__schema9"
          required:
            - actionType
            - fieldId
            - value
        - type: object
          properties:
            actionType:
              anyOf:
                - $ref: "#/components/schemas/__schema181"
                - $ref: "#/components/schemas/__schema182"
              description: "`delete` removes matched accounts. `clearDisposition` clears
                disposition contacts."
          required:
            - actionType
      type: object
    __schema181:
      type: string
      const: delete
    __schema182:
      type: string
      const: clearDisposition
    __schema183:
      type: object
      properties:
        accountIds:
          description: List of account IDs to filter by.
          $ref: "#/components/schemas/__schema184"
        workflowId:
          description: ID of the workflow to filter by.
          $ref: "#/components/schemas/WFId"
        stageIds:
          description: List of workflow stage IDs to filter by.
          $ref: "#/components/schemas/__schema185"
        actionIds:
          description: List of workflow action IDs to filter by.
          $ref: "#/components/schemas/__schema186"
        statusIds:
          default: []
          type: array
          items:
            $ref: "#/components/schemas/accountStatusId"
          description: List of account status IDs to filter by. Deprecated if using
            Workflows.
          deprecated: true
        teamId:
          description: ID of the team to filter by.
          $ref: "#/components/schemas/teamId"
        teamIds:
          description: List of team IDs to filter by.
          $ref: "#/components/schemas/__schema187"
        userId:
          description: ID of the user to filter by.
          $ref: "#/components/schemas/userId"
        roleIds:
          description: List of role IDs to filter by.
          $ref: "#/components/schemas/__schema188"
        startTime:
          description: Start of the search's date range, inclusive. UTC epoch milliseconds
            (a number below 100000000000 is read as epoch seconds), or an ISO
            8601 string. A string ending in `Z` or a `±HH:MM`, `±HHMM` or `±HH`
            offset after its time, such as `2026-01-15T10:00:00+0700`, is that
            instant; one without a time zone, such as `2026-01-15`, is read as
            America/Los_Angeles time.
          $ref: "#/components/schemas/__schema189"
        endTime:
          description: End of the search's date range, inclusive. UTC epoch milliseconds
            (a number below 100000000000 is read as epoch seconds), or an ISO
            8601 string. A string ending in `Z` or a `±HH:MM`, `±HHMM` or `±HH`
            offset after its time, such as `2026-01-15T10:00:00+0700`, is that
            instant; one without a time zone, such as `2026-01-15`, is read as
            America/Los_Angeles time.
          $ref: "#/components/schemas/__schema189"
        sortTimestamp:
          $ref: "#/components/schemas/__schema192"
        query:
          type: string
        searchByCurrentStage:
          description: Whether to search by the most recent stage in the status history.
            The default value is false
          $ref: "#/components/schemas/__schema199"
        tagIds:
          description: Filter by tag IDS
          $ref: "#/components/schemas/__schema200"
        cities:
          description: Filter by city names.
          $ref: "#/components/schemas/__schema201"
        states:
          description: Filter by state names.
          $ref: "#/components/schemas/__schema202"
        zipCodes:
          description: Filter by zip codes.
          $ref: "#/components/schemas/__schema203"
        customFields:
          description: Filter by custom field values (range, multipleChoice, or exists).
          $ref: "#/components/schemas/__schema156"
        coordinates:
          description: Geo polygon coordinates to filter by.
          $ref: "#/components/schemas/__schema204"
        contactCount:
          description: Range filter on contact count.
          $ref: "#/components/schemas/__schema157"
        workflowActionCount:
          description: Range filter on workflow action count.
          $ref: "#/components/schemas/__schema157"
        lastActionDate:
          description: Range filter on last action date.
          $ref: "#/components/schemas/__schema174"
        stageEntryDate:
          description: Range filter on current workflow stage entry date.
          $ref: "#/components/schemas/__schema174"
        sortBy:
          description: Field to sort accounts by. Defaults to createdDate.
          $ref: "#/components/schemas/__schema205"
        sortOrder:
          description: Sort direction. Defaults to asc.
          $ref: "#/components/schemas/__schema207"
    __schema184:
      type: array
      items:
        $ref: "#/components/schemas/accountId"
    __schema185:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema186:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema187:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema188:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema189:
      anyOf:
        - $ref: "#/components/schemas/__schema190"
        - $ref: "#/components/schemas/__schema191"
      description: UTC epoch milliseconds (a number below 100000000000 is read as
        epoch seconds), or an ISO 8601 string. A string ending in `Z` or a
        `±HH:MM`, `±HHMM` or `±HH` offset after its time, such as
        `2026-01-15T10:00:00+0700`, is that instant; one without a time zone,
        such as `2026-01-15`, is read as America/Los_Angeles time.
    __schema190:
      type: string
    __schema191:
      type: number
    __schema192:
      description: Sort cursor from the previous page. Send it back unchanged.
      $ref: "#/components/schemas/__schema193"
    __schema193:
      anyOf:
        - $ref: "#/components/schemas/__schema194"
        - $ref: "#/components/schemas/__schema198"
      description: "Sort cursor for pagination: the sort values of the last row on the
        previous page, usually an array ending with an id tiebreaker. Send it
        back unchanged. A single value is accepted from older clients, but rows
        that share it can be skipped or repeated at the page boundary."
    __schema194:
      anyOf:
        - $ref: "#/components/schemas/__schema195"
        - $ref: "#/components/schemas/__schema196"
        - $ref: "#/components/schemas/__schema197"
      description: The timestamp to sort by
    __schema195:
      type: string
    __schema196:
      type: number
    __schema197:
      type: boolean
    __schema198:
      type: array
      items:
        $ref: "#/components/schemas/__schema194"
    __schema199:
      type: boolean
    __schema200:
      type: array
      items:
        $ref: "#/components/schemas/TagId"
    __schema201:
      type: array
      items:
        type: string
    __schema202:
      type: array
      items:
        type: string
    __schema203:
      type: array
      items:
        type: string
    __schema204:
      minItems: 3
      type: array
      items:
        $ref: "#/components/schemas/latlng"
    __schema205:
      anyOf:
        - $ref: "#/components/schemas/__schema206"
        - $ref: "#/components/schemas/CFId"
      description: Field to sort accounts by.
    __schema206:
      type: string
      enum:
        - createdDate
        - lastActionDate
        - lastUpdatedDate
    __schema207:
      type: string
      enum:
        - asc
        - desc
      description: Sort direction.
    __schema208:
      type: number
      minimum: 10
      maximum: 1000
    __schema209:
      type: string
    __schema210:
      type: string
    __schema211:
      type: object
      properties:
        countrySubd:
          $ref: "#/components/schemas/__schema212"
        line1:
          $ref: "#/components/schemas/__schema213"
        locality:
          $ref: "#/components/schemas/__schema214"
        postal1:
          $ref: "#/components/schemas/__schema215"
        postal2:
          $ref: "#/components/schemas/__schema216"
        postal3:
          $ref: "#/components/schemas/__schema217"
        unitNbr:
          $ref: "#/components/schemas/__schema218"
        unitType:
          $ref: "#/components/schemas/__schema219"
        line2:
          $ref: "#/components/schemas/__schema220"
        oneLine:
          $ref: "#/components/schemas/__schema221"
        latlng:
          type: object
          properties:
            latitude:
              anyOf:
                - $ref: "#/components/schemas/latitude"
                - type: "null"
            longitude:
              anyOf:
                - $ref: "#/components/schemas/longitude"
                - type: "null"
    __schema212:
      $ref: "#/components/schemas/addressCountrySubd"
    __schema213:
      $ref: "#/components/schemas/addressLine1"
    __schema214:
      $ref: "#/components/schemas/addressLocality"
    __schema215:
      $ref: "#/components/schemas/addressPostal1"
    __schema216:
      $ref: "#/components/schemas/addressPostal2"
    __schema217:
      $ref: "#/components/schemas/addressPostal3"
    __schema218:
      $ref: "#/components/schemas/addressUnitNbr"
    __schema219:
      $ref: "#/components/schemas/addressUnitType"
    __schema220:
      $ref: "#/components/schemas/__schema42"
    __schema221:
      $ref: "#/components/schemas/__schema43"
    __schema222:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema223:
      type: boolean
    __schema224:
      type: array
      items:
        $ref: "#/components/schemas/__schema135"
    __schema225:
      anyOf:
        - $ref: "#/components/schemas/AId"
        - $ref: "#/components/schemas/SId"
    __schema226:
      type: string
    __schema227:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema228"
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrl"
        lastAccess:
          $ref: "#/components/schemas/userLastAccess"
        isDeleted:
          $ref: "#/components/schemas/userIsDeleted"
        color:
          $ref: "#/components/schemas/tinyUserColor"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhone"
        title:
          $ref: "#/components/schemas/userTitle"
        timeZone:
          $ref: "#/components/schemas/userTimeZone"
        teamIds:
          $ref: "#/components/schemas/__schema57"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema59"
        memberOf:
          $ref: "#/components/schemas/__schema229"
        companyId:
          $ref: "#/components/schemas/__schema60"
        createdDate:
          $ref: "#/components/schemas/userCreatedDate"
    __schema228:
      type: string
      pattern: ^U((\.)|(:))[\s\S]{0,}$
      description: Unique user identifier
      example: U:user123
      $ref: "#/components/schemas/userId"
    __schema229:
      type: array
      items:
        type: object
        properties:
          teamId:
            $ref: "#/components/schemas/teamId"
          name:
            $ref: "#/components/schemas/teamName"
        required:
          - teamId
          - name
    __schema230:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema228"
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrl"
        lastAccess:
          $ref: "#/components/schemas/userLastAccess"
        isDeleted:
          $ref: "#/components/schemas/userIsDeleted"
        color:
          $ref: "#/components/schemas/tinyUserColor"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhone"
        title:
          $ref: "#/components/schemas/userTitle"
        timeZone:
          $ref: "#/components/schemas/userTimeZone"
        teamIds:
          $ref: "#/components/schemas/__schema57"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema59"
        memberOf:
          $ref: "#/components/schemas/__schema229"
        companyId:
          $ref: "#/components/schemas/__schema60"
        createdDate:
          $ref: "#/components/schemas/userCreatedDate"
    __schema231:
      type: object
      properties:
        countrySubd:
          $ref: "#/components/schemas/__schema212"
        line1:
          $ref: "#/components/schemas/__schema213"
        locality:
          $ref: "#/components/schemas/__schema214"
        postal1:
          $ref: "#/components/schemas/__schema215"
        postal2:
          $ref: "#/components/schemas/__schema216"
        postal3:
          $ref: "#/components/schemas/__schema217"
        unitNbr:
          $ref: "#/components/schemas/__schema218"
        unitType:
          $ref: "#/components/schemas/__schema219"
        line2:
          $ref: "#/components/schemas/__schema220"
        oneLine:
          $ref: "#/components/schemas/__schema221"
        latlng:
          type: object
          properties:
            latitude:
              $ref: "#/components/schemas/__schema232"
            longitude:
              $ref: "#/components/schemas/__schema234"
        locationId:
          $ref: "#/components/schemas/locationId"
    __schema232:
      description: Geographical latitude. Accepts a number or a numeric string.
      example: 33.7
      $ref: "#/components/schemas/__schema233"
    __schema233:
      type:
        - string
        - number
    __schema234:
      description: Geographical longitude. Accepts a number or a numeric string.
      example: -117.8
      $ref: "#/components/schemas/__schema235"
    __schema235:
      type:
        - string
        - number
    __schema236:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/__schema65"
        firstName:
          $ref: "#/components/schemas/__schema66"
        lastName:
          $ref: "#/components/schemas/__schema67"
        email:
          $ref: "#/components/schemas/__schema68"
        businessName:
          $ref: "#/components/schemas/__schema74"
        age:
          $ref: "#/components/schemas/__schema79"
        creditScore:
          $ref: "#/components/schemas/__schema80"
        hasAge:
          $ref: "#/components/schemas/__schema81"
        hasCreditScore:
          $ref: "#/components/schemas/__schema82"
        phone:
          $ref: "#/components/schemas/__schema237"
        phone2:
          $ref: "#/components/schemas/__schema238"
    __schema237:
      type: string
    __schema238:
      type: string
    __schema239:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/__schema65"
        firstName:
          $ref: "#/components/schemas/__schema66"
        lastName:
          $ref: "#/components/schemas/__schema67"
        email:
          $ref: "#/components/schemas/__schema68"
        businessName:
          $ref: "#/components/schemas/__schema74"
        age:
          $ref: "#/components/schemas/__schema79"
        creditScore:
          $ref: "#/components/schemas/__schema80"
        hasAge:
          $ref: "#/components/schemas/__schema81"
        hasCreditScore:
          $ref: "#/components/schemas/__schema82"
        phone:
          $ref: "#/components/schemas/__schema237"
        phone2:
          $ref: "#/components/schemas/__schema238"
    __schema240:
      type: string
    __schema241:
      type: string
    __schema242:
      type: number
    __schema243:
      type: string
    __schema244:
      type: string
    __schema245:
      type: array
      items:
        type: object
        properties:
          timestamp:
            $ref: "#/components/schemas/utcMilliseconds"
          text:
            $ref: "#/components/schemas/__schema101"
          userId:
            description: Author of the note. Omit to write it as the actor (actorId), else
              the authenticated user.
            $ref: "#/components/schemas/userId"
          noteId:
            $ref: "#/components/schemas/__schema102"
        required:
          - timestamp
          - text
    __schema246:
      $ref: "#/components/schemas/__schema189"
    __schema247:
      $ref: "#/components/schemas/__schema189"
    __schema248:
      type: array
      items:
        type: string
    __schema249:
      type: array
      items:
        type: string
    __schema250:
      type: array
      items:
        type: string
    __schema251:
      type: number
    __schema252:
      type: string
    __schema253:
      type: object
      properties:
        version:
          $ref: "#/components/schemas/apiVersion"
        userId:
          $ref: "#/components/schemas/__schema254"
        teamId:
          $ref: "#/components/schemas/__schema255"
        teamIds:
          $ref: "#/components/schemas/__schema256"
        downlineTeamIds:
          $ref: "#/components/schemas/__schema258"
        query:
          $ref: "#/components/schemas/__schema260"
        boundingBox:
          $ref: "#/components/schemas/__schema262"
        areaStates:
          $ref: "#/components/schemas/__schema263"
        createdDate:
          $ref: "#/components/schemas/__schema265"
        lastAssignmentDate:
          $ref: "#/components/schemas/__schema267"
        expirationDate:
          $ref: "#/components/schemas/__schema268"
        sortBy:
          $ref: "#/components/schemas/__schema269"
        sortOrder:
          $ref: "#/components/schemas/__schema271"
        stats:
          $ref: "#/components/schemas/__schema273"
        archived:
          $ref: "#/components/schemas/archived"
        sortTimestamp:
          $ref: "#/components/schemas/__schema192"
        size:
          $ref: "#/components/schemas/__schema276"
    __schema254:
      description: Only areas assigned directly to this user through `userIds`. An
        area assigned to the user's team does not match; use `teamIds` or
        `downlineTeamIds` for those.
      $ref: "#/components/schemas/userId"
    __schema255:
      description: Legacy single-team filter. Kept mostly for backwards compatibility
        and behaves the same as teamIds.
      $ref: "#/components/schemas/teamId"
    __schema256:
      description: Preferred direct-team filter. Returns areas assigned exactly to any
        of these teams.
      $ref: "#/components/schemas/__schema257"
    __schema257:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema258:
      description: Downline-inclusive team filter. Returns areas relevant to any of
        these teams or their downline teams.
      $ref: "#/components/schemas/__schema259"
    __schema259:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema260:
      description: Only the area with exactly this ID, or areas whose name contains
        this text, ignoring case.
      $ref: "#/components/schemas/__schema261"
    __schema261:
      type: string
    __schema262:
      description: Only areas whose polygon intersects this box.
      $ref: "#/components/schemas/__schema169"
    __schema263:
      description: Only areas whose current state is one of these.
      $ref: "#/components/schemas/__schema264"
    __schema264:
      type: array
      items:
        type: string
        enum:
          - draft
          - scheduled
          - assigned
          - expiring
          - unassigned
    __schema265:
      $ref: "#/components/schemas/__schema266"
    __schema266:
      type: object
      properties:
        startTime:
          description: Start of the range, inclusive, in UTC epoch milliseconds. A string
            is ignored.
          $ref: "#/components/schemas/__schema189"
        endTime:
          description: End of the range, inclusive, in UTC epoch milliseconds. A string is
            ignored.
          $ref: "#/components/schemas/__schema189"
    __schema267:
      $ref: "#/components/schemas/__schema266"
    __schema268:
      $ref: "#/components/schemas/__schema266"
    __schema269:
      description: Field to sort by. Defaults to areaId.
      $ref: "#/components/schemas/__schema270"
    __schema270:
      type: string
      enum:
        - order
        - name
        - status
        - lastRunAt
        - createdAt
        - updatedAt
        - areaId
    __schema271:
      description: Sort direction. Defaults to asc.
      $ref: "#/components/schemas/__schema272"
    __schema272:
      type: string
      enum:
        - asc
        - desc
    __schema273:
      description: Account count fields to attach on each area. Omitted or empty skips
        count queries. When set, size cannot exceed 100.
      $ref: "#/components/schemas/__schema274"
    __schema274:
      type: array
      items:
        type: string
        enum:
          - totalAccounts
          - assignedAccounts
          - unassignedAccounts
    __schema275:
      anyOf:
        - type: boolean
        - type: string
          const: all
    __schema276:
      type: integer
      exclusiveMinimum: 0
      maximum: 10000
    __schema277:
      type: string
      enum:
        - dynamic
        - snapshot
    __schema278:
      type: string
    __schema279:
      default: []
      type: array
      items:
        $ref: "#/components/schemas/latlng"
    __schema280:
      type: string
      enum:
        - user
        - team
        - company
        - draft
    __schema281:
      $ref: "#/components/schemas/teamId"
    __schema282:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema283:
      type: string
    __schema284:
      type: string
    __schema285:
      type: object
      properties:
        cities:
          type: array
          items:
            type: string
        states:
          type: array
          items:
            type: string
        zipCodes:
          type: array
          items:
            type: string
        statusIds:
          type: array
          items:
            $ref: "#/components/schemas/accountStatusId"
        workflowStageIds:
          type: array
          items:
            $ref: "#/components/schemas/SId"
        teamIds:
          type: array
          items:
            $ref: "#/components/schemas/teamId"
        userIds:
          type: array
          items:
            $ref: "#/components/schemas/userId"
        customFields:
          type: array
          items:
            $ref: "#/components/schemas/__schema154"
        advancedCustomFields:
          $ref: "#/components/schemas/__schema156"
    __schema286:
      oneOf:
        - type: object
          properties:
            enabled:
              type: boolean
              const: false
            autoRunOnImport:
              type: boolean
          required:
            - enabled
        - type: object
          properties:
            enabled:
              type: boolean
              const: true
            autoRunOnImport:
              type: boolean
            order:
              type: number
          required:
            - enabled
            - order
      type: object
    __schema287:
      type: array
      items:
        oneOf:
          - type: object
            properties:
              type:
                type: string
                const: assign
              at:
                $ref: "#/components/schemas/utcMilliseconds"
              by:
                $ref: "#/components/schemas/__schema288"
            required:
              - type
              - at
          - type: object
            properties:
              type:
                type: string
                const: unassign
              at:
                $ref: "#/components/schemas/utcMilliseconds"
              by:
                $ref: "#/components/schemas/__schema288"
            required:
              - type
              - at
          - type: object
            properties:
              type:
                type: string
                const: reassign
              teamId:
                $ref: "#/components/schemas/teamId"
              userIds:
                type: array
                items:
                  $ref: "#/components/schemas/userId"
              at:
                $ref: "#/components/schemas/utcMilliseconds"
              by:
                $ref: "#/components/schemas/__schema288"
            required:
              - type
              - at
        type: object
    __schema288:
      $ref: "#/components/schemas/userId"
    __schema289:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema132"
        createdAt:
          description: When the area was created, in UTC epoch milliseconds, read from its
            audit log. Read-only.
          $ref: "#/components/schemas/utcMilliseconds"
        createdBy:
          description: User who created the area, read from its audit log. Read-only.
          $ref: "#/components/schemas/userId"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAt"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcess"
        version:
          $ref: "#/components/schemas/auditPropsVersion"
        isDeleted:
          $ref: "#/components/schemas/isDeleted"
        areaType:
          $ref: "#/components/schemas/__schema277"
        name:
          $ref: "#/components/schemas/__schema278"
        coordinates:
          $ref: "#/components/schemas/__schema279"
        assignmentType:
          $ref: "#/components/schemas/__schema280"
        teamId:
          $ref: "#/components/schemas/__schema281"
        userIds:
          $ref: "#/components/schemas/__schema282"
        color:
          $ref: "#/components/schemas/__schema283"
        note:
          $ref: "#/components/schemas/__schema284"
        filters:
          $ref: "#/components/schemas/__schema285"
        assignmentConfig:
          $ref: "#/components/schemas/__schema286"
        schedule:
          $ref: "#/components/schemas/__schema287"
        importId:
          $ref: "#/components/schemas/importId"
        areaId:
          $ref: "#/components/schemas/AreaId"
        snapshot:
          type: object
          properties:
            count:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            lastSnapshotAt:
              $ref: "#/components/schemas/utcMilliseconds"
            snapshotBy:
              $ref: "#/components/schemas/userId"
          required:
            - count
            - lastSnapshotAt
            - snapshotBy
        deleteOnCompletion:
          description: True while a move to Trash waits for the unassign run that clears
            the area from its accounts; the area is trashed when that run
            completes.
          $ref: "#/components/schemas/__schema291"
        runHistory:
          maxItems: 20
          type: array
          items:
            $ref: "#/components/schemas/__schema292"
        jobInfo:
          type: object
          properties:
            total:
              type: number
            assigned:
              type: number
            assignedDate:
              $ref: "#/components/schemas/utcMilliseconds"
            isRunning:
              type: boolean
            status:
              type: string
              enum:
                - preparing
                - queued
                - running
                - completed
          required:
            - total
            - assigned
            - assignedDate
            - isRunning
            - status
        accountCounts:
          type: object
          properties:
            total:
              type: number
            assigned:
              type: number
            unassigned:
              type: number
      required:
        - assignmentType
        - areaId
    __schema290:
      type: boolean
    __schema291:
      type: boolean
    __schema292:
      type: object
      properties:
        timestamp:
          $ref: "#/components/schemas/utcMilliseconds"
        count:
          type: number
        type:
          $ref: "#/components/schemas/__schema293"
        runBy:
          $ref: "#/components/schemas/userId"
        scheduled:
          type: boolean
        process:
          type: string
        teamId:
          $ref: "#/components/schemas/teamId"
        userIds:
          type: array
          items:
            $ref: "#/components/schemas/userId"
      required:
        - timestamp
        - count
    __schema293:
      type: string
      enum:
        - assign
        - unassign
        - reassign
    __schema294:
      type: boolean
    __schema295:
      type: string
    __schema296:
      deprecated: true
      $ref: "#/components/schemas/OId"
    __schema297:
      $ref: "#/components/schemas/__schema96"
    __schema298:
      description: Array of attachment IDs
      example:
        - Attachment:doc1
        - Attachment:doc2
      $ref: "#/components/schemas/__schema299"
    __schema299:
      type: array
      items:
        $ref: "#/components/schemas/AttachmentId"
    __schema300:
      type: object
      properties:
        utilityBill:
          $ref: "#/components/schemas/__schema301"
        customerVerification:
          $ref: "#/components/schemas/__schema302"
      description: Specialty attachments for calendar events
    __schema301:
      description: Utility bill attachment ID
      example: Attachment:util123
      $ref: "#/components/schemas/AttachmentId"
    __schema302:
      description: Customer verification attachment ID
      example: Attachment:verify123
      $ref: "#/components/schemas/AttachmentId"
    __schema303:
      type: object
      properties:
        oneLine:
          $ref: "#/components/schemas/addressOneLine"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbr"
        latitude:
          $ref: "#/components/schemas/latitude"
        longitude:
          $ref: "#/components/schemas/longitude"
      required:
        - oneLine
        - latitude
        - longitude
      description: Location information for calendar events
    __schema304:
      description: "Event owner user ID. Examples: Consultation: setter is owner,
        Shadow: rep is owner, Interview: manager is owner"
      example: U:owner123
      $ref: "#/components/schemas/userId"
    __schema305:
      type: boolean
    __schema306:
      type: boolean
    __schema307:
      type: string
    __schema308:
      description: Synced calendar IDs (deprecated - use Google Calendar sync)
      deprecated: true
      $ref: "#/components/schemas/__schema309"
    __schema309:
      type: array
      items:
        type: string
    __schema310:
      description: Synced calendar events (deprecated - use Google Calendar sync)
      deprecated: true
      $ref: "#/components/schemas/__schema311"
    __schema311:
      type: array
      items:
        type: object
        properties:
          calendarType:
            type: string
          calendarId:
            type: string
            description: ID of the synced device calendar
          userId:
            $ref: "#/components/schemas/userId"
          deviceId:
            type: string
            description: ID of the device that synced the event
          eventId:
            type: string
            description: ID of the event in the synced device calendar
        required:
          - calendarType
          - calendarId
          - userId
          - deviceId
          - eventId
    __schema312:
      type: boolean
    __schema313:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema314:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema315:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema316:
      minItems: 1
      type: array
      items:
        $ref: "#/components/schemas/__schema317"
    __schema317:
      type: string
      enum:
        - owner
        - attendee
      description: Type of user in relation to the calendar event
    __schema318:
      $ref: "#/components/schemas/importId"
    __schema319:
      $ref: "#/components/schemas/eventType"
    __schema320:
      $ref: "#/components/schemas/calendarEventTitle"
    __schema321:
      $ref: "#/components/schemas/calendarEventSourceId"
    __schema322:
      $ref: "#/components/schemas/utcMilliseconds"
    __schema323:
      $ref: "#/components/schemas/calendarEventOutcomeId"
    __schema324:
      $ref: "#/components/schemas/__schema297"
    __schema325:
      $ref: "#/components/schemas/calendarEventDuration"
    __schema326:
      $ref: "#/components/schemas/__schema298"
    __schema327:
      $ref: "#/components/schemas/__schema300"
    __schema328:
      $ref: "#/components/schemas/calendarEventAccountId"
    __schema329:
      $ref: "#/components/schemas/calendarEventLocationId"
    __schema330:
      $ref: "#/components/schemas/__schema303"
    __schema331:
      $ref: "#/components/schemas/userId"
    __schema332:
      description: Event attendee user ID (can be set to null to remove attendee)
      example: U:attendee123
      $ref: "#/components/schemas/__schema333"
    __schema333:
      anyOf:
        - $ref: "#/components/schemas/userId"
        - type: "null"
    __schema334:
      $ref: "#/components/schemas/calendarEventDispatcherId"
    __schema335:
      $ref: "#/components/schemas/calendarEventOccurredOwner"
    __schema336:
      $ref: "#/components/schemas/calendarEventOccurredAttendee"
    __schema337:
      $ref: "#/components/schemas/calendarEventInterviewId"
    __schema338:
      $ref: "#/components/schemas/calendarEventNotes"
    __schema339:
      $ref: "#/components/schemas/calendarEventPreviousId"
    __schema340:
      $ref: "#/components/schemas/__schema308"
    __schema341:
      $ref: "#/components/schemas/__schema310"
    __schema342:
      $ref: "#/components/schemas/calendarEventTeamId"
    __schema343:
      $ref: "#/components/schemas/companyId"
    __schema344:
      type: array
      items:
        type: object
        properties:
          outcomeId:
            $ref: "#/components/schemas/__schema296"
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/__schema345"
        required:
          - outcomeId
          - userId
          - timestamp
        description: Historical record of event outcome changes
    __schema345:
      description: When the outcome was recorded, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/utcMilliseconds"
    __schema346:
      $ref: "#/components/schemas/__schema132"
    __schema347:
      $ref: "#/components/schemas/auditPropsCreatedAt"
    __schema348:
      $ref: "#/components/schemas/auditPropsCreatedBy"
    __schema349:
      $ref: "#/components/schemas/auditPropsUpdatedAt"
    __schema350:
      $ref: "#/components/schemas/auditPropsUpdatedBy"
    __schema351:
      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
    __schema352:
      $ref: "#/components/schemas/auditPropsVersion"
    __schema353:
      $ref: "#/components/schemas/calendarEventOccurred"
    __schema354:
      type: boolean
    __schema355:
      $ref: "#/components/schemas/calendarEventClosed"
    __schema356:
      type: boolean
    __schema357:
      $ref: "#/components/schemas/calendarEventReasonNotOccurred"
    __schema358:
      type: string
    __schema359:
      $ref: "#/components/schemas/calendarEventFault"
    __schema360:
      type: string
      enum:
        - setter
        - closer
    __schema361:
      $ref: "#/components/schemas/calendarEventAllDay"
    __schema362:
      type: boolean
    __schema363:
      $ref: "#/components/schemas/calendarEventCanDelete"
    __schema364:
      type: boolean
    __schema365:
      type: boolean
    __schema366:
      type: string
    __schema367:
      type: string
    __schema368:
      $ref: "#/components/schemas/locationId"
    __schema369:
      type: string
    __schema370:
      type: string
    __schema371:
      type: string
    __schema372:
      type: string
    __schema373:
      type: boolean
    __schema374:
      type: boolean
    __schema375:
      type: string
    __schema376:
      $ref: "#/components/schemas/companyName"
    __schema377:
      type: string
      minLength: 1
      example: Salesforce
      description: A short globally unique name for the app, which will be displayed
        to users when they install the app and grant permissions. This is
        required for the App to be published.
    __schema378:
      description: A short markdown summary of the app's functionality and purpose.
        This is required for the App to be published.
      $ref: "#/components/schemas/__schema379"
    __schema379:
      type: string
    __schema380:
      description: Markdown documentation for the app
      $ref: "#/components/schemas/__schema381"
    __schema381:
      type: string
    __schema382:
      type: boolean
    __schema383:
      type: string
      enum:
        - none
        - pending
        - approved
        - rejected
    __schema384:
      type: number
    __schema385:
      type: number
    __schema386:
      type: string
      maxLength: 1024
    __schema387:
      type: integer
      exclusiveMinimum: 0
      maximum: 1000
    __schema388:
      type: string
    __schema389:
      $ref: "#/components/schemas/__schema132"
    __schema390:
      $ref: "#/components/schemas/auditPropsCreatedAt"
    __schema391:
      $ref: "#/components/schemas/auditPropsCreatedBy"
    __schema392:
      $ref: "#/components/schemas/auditPropsUpdatedAt"
    __schema393:
      $ref: "#/components/schemas/auditPropsUpdatedBy"
    __schema394:
      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
    __schema395:
      $ref: "#/components/schemas/auditPropsVersion"
    __schema396:
      $ref: "#/components/schemas/isDeleted"
    __schema397:
      $ref: "#/components/schemas/__schema377"
    __schema398:
      $ref: "#/components/schemas/__schema378"
    __schema399:
      $ref: "#/components/schemas/__schema380"
    __schema400:
      $ref: "#/components/schemas/AppId"
    __schema401:
      $ref: "#/components/schemas/companyId"
    __schema402:
      description: Company that created the app
      $ref: "#/components/schemas/__schema403"
    __schema403:
      type: object
      properties:
        companyId:
          $ref: "#/components/schemas/companyId"
        name:
          $ref: "#/components/schemas/__schema376"
      required:
        - companyId
        - name
    __schema404:
      type: string
      enum:
        - development
        - internal
        - published
        - deprecated
    __schema405:
      description: The currently published version of the app. This may be empty if no
        version is published yet.
      $ref: "#/components/schemas/__schema406"
    __schema406:
      type: string
      pattern: ^\d+\.\d+\.\d+$
      description: Semantic version number
    __schema407:
      type: array
      items:
        $ref: "#/components/schemas/__schema408"
      description: List of permissions requested by the app for use in scripts.
    __schema408:
      type: string
      enum:
        - account:save
        - account:add
        - account:manage
        - account:import
        - account:list
        - accountStatus:list
        - accountStatus:save
        - accountRule:save
        - aiChat:list
        - apikey:manage
        - companyCard:save
        - userCard:save
        - company:add
        - company:delete
        - company:read
        - company:update
        - company:list
        - customField:list
        - customField:save
        - app:list
        - app:manage
        - install:manage
        - event:outcome:save
        - event:outcome:list
        - export:manage
        - reportConfig:manage
        - ratio:list
        - ratio:save
        - webhook:manage
        - workflow:list
        - workflow:manage
        - quiz:manage
        - quiz:list
        - stats:list
        - area:add
        - area:list
        - contact:list
        - contact:add
        - contact:delete
        - contact:import
        - disposition:save
        - location:add
        - location:manage
        - tag:manage
        - attachment:manage
        - attachment:list
        - event:read
        - event:save
        - event:delete
        - event:import
        - event:manage
        - availability:list
        - availability:update
        - availability:manage
        - pitch:record
        - pitch:delete
        - evaluation:add
        - evaluation:delete
        - evaluation:list
        - message:archive
        - message:delete
        - message:send
        - message:send:group
        - plan:add
        - plan:delete
        - plan:list
        - plan:manage
        - widget:manage
        - widget:list
        - dashboard:manage
        - dashboard:list
        - program:manage
        - program:list
        - question:manage
        - task:list
        - task:update
        - task:manage
        - task:import
        - team:add
        - team:list
        - team:update
        - team:archive
        - role:manage
        - role:list
        - user:import
        - user:login
        - user:list
        - user:add
        - user:manage
        - user:update
        - user:developer
        - admin:assign
        - game:list
        - game:save
        - rubric:list
        - rubric:manage
        - conversation:manage
        - conversation:list
        - compliance:manage
        - externalLink:manage
        - externalLink:list
        - view:manage
        - shorts:manage
    __schema409:
      $ref: "#/components/schemas/appAvatarUrl"
    __schema410:
      type: string
    __schema411:
      $ref: "#/components/schemas/appAvatarBlurhash"
    __schema412:
      type: string
    __schema413:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema414"
    __schema414:
      type: string
    __schema415:
      description: URL to the privacy policy. Required for marketplace publication.
      $ref: "#/components/schemas/__schema416"
    __schema416:
      type: string
    __schema417:
      description: URL to the terms of service. Required for marketplace publication.
      $ref: "#/components/schemas/__schema418"
    __schema418:
      type: string
    __schema419:
      description: Current marketplace validation/review state. Defaults to "none"
        until the owner submits.
      $ref: "#/components/schemas/__schema383"
    __schema420:
      description: Optional note from the reviewer (typically a rejection reason).
      $ref: "#/components/schemas/__schema421"
    __schema421:
      type: string
    __schema422:
      $ref: "#/components/schemas/utcMilliseconds"
    __schema423:
      $ref: "#/components/schemas/userId"
    __schema424:
      $ref: "#/components/schemas/utcMilliseconds"
    __schema425:
      $ref: "#/components/schemas/userId"
    __schema426:
      type: string
      maxLength: 10000
    __schema427:
      oneOf:
        - type: object
          properties:
            tableType:
              $ref: "#/components/schemas/__schema428"
            statusId:
              $ref: "#/components/schemas/__schema429"
            workflowStageId:
              $ref: "#/components/schemas/__schema430"
            workflowIds:
              $ref: "#/components/schemas/__schema431"
            label:
              $ref: "#/components/schemas/__schema432"
            description:
              $ref: "#/components/schemas/__schema433"
            short:
              $ref: "#/components/schemas/__schema434"
            required:
              $ref: "#/components/schemas/__schema435"
            format:
              $ref: "#/components/schemas/__schema436"
            viewRoleIds:
              $ref: "#/components/schemas/__schema441"
            editRoleIds:
              $ref: "#/components/schemas/__schema442"
            order:
              $ref: "#/components/schemas/__schema443"
            allowMultiple:
              $ref: "#/components/schemas/__schema444"
            fieldType:
              type: string
              enum:
                - number
                - string
                - boolean
                - date
                - url
          required:
            - tableType
            - label
            - fieldType
        - type: object
          properties:
            tableType:
              $ref: "#/components/schemas/__schema428"
            statusId:
              $ref: "#/components/schemas/__schema429"
            workflowStageId:
              $ref: "#/components/schemas/__schema430"
            workflowIds:
              $ref: "#/components/schemas/__schema431"
            label:
              $ref: "#/components/schemas/__schema432"
            description:
              $ref: "#/components/schemas/__schema433"
            short:
              $ref: "#/components/schemas/__schema434"
            required:
              $ref: "#/components/schemas/__schema435"
            format:
              $ref: "#/components/schemas/__schema436"
            viewRoleIds:
              $ref: "#/components/schemas/__schema441"
            editRoleIds:
              $ref: "#/components/schemas/__schema442"
            order:
              $ref: "#/components/schemas/__schema443"
            allowMultiple:
              $ref: "#/components/schemas/__schema444"
            fieldType:
              type: string
              enum:
                - calculation
            calculation:
              oneOf:
                - type: object
                  properties:
                    operation:
                      type: string
                      const: multiplication
                    params:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema445"
                  required:
                    - operation
                    - params
                - type: object
                  properties:
                    operation:
                      type: string
                      const: addition
                    params:
                      type: array
                      items:
                        $ref: "#/components/schemas/__schema445"
                  required:
                    - operation
                    - params
                - type: object
                  properties:
                    operation:
                      type: string
                      const: division
                    dividend:
                      $ref: "#/components/schemas/__schema445"
                    divisor:
                      $ref: "#/components/schemas/__schema445"
                  required:
                    - operation
                    - dividend
                    - divisor
                - type: object
                  properties:
                    operation:
                      type: string
                      const: subtraction
                    minuend:
                      $ref: "#/components/schemas/__schema445"
                    subtrahend:
                      $ref: "#/components/schemas/__schema445"
                  required:
                    - operation
                    - minuend
                    - subtrahend
              type: object
          required:
            - tableType
            - label
            - fieldType
            - calculation
        - type: object
          properties:
            tableType:
              $ref: "#/components/schemas/__schema428"
            statusId:
              $ref: "#/components/schemas/__schema429"
            workflowStageId:
              $ref: "#/components/schemas/__schema430"
            workflowIds:
              $ref: "#/components/schemas/__schema431"
            label:
              $ref: "#/components/schemas/__schema432"
            description:
              $ref: "#/components/schemas/__schema433"
            short:
              $ref: "#/components/schemas/__schema434"
            required:
              $ref: "#/components/schemas/__schema435"
            format:
              $ref: "#/components/schemas/__schema436"
            viewRoleIds:
              $ref: "#/components/schemas/__schema441"
            editRoleIds:
              $ref: "#/components/schemas/__schema442"
            order:
              $ref: "#/components/schemas/__schema443"
            allowMultiple:
              type: boolean
            fieldType:
              type: string
              enum:
                - attachment
          required:
            - tableType
            - label
            - fieldType
        - type: object
          properties:
            tableType:
              $ref: "#/components/schemas/__schema428"
            statusId:
              $ref: "#/components/schemas/__schema429"
            workflowStageId:
              $ref: "#/components/schemas/__schema430"
            workflowIds:
              $ref: "#/components/schemas/__schema431"
            label:
              $ref: "#/components/schemas/__schema432"
            description:
              $ref: "#/components/schemas/__schema433"
            short:
              $ref: "#/components/schemas/__schema434"
            required:
              $ref: "#/components/schemas/__schema435"
            format:
              $ref: "#/components/schemas/__schema436"
            viewRoleIds:
              $ref: "#/components/schemas/__schema441"
            editRoleIds:
              $ref: "#/components/schemas/__schema442"
            order:
              $ref: "#/components/schemas/__schema443"
            allowMultiple:
              type: boolean
            fieldType:
              type: string
              enum:
                - multipleChoice
            options:
              type: array
              items:
                type: string
          required:
            - tableType
            - label
            - fieldType
            - options
      type: object
    __schema428:
      type: string
      enum:
        - Account
        - Team
        - User
    __schema429:
      $ref: "#/components/schemas/accountStatusId"
    __schema430:
      $ref: "#/components/schemas/SId"
    __schema431:
      type: array
      items:
        $ref: "#/components/schemas/WFId"
    __schema432:
      type: string
    __schema433:
      type: string
    __schema434:
      type: string
    __schema435:
      type: boolean
    __schema436:
      $ref: "#/components/schemas/__schema437"
    __schema437:
      type: object
      properties:
        prefix:
          type: string
        suffix:
          type: string
        decimalPlaces:
          description: Number of decimal places, only applies to number fields, 0 by default
          $ref: "#/components/schemas/__schema438"
        delimiter:
          description: Delimiter, only applies to number fields, "," by default
          $ref: "#/components/schemas/__schema439"
        separator:
          description: Separator, only applies to number fields, "." by default
          $ref: "#/components/schemas/__schema440"
    __schema438:
      type: number
    __schema439:
      type: string
    __schema440:
      type: string
    __schema441:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema442:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema443:
      type: number
    __schema444:
      type: boolean
      const: false
    __schema445:
      anyOf:
        - $ref: "#/components/schemas/CFId"
        - type: number
    __schema446:
      type: array
      items:
        $ref: "#/components/schemas/__schema96"
    __schema447:
      anyOf:
        - $ref: "#/components/schemas/userId"
        - $ref: "#/components/schemas/teamId"
        - $ref: "#/components/schemas/companyId"
    __schema448:
      type: boolean
    __schema449:
      type: number
    __schema450:
      type: number
    __schema451:
      type: object
      properties:
        code:
          type: string
          pattern: ^C:[\s\S]{0,}$
          description: "Terros ID: `C:` prefix followed by a unique suffix, e.g.
            `C:123-4aBc_d`"
          example: C:123-4aBc_d
        title:
          type: string
        score:
          type: number
        possible:
          type: number
        comment:
          type: string
        questions:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                pattern: ^Q:[\s\S]{0,}$
                description: "Terros ID: `Q:` prefix followed by a unique suffix, e.g.
                  `Q:123-4aBc_d`"
                example: Q:123-4aBc_d
              title:
                type: string
              score:
                type: number
              possible:
                type: number
              comment:
                type: string
            required:
              - code
              - title
              - score
              - possible
      required:
        - code
        - title
        - score
        - possible
        - questions
    __schema452:
      type: number
    __schema453:
      type: number
    __schema454:
      type: number
    __schema455:
      type: string
    __schema456:
      type: string
    __schema457:
      type: string
    __schema458:
      type: object
      properties:
        locationId:
          $ref: "#/components/schemas/locationId"
        addressMasterId:
          description: Numeric ID of the matching property data record, when known
          $ref: "#/components/schemas/__schema459"
        latlng:
          $ref: "#/components/schemas/latlng"
        line1:
          $ref: "#/components/schemas/addressLine1"
        line2:
          $ref: "#/components/schemas/addressLine2"
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        locality:
          $ref: "#/components/schemas/addressLocality"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbr"
        unitType:
          $ref: "#/components/schemas/addressUnitType"
        residents:
          type: array
          items:
            $ref: "#/components/schemas/__schema460"
        addressParts:
          type: object
          properties:
            street:
              type: string
            streetNumber:
              type: string
            streetType:
              type: string
            unitType:
              type: string
            unitNumber:
              type: string
            preDirectional:
              type: string
            postDirectional:
              type: string
        altLatLngs:
          type: array
          items:
            type: object
            properties:
              latitude:
                $ref: "#/components/schemas/latitude"
              longitude:
                $ref: "#/components/schemas/longitude"
              source:
                type: string
            required:
              - latitude
              - longitude
              - source
        titleOwners:
          type: array
          items:
            $ref: "#/components/schemas/__schema460"
      required:
        - locationId
        - latlng
        - line1
        - line2
        - countrySubd
        - locality
        - postal1
    __schema459:
      type: number
    __schema460:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema132"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAt"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAt"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcess"
        version:
          $ref: "#/components/schemas/auditPropsVersion"
        name:
          type: string
        firstName:
          type: string
        middleName:
          type: string
        lastName:
          type: string
        suffix:
          type: string
        prefix:
          type: string
        type:
          type: string
          enum:
            - Owner
            - Renter
            - Dependent
        gender:
          type: string
          enum:
            - M
            - F
            - O
        email:
          type: string
        phone:
          type: string
        favorite:
          type: boolean
        checked:
          type: boolean
        fields:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              value:
                type: string
            required:
              - field
              - value
        age:
          $ref: "#/components/schemas/__schema79"
        creditScore:
          $ref: "#/components/schemas/__schema80"
        hasAge:
          $ref: "#/components/schemas/__schema81"
        hasCreditScore:
          $ref: "#/components/schemas/__schema82"
      required:
        - name
    __schema461:
      type: string
      maxLength: 256
    __schema462:
      type: string
      enum:
        - json
        - csv
        - jsonl
    __schema463:
      default: none
      type: string
      enum:
        - gzip
        - none
    __schema464:
      type: object
      properties:
        startTime:
          type: number
          exclusiveMinimum: 0
          description: Start of the range, in UTC epoch milliseconds
        endTime:
          type: number
          exclusiveMinimum: 0
          description: End of the range, in UTC epoch milliseconds
      required:
        - startTime
        - endTime
    __schema465:
      type: array
      items:
        $ref: "#/components/schemas/AreaId"
    __schema466:
      type: array
      items:
        minItems: 3
        type: array
        items:
          $ref: "#/components/schemas/latlng"
    __schema467:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema468:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema469:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema470:
      type: array
      items:
        type: string
    __schema471:
      type: array
      items:
        type: string
    __schema472:
      type: array
      items:
        type: string
    __schema473:
      type: array
      items:
        $ref: "#/components/schemas/__schema96"
    __schema474:
      type: array
      items:
        $ref: "#/components/schemas/accountStatusId"
    __schema475:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema476:
      type: boolean
    __schema477:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema478:
      type: array
      items:
        $ref: "#/components/schemas/latlng"
    __schema479:
      type: array
      items:
        type: string
    __schema480:
      type: object
      properties: {}
    __schema481:
      type: boolean
    __schema482:
      type: string
      enum:
        - markdown
        - tiptap
    __schema483:
      type: string
      enum:
        - Account
        - Area
        - CalendarEvent
        - Task
        - User
    __schema484:
      type: string
    __schema485:
      description: When true, skip the external geocoding lookup for an address that
        matches no existing location. When false or omitted, that lookup runs.
      $ref: "#/components/schemas/__schema486"
    __schema486:
      type: boolean
    __schema487:
      description: Create placeholder users for any owner or assignee not already in Terros.
      $ref: "#/components/schemas/__schema488"
    __schema488:
      type: boolean
    __schema489:
      description: After all enabled lookups miss, create a location using the address
        and coordinates from the CSV.
      $ref: "#/components/schemas/__schema490"
    __schema490:
      type: boolean
    __schema491:
      description: Match imported addresses with our location data. When turned off,
        we use the location data in your file—unless its coordinates are within
        10 meters of one of our locations. When omitted, imports keep the
        matching they used before this option existed.
      $ref: "#/components/schemas/__schema492"
    __schema492:
      type: boolean
    __schema493:
      description: Send a welcome email with login instructions to each new user.
      $ref: "#/components/schemas/__schema494"
    __schema494:
      type: boolean
    __schema495:
      description: When a row matches an account that already exists, skip it instead
        of updating it. Skipped accounts won't be modified or removed when this
        import is deleted.
      $ref: "#/components/schemas/__schema496"
    __schema496:
      type: boolean
    __schema497:
      description: When this import updates an account that already exists, also run
        areas that auto-assign on import. New accounts always get those areas.
        Defaults to true.
      $ref: "#/components/schemas/__schema498"
    __schema498:
      type: boolean
    __schema499:
      $ref: "#/components/schemas/WFId"
    __schema500:
      $ref: "#/components/schemas/ColumnMapping"
    __schema501:
      type: string
    __schema502:
      type: string
    __schema503:
      type: integer
      exclusiveMinimum: 0
      maximum: 314572800
    __schema504:
      type: string
      enum:
        - text/csv
        - application/vnd.google-earth.kml+xml
        - application/vnd.google-earth.kmz
    __schema505:
      type: string
    __schema506:
      type:
        - string
        - number
        - boolean
    __schema507:
      description: Sort direction. Defaults to descending.
      $ref: "#/components/schemas/__schema508"
    __schema508:
      type: string
      enum:
        - asc
        - desc
    __schema509:
      type: string
      enum:
        - other
        - accessory_dwelling_unit
        - electric_vehicle_charger
        - electric_water_heater
        - electrical_panel_upgrade
        - home_addition
        - hvac_changeout
        - pool
        - roof
        - solar
        - spa_sauna
    __schema510:
      type: array
      items:
        $ref: "#/components/schemas/__schema509"
    __schema511:
      type: array
      items:
        $ref: "#/components/schemas/__schema512"
    __schema512:
      type: string
      enum:
        - any
        - submitted
        - approved
        - completed
        - cancelled
    __schema513:
      type: array
      items:
        type: string
    __schema514:
      description: Installer or contractor names to exclude.
      $ref: "#/components/schemas/__schema515"
    __schema515:
      type: array
      items:
        type: string
    __schema516:
      description: Permit statuses to exclude.
      $ref: "#/components/schemas/__schema517"
    __schema517:
      type: array
      items:
        $ref: "#/components/schemas/__schema512"
    __schema518:
      anyOf:
        - $ref: "#/components/schemas/__schema447"
        - $ref: "#/components/schemas/RoleId"
    __schema519:
      type: string
      enum:
        - any
        - all
    __schema520:
      type: string
      enum:
        - active
        - completed
        - pending
        - dropped
    __schema521:
      anyOf:
        - $ref: "#/components/schemas/__schema522"
        - $ref: "#/components/schemas/__schema523"
      description: Sort cursor for pagination — scalar (legacy) or array of sort
        values per sort field. Null in the first position is a missing start or
        completion date from an older client.
    __schema522:
      anyOf:
        - $ref: "#/components/schemas/__schema194"
        - type: "null"
    __schema523:
      type: array
      items:
        $ref: "#/components/schemas/__schema522"
    __schema524:
      oneOf:
        - type: object
          properties:
            name:
              $ref: "#/components/schemas/__schema525"
            type:
              type: string
              enum:
                - formula
              description: "`formula` evaluates `formula` with the variables defined in
                `scopes`."
            description:
              $ref: "#/components/schemas/__schema526"
            short:
              $ref: "#/components/schemas/__schema528"
            plural:
              $ref: "#/components/schemas/__schema530"
            scopeId:
              $ref: "#/components/schemas/__schema532"
            workflowId:
              $ref: "#/components/schemas/__schema533"
            formula:
              type: string
              minLength: 1
              description: Arithmetic expression over the `$` variables defined in `scopes`,
                for example `$pitches * 2 + $meetings`.
            scopes:
              type: object
              propertyNames:
                $ref: "#/components/schemas/__schema534"
              additionalProperties:
                $ref: "#/components/schemas/__schema535"
              description: "Maps each `$` variable used in `formula` to its input. A numeric
                report KPI: a `value` of a `type: number` column from
                /report/column, such as `contact.pitches` or
                `meetingAttendance.count`, or the `ratioId` of another custom
                stat."
            formatter:
              description: How the report formats the result.
              $ref: "#/components/schemas/__schema536"
            accumulator:
              description: How the report combines rows into a total. Defaults to `avg`.
              $ref: "#/components/schemas/__schema537"
          required:
            - name
            - type
            - formula
            - scopes
        - type: object
          properties:
            name:
              $ref: "#/components/schemas/__schema525"
            type:
              type: string
              enum:
                - ratio
                - percentage
              description: "`ratio` shows `numerator` divided by `denominator`; `percentage`
                shows it as a percentage."
            description:
              $ref: "#/components/schemas/__schema526"
            short:
              $ref: "#/components/schemas/__schema528"
            plural:
              $ref: "#/components/schemas/__schema530"
            scopeId:
              $ref: "#/components/schemas/__schema532"
            workflowId:
              $ref: "#/components/schemas/__schema533"
            numerator:
              type: string
              minLength: 1
              description: "A numeric report KPI: a `value` of a `type: number` column from
                /report/column, such as `contact.pitches` or
                `meetingAttendance.count`, or the `ratioId` of another custom
                stat."
            denominator:
              type: string
              minLength: 1
              description: "A numeric report KPI: a `value` of a `type: number` column from
                /report/column, such as `contact.pitches` or
                `meetingAttendance.count`, or the `ratioId` of another custom
                stat."
          required:
            - name
            - type
            - numerator
            - denominator
      type: object
    __schema525:
      type: string
      minLength: 1
      description: Name shown as the report column label.
    __schema526:
      description: Report column description. Defaults to the inputs for ratio and
        percentage stats, and to the name for formula stats.
      $ref: "#/components/schemas/__schema527"
    __schema527:
      type: string
    __schema528:
      description: Short name.
      $ref: "#/components/schemas/__schema529"
    __schema529:
      type: string
    __schema530:
      description: Plural name.
      $ref: "#/components/schemas/__schema531"
    __schema531:
      type: string
    __schema532:
      description: Company, team, or user the custom stat belongs to. Omit it on
        /ratio/add to use the caller's company.
      $ref: "#/components/schemas/__schema447"
    __schema533:
      description: Show the custom stat only with this workflow. Omit it for a global
        custom stat.
      $ref: "#/components/schemas/WFId"
    __schema534:
      type: string
      pattern: ^(\$)[\s\S]{0,}$
    __schema535:
      type: string
    __schema536:
      anyOf:
        - type: string
          enum:
            - round
            - ceiling
            - floor
            - daysSince
            - timeOfDay
        - type: string
          enum:
            - ratio
            - percentage
            - formula
        - $ref: "#/components/schemas/__schema437"
    __schema537:
      type: string
      enum:
        - sum
        - min
        - max
        - avg
        - median
        - distinct
        - query
    __schema538:
      type: boolean
    __schema539:
      type: array
      items:
        $ref: "#/components/schemas/WFId"
    __schema540:
      type: array
      items:
        $ref: "#/components/schemas/ProgramId"
    __schema541:
      type: array
      items:
        type: string
        enum:
          - string
          - number
          - boolean
          - timestamp
          - group
    __schema542:
      type: number
      const: 2
      description: Required. Selects the current positional table response instead of
        the legacy report shape.
      example: 2
    __schema543:
      type: array
      items:
        $ref: "#/components/schemas/__schema544"
      description: Ordered report columns. Copy each value and accumulator from report
        column; rows[rowIndex][kpiIndex] and totalRow[kpiIndex] correspond to
        kpis[kpiIndex]. Include {"value":"groupBy"} for row labels.
      example:
        - value: groupBy
        - value: action|A.xxxxxxxx|count
          accumulator: sum
        - value: setter|S.xxxxxxxx|count
          accumulator: distinct
    __schema544:
      type: object
      properties:
        value:
          $ref: "#/components/schemas/__schema545"
        accumulator:
          $ref: "#/components/schemas/__schema546"
      required:
        - value
    __schema545:
      type: string
      description: groupBy returns the grouped entity.
    __schema546:
      $ref: "#/components/schemas/__schema537"
    __schema547:
      $ref: "#/components/schemas/__schema548"
    __schema548:
      type: object
      properties:
        companyId:
          $ref: "#/components/schemas/__schema549"
        startDate:
          $ref: "#/components/schemas/__schema550"
        endDate:
          $ref: "#/components/schemas/__schema551"
        teams:
          $ref: "#/components/schemas/__schema552"
        users:
          $ref: "#/components/schemas/__schema554"
        roles:
          $ref: "#/components/schemas/__schema556"
        managers:
          $ref: "#/components/schemas/__schema557"
        workflowId:
          $ref: "#/components/schemas/__schema558"
        polygon:
          $ref: "#/components/schemas/__schema559"
        days:
          $ref: "#/components/schemas/__schema561"
        states:
          $ref: "#/components/schemas/__schema562"
        cities:
          $ref: "#/components/schemas/__schema564"
        zipCodes:
          $ref: "#/components/schemas/__schema565"
        customFields:
          $ref: "#/components/schemas/__schema566"
        programUserStatus:
          $ref: "#/components/schemas/__schema567"
        programUserStartDate:
          $ref: "#/components/schemas/__schema568"
      description: "Limits the report population and date range. Date fields are
        inclusive instants when a KPI supports date filtering. They filter the
        date field for that KPI: for example, workflow actions use their action
        timestamp, account-created/assigned/status KPIs use the corresponding
        account date, and setter/closer stage counts use stage-entry time—not
        account last-action time. User access/count fields ignore this report
        date range, so the dates do not have one universal account-creation or
        last-action meaning across all KPI types. On the account-history path,
        which serves setter/closer stage counts and account custom-field and
        ratio KPIs, `startDate` and `endDate` are independently optional:
        start-only applies a lower bound, end-only applies an upper bound, both
        apply a closed range, and neither applies no date filter. UTC epoch
        milliseconds (a number below 100000000000 is read as epoch seconds), or
        an ISO 8601 string. A string ending in `Z` or a `±HH:MM`, `±HHMM` or
        `±HH` offset after its time, such as `2026-01-15T10:00:00+0700`, is that
        instant; one without a time zone, such as `2026-01-15`, is read as
        America/Los_Angeles time. Zone-less strings use America/Los_Angeles, not
        the querying user's timezone. Equal start/end values select only that
        instant, not a whole day. For one calendar day, send its start and
        inclusive end, for example `2026-01-01T00:00:00.000Z` through
        `2026-01-01T23:59:59.999Z`."
      example:
        startDate: 2026-01-01T00:00:00.000Z
        endDate: 2026-01-01T23:59:59.999Z
    __schema549:
      description: Defaults to the current user's company.
      $ref: "#/components/schemas/companyId"
    __schema550:
      description: Optional inclusive lower bound when the KPI supports date
        filtering. It is enforced without `endDate`. UTC epoch milliseconds (a
        number below 100000000000 is read as epoch seconds), or an ISO 8601
        string. A string ending in `Z` or a `±HH:MM`, `±HHMM` or `±HH` offset
        after its time, such as `2026-01-15T10:00:00+0700`, is that instant; one
        without a time zone, such as `2026-01-15`, is read as
        America/Los_Angeles time. Zone-less strings use America/Los_Angeles, not
        the querying user's timezone.
      example: 2026-01-01T00:00:00.000Z
      $ref: "#/components/schemas/__schema189"
    __schema551:
      description: Optional inclusive upper bound when the KPI supports date
        filtering. It is enforced without `startDate`. Equal boundaries select
        one instant, not a whole day. UTC epoch milliseconds (a number below
        100000000000 is read as epoch seconds), or an ISO 8601 string. A string
        ending in `Z` or a `±HH:MM`, `±HHMM` or `±HH` offset after its time,
        such as `2026-01-15T10:00:00+0700`, is that instant; one without a time
        zone, such as `2026-01-15`, is read as America/Los_Angeles time.
        Zone-less strings use America/Los_Angeles, not the querying user's
        timezone.
      example: 2026-01-01T23:59:59.999Z
      $ref: "#/components/schemas/__schema189"
    __schema552:
      description: Scopes activity to these teams.
      $ref: "#/components/schemas/__schema553"
    __schema553:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema554:
      description: Matches the KPI's actor, setter, closer, or task owner.
      $ref: "#/components/schemas/__schema555"
    __schema555:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema556:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema557:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema558:
      $ref: "#/components/schemas/WFId"
    __schema559:
      description: Filters property locations when at least three points are provided.
      $ref: "#/components/schemas/__schema560"
    __schema560:
      type: array
      items:
        $ref: "#/components/schemas/latlng"
    __schema561:
      type: array
      items:
        type: string
        enum:
          - Sun
          - Mon
          - Tue
          - Wed
          - Thu
          - Fri
          - Sat
    __schema562:
      description: State codes, e.g. CA.
      $ref: "#/components/schemas/__schema563"
    __schema563:
      type: array
      items:
        type: string
    __schema564:
      type: array
      items:
        type: string
    __schema565:
      type: array
      items:
        type: string
    __schema566:
      $ref: "#/components/schemas/__schema156"
    __schema567:
      description: Applies only to task and program KPIs.
      $ref: "#/components/schemas/__schema520"
    __schema568:
      description: Inclusive; applies only to task and program KPIs.
      $ref: "#/components/schemas/__schema569"
    __schema569:
      type: object
      properties:
        startTime:
          $ref: "#/components/schemas/__schema189"
        endTime:
          $ref: "#/components/schemas/__schema189"
      required:
        - startTime
        - endTime
    __schema570:
      description: Defines one result row per group. Supported objects use type user,
        company, team, time, manager, state, city, zip, customField, or
        programTask; team requires level, time requires period, customField
        requires customFieldId, and manager level is optional.
      example:
        type: user
      $ref: "#/components/schemas/__schema583"
    __schema571:
      type: object
      properties:
        type:
          type: string
          const: user
      required:
        - type
    __schema572:
      type: object
      properties:
        type:
          type: string
          const: company
      required:
        - type
    __schema573:
      type: object
      properties:
        type:
          type: string
          const: team
        level:
          description: Team hierarchy level used to group rows.
          $ref: "#/components/schemas/teamLevel"
        include:
          description: Derived from filter.teams; clients normally omit it.
          $ref: "#/components/schemas/__schema574"
      required:
        - type
        - level
    __schema574:
      type: array
      items:
        type: string
    __schema575:
      type: object
      properties:
        type:
          type: string
          const: time
        period:
          description: Calendar periods use the querying user's timezone.
          $ref: "#/components/schemas/__schema576"
      required:
        - type
        - period
    __schema576:
      type: string
      enum:
        - hour
        - day
        - week
        - month
        - quarter
        - year
    __schema577:
      type: object
      properties:
        type:
          type: string
          const: manager
        level:
          description: Uses manager groupings stored at this team level.
          $ref: "#/components/schemas/teamLevel"
      required:
        - type
    __schema578:
      type: object
      properties:
        type:
          type: string
          const: state
      required:
        - type
    __schema579:
      type: object
      properties:
        type:
          type: string
          const: city
      required:
        - type
    __schema580:
      type: object
      properties:
        type:
          type: string
          const: zip
      required:
        - type
    __schema581:
      type: object
      properties:
        type:
          type: string
          const: customField
        customFieldId:
          $ref: "#/components/schemas/CFId"
      required:
        - type
        - customFieldId
    __schema582:
      type: object
      properties:
        type:
          type: string
          const: programTask
      required:
        - type
    __schema583:
      oneOf:
        - $ref: "#/components/schemas/__schema571"
        - $ref: "#/components/schemas/__schema572"
        - $ref: "#/components/schemas/__schema573"
        - $ref: "#/components/schemas/__schema575"
        - $ref: "#/components/schemas/__schema577"
        - $ref: "#/components/schemas/__schema578"
        - $ref: "#/components/schemas/__schema579"
        - $ref: "#/components/schemas/__schema580"
        - $ref: "#/components/schemas/__schema581"
        - $ref: "#/components/schemas/__schema582"
      type: object
      discriminator:
        propertyName: type
        mapping:
          user: "#/components/schemas/__schema571"
          company: "#/components/schemas/__schema572"
          team: "#/components/schemas/__schema573"
          time: "#/components/schemas/__schema575"
          manager: "#/components/schemas/__schema577"
          state: "#/components/schemas/__schema578"
          city: "#/components/schemas/__schema579"
          zip: "#/components/schemas/__schema580"
          customField: "#/components/schemas/__schema581"
          programTask: "#/components/schemas/__schema582"
    __schema584:
      description: False hides archived users, omitted aggregates them, and true
        returns individual archived users.
      $ref: "#/components/schemas/__schema585"
    __schema585:
      type: boolean
    __schema586:
      description: Hides Unassigned and system user rows. Defaults to true.
      $ref: "#/components/schemas/__schema587"
    __schema587:
      type: boolean
    __schema588:
      type: string
      enum:
        - setter
        - closer
        - all
        - none
    __schema589:
      description: Counts only accounts currently in a workflow stage.
      $ref: "#/components/schemas/__schema590"
    __schema590:
      type: boolean
    __schema591:
      type: string
      minLength: 1
    __schema592:
      type: boolean
    __schema593:
      type: integer
      minimum: 1
      maximum: 10000
    __schema594:
      description: KPI to report. Use a value from /report/column.
      $ref: "#/components/schemas/__schema544"
    __schema595:
      description: Calendar bucket size in the querying user's timezone.
      $ref: "#/components/schemas/__schema576"
    __schema596:
      oneOf:
        - $ref: "#/components/schemas/__schema571"
        - $ref: "#/components/schemas/__schema572"
        - $ref: "#/components/schemas/__schema573"
        - $ref: "#/components/schemas/__schema577"
        - $ref: "#/components/schemas/__schema578"
        - $ref: "#/components/schemas/__schema579"
        - $ref: "#/components/schemas/__schema580"
      description: Breakdown within each interval.
      type: object
      discriminator:
        propertyName: type
        mapping:
          user: "#/components/schemas/__schema571"
          company: "#/components/schemas/__schema572"
          team: "#/components/schemas/__schema573"
          manager: "#/components/schemas/__schema577"
          state: "#/components/schemas/__schema578"
          city: "#/components/schemas/__schema579"
          zip: "#/components/schemas/__schema580"
    __schema597:
      description: Limits the date range and population; teams can scope the report to
        a team.
      $ref: "#/components/schemas/__schema548"
    __schema598:
      type: object
      properties:
        showArchived:
          $ref: "#/components/schemas/__schema584"
        hideSystemUsers:
          $ref: "#/components/schemas/__schema586"
        includeUsersWithNoData:
          $ref: "#/components/schemas/__schema588"
        searchByCurrentStatus:
          $ref: "#/components/schemas/__schema589"
    __schema599:
      type: boolean
    __schema600:
      type: boolean
    __schema601:
      type: boolean
    __schema602:
      type: array
      items:
        $ref: "#/components/schemas/companyId"
    __schema603:
      type: number
    __schema604:
      type: number
    __schema605:
      type: string
    __schema606:
      anyOf:
        - $ref: "#/components/schemas/utcMilliseconds"
        - type: "null"
    __schema607:
      type: boolean
    __schema608:
      type: boolean
    __schema609:
      anyOf:
        - $ref: "#/components/schemas/accountStatusId"
        - $ref: "#/components/schemas/__schema96"
        - $ref: "#/components/schemas/__schema610"
        - $ref: "#/components/schemas/__schema611"
      description: "Activity that counts toward a task: an account status ID (`AS.`),
        a disposition ID (`Disposition.` or `Disposition:`), `contact`, or
        `pitch`"
      example: pitch
    __schema610:
      type: string
      const: contact
    __schema611:
      type: string
      const: pitch
    __schema612:
      type: string
      pattern: ^Video_[\s\S]{0,}$
      description: "Terros ID: `Video_` prefix followed by a unique suffix, e.g.
        `Video_123-4aBc_d`"
      example: Video_123-4aBc_d
    __schema613:
      type: string
      const: manager
    __schema614:
      type: boolean
    __schema615:
      type: string
      enum:
        - submitted
        - graded
        - selfAssessed
    __schema616:
      type: number
    __schema617:
      type: number
    __schema618:
      type: boolean
    __schema619:
      type: string
      enum:
        - Created
        - Submitted
        - Completed
        - Rejected
    __schema620:
      anyOf:
        - $ref: "#/components/schemas/utcMilliseconds"
        - type: "null"
    __schema621:
      type: number
    __schema622:
      type: number
    __schema623:
      type: boolean
    __schema624:
      type: string
    __schema625:
      type: string
    __schema626:
      type: string
    __schema627:
      type: string
    __schema628:
      type: array
      items:
        $ref: "#/components/schemas/__schema629"
    __schema629:
      type: object
      properties:
        day:
          $ref: "#/components/schemas/meetingTimeDay"
        start:
          $ref: "#/components/schemas/meetingTimeStart"
        end:
          $ref: "#/components/schemas/meetingTimeEnd"
      required:
        - day
        - start
        - end
    __schema630:
      type: boolean
    __schema631:
      type: boolean
    __schema632:
      type: string
    __schema633:
      type: string
    __schema634:
      type: string
    __schema635:
      type: boolean
    __schema636:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema637:
      description: When the member was last interviewed, in UTC epoch milliseconds; -1
        marks a member who still needs an interview
      $ref: "#/components/schemas/__schema638"
    __schema638:
      type: number
    __schema639:
      description: When the member last shadowed, in UTC epoch milliseconds
      $ref: "#/components/schemas/__schema640"
    __schema640:
      type: number
    __schema641:
      description: Company ID the user belongs to
      example: C:company123
      $ref: "#/components/schemas/companyId"
    __schema642:
      default: true
      type: boolean
    __schema643:
      description: User's self-reported manager selection
      $ref: "#/components/schemas/selfReportedManager"
    __schema644:
      description: User's primary team assignment
      $ref: "#/components/schemas/primaryTeam"
    __schema645:
      type: string
      pattern: ^Team((\.)|(:))[\s\S]{0,}$
      description: Team ID for the primary team
      example: Team:abc123
      $ref: "#/components/schemas/teamId"
    __schema646:
      type: number
      description: When the team assignment becomes stale, in UTC epoch milliseconds
    __schema647:
      type: boolean
    __schema648:
      type: string
    __schema649:
      type: array
      items:
        $ref: "#/components/schemas/languageCode"
    __schema650:
      type: string
    __schema651:
      type: number
    __schema652:
      description: User's custom fields for additional data
      example:
        CF.1: value1
        CF.2: value2
      $ref: "#/components/schemas/__schema7"
    __schema653:
      description: The accountId the user is associated with, only applicable for
        recruiting feature
      $ref: "#/components/schemas/accountId"
    __schema654:
      type: boolean
    __schema655:
      description: User's closer settings and preferences
      $ref: "#/components/schemas/__schema656"
    __schema656:
      type: object
      properties:
        order:
          description: Ranking of the closer, used to sort closers when displaying timeslots
          $ref: "#/components/schemas/__schema657"
        taskLockout:
          description: Decorated field from preferences
          $ref: "#/components/schemas/__schema658"
        bookingPercent:
          description: Decorated field from preferences
          $ref: "#/components/schemas/__schema659"
        meetingDuration:
          description: Length of the meeting in minutes
          example: 60
          $ref: "#/components/schemas/__schema660"
        timeBetweenAppointments:
          description: Buffer time between appointments in minutes
          example: 30
          $ref: "#/components/schemas/__schema661"
        serviceCenter:
          description: The center of the closer's serviceable area
          example:
            lat: 37.7749
            lng: -122.4194
          $ref: "#/components/schemas/latlng"
        serviceRadius:
          description: Farthest distance the closer is willing to travel in meters
          example: 50000
          $ref: "#/components/schemas/__schema662"
        minimumNotice:
          description: Minimum notice time before appointment in hours
          example: 24
          $ref: "#/components/schemas/__schema663"
        maximumNotice:
          description: Maximum notice time before appointment in days
          example: 14
          default: 14
          $ref: "#/components/schemas/__schema664"
        timeslots:
          description: Available time slots organized by day
          example:
            mon:
              - 540
              - 600
              - 660
            tue:
              - 480
              - 540
              - 600
          $ref: "#/components/schemas/__schema665"
        excludes:
          description: Time slots to exclude (minutes from midnight)
          example:
            - 720
            - 780
            - 840
          $ref: "#/components/schemas/__schema666"
        includes:
          description: Time slots to include (minutes from midnight)
          example:
            - 540
            - 600
            - 660
            - 720
          $ref: "#/components/schemas/__schema667"
        lastUpdatedDate:
          description: When closer settings were last updated, in UTC epoch milliseconds
          example: 1672531200000
          $ref: "#/components/schemas/utcMilliseconds"
    __schema657:
      type: number
    __schema658:
      type: boolean
    __schema659:
      type: number
    __schema660:
      type: number
    __schema661:
      type: number
    __schema662:
      type: number
    __schema663:
      type: number
    __schema664:
      type: number
    __schema665:
      type: object
      propertyNames:
        type: string
        enum:
          - sun
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
      additionalProperties:
        type: array
        items:
          type: number
      required:
        - sun
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
    __schema666:
      type: array
      items:
        type: number
    __schema667:
      type: array
      items:
        type: number
    __schema668:
      description: Optional user ID to use instead of generating one. Cannot be a
        system user ID.
      example: U.custom123
      $ref: "#/components/schemas/userId"
    __schema669:
      type: array
      items:
        type: object
        properties:
          teamId:
            $ref: "#/components/schemas/teamId"
          roleIds:
            type: array
            items:
              $ref: "#/components/schemas/RoleId"
        required:
          - teamId
    __schema670:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema671:
      type: string
    __schema672:
      type: array
      items:
        $ref: "#/components/schemas/userId"
      description: Array of user IDs to remove
      example:
        - U:user1
        - U:user2
    __schema673:
      type: object
      properties:
        userId:
          type: string
          pattern: ^U((\.)|(:))[\s\S]{0,}$
          description: Unique user identifier
          example: U:user123
          $ref: "#/components/schemas/userId"
        email:
          $ref: "#/components/schemas/userEmail"
        lastName:
          $ref: "#/components/schemas/userLastName"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        preferredName:
          $ref: "#/components/schemas/userPreferredName"
        language:
          $ref: "#/components/schemas/userLanguage"
        secondaryLanguages:
          $ref: "#/components/schemas/userSecondaryLanguages"
        birth:
          description: User's birth date information
          $ref: "#/components/schemas/__schema674"
        phone:
          $ref: "#/components/schemas/userPhone"
        shoeSize:
          description: User's shoe size for company events
          example: "10.5"
          $ref: "#/components/schemas/__schema675"
        shirtSize:
          description: User's shirt size for company events
          example: L
          $ref: "#/components/schemas/__schema676"
        timeZone:
          $ref: "#/components/schemas/userTimeZone"
        agreeToTerms:
          description: Timestamp when user agreed to terms
          example: 1672531200000
          $ref: "#/components/schemas/__schema677"
        agreeToLicensing:
          description: Timestamp when user agreed to licensing
          example: 1672531200000
          $ref: "#/components/schemas/__schema678"
        agreeToAITraining:
          description: Whether the user agreed to AI training on their pitch recordings
          $ref: "#/components/schemas/__schema679"
        mailingAddress:
          description: User's mailing address
          $ref: "#/components/schemas/__schema680"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhash"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        closer:
          $ref: "#/components/schemas/__schema655"
        closerIds:
          description: List of closer user IDs assigned to this user
          $ref: "#/components/schemas/__schema681"
        biography:
          $ref: "#/components/schemas/userBiography"
        title:
          $ref: "#/components/schemas/userTitle"
        clientUserId:
          $ref: "#/components/schemas/userClientUserId"
        notificationPrefs:
          description: User's notification preferences
          $ref: "#/components/schemas/__schema683"
        startDate:
          anyOf:
            - $ref: "#/components/schemas/userStartDate"
            - type: "null"
          description: User's employment start date, in UTC epoch milliseconds
        primaryTeam:
          $ref: "#/components/schemas/__schema644"
        hasManager:
          $ref: "#/components/schemas/userHasManager"
        selfReportedManager:
          $ref: "#/components/schemas/__schema643"
        betaProgram:
          $ref: "#/components/schemas/userBetaProgram"
        superuserScore:
          $ref: "#/components/schemas/userSuperuserScore"
        customFields:
          $ref: "#/components/schemas/__schema652"
        color:
          $ref: "#/components/schemas/userColor"
        accountId:
          $ref: "#/components/schemas/__schema653"
        whitelist:
          $ref: "#/components/schemas/userWhitelist"
        isDeleted:
          $ref: "#/components/schemas/isDeleted"
        managerId:
          $ref: "#/components/schemas/userManagerId"
    __schema674:
      type: object
      properties:
        month:
          type: number
        day:
          type: number
    __schema675:
      type: string
    __schema676:
      type: string
    __schema677:
      type: number
    __schema678:
      type: number
    __schema679:
      type: boolean
    __schema680:
      type: object
      properties:
        country:
          $ref: "#/components/schemas/addressCountry"
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        line1:
          $ref: "#/components/schemas/addressLine1"
        line2:
          $ref: "#/components/schemas/addressLine2"
        locality:
          $ref: "#/components/schemas/addressLocality"
        oneLine:
          $ref: "#/components/schemas/addressOneLine"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        postal2:
          $ref: "#/components/schemas/addressPostal2"
        postal3:
          $ref: "#/components/schemas/addressPostal3"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbr"
        unitType:
          $ref: "#/components/schemas/addressUnitType"
      required:
        - country
        - countrySubd
        - line1
        - line2
        - locality
        - oneLine
        - postal1
    __schema681:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema682:
      type: string
    __schema683:
      type: object
      properties:
        all:
          $ref: "#/components/schemas/__schema684"
        demoSetupFailed:
          $ref: "#/components/schemas/__schema684"
        demoSetupComplete:
          $ref: "#/components/schemas/__schema684"
        dispatcherAssignment:
          $ref: "#/components/schemas/__schema684"
        closeEvents:
          $ref: "#/components/schemas/__schema684"
        shadowEvents:
          $ref: "#/components/schemas/__schema684"
        submitPlan:
          $ref: "#/components/schemas/__schema684"
        planSubmitted:
          $ref: "#/components/schemas/__schema684"
        planReviewed:
          $ref: "#/components/schemas/__schema684"
        interviews:
          $ref: "#/components/schemas/__schema684"
        meetings:
          $ref: "#/components/schemas/__schema684"
        evaluationAssignment:
          $ref: "#/components/schemas/__schema684"
        evaluationRequest:
          $ref: "#/components/schemas/__schema684"
        evaluationReview:
          $ref: "#/components/schemas/__schema684"
        evaluationUpdate:
          $ref: "#/components/schemas/__schema684"
        tasks:
          $ref: "#/components/schemas/__schema684"
        messages:
          $ref: "#/components/schemas/__schema684"
        areaAssignment:
          $ref: "#/components/schemas/__schema684"
        teamAreaAssignment:
          $ref: "#/components/schemas/__schema684"
        game:
          $ref: "#/components/schemas/__schema684"
        recordingScored:
          $ref: "#/components/schemas/__schema684"
        recordingAssigned:
          $ref: "#/components/schemas/__schema684"
        recordingFeedbackAdded:
          $ref: "#/components/schemas/__schema684"
        recordingEventSuggestion:
          $ref: "#/components/schemas/__schema684"
        cardViewed:
          $ref: "#/components/schemas/__schema684"
        cardContactSaved:
          $ref: "#/components/schemas/__schema684"
    __schema684:
      type: object
      properties:
        push:
          type: boolean
        email:
          type: boolean
    __schema685:
      type: number
    __schema686:
      $ref: "#/components/schemas/companyId"
    __schema687:
      $ref: "#/components/schemas/teamId"
    __schema688:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema689:
      $ref: "#/components/schemas/__schema690"
    __schema690:
      type: boolean
    __schema691:
      type: boolean
    __schema692:
      type: number
    __schema693:
      type: string
      enum:
        - Account
        - Company
        - Contact
        - Evaluation
        - Event
        - Screenshot
        - Task
        - Team
        - User
    __schema694:
      type: string
    __schema695:
      anyOf:
        - type: string
          enum:
            - ENERFLO
            - SALESFORCE
            - JOBNIMBUS
            - SERVICETITAN
            - CONNECT
        - type: "null"
    __schema696:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        type: string
    __schema697:
      type: string
    __schema698:
      type: string
    __schema699:
      type: boolean
    __schema700:
      type: boolean
    __schema701:
      type: boolean
    __schema702:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        anyOf:
          - type: string
          - type: number
          - type: object
            propertyNames:
              type: string
            additionalProperties: {}
    __schema703:
      type: array
      items:
        $ref: "#/components/schemas/accountStatusId"
    __schema704:
      $ref: "#/components/schemas/WFId"
    __schema705:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema706:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema707:
      type: array
      items:
        type: string
        format: email
        pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
    __schema708:
      type: string
      minLength: 16
      maxLength: 256
    __schema709:
      type: boolean
    __schema710:
      type: string
      minLength: 1
      description: Name of the workflow
    __schema711:
      type: array
      items:
        type: object
        properties:
          stageId:
            $ref: "#/components/schemas/SId"
          legacyId:
            $ref: "#/components/schemas/accountStatusId"
          order:
            description: Order of the stage in the workflow
            $ref: "#/components/schemas/__schema712"
          name:
            type: string
          description:
            type: string
          autoTrigger:
            type: object
            properties:
              hours:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              days:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              years:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              stageId:
                $ref: "#/components/schemas/SId"
            required:
              - stageId
          short:
            type: string
          plural:
            type: string
          icon:
            type: string
            deprecated: true
          color:
            type: string
          restricted:
            type: boolean
          actionIds:
            description: The outgoing actions from this stage
            $ref: "#/components/schemas/__schema713"
          scope:
            type: string
            enum:
              - self
              - downline
              - withinRestrictions
              - company
          setter:
            $ref: "#/components/schemas/__schema714"
          closer:
            $ref: "#/components/schemas/__schema714"
          selfgen:
            $ref: "#/components/schemas/__schema714"
          requiredFields:
            type: array
            items:
              anyOf:
                - type: string
                  enum:
                    - firstName
                    - lastName
                    - email
                    - phone
                - $ref: "#/components/schemas/CFId"
          ioType:
            type: string
            enum:
              - Input
              - Output
              - Both
          aiConfig:
            type: object
            properties:
              enabled:
                description: When true, AI classification is enabled for this stage. Ignored
                  when `flagRecordings` is true.
                $ref: "#/components/schemas/__schema717"
              shouldGrade:
                $ref: "#/components/schemas/__schema718"
              prompt:
                $ref: "#/components/schemas/__schema720"
              flagRecordings:
                description: When true, recordings made at a location with an account in this
                  stage are flagged, and AI classification (`enabled`) is
                  ignored for this stage. Off by default.
                $ref: "#/components/schemas/__schema722"
          reportConfig:
            type: object
            properties:
              count:
                $ref: "#/components/schemas/__schema723"
              daysSince:
                $ref: "#/components/schemas/__schema724"
              timeOfDay:
                $ref: "#/components/schemas/__schema725"
              reportOn:
                $ref: "#/components/schemas/__schema726"
              variantsShown:
                $ref: "#/components/schemas/__schema727"
          advancedConfig:
            type: object
            properties:
              actionCredit:
                description: When disabled, the person who took the action that moved the entity
                  to this stage does not receive credit for it
                $ref: "#/components/schemas/__schema728"
              changePrimaryOwnership:
                description: Whether this stage changes primary ownership of the entity
                $ref: "#/components/schemas/__schema729"
              futurePipelineCredit:
                description: When enabled, the person who took the action that moved the entity
                  to this stage receives credit for all future pipeline stages
                  in the workflow from that point on
                $ref: "#/components/schemas/__schema730"
              who:
                type: string
                enum:
                  - none
                  - setter
                  - closer
              allowCreditAfterDays:
                type: integer
                minimum: -1
                maximum: 9007199254740991
          taskConfig:
            type: object
            properties:
              required:
                description: Whether the task is required, by default its optional
                $ref: "#/components/schemas/__schema731"
              priority:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              assignTo:
                description: Who the task will be assigned to, by default its actionRoles
                $ref: "#/components/schemas/__schema732"
              dateField:
                anyOf:
                  - type: string
                    const: appointmentDate
                  - $ref: "#/components/schemas/AId"
                  - $ref: "#/components/schemas/SId"
              dateOffset:
                description: Time offset configuration relative to the dateField
                $ref: "#/components/schemas/__schema733"
          eventConfig:
            type: object
            properties:
              scheduleAppointment:
                $ref: "#/components/schemas/__schema735"
              appointmentType:
                $ref: "#/components/schemas/__schema736"
              scheduleRestriction:
                $ref: "#/components/schemas/__schema737"
          noteConfig:
            description: Note requirement configuration for this stage. Can be overridden
              per action.
            $ref: "#/components/schemas/__schema739"
          hooks:
            description: Hooks to execute around this stage
            $ref: "#/components/schemas/__schema742"
          rollback:
            description: Rollback behavior for this stage. Unset = accounts in this stage
              can be rolled back.
            $ref: "#/components/schemas/__schema743"
          isDeleted:
            $ref: "#/components/schemas/isDeleted"
          modifiedBy:
            $ref: "#/components/schemas/__schema132"
        required:
          - stageId
          - name
          - icon
          - color
          - scope
    __schema712:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema713:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema714:
      type: object
      properties:
        includeOnPlan:
          description: Whether to include this on quarterly plans
          $ref: "#/components/schemas/__schema715"
        allowPayment:
          description: Whether to allow payment calculation on quarterly plans
          $ref: "#/components/schemas/__schema716"
    __schema715:
      type: boolean
    __schema716:
      type: boolean
    __schema717:
      type: boolean
    __schema718:
      description: Whether this action should trigger grading of the conversation by AI
      $ref: "#/components/schemas/__schema719"
    __schema719:
      type: boolean
    __schema720:
      description: The prompt to use for the AI when evaluating this action
      $ref: "#/components/schemas/__schema721"
    __schema721:
      type: string
    __schema722:
      type: boolean
    __schema723:
      type: boolean
    __schema724:
      type: boolean
    __schema725:
      type: boolean
    __schema726:
      type: array
      items:
        type: string
        enum:
          - contributor
          - actor
    __schema727:
      type: string
      enum:
        - none
        - setter
        - closer
        - both
    __schema728:
      type: boolean
    __schema729:
      type: boolean
    __schema730:
      type: boolean
    __schema731:
      type: boolean
    __schema732:
      type: string
      enum:
        - owner
        - closer
        - actionRoles
    __schema733:
      oneOf:
        - type: object
          properties:
            direction:
              type: string
              const: on
            unit:
              $ref: "#/components/schemas/__schema734"
          required:
            - direction
            - unit
        - type: object
          properties:
            direction:
              type: string
              enum:
                - before
                - after
            value:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
              description: Number of time units
            unit:
              description: Time unit for the offset
              $ref: "#/components/schemas/__schema734"
          required:
            - direction
            - value
            - unit
      type: object
    __schema734:
      type: string
      enum:
        - hour
        - day
        - week
        - month
    __schema735:
      type: boolean
    __schema736:
      type: string
      enum:
        - personal
        - closer
    __schema737:
      description: User can only schedule closer events in this time window. User with
        event:manage permission can bypass this restriction.
      $ref: "#/components/schemas/__schema738"
    __schema738:
      type: object
      properties:
        operator:
          type: string
          enum:
            - gte
            - lte
        milliseconds:
          type: integer
          minimum: 0
          maximum: 9007199254740991
      required:
        - operator
        - milliseconds
    __schema739:
      type: object
      properties:
        required:
          description: When enabled, users must add a note when performing this action
          $ref: "#/components/schemas/__schema740"
        timeframeMs:
          description: If a note was left within this timeframe (ms), skip the
            requirement. Defaults to 24 hours
          $ref: "#/components/schemas/__schema741"
    __schema740:
      type: boolean
    __schema741:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema742:
      type: object
      properties:
        post:
          type: array
          items:
            $ref: "#/components/schemas/__schema113"
    __schema743:
      type: string
      enum:
        - target
        - protected
    __schema744:
      type: array
      items:
        $ref: "#/components/schemas/__schema745"
    __schema745:
      type: object
      properties:
        actionId:
          $ref: "#/components/schemas/AId"
        legacyId:
          anyOf:
            - $ref: "#/components/schemas/__schema96"
            - $ref: "#/components/schemas/__schema296"
        toStageId:
          $ref: "#/components/schemas/SId"
        fromStages:
          type: array
          items:
            $ref: "#/components/schemas/SId"
          deprecated: true
        name:
          type: string
          minLength: 1
        description:
          type: string
        short:
          type: string
        plural:
          type: string
        icon:
          type: string
        color:
          type: string
          description: Hex color code for the action display. Defaults to the target stage
            color if not set. Empty string means no color override.
        conditions:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    const: action_count
                  actionId:
                    $ref: "#/components/schemas/AId"
                  count:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  operator:
                    default: gte
                    type: string
                    enum:
                      - eq
                      - lt
                      - lte
                      - gt
                      - gte
                required:
                  - type
                  - count
              - type: object
                properties:
                  type:
                    type: string
                    const: distance_from_property
                  meters:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                required:
                  - type
                  - meters
              - type: object
                properties:
                  type:
                    type: string
                    const: distance_from_action
                  on:
                    type: string
                    enum:
                      - this
                      - any
                  meters:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  actionId:
                    description: The action to measure distance from, defaults to the current action
                    $ref: "#/components/schemas/AId"
                required:
                  - type
                  - on
                  - meters
              - type: object
                properties:
                  type:
                    type: string
                    const: time_since
                  on:
                    type: string
                    enum:
                      - this
                      - any
                  milliseconds:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  actionId:
                    description: The action to measure distance from, defaults to the current action
                    $ref: "#/components/schemas/AId"
                required:
                  - type
                  - on
                  - milliseconds
              - type: object
                properties:
                  type:
                    $ref: "#/components/schemas/__schema746"
                  minutesStart:
                    $ref: "#/components/schemas/__schema747"
                  minutesEnd:
                    $ref: "#/components/schemas/__schema748"
                required:
                  - type
                  - minutesStart
                  - minutesEnd
            type: object
        aiConfig:
          deprecated: true
          $ref: "#/components/schemas/__schema749"
        accountConfig:
          type: object
          properties:
            scheduleAppointment:
              $ref: "#/components/schemas/__schema735"
            appointmentType:
              $ref: "#/components/schemas/__schema736"
            scheduleRestriction:
              $ref: "#/components/schemas/__schema737"
            trackUserLocation:
              description: Whether this action requires tracking the user's location
              $ref: "#/components/schemas/__schema750"
            undoAction:
              $ref: "#/components/schemas/__schema751"
            noteConfig:
              description: Note requirement configuration for this action
              $ref: "#/components/schemas/__schema739"
        eventConfig:
          type: object
          properties:
            occurred:
              type: boolean
            reschedule:
              type: boolean
            closed:
              type: boolean
            show:
              type: string
              enum:
                - before
                - after
            fault:
              type: string
              enum:
                - setter
                - closer
        reportConfig:
          type: object
          properties:
            count:
              $ref: "#/components/schemas/__schema723"
            daysSince:
              $ref: "#/components/schemas/__schema724"
            timeOfDay:
              $ref: "#/components/schemas/__schema725"
            hoursWorked:
              type: object
              properties:
                enabled:
                  type: boolean
              required:
                - enabled
            reportOn:
              $ref: "#/components/schemas/__schema726"
            variantsShown:
              $ref: "#/components/schemas/__schema727"
        checkpoints:
          description: 'Legacy, replaced by `hooks.pre`. Map of stageId to `{ behavior:
            "always" | "ask" | "never" }`: before this action, the account
            passes through these stages as stage-only history entries, so no
            action is credited for them.'
          $ref: "#/components/schemas/__schema753"
        hooks:
          description: 'Hooks to execute around this action. `pre` is an array of `{ type:
            "action", actionId, behavior: "always" | "ask" }`: actions recorded
            just before this one, each credited and condition-checked as its own
            action.'
          $ref: "#/components/schemas/__schema754"
        roles:
          type: array
          items:
            $ref: "#/components/schemas/RoleId"
        order:
          description: Order of the action in the workflow
          $ref: "#/components/schemas/__schema712"
        isDeleted:
          $ref: "#/components/schemas/isDeleted"
        modifiedBy:
          $ref: "#/components/schemas/__schema132"
      required:
        - actionId
        - fromStages
        - name
        - icon
        - color
    __schema746:
      type: string
      const: time_of_day
    __schema747:
      type: integer
      minimum: 0
      maximum: 1439
      description: Start time in minutes from midnight (0-1439)
    __schema748:
      type: integer
      minimum: 0
      maximum: 1439
      description: End time in minutes from midnight (0-1439)
    __schema749:
      type: object
      properties:
        enabled:
          type: boolean
        shouldGrade:
          $ref: "#/components/schemas/__schema718"
        prompt:
          $ref: "#/components/schemas/__schema720"
    __schema750:
      type: boolean
    __schema751:
      type: object
      properties:
        distanceFromLocation:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        timeSince:
          description: Minutes since the last activity after which the action can no
            longer be undone; 0 turns the time check off. A duration, so no time
            zone applies.
          $ref: "#/components/schemas/__schema752"
    __schema752:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema753:
      type: object
      propertyNames:
        $ref: "#/components/schemas/SId"
      additionalProperties:
        type: object
        properties:
          behavior:
            type: string
            enum:
              - always
              - ask
              - never
    __schema754:
      type: object
      properties:
        pre:
          type: array
          items:
            type: object
            properties:
              type:
                $ref: "#/components/schemas/__schema111"
              actionId:
                $ref: "#/components/schemas/AId"
              behavior:
                $ref: "#/components/schemas/__schema114"
            required:
              - type
              - actionId
              - behavior
        post:
          type: array
          items:
            $ref: "#/components/schemas/__schema113"
    __schema755:
      type: array
      items:
        $ref: "#/components/schemas/__schema756"
    __schema756:
      type: object
      properties:
        sourceStage:
          type: string
        targetId:
          anyOf:
            - $ref: "#/components/schemas/SId"
            - $ref: "#/components/schemas/AId"
      required:
        - sourceStage
        - targetId
    __schema757:
      description: "Maps a legacy ID (`sourceStage`: an account status, disposition or
        event outcome ID, or a legacy metric such as `pitch`) to the stage or
        action that replaces it (`targetId`). Imports, CRM syncs, plans,
        programs and reports still read it to translate legacy IDs. Unrelated to
        checkpoints."
      $ref: "#/components/schemas/__schema758"
    __schema758:
      type: array
      items:
        $ref: "#/components/schemas/__schema756"
    __schema759:
      description: Whether the company's legacy setup (account statuses, dispositions,
        event outcomes) has been fully migrated to this workflow. It does not
        say whether actions use `checkpoints` or `hooks.pre`. Read-only through
        `/workflow/update`.
      $ref: "#/components/schemas/__schema760"
    __schema760:
      type: boolean
    __schema761:
      type: array
      items:
        anyOf:
          - $ref: "#/components/schemas/companyId"
          - $ref: "#/components/schemas/teamId"
          - $ref: "#/components/schemas/RoleId"
    __schema762:
      type: string
      enum:
        - account
        - user
        - subAccount
      description: The entity this workflow applies to
    __schema763:
      type: array
      items:
        type: string
        enum:
          - canvass
          - user_manage
          - team_manage
          - calendar
          - setter_closer
          - integrations
          - videos
          - chat
          - recording
          - gamification
          - stats
          - demo
          - programs
          - tasks
          - dashboards
          - recruiting
          - account_assignment
          - shadow
          - one_on_one
          - team_meeting
          - compliance
          - wirecenter_data
    __schema764:
      type: object
      properties:
        undoAction:
          $ref: "#/components/schemas/__schema751"
        deleteOnUndo:
          description: When enabled, prompt users to delete an account when undoing the
            last activity results in an empty activity history
          $ref: "#/components/schemas/__schema765"
        hidePreviousActivity:
          description: Hide account activity prior to the current assignment for these roles
          $ref: "#/components/schemas/__schema766"
        closerEventFlow:
          default:
            type: residentFirst
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: residentFirst
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  const: timeslotFirst
              required:
                - type
          type: object
        mapControlKpis:
          description: Up to 2 report KPI columns to display in the mobile map control
            alongside Active
          $ref: "#/components/schemas/__schema767"
        showAllCustomFieldsInResidentForm:
          description: Show all editable account custom fields in the mobile resident form
          $ref: "#/components/schemas/__schema768"
        defaultEventConfig:
          description: Default schedule restriction applied when no stage/action-level
            scheduleRestriction is configured.
          $ref: "#/components/schemas/__schema769"
        rollback:
          description: Account stage rollback configuration
          $ref: "#/components/schemas/__schema770"
    __schema765:
      type: boolean
    __schema766:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema767:
      maxItems: 2
      type: array
      items:
        $ref: "#/components/schemas/__schema544"
    __schema768:
      type: boolean
    __schema769:
      type: object
      properties:
        scheduleRestriction:
          $ref: "#/components/schemas/__schema737"
    __schema770:
      type: object
      properties:
        enabled:
          type: boolean
        defaultStageId:
          description: Fallback when an account has no target stage in its history. Must
            be a target stage.
          $ref: "#/components/schemas/SId"
        roleIds:
          description: Roles allowed to roll back accounts
          $ref: "#/components/schemas/__schema771"
      required:
        - enabled
    __schema771:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema772:
      $ref: "#/components/schemas/__schema132"
    __schema773:
      $ref: "#/components/schemas/auditPropsCreatedAt"
    __schema774:
      $ref: "#/components/schemas/auditPropsCreatedBy"
    __schema775:
      $ref: "#/components/schemas/auditPropsUpdatedAt"
    __schema776:
      $ref: "#/components/schemas/auditPropsUpdatedBy"
    __schema777:
      $ref: "#/components/schemas/auditPropsLastUpdateProcess"
    __schema778:
      $ref: "#/components/schemas/auditPropsVersion"
    __schema779:
      $ref: "#/components/schemas/isDeleted"
    __schema780:
      $ref: "#/components/schemas/companyId"
    __schema781:
      $ref: "#/components/schemas/__schema710"
    __schema782:
      $ref: "#/components/schemas/__schema711"
    __schema783:
      $ref: "#/components/schemas/__schema744"
    __schema784:
      $ref: "#/components/schemas/__schema755"
    __schema785:
      $ref: "#/components/schemas/__schema757"
    __schema786:
      $ref: "#/components/schemas/__schema759"
    __schema787:
      $ref: "#/components/schemas/__schema761"
    __schema788:
      $ref: "#/components/schemas/__schema762"
    __schema789:
      $ref: "#/components/schemas/__schema763"
    __schema790:
      $ref: "#/components/schemas/__schema764"
    __schema791:
      $ref: "#/components/schemas/WFId"
    __schema792:
      type: array
      items:
        $ref: "#/components/schemas/__schema745"
    __schema793:
      type: boolean
    __schema794:
      type: string
      const: add
    __schema795:
      type: string
      const: update
    __schema796:
      type: object
      properties:
        name:
          type: string
          description: Label or name for a single account in this status
        statusId:
          $ref: "#/components/schemas/accountStatusId"
      required:
        - name
        - statusId
    __schema797:
      type: object
      properties:
        actionId:
          $ref: "#/components/schemas/AId"
        stageId:
          $ref: "#/components/schemas/SId"
        workflowId:
          $ref: "#/components/schemas/WFId"
        stageName:
          type: string
        actionName:
          type: string
        sourceStage:
          type: string
      required:
        - stageId
        - workflowId
    __schema798:
      type: number
    __schema799:
      type: number
    __schema800:
      type: string
    __schema801:
      description: External system ID of the event
      $ref: "#/components/schemas/__schema802"
    __schema802:
      type: string
    __schema803:
      type: string
    __schema804:
      type: string
    __schema805:
      type: string
    __schema806:
      type: string
    responseSuccessType:
      type: string
      const: success
      title: Success Response
      description: Standard success response for API calls
    responseError:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/__schema925"
        error:
          $ref: "#/components/schemas/__schema926"
        message:
          $ref: "#/components/schemas/__schema927"
        retry:
          $ref: "#/components/schemas/__schema928"
      required:
        - type
        - error
      additionalProperties: false
      title: Error Response
      description: Standard error response for API calls
    lambdaResponseError:
      type: object
      properties:
        message:
          $ref: "#/components/schemas/__schema929"
      required:
        - message
      additionalProperties: false
    dispositionName:
      type: string
      minLength: 1
      description: The name of the disposition
    dispositionOrder:
      type: number
      description: The position of the disposition
    dispositionColor:
      type: string
      description: The color of the disposition
    dispositionCode:
      description: The disposition's shorthand code
      $ref: "#/components/schemas/__schema1099"
    dispositionInteraction:
      description: Indicates if the disposition involves user interaction
      $ref: "#/components/schemas/__schema1100"
    dispositionPitch:
      description: Indicates if the disposition is a pitch
      $ref: "#/components/schemas/__schema1101"
    dispositionCreateAccount:
      $ref: "#/components/schemas/__schema1103"
    dispositionAccountStatusId:
      $ref: "#/components/schemas/accountStatusId"
    dispositionFromStatusId:
      $ref: "#/components/schemas/accountStatusId"
    dispositionShowIfNoStatusId:
      $ref: "#/components/schemas/__schema1104"
    dispositionScheduleAppointment:
      type: boolean
    dispositionOccurred:
      $ref: "#/components/schemas/__schema1105"
    dispositionClosed:
      $ref: "#/components/schemas/__schema1106"
    dispositionFault:
      $ref: "#/components/schemas/__schema979"
    dispositionParentOnly:
      description: Indicates if the disposition is for parent accounts
      $ref: "#/components/schemas/__schema1107"
    dispositionEventDateType:
      $ref: "#/components/schemas/__schema1108"
    utcSeconds:
      title: Timestamp
      description: A timestamp in UTC seconds
      example: $Math.floor(Date.now() / 1000)
      $ref: "#/components/schemas/__schema1149"
    PrizeId:
      type: string
      pattern: ^Prize\.[\s\S]{0,}$
      description: "Terros ID: `Prize.` prefix followed by a unique suffix, e.g.
        `Prize.123-4aBc_d`"
      example: Prize.123-4aBc_d
    GroupId:
      type: string
      pattern: ^Group\.[\s\S]{0,}$
      description: "Terros ID: `Group.` prefix followed by a unique suffix, e.g.
        `Group.123-4aBc_d`"
      example: Group.123-4aBc_d
    ConvoId:
      type: string
      pattern: ^Convo\.[\s\S]{0,}$
      description: "Terros ID: `Convo.` prefix followed by a unique suffix, e.g.
        `Convo.123-4aBc_d`"
      example: Convo.123-4aBc_d
    CViolationId:
      type: string
      pattern: ^CViolation\.[\s\S]{0,}$
      description: "Terros ID: `CViolation.` prefix followed by a unique suffix, e.g.
        `CViolation.123-4aBc_d`"
      example: CViolation.123-4aBc_d
    CPolicyId:
      type: string
      pattern: ^CPolicy\.[\s\S]{0,}$
      description: "Terros ID: `CPolicy.` prefix followed by a unique suffix, e.g.
        `CPolicy.123-4aBc_d`"
      example: CPolicy.123-4aBc_d
    ConvoFlagMatchId:
      type: string
      pattern: ^ConvoFlagMatch\.[\s\S]{0,}$
      description: "Terros ID: `ConvoFlagMatch.` prefix followed by a unique suffix,
        e.g. `ConvoFlagMatch.123-4aBc_d`"
      example: ConvoFlagMatch.123-4aBc_d
    RecordingId:
      type: string
      pattern: ^Recording\.[\s\S]{0,}$
      description: "Terros ID: `Recording.` prefix followed by a unique suffix, e.g.
        `Recording.123-4aBc_d`"
      example: Recording.123-4aBc_d
    RubricId:
      type: string
      pattern: ^Rubric\.[\s\S]{0,}$
      description: "Terros ID: `Rubric.` prefix followed by a unique suffix, e.g.
        `Rubric.123-4aBc_d`"
      example: Rubric.123-4aBc_d
    companyKind:
      type: string
      enum:
        - customer
        - sandbox
        - demo
        - template
        - development
    demoProgressState:
      type: string
      enum:
        - Ready
        - Copying
        - Failed
    companyAvatarUrl:
      $ref: "#/components/schemas/__schema1359"
    companyAvatarBlurhash:
      $ref: "#/components/schemas/__schema1360"
    teamChildTeamIds:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
      description: IDs of the direct child teams visible to the caller.
    teamIsLeaf:
      type: boolean
      description: "True when the caller sees no child teams under this team: the
        bottom of the org chart from their point of view."
    teamLevelName:
      description: The company's name for this team's level, such as Region or Office.
        Omitted when the level has no name.
      example: Office
      $ref: "#/components/schemas/__schema1390"
    userData:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        importId:
          $ref: "#/components/schemas/importId"
        phone:
          $ref: "#/components/schemas/userPhoneOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        email:
          $ref: "#/components/schemas/userEmail"
        timeZone:
          $ref: "#/components/schemas/userTimeZoneOutput"
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        title:
          $ref: "#/components/schemas/userTitleOutput"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        companyId:
          $ref: "#/components/schemas/__schema1392"
        managerId:
          $ref: "#/components/schemas/userManagerId"
        hasManager:
          $ref: "#/components/schemas/userHasManagerOutput"
        selfReportedManager:
          $ref: "#/components/schemas/__schema1394"
        primaryTeam:
          $ref: "#/components/schemas/__schema1395"
        betaProgram:
          $ref: "#/components/schemas/userBetaProgramOutput"
        language:
          $ref: "#/components/schemas/userLanguageOutput"
        secondaryLanguages:
          $ref: "#/components/schemas/userSecondaryLanguagesOutput"
        color:
          $ref: "#/components/schemas/userColorOutput"
        superuserScore:
          $ref: "#/components/schemas/userSuperuserScoreOutput"
        customFields:
          $ref: "#/components/schemas/__schema1403"
        accountId:
          $ref: "#/components/schemas/__schema1404"
        whitelist:
          $ref: "#/components/schemas/userWhitelistOutput"
        closer:
          $ref: "#/components/schemas/__schema1406"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        userId:
          $ref: "#/components/schemas/__schema1419"
        firstAccess:
          $ref: "#/components/schemas/userFirstAccess"
        startDate:
          $ref: "#/components/schemas/userStartDateOutput"
        clientTeamId:
          $ref: "#/components/schemas/userClientTeamId"
        teams:
          $ref: "#/components/schemas/__schema1423"
        roles:
          $ref: "#/components/schemas/__schema1428"
        biography:
          $ref: "#/components/schemas/userBiographyOutput"
        notificationPrefs:
          $ref: "#/components/schemas/__schema1431"
        agreeToTerms:
          $ref: "#/components/schemas/__schema1434"
        agreeToLicensing:
          $ref: "#/components/schemas/__schema1436"
        agreeToAITraining:
          $ref: "#/components/schemas/__schema1438"
      required:
        - firstName
        - lastName
        - email
        - companyId
        - userId
      additionalProperties: false
      title: User Data
      description: Complete user information including system-generated fields
    userFirstAccess:
      description: Timestamp of user's first login
      example: 1672531200000
      $ref: "#/components/schemas/__schema1420"
    userClientTeamId:
      description: External client system team identifier
      example: TEAM001
      $ref: "#/components/schemas/__schema1422"
    userTeamsByLevel:
      description: Dynamic team level keys. Keys are team{level}, such as team1,
        team2, or team12.
      type: object
      additionalProperties:
        def:
          type: array
          element:
            def:
              type: object
              shape:
                teamId:
                  def:
                    type: template_literal
                    parts:
                      - Team
                      - def:
                          type: union
                          options:
                            - def:
                                type: literal
                                values:
                                  - .
                              type: literal
                              values: {}
                            - def:
                                type: literal
                                values:
                                  - ":"
                              type: literal
                              values: {}
                        type: union
                        options:
                          - def:
                              type: literal
                              values:
                                - .
                            type: literal
                            values: {}
                          - def:
                              type: literal
                              values:
                                - ":"
                            type: literal
                            values: {}
                      - def:
                          type: string
                        type: string
                  type: template_literal
                name:
                  def:
                    type: string
                  type: string
                parentId:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: template_literal
                        parts:
                          - Team
                          - def:
                              type: union
                              options:
                                - def:
                                    type: literal
                                    values:
                                      - .
                                  type: literal
                                  values: {}
                                - def:
                                    type: literal
                                    values:
                                      - ":"
                                  type: literal
                                  values: {}
                            type: union
                            options:
                              - def:
                                  type: literal
                                  values:
                                    - .
                                type: literal
                                values: {}
                              - def:
                                  type: literal
                                  values:
                                    - ":"
                                type: literal
                                values: {}
                          - def:
                              type: string
                            type: string
                      type: template_literal
                  type: optional
                isDeleted:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: boolean
                      type: boolean
                  type: optional
                externalId:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: string
                      type: string
                  type: optional
                avatarBlurhash:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: string
                      type: string
                  type: optional
                avatarUrl:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: string
                      type: string
                  type: optional
                restrictVisibility:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: boolean
                      type: boolean
                  type: optional
                level:
                  def:
                    type: number
                    checks:
                      - def:
                          type: number
                          check: number_format
                          abort: false
                          format: safeint
                        type: number
                        isFinite: true
                      - {}
                  type: number
                  isFinite: true
                meetingTimes:
                  def:
                    type: optional
                    innerType:
                      def:
                        type: array
                        element:
                          def:
                            type: object
                            shape:
                              day:
                                def:
                                  type: number
                                  checks:
                                    - {}
                                    - {}
                                type: number
                                isFinite: true
                              start:
                                def:
                                  type: number
                                  checks:
                                    - {}
                                    - {}
                                type: number
                                isFinite: true
                              end:
                                def:
                                  type: number
                                  checks:
                                    - {}
                                    - {}
                                type: number
                                isFinite: true
                          type: object
                      type: array
                      element:
                        def:
                          type: object
                          shape:
                            day:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                            start:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                            end:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                        type: object
                  type: optional
              checks: []
            type: object
        type: array
        element:
          def:
            type: object
            shape:
              teamId:
                def:
                  type: template_literal
                  parts:
                    - Team
                    - def:
                        type: union
                        options:
                          - def:
                              type: literal
                              values:
                                - .
                            type: literal
                            values: {}
                          - def:
                              type: literal
                              values:
                                - ":"
                            type: literal
                            values: {}
                      type: union
                      options:
                        - def:
                            type: literal
                            values:
                              - .
                          type: literal
                          values: {}
                        - def:
                            type: literal
                            values:
                              - ":"
                          type: literal
                          values: {}
                    - def:
                        type: string
                      type: string
                type: template_literal
              name:
                def:
                  type: string
                type: string
              parentId:
                def:
                  type: optional
                  innerType:
                    def:
                      type: template_literal
                      parts:
                        - Team
                        - def:
                            type: union
                            options:
                              - def:
                                  type: literal
                                  values:
                                    - .
                                type: literal
                                values: {}
                              - def:
                                  type: literal
                                  values:
                                    - ":"
                                type: literal
                                values: {}
                          type: union
                          options:
                            - def:
                                type: literal
                                values:
                                  - .
                              type: literal
                              values: {}
                            - def:
                                type: literal
                                values:
                                  - ":"
                              type: literal
                              values: {}
                        - def:
                            type: string
                          type: string
                    type: template_literal
                type: optional
              isDeleted:
                def:
                  type: optional
                  innerType:
                    def:
                      type: boolean
                    type: boolean
                type: optional
              externalId:
                def:
                  type: optional
                  innerType:
                    def:
                      type: string
                    type: string
                type: optional
              avatarBlurhash:
                def:
                  type: optional
                  innerType:
                    def:
                      type: string
                    type: string
                type: optional
              avatarUrl:
                def:
                  type: optional
                  innerType:
                    def:
                      type: string
                    type: string
                type: optional
              restrictVisibility:
                def:
                  type: optional
                  innerType:
                    def:
                      type: boolean
                    type: boolean
                type: optional
              level:
                def:
                  type: number
                  checks:
                    - def:
                        type: number
                        check: number_format
                        abort: false
                        format: safeint
                      type: number
                      isFinite: true
                    - {}
                type: number
                isFinite: true
              meetingTimes:
                def:
                  type: optional
                  innerType:
                    def:
                      type: array
                      element:
                        def:
                          type: object
                          shape:
                            day:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                            start:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                            end:
                              def:
                                type: number
                                checks:
                                  - {}
                                  - {}
                              type: number
                              isFinite: true
                        type: object
                    type: array
                    element:
                      def:
                        type: object
                        shape:
                          day:
                            def:
                              type: number
                              checks:
                                - {}
                                - {}
                            type: number
                            isFinite: true
                          start:
                            def:
                              type: number
                              checks:
                                - {}
                                - {}
                            type: number
                            isFinite: true
                          end:
                            def:
                              type: number
                              checks:
                                - {}
                                - {}
                            type: number
                            isFinite: true
                      type: object
                type: optional
            checks: []
          type: object
      example:
        team1:
          - teamId: Team:member
            name: Member Team
            level: 1
        team12:
          - teamId: Team:regional
            name: Regional Team
            level: 12
    userProfileData:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        importId:
          $ref: "#/components/schemas/importId"
        phone:
          $ref: "#/components/schemas/userPhoneOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        email:
          $ref: "#/components/schemas/userEmail"
        timeZone:
          $ref: "#/components/schemas/userTimeZoneOutput"
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        title:
          $ref: "#/components/schemas/userTitleOutput"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        companyId:
          $ref: "#/components/schemas/__schema1392"
        managerId:
          $ref: "#/components/schemas/userManagerId"
        hasManager:
          $ref: "#/components/schemas/userHasManagerOutput"
        selfReportedManager:
          $ref: "#/components/schemas/__schema1394"
        primaryTeam:
          $ref: "#/components/schemas/__schema1395"
        betaProgram:
          $ref: "#/components/schemas/userBetaProgramOutput"
        language:
          $ref: "#/components/schemas/userLanguageOutput"
        secondaryLanguages:
          $ref: "#/components/schemas/userSecondaryLanguagesOutput"
        color:
          $ref: "#/components/schemas/userColorOutput"
        superuserScore:
          $ref: "#/components/schemas/userSuperuserScoreOutput"
        customFields:
          $ref: "#/components/schemas/__schema1403"
        accountId:
          $ref: "#/components/schemas/__schema1404"
        whitelist:
          $ref: "#/components/schemas/userWhitelistOutput"
        closer:
          $ref: "#/components/schemas/__schema1406"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        userId:
          $ref: "#/components/schemas/__schema1419"
        firstAccess:
          $ref: "#/components/schemas/userFirstAccess"
        startDate:
          $ref: "#/components/schemas/userStartDateOutput"
        clientTeamId:
          $ref: "#/components/schemas/userClientTeamId"
        teams:
          $ref: "#/components/schemas/__schema1423"
        roles:
          $ref: "#/components/schemas/__schema1428"
        biography:
          $ref: "#/components/schemas/userBiographyOutput"
        notificationPrefs:
          $ref: "#/components/schemas/__schema1431"
        agreeToTerms:
          $ref: "#/components/schemas/__schema1434"
        agreeToLicensing:
          $ref: "#/components/schemas/__schema1436"
        agreeToAITraining:
          $ref: "#/components/schemas/__schema1438"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        permissionMap:
          $ref: "#/components/schemas/__schema1444"
        mailingAddress:
          $ref: "#/components/schemas/__schema1445"
        shoeSize:
          $ref: "#/components/schemas/__schema1447"
        shirtSize:
          $ref: "#/components/schemas/__schema1449"
        birth:
          $ref: "#/components/schemas/__schema1451"
        uploadAvatarUrl:
          $ref: "#/components/schemas/__schema1453"
        closerIds:
          $ref: "#/components/schemas/__schema1455"
        directRoles:
          $ref: "#/components/schemas/__schema1457"
      required:
        - firstName
        - lastName
        - email
        - companyId
        - userId
      additionalProperties: false
      title: User Profile Data
      description: Extended user profile information including private details
    userRoleAssignment:
      type: object
      properties:
        roleId:
          $ref: "#/components/schemas/RoleId"
        roleType:
          $ref: "#/components/schemas/__schema858"
        name:
          $ref: "#/components/schemas/__schema859"
        teamId:
          $ref: "#/components/schemas/__schema1378"
        teamName:
          $ref: "#/components/schemas/__schema1379"
      required:
        - roleId
        - name
      additionalProperties: false
      description: One role a user holds, either directly or on one team
    __schema807:
      type: array
      items:
        type: object
        properties:
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/utcMillisecondsOutput"
          updateProcess:
            type: string
        required:
          - userId
          - timestamp
        additionalProperties: false
    __schema808:
      type: integer
      minimum: 0
      maximum: 8640000000000000
    __schema809:
      type: string
    __schema810:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    __schema811:
      $ref: "#/components/schemas/__schema812"
    __schema812:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema813"
      additionalProperties:
        anyOf:
          - $ref: "#/components/schemas/__schema814"
          - type: array
            items:
              $ref: "#/components/schemas/__schema814"
    __schema813:
      type: string
      pattern: ^CF\.[\s\S]{0,}$
      description: A unique identifier for the custom field set
      example: CF.123-4aBc_d
    __schema814:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - $ref: "#/components/schemas/AttachmentId"
        - type: "null"
    __schema815:
      description: Workflow ID that is associated with the account
      $ref: "#/components/schemas/WFId"
    __schema816:
      description: List of workflow stages and actions that the account has progressed
        through
      $ref: "#/components/schemas/__schema817"
    __schema817:
      type: array
      items:
        $ref: "#/components/schemas/__schema818"
    __schema818:
      type: object
      properties:
        stageId:
          $ref: "#/components/schemas/SId"
        actionId:
          $ref: "#/components/schemas/AId"
        userId:
          $ref: "#/components/schemas/userId"
        timestamp:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        latlng:
          description: Location where the action was taken
          $ref: "#/components/schemas/latlngOutput"
        sourceStatus:
          description: External status from source system at the time of action
          $ref: "#/components/schemas/__schema819"
        source:
          description: Set when the entry was written by a bulk process (e.g. rollback)
            that must not earn new stage credit
          $ref: "#/components/schemas/__schema820"
      required:
        - stageId
        - userId
        - timestamp
      additionalProperties: false
    __schema819:
      type: string
    __schema820:
      type: string
      enum:
        - rollback
    __schema821:
      description: Current workflow stage ID that the account is in
      $ref: "#/components/schemas/SId"
    __schema822:
      description: Current workflow action ID that the account is in
      $ref: "#/components/schemas/AId"
    __schema823:
      $ref: "#/components/schemas/latlngOutput"
    __schema824:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema825:
      example: AS.test
      $ref: "#/components/schemas/accountStatusId"
    __schema826:
      description: Optional label for the system this account came from. Stored on the
        account. Not required to match or look up an account by sourceId.
      example: Statra
      $ref: "#/components/schemas/__schema827"
    __schema827:
      type: string
    __schema828:
      description: Raw status from the source system
      $ref: "#/components/schemas/__schema829"
    __schema829:
      type: string
    __schema830:
      description: "External identifier for the account within your company. sourceId
        is a single-part key: matching and lookup use sourceId alone.
        accountSource is not part of the key and is not required."
      $ref: "#/components/schemas/__schema831"
    __schema831:
      type: string
    __schema832:
      description: Alternate external lead identifier
      $ref: "#/components/schemas/__schema833"
    __schema833:
      type: string
    __schema834:
      $ref: "#/components/schemas/locationIdOutput"
    __schema835:
      type: string
      pattern: ^Loc:[\s\S]{0,}$
      description: "Terros ID: `Loc:` prefix followed by a unique suffix, e.g.
        `Loc:123-4aBc_d`"
      example: Loc:123-4aBc_d
    __schema836:
      type: object
      properties:
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        line1:
          $ref: "#/components/schemas/addressLine1"
        locality:
          $ref: "#/components/schemas/addressLocality"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        postal2:
          $ref: "#/components/schemas/addressPostal2Output"
        postal3:
          $ref: "#/components/schemas/addressPostal3Output"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbrOutput"
        unitType:
          $ref: "#/components/schemas/addressUnitTypeOutput"
        line2:
          $ref: "#/components/schemas/addressLine2"
        oneLine:
          $ref: "#/components/schemas/addressOneLine"
        latlng:
          $ref: "#/components/schemas/latlngOutput"
      required:
        - countrySubd
        - line1
        - locality
        - postal1
        - latlng
      additionalProperties: false
    __schema837:
      type: string
    __schema838:
      type: string
    __schema839:
      type: string
    __schema840:
      type: string
    __schema841:
      description: User ID of the account owner
      example: U.test
      $ref: "#/components/schemas/userId"
    __schema842:
      description: Details of the account owner
      $ref: "#/components/schemas/__schema843"
    __schema843:
      type: object
      properties:
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        isDeleted:
          $ref: "#/components/schemas/userIsDeletedOutput"
        color:
          $ref: "#/components/schemas/tinyUserColorOutput"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhoneOutput"
        title:
          $ref: "#/components/schemas/userTitleOutput"
        timeZone:
          $ref: "#/components/schemas/userTimeZoneOutput"
        teamIds:
          $ref: "#/components/schemas/__schema854"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema856"
        companyId:
          $ref: "#/components/schemas/__schema860"
        createdDate:
          $ref: "#/components/schemas/userCreatedDateOutput"
      required:
        - firstName
        - lastName
        - email
      additionalProperties: false
    __schema844:
      type: string
    __schema845:
      type: string
    __schema846:
      type: string
    __schema847:
      type: string
    __schema848:
      type: number
    __schema849:
      type: boolean
    __schema850:
      type: string
    __schema851:
      type: string
    __schema852:
      type: string
    __schema853:
      type: string
    __schema854:
      description: List of team IDs the user belongs to
      $ref: "#/components/schemas/__schema855"
    __schema855:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema856:
      type: array
      items:
        $ref: "#/components/schemas/__schema857"
    __schema857:
      type: object
      properties:
        roleId:
          $ref: "#/components/schemas/RoleId"
        roleType:
          $ref: "#/components/schemas/__schema858"
        name:
          $ref: "#/components/schemas/__schema859"
      required:
        - roleId
        - name
      additionalProperties: false
    __schema858:
      anyOf:
        - type: string
          enum:
            - admin
            - manager
            - recruit
        - type: "null"
    __schema859:
      type: string
      minLength: 1
    __schema860:
      $ref: "#/components/schemas/companyId"
    __schema861:
      type: number
    __schema862:
      description: User ID of the account closer
      $ref: "#/components/schemas/userId"
    __schema863:
      description: Details of the account closer
      $ref: "#/components/schemas/__schema843"
    __schema864:
      description: Primary resident information
      $ref: "#/components/schemas/tinyResidentOutput"
    __schema865:
      type: string
    __schema866:
      type: string
    __schema867:
      type: string
    __schema868:
      anyOf:
        - type: string
          format: email
          pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        - $ref: "#/components/schemas/__schema869"
    __schema869:
      type: string
      const: ""
    __schema870:
      anyOf:
        - $ref: "#/components/schemas/__schema871"
        - $ref: "#/components/schemas/__schema869"
    __schema871:
      title: Phone Number
      description: Phone number as 10 digits (formatting will be applied when displayed)
      example: "1234567890"
      $ref: "#/components/schemas/__schema872"
    __schema872: {}
    __schema873:
      anyOf:
        - $ref: "#/components/schemas/__schema871"
        - $ref: "#/components/schemas/__schema869"
    __schema874:
      type: string
    __schema875:
      $ref: "#/components/schemas/__schema876"
    __schema876:
      type: string
      enum:
        - PASS
        - FAIL
        - NO_HIT
    __schema877:
      $ref: "#/components/schemas/__schema878"
    __schema878:
      type: string
      pattern: ^Si:[\s\S]{0,}$
      description: "Terros ID: `Si:` prefix followed by a unique suffix, e.g.
        `Si:123-4aBc_d`"
      example: Si:123-4aBc_d
    __schema879:
      type: number
      minimum: 0
    __schema880:
      type: object
      properties:
        gte:
          type: number
        lte:
          type: number
      required:
        - gte
        - lte
      additionalProperties: false
    __schema881:
      type: boolean
    __schema882:
      type: boolean
    __schema883:
      description: Secondary resident information
      $ref: "#/components/schemas/tinyResidentOutput"
    __schema884:
      description: Primary language spoken for the customer or household
      $ref: "#/components/schemas/languageCode"
    __schema885:
      description: Number of times appointment was rescheduled (deprecated)
      deprecated: true
      $ref: "#/components/schemas/__schema886"
    __schema886:
      type: number
    __schema887:
      description: Estimated deal size (deprecated)
      deprecated: true
      $ref: "#/components/schemas/__schema888"
    __schema888:
      type: number
    __schema889:
      description: Appointment date as UTC milliseconds
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema890:
      description: Flag indicating if this is a test record
      $ref: "#/components/schemas/__schema891"
    __schema891:
      type: boolean
    __schema892:
      description: ID of team this account belongs to
      $ref: "#/components/schemas/teamId"
    __schema893:
      description: Flag indicating if this is a parent account
      $ref: "#/components/schemas/__schema894"
    __schema894:
      type: boolean
    __schema895:
      description: Parent account identifier
      $ref: "#/components/schemas/accountId"
    __schema896:
      description: List of tags associated with the account
      $ref: "#/components/schemas/__schema897"
    __schema897:
      type: array
      items:
        type: object
        properties:
          tagId:
            $ref: "#/components/schemas/TagId"
          timestamp:
            $ref: "#/components/schemas/utcMillisecondsOutput"
          userId:
            $ref: "#/components/schemas/userId"
        required:
          - tagId
          - timestamp
          - userId
        additionalProperties: false
    __schema898:
      type: array
      items:
        $ref: "#/components/schemas/__schema899"
      deprecated: true
    __schema899:
      type: object
      properties:
        statusId:
          $ref: "#/components/schemas/accountStatusId"
        sourceStatus:
          type: string
        statusChangedDate:
          $ref: "#/components/schemas/utcMillisecondsOutput"
      required:
        - statusId
        - statusChangedDate
      additionalProperties: false
    __schema900:
      description: Name of the current workflow stage, resolved from the workflow definition
      $ref: "#/components/schemas/__schema901"
    __schema901:
      type: string
    __schema902:
      description: Name of the current workflow action, resolved from the workflow
        definition
      $ref: "#/components/schemas/__schema903"
    __schema903:
      type: string
    __schema904:
      description: Homeowner resident information, included for convenience but may be
        incomplete
      $ref: "#/components/schemas/tinyResidentOutput"
    __schema905:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema906:
      type: array
      items:
        type: object
        properties:
          timestamp:
            $ref: "#/components/schemas/utcMillisecondsOutput"
          method:
            $ref: "#/components/schemas/contactMethod"
          userId:
            $ref: "#/components/schemas/userId"
          contactId:
            $ref: "#/components/schemas/ContactId"
          dispositionId:
            $ref: "#/components/schemas/__schema907"
          deviceLocation:
            $ref: "#/components/schemas/latlngOutput"
          isPitch:
            type: boolean
        required:
          - timestamp
          - method
          - userId
          - contactId
          - dispositionId
        additionalProperties: false
    __schema907:
      anyOf:
        - $ref: "#/components/schemas/DispositionId"
        - $ref: "#/components/schemas/__schema908"
      deprecated: true
      description: Deprecated when using Workflows
    __schema908:
      type: string
      enum:
        - NotHome
        - Comeback
        - NotNow
        - NotQualified
        - PartialPitch
        - NewAccount
        - Competitor
        - Custom1
        - Custom2
        - Custom3
    __schema909:
      type: array
      items:
        $ref: "#/components/schemas/__schema910"
    __schema910:
      type: object
      properties:
        timestamp:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        text:
          type: string
        userId:
          $ref: "#/components/schemas/userId"
        noteId:
          $ref: "#/components/schemas/NoteId"
      required:
        - timestamp
        - text
        - userId
        - noteId
      additionalProperties: false
    __schema911:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema912:
      description: UserId of the recruit who was assigned to the account
      $ref: "#/components/schemas/userId"
    __schema913:
      description: History of account owners
      $ref: "#/components/schemas/__schema914"
    __schema914:
      type: array
      items:
        type: object
        properties:
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/utcMillisecondsOutput"
        required:
          - userId
          - timestamp
        additionalProperties: false
    __schema915:
      description: History of account closers
      $ref: "#/components/schemas/__schema914"
    __schema916:
      description: History of account teams
      $ref: "#/components/schemas/__schema917"
    __schema917:
      type: array
      items:
        type: object
        properties:
          teamId:
            $ref: "#/components/schemas/teamId"
          timestamp:
            $ref: "#/components/schemas/utcMillisecondsOutput"
        required:
          - teamId
          - timestamp
        additionalProperties: false
    __schema918:
      description: When the latest area assignment run that touched this account
        started, in UTC epoch milliseconds; matches that run in the area run
        history
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema919:
      description: Whether the current user can edit this account. Decorated
        per-request, not stored.
      $ref: "#/components/schemas/__schema920"
    __schema920:
      type: boolean
    __schema921:
      description: How the account pin was placed during import. Reads return unknown
        values for pins created before placement tracking.
      $ref: "#/components/schemas/__schema922"
    __schema922:
      type: object
      properties:
        source:
          type: string
          enum:
            - first_american
            - amazon_location
            - supplied_coordinates
            - unknown
          description: Data source used to place the account pin; unknown for pins created
            before placement tracking
        precision:
          type: string
          enum:
            - house
            - street
            - zip
            - custom_coordinates
            - unknown
          description: Geographic precision of the account pin; unknown for pins created
            before placement tracking
      required:
        - source
        - precision
      additionalProperties: false
    __schema923:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        customFields:
          $ref: "#/components/schemas/__schema811"
        importId:
          $ref: "#/components/schemas/importId"
        workflowId:
          $ref: "#/components/schemas/__schema815"
        workflowHistory:
          $ref: "#/components/schemas/__schema816"
        workflowStageId:
          $ref: "#/components/schemas/__schema821"
        workflowActionId:
          $ref: "#/components/schemas/__schema822"
        deviceLocation:
          $ref: "#/components/schemas/__schema823"
        checkpoints:
          $ref: "#/components/schemas/__schema824"
        accountId:
          $ref: "#/components/schemas/accountId"
        statusId:
          $ref: "#/components/schemas/__schema825"
        accountSource:
          $ref: "#/components/schemas/__schema826"
        sourceStatus:
          $ref: "#/components/schemas/__schema828"
        sourceId:
          $ref: "#/components/schemas/__schema830"
        externalLeadId:
          $ref: "#/components/schemas/__schema832"
        locationId:
          $ref: "#/components/schemas/__schema834"
        location:
          $ref: "#/components/schemas/__schema836"
        ownerId:
          $ref: "#/components/schemas/__schema841"
        owner:
          $ref: "#/components/schemas/__schema842"
        closerId:
          $ref: "#/components/schemas/__schema862"
        closer:
          $ref: "#/components/schemas/__schema863"
        resident:
          $ref: "#/components/schemas/__schema864"
        resident2:
          $ref: "#/components/schemas/__schema883"
        language:
          $ref: "#/components/schemas/__schema884"
        rescheduleCount:
          $ref: "#/components/schemas/__schema885"
        dealSize:
          $ref: "#/components/schemas/__schema887"
        appointmentDate:
          $ref: "#/components/schemas/__schema889"
        test:
          $ref: "#/components/schemas/__schema890"
        teamId:
          $ref: "#/components/schemas/__schema892"
        isParent:
          $ref: "#/components/schemas/__schema893"
        parentAccountId:
          $ref: "#/components/schemas/__schema895"
        tags:
          $ref: "#/components/schemas/__schema896"
        statusHistory:
          $ref: "#/components/schemas/__schema898"
        workflowStageName:
          $ref: "#/components/schemas/__schema900"
        workflowActionName:
          $ref: "#/components/schemas/__schema902"
        homeowner:
          $ref: "#/components/schemas/__schema904"
        expiresAt:
          $ref: "#/components/schemas/__schema905"
        contacts:
          $ref: "#/components/schemas/__schema906"
        notes:
          $ref: "#/components/schemas/__schema909"
        lastActionDate:
          $ref: "#/components/schemas/__schema911"
        recruitId:
          $ref: "#/components/schemas/__schema912"
        ownerHistory:
          $ref: "#/components/schemas/__schema913"
        closerHistory:
          $ref: "#/components/schemas/__schema915"
        teamHistory:
          $ref: "#/components/schemas/__schema916"
        assignmentDate:
          $ref: "#/components/schemas/__schema918"
        editable:
          $ref: "#/components/schemas/__schema919"
        pinPlacement:
          $ref: "#/components/schemas/__schema921"
      required:
        - accountId
        - statusHistory
      additionalProperties: false
    __schema924:
      type: boolean
    __schema925:
      type: string
      const: error
    __schema926:
      type: string
    __schema927:
      type: string
    __schema928:
      type: boolean
    __schema929:
      $ref: "#/components/schemas/__schema927"
    __schema930:
      type: object
      properties:
        index:
          type: number
          description: Position of the operation in the request array.
        op:
          type: string
          enum:
            - add
            - update
            - remove
          description: The operation type that was processed.
        success:
          type: boolean
          description: Whether the operation succeeded.
        accountId:
          description: The account ID, present on success.
          $ref: "#/components/schemas/accountId"
        duplicate:
          description: Whether the account already existed (add operations only).
          $ref: "#/components/schemas/__schema931"
        error:
          description: Error details, present when the operation failed.
          $ref: "#/components/schemas/__schema932"
      required:
        - index
        - op
        - success
      additionalProperties: false
    __schema931:
      type: boolean
    __schema932:
      type: object
      properties:
        code:
          type: string
          description: Error code classifying the failure.
        message:
          type: string
          description: Human-readable error message.
      required:
        - code
        - message
      additionalProperties: false
    __schema933:
      type: array
      items:
        $ref: "#/components/schemas/__schema923"
    __schema934:
      description: Sort cursor to fetch the next page. Send it back unchanged.
      $ref: "#/components/schemas/__schema935"
    __schema935:
      anyOf:
        - $ref: "#/components/schemas/__schema936"
        - $ref: "#/components/schemas/__schema940"
      description: "Sort cursor for pagination: the sort values of the last row on the
        previous page, usually an array ending with an id tiebreaker. Send it
        back unchanged. A single value is accepted from older clients, but rows
        that share it can be skipped or repeated at the page boundary."
    __schema936:
      anyOf:
        - $ref: "#/components/schemas/__schema937"
        - $ref: "#/components/schemas/__schema938"
        - $ref: "#/components/schemas/__schema939"
      description: The timestamp to sort by
    __schema937:
      type: string
    __schema938:
      type: number
    __schema939:
      type: boolean
    __schema940:
      type: array
      items:
        $ref: "#/components/schemas/__schema936"
    __schema941:
      description: Total number of matching records.
      $ref: "#/components/schemas/__schema942"
    __schema942:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema943:
      type: string
      enum:
        - accountId
        - externalLeadId
        - sourceId
        - address
    __schema944:
      type: array
      items:
        $ref: "#/components/schemas/__schema923"
    __schema945:
      type: object
      properties:
        total:
          type: number
          description: Number of matched accounts.
        targets:
          type: array
          items:
            $ref: "#/components/schemas/__schema946"
          description: Accounts that roll back, per stage, in workflow stage order.
            Includes default stage fallbacks.
        defaultCount:
          type: number
          description: Accounts with no target stage in their history that roll back to
            the default stage. A subset of the targets counts.
        skippedCount:
          type: number
          description: Accounts that will not be changed.
      required:
        - total
        - targets
        - defaultCount
        - skippedCount
      additionalProperties: false
    __schema946:
      type: object
      properties:
        stageId:
          description: Stage the accounts roll back to.
          $ref: "#/components/schemas/SId"
        count:
          type: number
          description: Number of accounts that roll back to this stage.
      required:
        - stageId
        - count
      additionalProperties: false
    __schema947:
      type: string
      pattern: ^U((\.)|(:))[\s\S]{0,}$
      description: Unique user identifier
      example: U:user123
      $ref: "#/components/schemas/userId"
    __schema948:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/responseSuccessType"
        area:
          $ref: "#/components/schemas/__schema949"
      required:
        - type
        - area
      additionalProperties: false
    __schema949:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          description: When the area was created, in UTC epoch milliseconds, read from its
            audit log. Read-only.
          $ref: "#/components/schemas/utcMillisecondsOutput"
        createdBy:
          description: User who created the area, read from its audit log. Read-only.
          $ref: "#/components/schemas/userId"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        deletedAt:
          description: When the item was deleted, in UTC epoch milliseconds. Present only
            when the deletion was recorded.
          $ref: "#/components/schemas/utcMillisecondsOutput"
        deletedBy:
          description: User who deleted the item. Present only when the deletion was
            recorded.
          $ref: "#/components/schemas/userId"
        areaType:
          type: string
          enum:
            - dynamic
            - snapshot
        name:
          type: string
        coordinates:
          default: []
          type: array
          items:
            $ref: "#/components/schemas/latlngOutput"
        assignmentType:
          type: string
          enum:
            - user
            - team
            - company
            - draft
        teamId:
          $ref: "#/components/schemas/teamId"
        userIds:
          type: array
          items:
            $ref: "#/components/schemas/userId"
        color:
          type: string
        note:
          type: string
        filters:
          type: object
          properties:
            cities:
              type: array
              items:
                type: string
            states:
              type: array
              items:
                type: string
            zipCodes:
              type: array
              items:
                type: string
            statusIds:
              type: array
              items:
                $ref: "#/components/schemas/accountStatusId"
            workflowStageIds:
              type: array
              items:
                $ref: "#/components/schemas/SId"
            teamIds:
              type: array
              items:
                $ref: "#/components/schemas/teamId"
            userIds:
              type: array
              items:
                $ref: "#/components/schemas/userId"
            customFields:
              type: array
              items:
                type: object
                properties:
                  id:
                    $ref: "#/components/schemas/CFId"
                  value:
                    $ref: "#/components/schemas/__schema814"
                required:
                  - id
                  - value
                additionalProperties: false
            advancedCustomFields:
              $ref: "#/components/schemas/__schema951"
          additionalProperties: false
        assignmentConfig:
          oneOf:
            - type: object
              properties:
                enabled:
                  type: boolean
                  const: false
                autoRunOnImport:
                  type: boolean
              required:
                - enabled
              additionalProperties: false
            - type: object
              properties:
                enabled:
                  type: boolean
                  const: true
                autoRunOnImport:
                  type: boolean
                order:
                  type: number
              required:
                - enabled
                - order
              additionalProperties: false
          type: object
        schedule:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    const: assign
                  at:
                    $ref: "#/components/schemas/utcMillisecondsOutput"
                  by:
                    $ref: "#/components/schemas/__schema952"
                required:
                  - type
                  - at
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    const: unassign
                  at:
                    $ref: "#/components/schemas/utcMillisecondsOutput"
                  by:
                    $ref: "#/components/schemas/__schema952"
                required:
                  - type
                  - at
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    const: reassign
                  teamId:
                    $ref: "#/components/schemas/teamId"
                  userIds:
                    type: array
                    items:
                      $ref: "#/components/schemas/userId"
                  at:
                    $ref: "#/components/schemas/utcMillisecondsOutput"
                  by:
                    $ref: "#/components/schemas/__schema952"
                required:
                  - type
                  - at
                additionalProperties: false
            type: object
        importId:
          $ref: "#/components/schemas/importId"
        areaId:
          $ref: "#/components/schemas/AreaId"
        snapshot:
          type: object
          properties:
            count:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            lastSnapshotAt:
              $ref: "#/components/schemas/utcMillisecondsOutput"
            snapshotBy:
              $ref: "#/components/schemas/userId"
          required:
            - count
            - lastSnapshotAt
            - snapshotBy
          additionalProperties: false
        deleteOnCompletion:
          description: True while a move to Trash waits for the unassign run that clears
            the area from its accounts; the area is trashed when that run
            completes.
          $ref: "#/components/schemas/__schema953"
        runHistory:
          maxItems: 20
          type: array
          items:
            $ref: "#/components/schemas/__schema954"
        jobInfo:
          type: object
          properties:
            total:
              type: number
            assigned:
              type: number
            assignedDate:
              $ref: "#/components/schemas/utcMillisecondsOutput"
            isRunning:
              type: boolean
            status:
              type: string
              enum:
                - preparing
                - queued
                - running
                - completed
          required:
            - total
            - assigned
            - assignedDate
            - isRunning
            - status
          additionalProperties: false
        accountCounts:
          type: object
          properties:
            total:
              type: number
            assigned:
              type: number
            unassigned:
              type: number
          additionalProperties: false
      required:
        - coordinates
        - assignmentType
        - areaId
      additionalProperties: false
    __schema950:
      type: boolean
    __schema951:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema813"
      additionalProperties:
        oneOf:
          - type: object
            properties:
              type:
                type: string
                const: range
              range:
                type: object
                properties:
                  gte:
                    type: number
                  lte:
                    type: number
                additionalProperties: false
            required:
              - type
              - range
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: multipleChoice
              values:
                minItems: 1
                type: array
                items:
                  $ref: "#/components/schemas/__schema814"
            required:
              - type
              - values
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: exists
              exists:
                type: boolean
            required:
              - type
              - exists
            additionalProperties: false
        type: object
    __schema952:
      $ref: "#/components/schemas/userId"
    __schema953:
      type: boolean
    __schema954:
      type: object
      properties:
        timestamp:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        count:
          type: number
        type:
          type: string
          enum:
            - assign
            - unassign
            - reassign
        runBy:
          $ref: "#/components/schemas/userId"
        scheduled:
          type: boolean
        process:
          type: string
        teamId:
          $ref: "#/components/schemas/teamId"
        userIds:
          type: array
          items:
            $ref: "#/components/schemas/userId"
      required:
        - timestamp
        - count
      additionalProperties: false
    __schema955:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/responseSuccessType"
      required:
        - type
      additionalProperties: false
    __schema956:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        filename:
          type: string
        contentType:
          type: string
        size:
          type: number
        locationId:
          $ref: "#/components/schemas/locationIdOutput"
        attachmentId:
          $ref: "#/components/schemas/AttachmentId"
        userId:
          $ref: "#/components/schemas/userId"
        companyId:
          $ref: "#/components/schemas/companyId"
        downloadUrl:
          type: string
        checksum:
          type: string
        expiresAt:
          type: number
        uploadedAt:
          type: number
        status:
          default: pending
          type: string
          enum:
            - pending
            - valid
            - corrupted
      required:
        - filename
        - contentType
        - attachmentId
        - userId
        - companyId
        - downloadUrl
        - status
      additionalProperties: false
    __schema957:
      type: string
    __schema958:
      deprecated: true
      $ref: "#/components/schemas/OId"
    __schema959:
      $ref: "#/components/schemas/__schema907"
    __schema960:
      description: Array of attachment IDs
      example:
        - Attachment:doc1
        - Attachment:doc2
      $ref: "#/components/schemas/__schema961"
    __schema961:
      type: array
      items:
        $ref: "#/components/schemas/AttachmentId"
    __schema962:
      type: object
      properties:
        utilityBill:
          $ref: "#/components/schemas/__schema963"
        customerVerification:
          $ref: "#/components/schemas/__schema964"
      additionalProperties: false
      description: Specialty attachments for calendar events
    __schema963:
      description: Utility bill attachment ID
      example: Attachment:util123
      $ref: "#/components/schemas/AttachmentId"
    __schema964:
      description: Customer verification attachment ID
      example: Attachment:verify123
      $ref: "#/components/schemas/AttachmentId"
    __schema965:
      type: object
      properties:
        oneLine:
          $ref: "#/components/schemas/addressOneLine"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbrOutput"
        latitude:
          $ref: "#/components/schemas/latitude"
        longitude:
          $ref: "#/components/schemas/longitude"
      required:
        - oneLine
        - latitude
        - longitude
      additionalProperties: false
      description: Location information for calendar events
    __schema966:
      type: boolean
    __schema967:
      type: boolean
    __schema968:
      type: string
    __schema969:
      description: Synced calendar IDs (deprecated - use Google Calendar sync)
      deprecated: true
      $ref: "#/components/schemas/__schema970"
    __schema970:
      type: array
      items:
        type: string
    __schema971:
      description: Synced calendar events (deprecated - use Google Calendar sync)
      deprecated: true
      $ref: "#/components/schemas/__schema972"
    __schema972:
      type: array
      items:
        type: object
        properties:
          calendarType:
            type: string
          calendarId:
            type: string
            description: ID of the synced device calendar
          userId:
            $ref: "#/components/schemas/userId"
          deviceId:
            type: string
            description: ID of the device that synced the event
          eventId:
            type: string
            description: ID of the event in the synced device calendar
        required:
          - calendarType
          - calendarId
          - userId
          - deviceId
          - eventId
        additionalProperties: false
    __schema973:
      $ref: "#/components/schemas/companyId"
    __schema974:
      type: array
      items:
        type: object
        properties:
          outcomeId:
            $ref: "#/components/schemas/__schema958"
          userId:
            $ref: "#/components/schemas/userId"
          timestamp:
            $ref: "#/components/schemas/__schema975"
        required:
          - outcomeId
          - userId
          - timestamp
        additionalProperties: false
        description: Historical record of event outcome changes
    __schema975:
      description: When the outcome was recorded, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema976:
      type: boolean
    __schema977:
      type: boolean
    __schema978:
      type: string
    __schema979:
      type: string
      enum:
        - setter
        - closer
    __schema980:
      type: boolean
    __schema981:
      type: boolean
    __schema982:
      type: object
      properties:
        importId:
          $ref: "#/components/schemas/importId"
        eventType:
          $ref: "#/components/schemas/eventType"
        title:
          $ref: "#/components/schemas/calendarEventTitle"
        sourceId:
          $ref: "#/components/schemas/calendarEventSourceIdOutput"
        eventDate:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        outcomeId:
          $ref: "#/components/schemas/calendarEventOutcomeIdOutput"
        dispositionId:
          $ref: "#/components/schemas/__schema959"
        duration:
          $ref: "#/components/schemas/calendarEventDuration"
        attachments:
          $ref: "#/components/schemas/__schema960"
        specialtyAttachments:
          $ref: "#/components/schemas/__schema962"
        accountId:
          $ref: "#/components/schemas/calendarEventAccountId"
        locationId:
          $ref: "#/components/schemas/calendarEventLocationIdOutput"
        location:
          $ref: "#/components/schemas/__schema965"
        ownerId:
          $ref: "#/components/schemas/userId"
        attendeeId:
          $ref: "#/components/schemas/calendarEventAttendeeId"
        dispatcherId:
          $ref: "#/components/schemas/calendarEventDispatcherId"
        occurredOwner:
          $ref: "#/components/schemas/calendarEventOccurredOwnerOutput"
        occurredAttendee:
          $ref: "#/components/schemas/calendarEventOccurredAttendeeOutput"
        interviewId:
          $ref: "#/components/schemas/calendarEventInterviewId"
        notes:
          $ref: "#/components/schemas/calendarEventNotesOutput"
        previousEventId:
          $ref: "#/components/schemas/calendarEventPreviousId"
        syncedCalendarIds:
          $ref: "#/components/schemas/__schema969"
        syncedCalendarEvents:
          $ref: "#/components/schemas/__schema971"
        teamId:
          $ref: "#/components/schemas/calendarEventTeamId"
        companyId:
          $ref: "#/components/schemas/__schema973"
        outcomeHistory:
          $ref: "#/components/schemas/__schema974"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        eventId:
          $ref: "#/components/schemas/EventId"
        occurred:
          $ref: "#/components/schemas/calendarEventOccurredOutput"
        closed:
          $ref: "#/components/schemas/calendarEventClosedOutput"
        reasonNotOccurred:
          $ref: "#/components/schemas/calendarEventReasonNotOccurredOutput"
        fault:
          $ref: "#/components/schemas/calendarEventFaultOutput"
        allDay:
          $ref: "#/components/schemas/calendarEventAllDayOutput"
        canDelete:
          $ref: "#/components/schemas/calendarEventCanDeleteOutput"
      required:
        - eventType
        - title
        - eventDate
        - duration
        - ownerId
        - eventId
      additionalProperties: false
      description: Complete calendar event data with audit information
    __schema983:
      description: Resident information (populated asynchronously)
      $ref: "#/components/schemas/tinyResidentOutput"
    __schema984:
      description: Event owner details (populated from ownerId)
      $ref: "#/components/schemas/smallUserOutput"
    __schema985:
      type: array
      items:
        type: object
        properties:
          teamId:
            $ref: "#/components/schemas/teamId"
          name:
            $ref: "#/components/schemas/teamName"
        required:
          - teamId
          - name
        additionalProperties: false
    __schema986:
      description: Event attendee details (populated from attendeeId)
      $ref: "#/components/schemas/smallUserOutput"
    __schema987:
      description: Associated teams (populated asynchronously)
      $ref: "#/components/schemas/__schema988"
    __schema988:
      type: array
      items:
        $ref: "#/components/schemas/__schema989"
    __schema989:
      type: object
      properties:
        teamId:
          $ref: "#/components/schemas/teamId"
        name:
          $ref: "#/components/schemas/teamName"
        parentId:
          $ref: "#/components/schemas/parentTeamId"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        externalId:
          $ref: "#/components/schemas/teamExternalIdOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/teamAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/teamAvatarUrlOutput"
        restrictVisibility:
          $ref: "#/components/schemas/teamRestrictVisibilityOutput"
        level:
          $ref: "#/components/schemas/teamLevel"
        meetingTimes:
          $ref: "#/components/schemas/teamMeetingTimesOutput"
      required:
        - teamId
        - name
        - level
      additionalProperties: false
    __schema990:
      type: string
    __schema991:
      type: string
    __schema992:
      type: string
    __schema993:
      type: boolean
    __schema994:
      type: array
      items:
        $ref: "#/components/schemas/__schema995"
    __schema995:
      type: object
      properties:
        day:
          $ref: "#/components/schemas/meetingTimeDay"
        start:
          $ref: "#/components/schemas/meetingTimeStart"
        end:
          $ref: "#/components/schemas/meetingTimeEnd"
      required:
        - day
        - start
        - end
      additionalProperties: false
    __schema996:
      description: Workflow Account information (populated asynchronously)
      $ref: "#/components/schemas/__schema997"
    __schema997:
      type: object
      properties:
        accountId:
          $ref: "#/components/schemas/accountId"
        workflowId:
          $ref: "#/components/schemas/WFId"
        workflowStageId:
          $ref: "#/components/schemas/SId"
        workflowActionId:
          $ref: "#/components/schemas/AId"
        workflowLastActionDate:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        workflowHistory:
          type: array
          items:
            $ref: "#/components/schemas/__schema818"
        customFields:
          $ref: "#/components/schemas/__schema812"
      required:
        - accountId
        - workflowId
        - workflowStageId
        - workflowHistory
      additionalProperties: false
    __schema998:
      type: object
      properties:
        importId:
          $ref: "#/components/schemas/importId"
        eventType:
          $ref: "#/components/schemas/eventType"
        title:
          $ref: "#/components/schemas/calendarEventTitle"
        sourceId:
          $ref: "#/components/schemas/calendarEventSourceIdOutput"
        eventDate:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        outcomeId:
          $ref: "#/components/schemas/calendarEventOutcomeIdOutput"
        dispositionId:
          $ref: "#/components/schemas/__schema959"
        duration:
          $ref: "#/components/schemas/calendarEventDuration"
        attachments:
          $ref: "#/components/schemas/__schema960"
        specialtyAttachments:
          $ref: "#/components/schemas/__schema962"
        accountId:
          $ref: "#/components/schemas/calendarEventAccountId"
        locationId:
          $ref: "#/components/schemas/calendarEventLocationIdOutput"
        location:
          $ref: "#/components/schemas/__schema965"
        ownerId:
          $ref: "#/components/schemas/userId"
        attendeeId:
          $ref: "#/components/schemas/calendarEventAttendeeId"
        dispatcherId:
          $ref: "#/components/schemas/calendarEventDispatcherId"
        occurredOwner:
          $ref: "#/components/schemas/calendarEventOccurredOwnerOutput"
        occurredAttendee:
          $ref: "#/components/schemas/calendarEventOccurredAttendeeOutput"
        interviewId:
          $ref: "#/components/schemas/calendarEventInterviewId"
        notes:
          $ref: "#/components/schemas/calendarEventNotesOutput"
        previousEventId:
          $ref: "#/components/schemas/calendarEventPreviousId"
        syncedCalendarIds:
          $ref: "#/components/schemas/__schema969"
        syncedCalendarEvents:
          $ref: "#/components/schemas/__schema971"
        teamId:
          $ref: "#/components/schemas/calendarEventTeamId"
        companyId:
          $ref: "#/components/schemas/__schema973"
        outcomeHistory:
          $ref: "#/components/schemas/__schema974"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        eventId:
          $ref: "#/components/schemas/EventId"
        occurred:
          $ref: "#/components/schemas/calendarEventOccurredOutput"
        closed:
          $ref: "#/components/schemas/calendarEventClosedOutput"
        reasonNotOccurred:
          $ref: "#/components/schemas/calendarEventReasonNotOccurredOutput"
        fault:
          $ref: "#/components/schemas/calendarEventFaultOutput"
        allDay:
          $ref: "#/components/schemas/calendarEventAllDayOutput"
        canDelete:
          $ref: "#/components/schemas/calendarEventCanDeleteOutput"
        resident:
          $ref: "#/components/schemas/__schema983"
        owner:
          $ref: "#/components/schemas/__schema984"
        attendee:
          $ref: "#/components/schemas/__schema986"
        teams:
          $ref: "#/components/schemas/__schema987"
        account:
          $ref: "#/components/schemas/__schema996"
      required:
        - eventType
        - title
        - eventDate
        - duration
        - ownerId
        - eventId
      additionalProperties: false
      description: Calendar event data with populated details (resident, owner,
        attendee, teams)
    __schema999:
      type: object
      properties:
        type:
          type: string
          const: unrestricted
          description: The closer has no location restriction
      required:
        - type
      additionalProperties: false
    __schema1000:
      type: object
      properties:
        type:
          type: string
          const: radius
        center:
          description: The effective center of the closer's service area
          $ref: "#/components/schemas/latlngOutput"
        radiusMeters:
          type: number
          exclusiveMinimum: 0
          description: The effective radius of the closer's service area in meters
          example: 50000
      required:
        - type
        - center
        - radiusMeters
      additionalProperties: false
    __schema1001:
      type: object
      properties:
        type:
          type: string
          const: unknown
          description: The effective service area could not be determined from the
            configured data
      required:
        - type
      additionalProperties: false
    __schema1002:
      $ref: "#/components/schemas/accessStatus"
    __schema1003:
      type: string
    __schema1004:
      $ref: "#/components/schemas/billingMethod"
    __schema1005:
      $ref: "#/components/schemas/teamLevel"
    __schema1006:
      type: array
      items:
        $ref: "#/components/schemas/companyIndustry"
    __schema1007:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        type: string
    __schema1008:
      $ref: "#/components/schemas/teamLevel"
    __schema1009:
      $ref: "#/components/schemas/companyName"
    __schema1010:
      $ref: "#/components/schemas/companyId"
    __schema1011:
      type: array
      items:
        type: string
    __schema1012:
      $ref: "#/components/schemas/companySize"
    __schema1013:
      type: string
    __schema1014:
      type: string
      minLength: 1
      example: Salesforce
      description: A short globally unique name for the app, which will be displayed
        to users when they install the app and grant permissions. This is
        required for the App to be published.
    __schema1015:
      description: A short markdown summary of the app's functionality and purpose.
        This is required for the App to be published.
      $ref: "#/components/schemas/__schema1016"
    __schema1016:
      type: string
    __schema1017:
      description: Markdown documentation for the app
      $ref: "#/components/schemas/__schema1018"
    __schema1018:
      type: string
    __schema1019:
      description: Company that created the app
      $ref: "#/components/schemas/__schema1020"
    __schema1020:
      type: object
      properties:
        companyId:
          $ref: "#/components/schemas/companyId"
        name:
          $ref: "#/components/schemas/__schema1009"
      required:
        - companyId
        - name
      additionalProperties: false
    __schema1021:
      type: string
      enum:
        - development
        - internal
        - published
        - deprecated
    __schema1022:
      description: The currently published version of the app. This may be empty if no
        version is published yet.
      $ref: "#/components/schemas/__schema1023"
    __schema1023:
      type: string
      pattern: ^\d+\.\d+\.\d+$
      description: Semantic version number
    __schema1024:
      type: array
      items:
        $ref: "#/components/schemas/__schema1025"
      description: List of permissions requested by the app for use in scripts.
    __schema1025:
      type: string
      enum:
        - account:save
        - account:add
        - account:manage
        - account:import
        - account:list
        - accountStatus:list
        - accountStatus:save
        - accountRule:save
        - aiChat:list
        - apikey:manage
        - companyCard:save
        - userCard:save
        - company:add
        - company:delete
        - company:read
        - company:update
        - company:list
        - customField:list
        - customField:save
        - app:list
        - app:manage
        - install:manage
        - event:outcome:save
        - event:outcome:list
        - export:manage
        - reportConfig:manage
        - ratio:list
        - ratio:save
        - webhook:manage
        - workflow:list
        - workflow:manage
        - quiz:manage
        - quiz:list
        - stats:list
        - area:add
        - area:list
        - contact:list
        - contact:add
        - contact:delete
        - contact:import
        - disposition:save
        - location:add
        - location:manage
        - tag:manage
        - attachment:manage
        - attachment:list
        - event:read
        - event:save
        - event:delete
        - event:import
        - event:manage
        - availability:list
        - availability:update
        - availability:manage
        - pitch:record
        - pitch:delete
        - evaluation:add
        - evaluation:delete
        - evaluation:list
        - message:archive
        - message:delete
        - message:send
        - message:send:group
        - plan:add
        - plan:delete
        - plan:list
        - plan:manage
        - widget:manage
        - widget:list
        - dashboard:manage
        - dashboard:list
        - program:manage
        - program:list
        - question:manage
        - task:list
        - task:update
        - task:manage
        - task:import
        - team:add
        - team:list
        - team:update
        - team:archive
        - role:manage
        - role:list
        - user:import
        - user:login
        - user:list
        - user:add
        - user:manage
        - user:update
        - user:developer
        - admin:assign
        - game:list
        - game:save
        - rubric:list
        - rubric:manage
        - conversation:manage
        - conversation:list
        - compliance:manage
        - externalLink:manage
        - externalLink:list
        - view:manage
        - shorts:manage
    __schema1026:
      type: string
    __schema1027:
      type: string
    __schema1028:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema1029"
    __schema1029:
      type: string
    __schema1030:
      description: URL to the privacy policy. Required for marketplace publication.
      $ref: "#/components/schemas/__schema1031"
    __schema1031:
      type: string
    __schema1032:
      description: URL to the terms of service. Required for marketplace publication.
      $ref: "#/components/schemas/__schema1033"
    __schema1033:
      type: string
    __schema1034:
      description: Current marketplace validation/review state. Defaults to "none"
        until the owner submits.
      $ref: "#/components/schemas/__schema1035"
    __schema1035:
      type: string
      enum:
        - none
        - pending
        - approved
        - rejected
    __schema1036:
      description: Optional note from the reviewer (typically a rejection reason).
      $ref: "#/components/schemas/__schema1037"
    __schema1037:
      type: string
    __schema1038:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema1039:
      $ref: "#/components/schemas/userId"
    __schema1040:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema1041:
      $ref: "#/components/schemas/userId"
    __schema1042:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        name:
          $ref: "#/components/schemas/__schema1014"
        description:
          $ref: "#/components/schemas/__schema1015"
        documentation:
          $ref: "#/components/schemas/__schema1017"
        appId:
          $ref: "#/components/schemas/AppId"
        companyId:
          $ref: "#/components/schemas/companyId"
        company:
          $ref: "#/components/schemas/__schema1019"
        status:
          $ref: "#/components/schemas/__schema1021"
        currentVersion:
          $ref: "#/components/schemas/__schema1022"
        permissions:
          $ref: "#/components/schemas/__schema1024"
        avatarUrl:
          $ref: "#/components/schemas/appAvatarUrlOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/appAvatarBlurhashOutput"
        uploadAvatarUrl:
          $ref: "#/components/schemas/__schema1028"
        privacyPolicy:
          $ref: "#/components/schemas/__schema1030"
        termsOfService:
          $ref: "#/components/schemas/__schema1032"
        validationStatus:
          $ref: "#/components/schemas/__schema1034"
        validationNote:
          $ref: "#/components/schemas/__schema1036"
        submittedAt:
          $ref: "#/components/schemas/__schema1038"
        submittedBy:
          $ref: "#/components/schemas/__schema1039"
        reviewedAt:
          $ref: "#/components/schemas/__schema1040"
        reviewedBy:
          $ref: "#/components/schemas/__schema1041"
      required:
        - name
        - appId
        - companyId
        - permissions
      additionalProperties: false
    __schema1043:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        appId:
          $ref: "#/components/schemas/__schema1044"
        appVersion:
          $ref: "#/components/schemas/__schema1045"
        status:
          $ref: "#/components/schemas/__schema1046"
        changelog:
          $ref: "#/components/schemas/__schema1047"
        permissions:
          $ref: "#/components/schemas/__schema1049"
        cache:
          $ref: "#/components/schemas/__schema1050"
        deployedAt:
          $ref: "#/components/schemas/__schema1051"
        versionId:
          $ref: "#/components/schemas/AppVersionId"
      required:
        - appId
        - appVersion
        - versionId
      additionalProperties: false
    __schema1044:
      $ref: "#/components/schemas/AppId"
    __schema1045:
      $ref: "#/components/schemas/__schema1023"
    __schema1046:
      type: string
      enum:
        - draft
        - deployed
        - deprecated
    __schema1047:
      description: Markdown description of what changed
      $ref: "#/components/schemas/__schema1048"
    __schema1048:
      type: string
      maxLength: 10000
    __schema1049:
      type: array
      items:
        $ref: "#/components/schemas/__schema1025"
    __schema1050:
      type: object
      properties:
        enabled:
          type: boolean
        ttlSeconds:
          type: number
      required:
        - enabled
        - ttlSeconds
      additionalProperties: false
    __schema1051:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema1052:
      type: object
      properties:
        id:
          description: Unique identifier for this log event.
          $ref: "#/components/schemas/__schema1053"
        timestamp:
          type: number
          description: Event timestamp in UTC epoch milliseconds.
        message:
          type: string
          description: Log event message.
        ingestionTime:
          description: Ingestion time in UTC epoch milliseconds.
          $ref: "#/components/schemas/__schema1054"
        logStreamName:
          description: Name of the log stream the event came from.
          $ref: "#/components/schemas/__schema1055"
        requestId:
          description: AWS Lambda request ID for the invocation this event belongs to.
          $ref: "#/components/schemas/__schema1056"
        companyId:
          description: Company the run belonged to, when known.
          $ref: "#/components/schemas/companyId"
      required:
        - timestamp
        - message
      additionalProperties: false
    __schema1053:
      type: string
    __schema1054:
      type: number
    __schema1055:
      type: string
    __schema1056:
      type: string
    __schema1057:
      type: string
    __schema1058:
      allOf:
        - type: object
          properties:
            modifiedBy:
              $ref: "#/components/schemas/__schema807"
            createdAt:
              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
            createdBy:
              $ref: "#/components/schemas/auditPropsCreatedBy"
            updatedAt:
              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
            updatedBy:
              $ref: "#/components/schemas/auditPropsUpdatedBy"
            lastUpdateProcess:
              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
            version:
              $ref: "#/components/schemas/auditPropsVersionOutput"
            isDeleted:
              $ref: "#/components/schemas/isDeletedOutput"
            scriptId:
              $ref: "#/components/schemas/AppScriptId"
          required:
            - scriptId
          additionalProperties: false
        - oneOf:
            - type: object
              properties:
                appId:
                  $ref: "#/components/schemas/AppId"
                appVersion:
                  $ref: "#/components/schemas/__schema1023"
                name:
                  $ref: "#/components/schemas/__schema1059"
                description:
                  $ref: "#/components/schemas/__schema1060"
                configSchema:
                  $ref: "#/components/schemas/__schema1062"
                authSchema:
                  $ref: "#/components/schemas/__schema1069"
                runtime:
                  $ref: "#/components/schemas/__schema1070"
                permissions:
                  $ref: "#/components/schemas/__schema1071"
                slug:
                  $ref: "#/components/schemas/__schema1072"
                type:
                  type: string
                  enum:
                    - incoming
              required:
                - appId
                - appVersion
                - name
                - configSchema
                - authSchema
                - permissions
                - type
              additionalProperties: false
            - type: object
              properties:
                appId:
                  $ref: "#/components/schemas/AppId"
                appVersion:
                  $ref: "#/components/schemas/__schema1023"
                name:
                  $ref: "#/components/schemas/__schema1059"
                description:
                  $ref: "#/components/schemas/__schema1060"
                configSchema:
                  $ref: "#/components/schemas/__schema1062"
                authSchema:
                  $ref: "#/components/schemas/__schema1069"
                runtime:
                  $ref: "#/components/schemas/__schema1070"
                permissions:
                  $ref: "#/components/schemas/__schema1071"
                slug:
                  $ref: "#/components/schemas/__schema1072"
                type:
                  type: string
                  enum:
                    - outgoing
                dataType:
                  type: string
                  enum:
                    - Account
                    - Company
                    - User
                    - Event
                    - Screenshot
              required:
                - appId
                - appVersion
                - name
                - configSchema
                - authSchema
                - permissions
                - type
                - dataType
              additionalProperties: false
            - type: object
              properties:
                appId:
                  $ref: "#/components/schemas/AppId"
                appVersion:
                  $ref: "#/components/schemas/__schema1023"
                name:
                  $ref: "#/components/schemas/__schema1059"
                description:
                  $ref: "#/components/schemas/__schema1060"
                configSchema:
                  $ref: "#/components/schemas/__schema1062"
                authSchema:
                  $ref: "#/components/schemas/__schema1069"
                runtime:
                  $ref: "#/components/schemas/__schema1070"
                permissions:
                  $ref: "#/components/schemas/__schema1071"
                slug:
                  $ref: "#/components/schemas/__schema1072"
                type:
                  type: string
                  enum:
                    - scheduled
                cron:
                  type: string
              required:
                - appId
                - appVersion
                - name
                - configSchema
                - authSchema
                - permissions
                - type
                - cron
              additionalProperties: false
          type: object
    __schema1059:
      type: string
    __schema1060:
      description: Markdown instructions on how to configure the script
      $ref: "#/components/schemas/__schema1061"
    __schema1061:
      type: string
      maxLength: 10000
    __schema1062:
      type: array
      items:
        type: object
        properties:
          name:
            $ref: "#/components/schemas/__schema1063"
          type:
            $ref: "#/components/schemas/__schema1064"
          description:
            $ref: "#/components/schemas/__schema1065"
          dataType:
            $ref: "#/components/schemas/__schema1066"
          customFieldAccess:
            $ref: "#/components/schemas/__schema1067"
        required:
          - name
          - type
        additionalProperties: false
    __schema1063:
      type: string
    __schema1064:
      type: string
      enum:
        - string
        - number
        - mapping
    __schema1065:
      type: string
    __schema1066:
      type: string
      enum:
        - None
        - Account
        - User
        - Event
    __schema1067:
      description: Marks a string field whose value is an account custom field ID, and
        the access the app needs to that field. An install grants it only when
        the user who saves the install can view the field (read) or view and
        edit it (write).
      $ref: "#/components/schemas/__schema1068"
    __schema1068:
      type: string
      enum:
        - read
        - write
    __schema1069:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        anyOf:
          - type: string
          - type: object
            properties:
              description:
                type: string
              mapping:
                type: boolean
            required:
              - description
            additionalProperties: false
    __schema1070:
      type: string
    __schema1071:
      type: array
      items:
        $ref: "#/components/schemas/__schema1025"
    __schema1072:
      description: Stable public key used in incoming webhook URLs. Generated on
        create when omitted.
      $ref: "#/components/schemas/__schema1073"
    __schema1073:
      type: string
    __schema1074:
      type: object
      properties:
        pk:
          type: string
          deprecated: true
        sk:
          type: string
          deprecated: true
        locationId:
          $ref: "#/components/schemas/locationIdOutput"
        disposition:
          $ref: "#/components/schemas/__schema907"
        latitude:
          description: latitude of the device location
          $ref: "#/components/schemas/latitude"
        longitude:
          description: longitude of the device location
          $ref: "#/components/schemas/longitude"
        pitch:
          description: does this contact qualify as a pitch, leave blank to use the
            disposition's default
          $ref: "#/components/schemas/__schema1075"
        method:
          $ref: "#/components/schemas/contactMethod"
        contactDate:
          type: number
        contactDay:
          type: string
          description: ISO 8601 string
        source:
          type: string
        importId:
          type: string
        contactId:
          $ref: "#/components/schemas/__schema1076"
        teamId:
          $ref: "#/components/schemas/teamId"
        pitchErrors:
          type: array
          items:
            type: string
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        setterId:
          $ref: "#/components/schemas/userId"
        setter:
          $ref: "#/components/schemas/tinyUserOutput"
        line1:
          type: string
        line2:
          type: string
        locationCoordinates:
          description: The coordinates of the location
          $ref: "#/components/schemas/latlngOutput"
        distanceFromProperty:
          type: number
      required:
        - pk
        - sk
        - locationId
        - disposition
        - latitude
        - longitude
        - contactDate
        - contactDay
        - contactId
        - setterId
        - line1
        - line2
      additionalProperties: false
    __schema1075:
      type: boolean
    __schema1076:
      anyOf:
        - $ref: "#/components/schemas/ContactId"
        - type: string
          pattern: ^[\s\S]{0,}(\|)[\s\S]{0,}$
    __schema1077:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/responseSuccessType"
        customField:
          $ref: "#/components/schemas/__schema1078"
      required:
        - type
        - customField
      additionalProperties: false
    __schema1078:
      allOf:
        - oneOf:
            - type: object
              properties:
                tableType:
                  $ref: "#/components/schemas/__schema1079"
                statusId:
                  $ref: "#/components/schemas/__schema1080"
                workflowStageId:
                  $ref: "#/components/schemas/__schema1081"
                workflowIds:
                  $ref: "#/components/schemas/__schema1082"
                label:
                  $ref: "#/components/schemas/__schema1083"
                description:
                  $ref: "#/components/schemas/__schema1084"
                short:
                  $ref: "#/components/schemas/__schema1085"
                required:
                  $ref: "#/components/schemas/__schema1086"
                format:
                  $ref: "#/components/schemas/__schema1087"
                viewRoleIds:
                  $ref: "#/components/schemas/__schema1092"
                editRoleIds:
                  $ref: "#/components/schemas/__schema1093"
                order:
                  $ref: "#/components/schemas/__schema1094"
                allowMultiple:
                  $ref: "#/components/schemas/__schema1095"
                fieldType:
                  type: string
                  enum:
                    - number
                    - string
                    - boolean
                    - date
                    - url
              required:
                - tableType
                - label
                - fieldType
              additionalProperties: false
            - type: object
              properties:
                tableType:
                  $ref: "#/components/schemas/__schema1079"
                statusId:
                  $ref: "#/components/schemas/__schema1080"
                workflowStageId:
                  $ref: "#/components/schemas/__schema1081"
                workflowIds:
                  $ref: "#/components/schemas/__schema1082"
                label:
                  $ref: "#/components/schemas/__schema1083"
                description:
                  $ref: "#/components/schemas/__schema1084"
                short:
                  $ref: "#/components/schemas/__schema1085"
                required:
                  $ref: "#/components/schemas/__schema1086"
                format:
                  $ref: "#/components/schemas/__schema1087"
                viewRoleIds:
                  $ref: "#/components/schemas/__schema1092"
                editRoleIds:
                  $ref: "#/components/schemas/__schema1093"
                order:
                  $ref: "#/components/schemas/__schema1094"
                allowMultiple:
                  $ref: "#/components/schemas/__schema1095"
                fieldType:
                  type: string
                  enum:
                    - calculation
                calculation:
                  oneOf:
                    - type: object
                      properties:
                        operation:
                          type: string
                          const: multiplication
                        params:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1096"
                      required:
                        - operation
                        - params
                      additionalProperties: false
                    - type: object
                      properties:
                        operation:
                          type: string
                          const: addition
                        params:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1096"
                      required:
                        - operation
                        - params
                      additionalProperties: false
                    - type: object
                      properties:
                        operation:
                          type: string
                          const: division
                        dividend:
                          $ref: "#/components/schemas/__schema1096"
                        divisor:
                          $ref: "#/components/schemas/__schema1096"
                      required:
                        - operation
                        - dividend
                        - divisor
                      additionalProperties: false
                    - type: object
                      properties:
                        operation:
                          type: string
                          const: subtraction
                        minuend:
                          $ref: "#/components/schemas/__schema1096"
                        subtrahend:
                          $ref: "#/components/schemas/__schema1096"
                      required:
                        - operation
                        - minuend
                        - subtrahend
                      additionalProperties: false
                  type: object
              required:
                - tableType
                - label
                - fieldType
                - calculation
              additionalProperties: false
            - type: object
              properties:
                tableType:
                  $ref: "#/components/schemas/__schema1079"
                statusId:
                  $ref: "#/components/schemas/__schema1080"
                workflowStageId:
                  $ref: "#/components/schemas/__schema1081"
                workflowIds:
                  $ref: "#/components/schemas/__schema1082"
                label:
                  $ref: "#/components/schemas/__schema1083"
                description:
                  $ref: "#/components/schemas/__schema1084"
                short:
                  $ref: "#/components/schemas/__schema1085"
                required:
                  $ref: "#/components/schemas/__schema1086"
                format:
                  $ref: "#/components/schemas/__schema1087"
                viewRoleIds:
                  $ref: "#/components/schemas/__schema1092"
                editRoleIds:
                  $ref: "#/components/schemas/__schema1093"
                order:
                  $ref: "#/components/schemas/__schema1094"
                allowMultiple:
                  type: boolean
                fieldType:
                  type: string
                  enum:
                    - attachment
              required:
                - tableType
                - label
                - fieldType
              additionalProperties: false
            - type: object
              properties:
                tableType:
                  $ref: "#/components/schemas/__schema1079"
                statusId:
                  $ref: "#/components/schemas/__schema1080"
                workflowStageId:
                  $ref: "#/components/schemas/__schema1081"
                workflowIds:
                  $ref: "#/components/schemas/__schema1082"
                label:
                  $ref: "#/components/schemas/__schema1083"
                description:
                  $ref: "#/components/schemas/__schema1084"
                short:
                  $ref: "#/components/schemas/__schema1085"
                required:
                  $ref: "#/components/schemas/__schema1086"
                format:
                  $ref: "#/components/schemas/__schema1087"
                viewRoleIds:
                  $ref: "#/components/schemas/__schema1092"
                editRoleIds:
                  $ref: "#/components/schemas/__schema1093"
                order:
                  $ref: "#/components/schemas/__schema1094"
                allowMultiple:
                  type: boolean
                fieldType:
                  type: string
                  enum:
                    - multipleChoice
                options:
                  type: array
                  items:
                    type: string
              required:
                - tableType
                - label
                - fieldType
                - options
              additionalProperties: false
          type: object
        - $ref: "#/components/schemas/__schema1097"
        - $ref: "#/components/schemas/__schema1098"
        - type: object
          properties:
            fieldId:
              $ref: "#/components/schemas/CFId"
          required:
            - fieldId
          additionalProperties: false
    __schema1079:
      type: string
      enum:
        - Account
        - Team
        - User
    __schema1080:
      $ref: "#/components/schemas/accountStatusId"
    __schema1081:
      $ref: "#/components/schemas/SId"
    __schema1082:
      type: array
      items:
        $ref: "#/components/schemas/WFId"
    __schema1083:
      type: string
    __schema1084:
      type: string
    __schema1085:
      type: string
    __schema1086:
      type: boolean
    __schema1087:
      $ref: "#/components/schemas/__schema1088"
    __schema1088:
      type: object
      properties:
        prefix:
          type: string
        suffix:
          type: string
        decimalPlaces:
          description: Number of decimal places, only applies to number fields, 0 by default
          $ref: "#/components/schemas/__schema1089"
        delimiter:
          description: Delimiter, only applies to number fields, "," by default
          $ref: "#/components/schemas/__schema1090"
        separator:
          description: Separator, only applies to number fields, "." by default
          $ref: "#/components/schemas/__schema1091"
      additionalProperties: false
    __schema1089:
      type: number
    __schema1090:
      type: string
    __schema1091:
      type: string
    __schema1092:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema1093:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema1094:
      type: number
    __schema1095:
      type: boolean
      const: false
    __schema1096:
      anyOf:
        - $ref: "#/components/schemas/CFId"
        - type: number
    __schema1097:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
      additionalProperties: false
    __schema1098:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
      additionalProperties: false
    __schema1099:
      type: string
    __schema1100:
      type: boolean
    __schema1101:
      type: boolean
    __schema1102:
      anyOf:
        - type: string
          enum:
            - plus
            - door-closed
            - clockcircle
            - hour-glass
            - not-interested
            - flag
            - comment-dots
            - home-floor-1
            - home-floor-2
            - home-floor-3
        - type: string
    __schema1103:
      type: boolean
    __schema1104:
      type: boolean
    __schema1105:
      type: boolean
    __schema1106:
      type: boolean
    __schema1107:
      type: boolean
    __schema1108:
      type: string
      enum:
        - eventDate
        - createdAt
    __schema1109:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        evaluationId:
          $ref: "#/components/schemas/EvalId"
        evalState:
          $ref: "#/components/schemas/evaluationEvalState"
        user:
          $ref: "#/components/schemas/tinyUserOutput"
        teamId:
          $ref: "#/components/schemas/evaluationTeamId"
        possible:
          $ref: "#/components/schemas/evaluationPossible"
        categories:
          type: array
          items:
            $ref: "#/components/schemas/__schema1110"
        selfAssessment:
          type: array
          items:
            $ref: "#/components/schemas/__schema1110"
        eventDate:
          $ref: "#/components/schemas/evaluationEventDateOutput"
        evaluator:
          $ref: "#/components/schemas/evaluationEvaluatorOutput"
        evalDate:
          $ref: "#/components/schemas/evaluationEvalDateOutput"
        score:
          $ref: "#/components/schemas/evaluationScoreOutput"
        comment:
          $ref: "#/components/schemas/evaluationCommentOutput"
        downloadUrl:
          $ref: "#/components/schemas/evaluationDownloadUrlOutput"
        uploadUrl:
          $ref: "#/components/schemas/evaluationUploadUrlOutput"
        locationId:
          $ref: "#/components/schemas/__schema1119"
        location:
          $ref: "#/components/schemas/__schema1120"
        accountId:
          $ref: "#/components/schemas/evaluationAccountId"
        feedback:
          type: array
          items:
            type: object
            properties:
              prompt:
                type: string
              feedback:
                type: string
            required:
              - prompt
              - feedback
            additionalProperties: false
      required:
        - evaluationId
        - evalState
        - user
        - possible
        - categories
      additionalProperties: false
    __schema1110:
      type: object
      properties:
        code:
          $ref: "#/components/schemas/__schema1111"
        title:
          type: string
        score:
          type: number
        possible:
          type: number
        comment:
          type: string
        questions:
          type: array
          items:
            type: object
            properties:
              code:
                $ref: "#/components/schemas/__schema1112"
              title:
                type: string
              score:
                type: number
              possible:
                type: number
              comment:
                type: string
            required:
              - code
              - title
              - score
              - possible
            additionalProperties: false
      required:
        - code
        - title
        - score
        - possible
        - questions
      additionalProperties: false
    __schema1111:
      type: string
      pattern: ^C:[\s\S]{0,}$
      description: "Terros ID: `C:` prefix followed by a unique suffix, e.g. `C:123-4aBc_d`"
      example: C:123-4aBc_d
    __schema1112:
      type: string
      pattern: ^Q:[\s\S]{0,}$
      description: "Terros ID: `Q:` prefix followed by a unique suffix, e.g. `Q:123-4aBc_d`"
      example: Q:123-4aBc_d
    __schema1113:
      type: number
    __schema1114:
      type: number
    __schema1115:
      type: number
    __schema1116:
      type: string
    __schema1117:
      type: string
    __schema1118:
      type: string
    __schema1119:
      description: The location ID where the pitch was recorded
      $ref: "#/components/schemas/locationIdOutput"
    __schema1120:
      type: object
      properties:
        locationId:
          $ref: "#/components/schemas/locationIdOutput"
        addressMasterId:
          $ref: "#/components/schemas/__schema1121"
        latlng:
          $ref: "#/components/schemas/latlngOutput"
        line1:
          $ref: "#/components/schemas/addressLine1"
        line2:
          $ref: "#/components/schemas/addressLine2"
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        locality:
          $ref: "#/components/schemas/addressLocality"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbrOutput"
        unitType:
          $ref: "#/components/schemas/addressUnitTypeOutput"
        residents:
          $ref: "#/components/schemas/__schema1123"
        addressParts:
          $ref: "#/components/schemas/__schema1126"
        altLatLngs:
          $ref: "#/components/schemas/__schema1127"
        titleOwners:
          $ref: "#/components/schemas/__schema1128"
      required:
        - locationId
        - latlng
        - line1
        - line2
        - countrySubd
        - locality
        - postal1
      additionalProperties: false
    __schema1121:
      description: Numeric ID of the matching property data record, when known
      $ref: "#/components/schemas/__schema1122"
    __schema1122:
      type: number
    __schema1123:
      type: array
      items:
        $ref: "#/components/schemas/__schema1124"
    __schema1124:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        name:
          type: string
        firstName:
          type: string
        middleName:
          type: string
        lastName:
          type: string
        suffix:
          type: string
        prefix:
          type: string
        type:
          type: string
          enum:
            - Owner
            - Renter
            - Dependent
        gender:
          type: string
          enum:
            - M
            - F
            - O
        email:
          type: string
        phone:
          type: string
        favorite:
          type: boolean
        checked:
          type: boolean
        fields:
          type: array
          items:
            $ref: "#/components/schemas/__schema1125"
        age:
          $ref: "#/components/schemas/__schema879"
        creditScore:
          $ref: "#/components/schemas/__schema880"
        hasAge:
          $ref: "#/components/schemas/__schema881"
        hasCreditScore:
          $ref: "#/components/schemas/__schema882"
      required:
        - name
      additionalProperties: false
    __schema1125:
      type: object
      properties:
        field:
          type: string
        value:
          type: string
      required:
        - field
        - value
      additionalProperties: false
    __schema1126:
      type: object
      properties:
        street:
          type: string
        streetNumber:
          type: string
        streetType:
          type: string
        unitType:
          type: string
        unitNumber:
          type: string
        preDirectional:
          type: string
        postDirectional:
          type: string
      additionalProperties: false
    __schema1127:
      type: array
      items:
        type: object
        properties:
          latitude:
            $ref: "#/components/schemas/latitude"
          longitude:
            $ref: "#/components/schemas/longitude"
          source:
            type: string
        required:
          - latitude
          - longitude
          - source
        additionalProperties: false
    __schema1128:
      type: array
      items:
        $ref: "#/components/schemas/__schema1124"
    __schema1129:
      type: object
      properties:
        name:
          description: Optional user-defined name for the export
          $ref: "#/components/schemas/__schema1130"
        type:
          type: string
          enum:
            - CalendarEvent
            - Account
            - User
            - Task
            - Activity
          description: Supported entities for export
        format:
          default: json
          description: Format of the export files. `json` writes each file as one JSON
            array of records. `jsonl` (JSON Lines) writes one JSON object per
            line with no surrounding array, which is easier to stream. `csv`
            writes a header row followed by one row per record.
          $ref: "#/components/schemas/__schema1131"
        compression:
          description: Compression method for the export file
          $ref: "#/components/schemas/__schema1132"
        range:
          description: Optional date range for the export. If not provided, the entire
            data set will be exported
          $ref: "#/components/schemas/__schema1133"
        filter:
          type: object
          properties:
            areaIds:
              description: Filter account export to the specified areas
              $ref: "#/components/schemas/__schema1134"
            areaCoordinates:
              description: Filter account export to accounts within these area boundaries
              $ref: "#/components/schemas/__schema1135"
            workflowId:
              description: Filter accounts by the specified workflow ID
              $ref: "#/components/schemas/WFId"
            teamIds:
              description: Filter exported data to these teams (set by downline scope)
              $ref: "#/components/schemas/__schema1136"
            userIds:
              description: Filter exported activity/contact data to these users
              $ref: "#/components/schemas/__schema1137"
            workflowActionIds:
              description: Filter workflow activity export to these action IDs
              $ref: "#/components/schemas/__schema1138"
            cities:
              description: Filter workflow activity export to these cities
              $ref: "#/components/schemas/__schema1139"
            states:
              description: Filter workflow activity export to these states
              $ref: "#/components/schemas/__schema1140"
            zipCodes:
              description: Filter workflow activity export to these ZIP codes
              $ref: "#/components/schemas/__schema1141"
            dispositionIds:
              description: Filter legacy contact activity export to these disposition IDs
              $ref: "#/components/schemas/__schema1142"
            statusIds:
              description: Filter account export to these statuses
              $ref: "#/components/schemas/__schema1143"
            stageIds:
              description: Filter account export to these workflow stages
              $ref: "#/components/schemas/__schema1144"
            searchByCurrentStage:
              description: Whether to filter account export to only accounts currently in the
                selected stages, rather than accounts that ever passed through
                them. The default value is true
              $ref: "#/components/schemas/__schema1145"
            roleIds:
              description: Filter exported users, or account owners/closers, to these roles
              $ref: "#/components/schemas/__schema1146"
            coordinates:
              description: Filter account export to accounts within this polygon
              $ref: "#/components/schemas/__schema1147"
            advancedCustomFields:
              description: Filter account export to these custom field values
              $ref: "#/components/schemas/__schema951"
          additionalProperties: false
        fields:
          description: >-
            Optional list of field keys to include in the export (standard field
            keys or custom field IDs). Only supported for the Account export
            type. If omitted, all fields are included.


            Account exports can also include these fields. They are enabled per
            company on request; contact Terros support to turn them on. For
            companies without them enabled, requesting one of these keys is
            accepted but the field is left out of the export.


            - `lastModifiedBy`: user ID of the most recent modifier of the
            account

            - `updatedAt`: when the account was last updated, in UTC
            milliseconds

            - `lastUpdateProcess`: name of the process that last updated the
            account. This value is informational and is subject to change
            without notice; do not build logic that depends on specific values.

            - `importId`: ID of the import that created the account

            - `ownerHistory`: history of account owners, in the same shape as
            the Account API

            - `teamHistory`: history of account teams, in the same shape as the
            Account API

            - `workflowHistory`: when enabled, selecting `workflowHistory` (or
            omitting `fields`) also includes the workflow stages and actions the
            account has progressed through, in the same shape as the Account API


            In CSV files these columns come after any status, stage, and custom
            field columns, so existing column positions do not change. Array
            values are written as a JSON string in a single cell.
          $ref: "#/components/schemas/__schema1148"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        exportId:
          $ref: "#/components/schemas/ExportId"
        companyId:
          type: string
          pattern: ^C((\.)|(:))[\s\S]{0,}$
          description: ID of the company for which the export is created
          example: C.123-4aBc_d
          $ref: "#/components/schemas/companyId"
        ownerId:
          description: User who created the export
          $ref: "#/components/schemas/userId"
        total:
          type: number
          description: Total number of records included in the export
        processed:
          type: number
          description: Number of records processed so far in the export
        expiresAt:
          description: Timestamp when the export will expire and be deleted
          $ref: "#/components/schemas/utcSeconds"
        status:
          default: New
          description: "Export status: `New` (queued), `Processing`, `Completed` (files
            ready for /export/download) or `Failed`"
          $ref: "#/components/schemas/__schema1150"
      required:
        - type
        - format
        - filter
        - exportId
        - companyId
        - total
        - processed
        - status
      additionalProperties: false
    __schema1130:
      type: string
      maxLength: 256
    __schema1131:
      type: string
      enum:
        - json
        - csv
        - jsonl
    __schema1132:
      default: none
      type: string
      enum:
        - gzip
        - none
    __schema1133:
      type: object
      properties:
        startTime:
          type: number
          exclusiveMinimum: 0
          description: Start of the range, in UTC epoch milliseconds
        endTime:
          type: number
          exclusiveMinimum: 0
          description: End of the range, in UTC epoch milliseconds
      required:
        - startTime
        - endTime
      additionalProperties: false
    __schema1134:
      type: array
      items:
        $ref: "#/components/schemas/AreaId"
    __schema1135:
      type: array
      items:
        minItems: 3
        type: array
        items:
          $ref: "#/components/schemas/latlngOutput"
    __schema1136:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema1137:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema1138:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema1139:
      type: array
      items:
        type: string
    __schema1140:
      type: array
      items:
        type: string
    __schema1141:
      type: array
      items:
        type: string
    __schema1142:
      type: array
      items:
        $ref: "#/components/schemas/__schema907"
    __schema1143:
      type: array
      items:
        $ref: "#/components/schemas/accountStatusId"
    __schema1144:
      type: array
      items:
        $ref: "#/components/schemas/SId"
    __schema1145:
      type: boolean
    __schema1146:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema1147:
      type: array
      items:
        $ref: "#/components/schemas/latlngOutput"
    __schema1148:
      type: array
      items:
        type: string
    __schema1149:
      type: integer
      minimum: 0
      maximum: 8640000000000
    __schema1150:
      type: string
      enum:
        - New
        - Processing
        - Completed
        - Failed
    __schema1151:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        url:
          type: string
        label:
          type: string
        description:
          type: string
        icon:
          type: string
        color:
          type: string
        scopeId:
          anyOf:
            - $ref: "#/components/schemas/companyId"
            - $ref: "#/components/schemas/teamId"
        order:
          type: number
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        externalLinkId:
          $ref: "#/components/schemas/ExternalLinkId"
        userId:
          $ref: "#/components/schemas/userId"
        companyId:
          $ref: "#/components/schemas/companyId"
      required:
        - url
        - label
        - scopeId
        - order
        - externalLinkId
        - userId
        - companyId
      additionalProperties: false
    __schema1152:
      allOf:
        - oneOf:
            - type: object
              properties:
                gameId:
                  $ref: "#/components/schemas/__schema1153"
                timezone:
                  $ref: "#/components/schemas/__schema1154"
                name:
                  $ref: "#/components/schemas/__schema1155"
                startDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                endDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                announceDate:
                  $ref: "#/components/schemas/__schema1156"
                status:
                  $ref: "#/components/schemas/__schema1157"
                tagline:
                  $ref: "#/components/schemas/__schema1158"
                description:
                  $ref: "#/components/schemas/__schema1160"
                color:
                  $ref: "#/components/schemas/__schema1161"
                awards:
                  $ref: "#/components/schemas/__schema1162"
                criteria:
                  $ref: "#/components/schemas/__schema1163"
                seedingCriteria:
                  $ref: "#/components/schemas/__schema1175"
                settings:
                  $ref: "#/components/schemas/__schema1177"
                terms:
                  $ref: "#/components/schemas/__schema1185"
                gameType:
                  type: string
                  enum:
                    - ladder
                tiebreakers:
                  $ref: "#/components/schemas/__schema1191"
              required:
                - name
                - startDate
                - endDate
                - status
                - awards
                - criteria
                - settings
                - gameType
              additionalProperties: false
            - type: object
              properties:
                gameId:
                  $ref: "#/components/schemas/__schema1153"
                timezone:
                  $ref: "#/components/schemas/__schema1154"
                name:
                  $ref: "#/components/schemas/__schema1155"
                startDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                endDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                announceDate:
                  $ref: "#/components/schemas/__schema1156"
                status:
                  $ref: "#/components/schemas/__schema1157"
                tagline:
                  $ref: "#/components/schemas/__schema1158"
                description:
                  $ref: "#/components/schemas/__schema1160"
                color:
                  $ref: "#/components/schemas/__schema1161"
                awards:
                  $ref: "#/components/schemas/__schema1162"
                criteria:
                  $ref: "#/components/schemas/__schema1163"
                seedingCriteria:
                  $ref: "#/components/schemas/__schema1175"
                settings:
                  $ref: "#/components/schemas/__schema1177"
                terms:
                  $ref: "#/components/schemas/__schema1185"
                gameType:
                  type: string
                  enum:
                    - raffle
                winnersDrawn:
                  description: Whether the winners have been drawn on the frontend
                  $ref: "#/components/schemas/__schema1194"
              required:
                - name
                - startDate
                - endDate
                - status
                - awards
                - criteria
                - settings
                - gameType
              additionalProperties: false
            - type: object
              properties:
                gameId:
                  $ref: "#/components/schemas/__schema1153"
                timezone:
                  $ref: "#/components/schemas/__schema1154"
                name:
                  $ref: "#/components/schemas/__schema1155"
                startDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                endDate:
                  $ref: "#/components/schemas/utcMillisecondsOutput"
                announceDate:
                  $ref: "#/components/schemas/__schema1156"
                status:
                  $ref: "#/components/schemas/__schema1157"
                tagline:
                  $ref: "#/components/schemas/__schema1158"
                description:
                  $ref: "#/components/schemas/__schema1160"
                color:
                  $ref: "#/components/schemas/__schema1161"
                awards:
                  $ref: "#/components/schemas/__schema1162"
                criteria:
                  $ref: "#/components/schemas/__schema1163"
                seedingCriteria:
                  $ref: "#/components/schemas/__schema1175"
                settings:
                  $ref: "#/components/schemas/__schema1177"
                terms:
                  $ref: "#/components/schemas/__schema1185"
                gameType:
                  type: string
                  enum:
                    - bracket
                rounds:
                  type: array
                  items:
                    type: object
                    properties:
                      round:
                        type: number
                        minimum: 0
                        description: The round number
                      startDate:
                        description: The start date of the round
                        $ref: "#/components/schemas/utcMillisecondsOutput"
                      endDate:
                        description: The end date of the round
                        $ref: "#/components/schemas/utcMillisecondsOutput"
                      matches:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema1195"
                        description: The games in the round
                    required:
                      - round
                      - startDate
                      - endDate
                      - matches
                    additionalProperties: false
                tiebreakers:
                  $ref: "#/components/schemas/__schema1191"
              required:
                - name
                - startDate
                - endDate
                - status
                - awards
                - criteria
                - settings
                - gameType
                - rounds
              additionalProperties: false
          type: object
        - type: object
          properties:
            gameId:
              $ref: "#/components/schemas/GameId"
            companyId:
              $ref: "#/components/schemas/companyId"
            ownerId:
              $ref: "#/components/schemas/userId"
            currentRound:
              type: number
              minimum: 0
              description: The current round of the game
            cover:
              type: object
              properties:
                blurhash:
                  type: string
                download:
                  type: string
                upload:
                  description: present when `includeUploadUrls` is true or omitted (for now) and
                    the caller can edit this entity; presigned PUT URL, expires
                    in about 1h
                  $ref: "#/components/schemas/__schema1201"
              additionalProperties: false
            video:
              type: object
              properties:
                videoId:
                  $ref: "#/components/schemas/__schema1202"
              required:
                - videoId
              additionalProperties: false
            failReason:
              description: If the game failed a schedule worker, this field will contain the
                reason
              $ref: "#/components/schemas/__schema1203"
          required:
            - gameId
            - companyId
            - ownerId
            - currentRound
          additionalProperties: false
        - $ref: "#/components/schemas/__schema1097"
        - $ref: "#/components/schemas/__schema1098"
    __schema1153:
      $ref: "#/components/schemas/GameId"
    __schema1154:
      type: string
    __schema1155:
      type: string
      minLength: 1
    __schema1156:
      description: optional date by which to reveal/announce the competition to all
        competitors
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema1157:
      type: string
      enum:
        - draft
        - published
        - active
        - finished
    __schema1158:
      description: short catch phrase for the game
      $ref: "#/components/schemas/__schema1159"
    __schema1159:
      type: string
    __schema1160:
      type: string
    __schema1161:
      type: string
    __schema1162:
      type: array
      items:
        type: object
        properties:
          place:
            type: number
          type:
            type: string
            enum:
              - pick
              - all
          prizes:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                prizeId:
                  $ref: "#/components/schemas/PrizeId"
                download:
                  type: string
                url:
                  anyOf:
                    - type: string
                      format: uri
                    - type: string
                      const: ""
                description:
                  type: string
              required:
                - name
                - prizeId
              additionalProperties: false
        required:
          - place
          - prizes
        additionalProperties: false
    __schema1163:
      type: array
      items:
        $ref: "#/components/schemas/__schema1164"
    __schema1164:
      allOf:
        - type: object
          properties:
            pointsPerMetric:
              type: number
            qualifiers:
              type: array
              items:
                allOf:
                  - type: object
                    properties:
                      minPercent:
                        type: number
                        exclusiveMinimum: 0
                        maximum: 1
                    required:
                      - minPercent
                    additionalProperties: false
                  - $ref: "#/components/schemas/__schema1165"
            boostMultiplier:
              type: object
              properties:
                days:
                  type: array
                  items:
                    anyOf:
                      - type: number
                        const: 1
                      - type: number
                        const: 2
                      - type: number
                        const: 3
                      - type: number
                        const: 4
                      - type: number
                        const: 5
                      - type: number
                        const: 6
                      - type: number
                        const: 7
                multiplier:
                  type: number
              required:
                - days
                - multiplier
              additionalProperties: false
          required:
            - pointsPerMetric
          additionalProperties: false
        - $ref: "#/components/schemas/__schema1165"
    __schema1165:
      anyOf:
        - oneOf:
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1167"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1168"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1169"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1170"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
          type: object
        - anyOf:
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1171"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/__schema1172"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  anyOf:
                    - $ref: "#/components/schemas/__schema1173"
                    - $ref: "#/components/schemas/__schema1174"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1166"
                field:
                  $ref: "#/components/schemas/RatioId"
                type:
                  type: string
                  const: exists
              required:
                - name
                - field
                - type
              additionalProperties: false
    __schema1166:
      type: string
    __schema1167:
      type: string
      enum:
        - contact.pitch
        - contact.pitches
    __schema1168:
      type: string
      const: contact.daysWorked
    __schema1169:
      type: string
      enum:
        - meeting.checkin
        - meetingAttendance.count
    __schema1170:
      type: string
      enum:
        - conversation.averageScore
        - conversation.count
        - conversation.activeHours
    __schema1171:
      anyOf:
        - $ref: "#/components/schemas/accountStatusId"
        - type: string
          pattern: ^(setter|closer)\.AS\.[\s\S]{0,}\.(count)$
    __schema1172:
      anyOf:
        - $ref: "#/components/schemas/CFId"
        - type: string
          pattern: ^cf\|(setter|closer)\|(count)\|CF\.[\s\S]{0,}\|(AS\.[\s\S]{0,}|S\.[\s\S]{0,}|(createdDate))$
    __schema1173:
      type: string
      pattern: ^(setter|closer)\|S\.[\s\S]{0,}\|(count)$
    __schema1174:
      type: string
      pattern: ^(account|actor|setter|closer)\|S\.[\s\S]{0,}\|((count|lastDate|avgPerDay|avgPerWeek|teamAvgPerDay|teamAvgPerWeek|avgStartOfDay|avgEndOfDay)|S\.[\s\S]{0,}|daysSince\|-?\d+(?:\.\d+)?)$
    __schema1175:
      description: criteria to use for seeding, only applicable for bracket games
      $ref: "#/components/schemas/__schema1176"
    __schema1176:
      type: array
      items:
        $ref: "#/components/schemas/__schema1164"
    __schema1177:
      anyOf:
        - type: object
          properties:
            timeBetweenRounds:
              $ref: "#/components/schemas/__schema1178"
            seedingType:
              $ref: "#/components/schemas/__schema1180"
            bracketSize:
              $ref: "#/components/schemas/__schema1182"
            participantType:
              type: string
              enum:
                - group
            scoringPattern:
              type: string
              enum:
                - sum
                - average
            useInitialGroupSize:
              description: Whether to use the initial group size for average scoring
              $ref: "#/components/schemas/__schema1184"
          required:
            - participantType
            - scoringPattern
          additionalProperties: false
        - type: object
          properties:
            timeBetweenRounds:
              $ref: "#/components/schemas/__schema1178"
            seedingType:
              $ref: "#/components/schemas/__schema1180"
            bracketSize:
              $ref: "#/components/schemas/__schema1182"
            participantType:
              type: string
              enum:
                - user
          required:
            - participantType
          additionalProperties: false
    __schema1178:
      description: time between rounds for bracket games in days
      $ref: "#/components/schemas/__schema1179"
    __schema1179:
      type: number
      minimum: 0
    __schema1180:
      description: "standard: seed participants by a preliminary round"
      $ref: "#/components/schemas/__schema1181"
    __schema1181:
      type: string
      enum:
        - standard
        - historical
    __schema1182:
      description: The number of participants that should advance to the bracket
        rounds if seeding type is standard
      $ref: "#/components/schemas/__schema1183"
    __schema1183:
      type: integer
      minimum: 2
      maximum: 9007199254740991
    __schema1184:
      type: boolean
    __schema1185:
      anyOf:
        - type: string
        - type: object
          properties:
            type:
              type: string
              const: doc
            content:
              type: array
              items:
                anyOf:
                  - $ref: "#/components/schemas/__schema1186"
                  - $ref: "#/components/schemas/__schema1188"
                  - $ref: "#/components/schemas/__schema1189"
                  - type: object
                    properties:
                      type:
                        type: string
                        const: heading
                      attrs:
                        type: object
                        properties:
                          level:
                            type: integer
                            minimum: 1
                            maximum: 6
                        required:
                          - level
                        additionalProperties: false
                      content:
                        type: array
                        items:
                          $ref: "#/components/schemas/__schema1190"
                    required:
                      - type
                      - attrs
                      - content
                    additionalProperties: false
          required:
            - type
            - content
          additionalProperties: false
    __schema1186:
      type: object
      properties:
        type:
          type: string
          const: bulletList
        content:
          type: array
          items:
            $ref: "#/components/schemas/__schema1187"
      required:
        - type
        - content
      additionalProperties: false
    __schema1187:
      type: object
      properties:
        type:
          type: string
          const: listItem
        content:
          type: array
          items:
            anyOf:
              - $ref: "#/components/schemas/__schema1186"
              - $ref: "#/components/schemas/__schema1188"
              - $ref: "#/components/schemas/__schema1189"
      required:
        - type
        - content
      additionalProperties: false
    __schema1188:
      type: object
      properties:
        type:
          type: string
          const: orderedList
        attrs:
          type: object
          properties:
            start:
              type: integer
              minimum: 1
              maximum: 9007199254740991
            type:
              type: "null"
              const: null
          required:
            - start
            - type
          additionalProperties: false
        content:
          type: array
          items:
            $ref: "#/components/schemas/__schema1187"
      required:
        - type
        - attrs
        - content
      additionalProperties: false
    __schema1189:
      type: object
      properties:
        type:
          type: string
          const: paragraph
        content:
          type: array
          items:
            $ref: "#/components/schemas/__schema1190"
      required:
        - type
        - content
      additionalProperties: false
    __schema1190:
      type: object
      properties:
        type:
          type: string
          const: text
        text:
          type: string
        marks:
          type: array
          items:
            anyOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - bold
                      - underline
                      - strike
                required:
                  - type
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    const: link
                  attrs:
                    type: object
                    properties:
                      href:
                        type: string
                      rel:
                        type: string
                      target:
                        anyOf:
                          - type: string
                          - type: "null"
                            const: null
                      class:
                        anyOf:
                          - type: string
                          - type: "null"
                            const: null
                    required:
                      - href
                      - rel
                      - target
                      - class
                    additionalProperties: false
                required:
                  - type
                  - attrs
                additionalProperties: false
      required:
        - type
        - text
      additionalProperties: false
    __schema1191:
      type: object
      properties:
        startTime:
          type:
            - string
            - number
        endTime:
          type:
            - string
            - number
        metrics:
          type: array
          items:
            $ref: "#/components/schemas/__schema1192"
          description: The ordered list of metrics to use for tiebreakers
      required:
        - metrics
      additionalProperties: false
    __schema1192:
      type: object
      properties:
        metricId:
          $ref: "#/components/schemas/__schema1193"
        order:
          type: integer
          minimum: 1
          maximum: 9007199254740991
      required:
        - metricId
        - order
      additionalProperties: false
    __schema1193:
      anyOf:
        - $ref: "#/components/schemas/__schema1167"
        - $ref: "#/components/schemas/__schema1168"
        - $ref: "#/components/schemas/__schema1169"
        - $ref: "#/components/schemas/__schema1171"
        - $ref: "#/components/schemas/__schema1172"
        - $ref: "#/components/schemas/__schema1173"
        - $ref: "#/components/schemas/__schema1174"
        - $ref: "#/components/schemas/__schema1170"
        - $ref: "#/components/schemas/RatioId"
    __schema1194:
      type: boolean
    __schema1195:
      type: object
      properties:
        id:
          type: number
          minimum: 1
        participant1:
          $ref: "#/components/schemas/__schema1196"
        participant2:
          $ref: "#/components/schemas/__schema1196"
        winner:
          description: 1 if winner is player 1, 2 if player 2
          $ref: "#/components/schemas/__schema1197"
        overrideReason:
          type: string
        winnerGame:
          description: bracket id for the winners next game
          $ref: "#/components/schemas/__schema1198"
        loserGame:
          description: bracket id for the losers next game
          $ref: "#/components/schemas/__schema1199"
        order:
          description: order of the match in the round
          $ref: "#/components/schemas/__schema1200"
      required:
        - id
      additionalProperties: false
    __schema1196:
      anyOf:
        - $ref: "#/components/schemas/userId"
        - $ref: "#/components/schemas/GroupId"
    __schema1197:
      anyOf:
        - type: number
          const: 1
        - type: number
          const: 2
    __schema1198:
      type: number
    __schema1199:
      type: number
    __schema1200:
      type: number
    __schema1201:
      type: string
    __schema1202:
      type: string
      pattern: ^Video_[\s\S]{0,}$
      description: "Terros ID: `Video_` prefix followed by a unique suffix, e.g.
        `Video_123-4aBc_d`"
      example: Video_123-4aBc_d
    __schema1203:
      type: string
    __schema1204:
      oneOf:
        - $ref: "#/components/schemas/__schema1205"
        - type: object
          properties:
            type:
              type: string
              enum:
                - group
            participantId:
              $ref: "#/components/schemas/GroupId"
            pointsUpdatedAt:
              type: number
            finalPlace:
              type: number
            isDeleted:
              type: boolean
            users:
              type: array
              items:
                $ref: "#/components/schemas/__schema1205"
            groupSize:
              type: number
            name:
              type: string
          required:
            - type
            - participantId
            - pointsUpdatedAt
            - isDeleted
            - users
            - name
          additionalProperties: false
      type: object
    __schema1205:
      type: object
      properties:
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        color:
          $ref: "#/components/schemas/tinyUserColorOutput"
        prizeChoices:
          description: A list of prize ids the user can choose from
          $ref: "#/components/schemas/__schema1206"
        prizeIds:
          description: The prizes the user has won
          $ref: "#/components/schemas/__schema1207"
        type:
          type: string
          enum:
            - user
        participantId:
          $ref: "#/components/schemas/userId"
        pointsUpdatedAt:
          type: number
        finalPlace:
          type: number
        isDeleted:
          type: boolean
        ledger:
          type: object
          propertyNames:
            type: string
            pattern: ^-?\d+(?:\.\d+)?$
          additionalProperties:
            type: object
            propertyNames:
              $ref: "#/components/schemas/__schema1193"
            additionalProperties:
              type: object
              properties:
                highestPossiblePrimaryMetricPoints:
                  type: number
                totalCount:
                  type: number
                pointValue:
                  type: number
                multiplier:
                  type: number
                qualifiers:
                  type: object
                  propertyNames:
                    $ref: "#/components/schemas/__schema1193"
                  additionalProperties:
                    type: object
                    properties:
                      minPercent:
                        type: number
                      totalCount:
                        type: number
                    required:
                      - minPercent
                      - totalCount
                    additionalProperties: false
              required:
                - highestPossiblePrimaryMetricPoints
                - totalCount
                - pointValue
                - multiplier
              additionalProperties: false
        overrideReason:
          type: string
        name:
          type: string
        groupSize:
          type: number
      required:
        - firstName
        - lastName
        - type
        - participantId
        - pointsUpdatedAt
        - isDeleted
      additionalProperties: false
    __schema1206:
      type: array
      items:
        type: object
        properties:
          place:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          prizeIds:
            type: array
            items:
              $ref: "#/components/schemas/PrizeId"
        required:
          - place
          - prizeIds
        additionalProperties: false
    __schema1207:
      type: array
      items:
        $ref: "#/components/schemas/PrizeId"
    __schema1208:
      type: object
      properties:
        entity:
          type: string
          enum:
            - Account
            - Area
            - CalendarEvent
            - Contact
            - Task
            - User
        name:
          type: string
        disableGeocoding:
          description: When true, skip the external geocoding lookup for an address that
            matches no existing location. When false or omitted, that lookup
            runs.
          $ref: "#/components/schemas/__schema1209"
        addMissingUsers:
          description: Create placeholder users for any owner or assignee not already in
            Terros.
          $ref: "#/components/schemas/__schema1210"
        createCustomLocations:
          description: After all enabled lookups miss, create a location using the address
            and coordinates from the CSV.
          $ref: "#/components/schemas/__schema1211"
        cleanupLocation:
          description: Match imported addresses with our location data. When turned off,
            we use the location data in your file—unless its coordinates are
            within 10 meters of one of our locations. When omitted, imports keep
            the matching they used before this option existed.
          $ref: "#/components/schemas/__schema1212"
        notifyUsers:
          description: Send a welcome email with login instructions to each new user.
          $ref: "#/components/schemas/__schema1213"
        skipDuplicates:
          description: When a row matches an account that already exists, skip it instead
            of updating it. Skipped accounts won't be modified or removed when
            this import is deleted.
          $ref: "#/components/schemas/__schema1214"
        assignAreasOnExisting:
          description: When this import updates an account that already exists, also run
            areas that auto-assign on import. New accounts always get those
            areas. Defaults to true.
          $ref: "#/components/schemas/__schema1215"
        workflowId:
          $ref: "#/components/schemas/WFId"
        columnMapping:
          $ref: "#/components/schemas/ColumnMappingOutput"
        successes:
          type: number
        errors:
          type: number
        skipped:
          default: 0
          type: number
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        importId:
          $ref: "#/components/schemas/ImportId"
        ownerId:
          $ref: "#/components/schemas/userId"
        importStatus:
          $ref: "#/components/schemas/__schema1218"
        statusHistory:
          type: array
          items:
            type: object
            properties:
              status:
                $ref: "#/components/schemas/__schema1218"
              timestamp:
                $ref: "#/components/schemas/utcMillisecondsOutput"
            required:
              - status
              - timestamp
            additionalProperties: false
        completedAt:
          $ref: "#/components/schemas/utcMillisecondsOutput"
        totalMessages:
          type: number
        companyId:
          $ref: "#/components/schemas/companyId"
        headers:
          type: array
          items:
            type: string
        reason:
          type: string
        expiresAt:
          type: number
        expectedRecords:
          description: Records this import saved, counted while post-processing waits for
            them to become searchable.
          $ref: "#/components/schemas/__schema1219"
        indexedRecords:
          description: Records this import saved that are searchable so far, counted
            during the same wait.
          $ref: "#/components/schemas/__schema1220"
      required:
        - entity
        - successes
        - errors
        - skipped
        - importId
        - ownerId
        - importStatus
        - totalMessages
        - companyId
        - headers
      additionalProperties: false
    __schema1209:
      type: boolean
    __schema1210:
      type: boolean
    __schema1211:
      type: boolean
    __schema1212:
      type: boolean
    __schema1213:
      type: boolean
    __schema1214:
      type: boolean
    __schema1215:
      type: boolean
    __schema1216:
      type: string
    __schema1217:
      type: string
    __schema1218:
      type: string
      enum:
        - New
        - Uploaded
        - Queued
        - Processing
        - PostProcessing
        - Completed
        - Failed
    __schema1219:
      type: number
    __schema1220:
      type: number
    __schema1221:
      type: string
    __schema1222:
      type:
        - string
        - number
        - boolean
    __schema1223:
      type: number
    __schema1224:
      description: The permits filtered by entitlements
      $ref: "#/components/schemas/__schema1225"
    __schema1225:
      type: array
      items:
        type: object
        properties:
          label:
            type: string
            enum:
              - other
              - accessory_dwelling_unit
              - electric_vehicle_charger
              - electric_water_heater
              - electrical_panel_upgrade
              - home_addition
              - hvac_changeout
              - pool
              - roof
              - solar
              - spa_sauna
          contractorId:
            type: string
          contractorName:
            type: string
          initStatusDate:
            type: number
          initStatus:
            $ref: "#/components/schemas/__schema1226"
          latestStatusDate:
            type: number
          latestStatus:
            $ref: "#/components/schemas/__schema1226"
          cancelledDate:
            type: number
          isBankrupt:
            type: boolean
        required:
          - label
        additionalProperties: false
    __schema1226:
      type: string
      enum:
        - expired
        - complete
        - final
        - filed
        - plancheck
        - triage
        - issued
        - revoked
        - rejected
        - canceled
        - approved
        - suspended
        - withdrawn
        - reinstated
        - applied
    __schema1227:
      type: number
    __schema1228:
      type: object
      properties:
        date:
          type: number
        price:
          type: number
        transactionId:
          type: number
      additionalProperties: false
    __schema1229:
      type: object
      properties:
        value:
          type: number
        improvementsPercentage:
          type: number
        landValue:
          type: number
        improvementsValue:
          type: number
      additionalProperties: false
    __schema1230:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
      additionalProperties: false
    __schema1231:
      type: array
      items:
        type: number
    __schema1232:
      type: array
      items:
        oneOf:
          - type: object
            properties:
              type:
                $ref: "#/components/schemas/__schema1233"
              violationId:
                $ref: "#/components/schemas/CViolationId"
              policyId:
                $ref: "#/components/schemas/CPolicyId"
              policyTitle:
                $ref: "#/components/schemas/__schema1234"
              timestamps:
                $ref: "#/components/schemas/__schema1235"
              violationDate:
                $ref: "#/components/schemas/utcMillisecondsOutput"
            required:
              - type
              - violationId
              - policyId
              - timestamps
              - violationDate
            additionalProperties: false
            description: A compliance violation detected in the conversation.
          - type: object
            properties:
              type:
                $ref: "#/components/schemas/__schema1237"
              violationId:
                $ref: "#/components/schemas/ConvoFlagMatchId"
              accountId:
                $ref: "#/components/schemas/accountId"
              workflowStageId:
                $ref: "#/components/schemas/SId"
              locationId:
                $ref: "#/components/schemas/locationIdOutput"
              flaggedAt:
                $ref: "#/components/schemas/utcMillisecondsOutput"
              resolvedBy:
                $ref: "#/components/schemas/__schema1238"
              resolvedAt:
                $ref: "#/components/schemas/__schema1239"
            required:
              - type
              - violationId
              - accountId
              - workflowStageId
              - locationId
              - flaggedAt
            additionalProperties: false
            description: A recording made at a location with an existing customer in a
              restricted stage.
        type: object
    __schema1233:
      type: string
      const: Compliance
    __schema1234:
      type: string
    __schema1235:
      type: array
      items:
        $ref: "#/components/schemas/__schema1236"
    __schema1236:
      type: string
      pattern: ^\d{1,2}:\d{2}$
    __schema1237:
      type: string
      const: ExistingCustomer
    __schema1238:
      $ref: "#/components/schemas/userId"
    __schema1239:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    __schema1240:
      type: object
      properties:
        code:
          $ref: "#/components/schemas/__schema1112"
        title:
          type: string
        criteria:
          type: string
        value:
          type: number
        ai:
          description: The AI graded score for the criteria
          $ref: "#/components/schemas/__schema1241"
        user:
          description: The user feedback for the criteria
          $ref: "#/components/schemas/__schema1241"
      required:
        - code
        - title
        - value
      additionalProperties: false
    __schema1241:
      type: object
      properties:
        score:
          type: number
          description: The score given for the criteria
        feedback:
          description: The feedback provided for the criteria
          $ref: "#/components/schemas/__schema1242"
      required:
        - score
      additionalProperties: false
    __schema1242:
      type: string
    __schema1243:
      type: boolean
    __schema1244:
      type: number
      minimum: 0
      maximum: 1
    __schema1245:
      type: array
      items:
        type: object
        properties:
          timestamp:
            $ref: "#/components/schemas/__schema1236"
          comment:
            type: string
        required:
          - timestamp
          - comment
        additionalProperties: false
    __schema1246:
      type: array
      items:
        type: string
    __schema1247:
      type: boolean
    __schema1248:
      type: array
      items:
        type: string
    __schema1249:
      type: string
    __schema1250:
      type: array
      items:
        type: object
        properties:
          timestamp:
            $ref: "#/components/schemas/__schema1236"
          chapterTitle:
            type: string
        required:
          - timestamp
          - chapterTitle
        additionalProperties: false
    __schema1251:
      type: array
      items:
        type: object
        properties:
          speaker:
            type: integer
            minimum: 0
            maximum: 9007199254740991
          wordCount:
            type: number
            minimum: 0
          speakingDuration:
            type: number
            minimum: 0
            description: Total speaking duration in seconds
        required:
          - speaker
          - wordCount
          - speakingDuration
        additionalProperties: false
    __schema1252:
      type: string
    __schema1253:
      type: number
    __schema1254:
      type: object
      properties:
        lastOwnershipTransferDate:
          $ref: "#/components/schemas/__schema1227"
        permits:
          $ref: "#/components/schemas/__schema1224"
      additionalProperties: false
    __schema1255:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/__schema865"
        firstName:
          $ref: "#/components/schemas/__schema866"
        lastName:
          $ref: "#/components/schemas/__schema867"
        email:
          $ref: "#/components/schemas/__schema868"
        phone:
          $ref: "#/components/schemas/__schema870"
        phone2:
          $ref: "#/components/schemas/__schema873"
        businessName:
          $ref: "#/components/schemas/__schema874"
        hasAge:
          $ref: "#/components/schemas/__schema881"
        hasCreditScore:
          $ref: "#/components/schemas/__schema882"
      additionalProperties: false
    __schema1256:
      type: string
    __schema1257:
      type: string
    __schema1258:
      type: boolean
    __schema1259:
      allOf:
        - oneOf:
            - type: object
              properties:
                entity:
                  type: string
                  const: self
              required:
                - entity
              additionalProperties: false
            - type: object
              properties:
                entity:
                  type: string
                  const: downline
                entityId:
                  anyOf:
                    - $ref: "#/components/schemas/userId"
                    - $ref: "#/components/schemas/teamId"
              required:
                - entity
                - entityId
              additionalProperties: false
            - type: object
              properties:
                entity:
                  type: string
                  const: company
              required:
                - entity
              additionalProperties: false
            - type: object
              properties:
                entity:
                  type: string
                  const: withinRestrictions
              required:
                - entity
              additionalProperties: false
            - type: object
              properties:
                entity:
                  type: string
                  const: none
              required:
                - entity
              additionalProperties: false
          type: object
        - $ref: "#/components/schemas/__schema1097"
        - type: object
          properties:
            source:
              $ref: "#/components/schemas/__schema1260"
          required:
            - source
          additionalProperties: false
    __schema1260:
      anyOf:
        - $ref: "#/components/schemas/__schema1261"
        - $ref: "#/components/schemas/RoleId"
    __schema1261:
      anyOf:
        - $ref: "#/components/schemas/userId"
        - $ref: "#/components/schemas/teamId"
        - $ref: "#/components/schemas/companyId"
    __schema1262:
      type: string
      enum:
        - none
        - self
        - downline
        - withinRestrictions
        - company
    __schema1263:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema1025"
      additionalProperties:
        type: array
        items:
          $ref: "#/components/schemas/__schema1259"
    __schema1264:
      type: string
    __schema1265:
      type: string
    __schema1266:
      anyOf:
        - anyOf:
            - $ref: "#/components/schemas/accountStatusId"
            - $ref: "#/components/schemas/RoleId"
            - $ref: "#/components/schemas/teamId"
            - $ref: "#/components/schemas/ProgramId"
            - $ref: "#/components/schemas/SId"
            - $ref: "#/components/schemas/AId"
            - type: string
              const: userCreated
        - type: "null"
    __schema1267:
      type: array
      items:
        oneOf:
          - type: object
            properties:
              type:
                type: string
                const: stage
              stageId:
                anyOf:
                  - $ref: "#/components/schemas/accountStatusId"
                  - $ref: "#/components/schemas/SId"
            required:
              - type
              - stageId
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: action
              actionId:
                $ref: "#/components/schemas/AId"
            required:
              - type
              - actionId
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: role
              roleId:
                $ref: "#/components/schemas/RoleId"
            required:
              - type
              - roleId
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: team
              teamId:
                $ref: "#/components/schemas/teamId"
            required:
              - type
              - teamId
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: program
              programId:
                $ref: "#/components/schemas/ProgramId"
            required:
              - type
              - programId
            additionalProperties: false
          - type: object
            properties:
              type:
                type: string
                const: userCreated
            required:
              - type
            additionalProperties: false
        type: object
    __schema1268:
      description: Enable the program for these teams, if empty the program will be
        enabled for all teams
      $ref: "#/components/schemas/__schema1269"
    __schema1269:
      type: array
      items:
        $ref: "#/components/schemas/teamId"
    __schema1270:
      type: array
      items:
        type: object
        properties:
          isDeleted:
            $ref: "#/components/schemas/isDeletedOutput"
          programTaskId:
            $ref: "#/components/schemas/PTId"
          type:
            $ref: "#/components/schemas/__schema1271"
          subject:
            type: string
          body:
            type: string
          schedule:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - day
                  days:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1272"
                    description: day in the program starting from 1
                required:
                  - type
                  - days
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - weekday
                  days:
                    type: array
                    items:
                      type: object
                      properties:
                        weekday:
                          $ref: "#/components/schemas/__schema1273"
                        weeks:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1274"
                          description: the weeks of the program for this weekday
                      required:
                        - weekday
                        - weeks
                      additionalProperties: false
                required:
                  - type
                  - days
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - sequentialWeekday
                  weekdays:
                    type: array
                    items:
                      $ref: "#/components/schemas/__schema1273"
                required:
                  - type
                  - weekdays
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - none
                required:
                  - type
                additionalProperties: false
            type: object
          criteria:
            type: array
            items:
              $ref: "#/components/schemas/__schema1275"
          openSince:
            description: minutes from midnight that the task can be started, default is
              midnight
            $ref: "#/components/schemas/__schema1281"
          duration:
            description: duration of task in minutes, default is end of day
            $ref: "#/components/schemas/__schema1282"
          priority:
            type: number
            description: priority of the task
          nextTaskId:
            deprecated: true
            $ref: "#/components/schemas/PTId"
          nextTaskIds:
            type: array
            items:
              $ref: "#/components/schemas/PTId"
          expiration:
            $ref: "#/components/schemas/__schema1283"
          required:
            description: is the task required
            $ref: "#/components/schemas/__schema1285"
        required:
          - programTaskId
          - type
          - subject
          - body
          - schedule
          - criteria
          - priority
        additionalProperties: false
    __schema1271:
      type: string
      enum:
        - AcknowledgeEvaluation
        - Birthday
        - CalendarEvent
        - ConfirmAppointment
        - ConfirmEventOutcome
        - ConfirmManagerInterview
        - Custom
        - ExternalLink
        - ConfirmShadowDay
        - ConversionFromPitchToLead
        - FixIntegrationMapping
        - GradeEvaluation
        - GameInvitations
        - GameRaffles
        - GamePickPrizes
        - MilestoneAllTimeApprove
        - MilestoneAllTimeInstall
        - MilestoneAllTimeLead
        - MilestoneAllTimePitch
        - MilestoneFirstPitch
        - MilestoneLastMonthApprove
        - MilestoneLastMonthInstall
        - MilestoneLastMonthLead
        - MilestoneLastMonthPitch
        - MilestoneThisQuarterApprove
        - MilestoneThisQuarterInstall
        - MilestoneThisQuarterLead
        - MilestoneThisQuarterPitch
        - SalesActivity
        - SalesTraining
        - ScheduleInterview
        - SetCloserSettings
        - SendMessage
        - SubmitQuarterlyPlan
        - SubmitWeeklyPlan
        - ReauthorizeGoogle
        - RecordConversation
        - RecordEvaluation
        - ResubmitRejectedPlan
        - ReviewSubmittedPlan
        - TakeQuiz
        - TimeSinceLastApprove
        - TimeSinceLastLead
        - TimeSinceLastPitch
        - UpdateCloserAvailability
        - UploadProfilePicture
        - WatchVideo
        - WorkAnniversary
        - WorkflowTasks
    __schema1272:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    __schema1273:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
      description: 1-7 (Mon-Sun)
    __schema1274:
      type: integer
      exclusiveMinimum: 0
      maximum: 9007199254740991
    __schema1275:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: activity
            activityId:
              anyOf:
                - $ref: "#/components/schemas/accountStatusId"
                - $ref: "#/components/schemas/__schema907"
                - $ref: "#/components/schemas/__schema1276"
                - $ref: "#/components/schemas/__schema1277"
              description: "Activity that counts toward a task: an account status ID (`AS.`),
                a disposition ID (`Disposition.` or `Disposition:`), `contact`,
                or `pitch`"
              example: pitch
            count:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - type
            - activityId
            - count
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: workflow
            count:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            stageOrActionId:
              anyOf:
                - $ref: "#/components/schemas/SId"
                - $ref: "#/components/schemas/AId"
          required:
            - type
            - count
            - stageOrActionId
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: video
            videoId:
              $ref: "#/components/schemas/__schema1202"
            tags:
              type: array
              items:
                type: string
            description:
              type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: videoChat
            description:
              type: string
            target:
              anyOf:
                - $ref: "#/components/schemas/__schema1278"
                - $ref: "#/components/schemas/userId"
              description: The target for the video chat (any manager or a specific user),
                manager by default if not specified
            createResponseTask:
              description: Whether to create a task for the user to respond to the message
              $ref: "#/components/schemas/__schema1279"
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: shadow
            target:
              type: string
              enum:
                - manager
                - team
            completeWhen:
              type: string
              enum:
                - scheduled
                - happened
            count:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - type
            - target
            - completeWhen
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: evaluation
            evaluator:
              type: string
              enum:
                - manager
                - self
            completeWhen:
              description: When the evaluation should be marked as complete, default to graded
              $ref: "#/components/schemas/__schema1280"
            count:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: convo
            completeWhen:
              type: string
              enum:
                - recorded
                - reviewedFeedback
                - selfAssessed
                - submittedForFeedback
                - managerFeedback
            count:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: externalLink
            label:
              type: string
            url:
              type: string
            completeWhen:
              type: string
              enum:
                - clicked
                - external
            count:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - type
            - url
            - completeWhen
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: quiz
            quizId:
              $ref: "#/components/schemas/QuizId"
          required:
            - type
            - quizId
          additionalProperties: false
      type: object
    __schema1276:
      type: string
      const: contact
    __schema1277:
      type: string
      const: pitch
    __schema1278:
      type: string
      const: manager
    __schema1279:
      type: boolean
    __schema1280:
      type: string
      enum:
        - submitted
        - graded
        - selfAssessed
    __schema1281:
      type: number
    __schema1282:
      type: number
    __schema1283:
      anyOf:
        - description: minutes after the due that the task can still be completed, 0 for
            expires at due date
          $ref: "#/components/schemas/__schema1284"
        - type: string
          const: programEndDate
          description: expires at the end of the program
    __schema1284:
      type: number
    __schema1285:
      type: boolean
    __schema1286:
      type: string
      enum:
        - active
        - inactive
    __schema1287:
      description: duration of program in days
      $ref: "#/components/schemas/__schema1288"
    __schema1288:
      type: number
    __schema1289:
      type: string
      enum:
        - timeline
        - taskCompletion
      description: If timeline, a user in the program will be marked completed after
        the total days of the program. If taskCompletion, a user in the program
        will be marked complete when they have finished all their tasks
    __schema1290:
      description: The weekday the program should start on
      $ref: "#/components/schemas/__schema1291"
    __schema1291:
      anyOf:
        - $ref: "#/components/schemas/__schema1292"
        - type: "null"
    __schema1292:
      type: string
      enum:
        - sun
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
    __schema1293:
      description: The stage recruit should be in to be enrolled in the program,
        applies only for recruiting
      $ref: "#/components/schemas/accountStatusId"
    __schema1294:
      description: The stage recruit should be moved to after completing the program,
        applies only for recruiting
      $ref: "#/components/schemas/accountStatusId"
    __schema1295:
      description: When a user finishes the program, take this action on the account
      $ref: "#/components/schemas/AId"
    __schema1296:
      description: Epoch milliseconds when the program was archived
      $ref: "#/components/schemas/__schema1297"
    __schema1297:
      type: number
    __schema1298:
      description: Epoch milliseconds when the program most recently became active
      $ref: "#/components/schemas/__schema1299"
    __schema1299:
      type: number
    __schema1300:
      description: Epoch milliseconds when the program was most recently paused
      $ref: "#/components/schemas/__schema1301"
    __schema1301:
      type: number
    __schema1302:
      type: object
      properties:
        active:
          type: number
        pending:
          type: number
        completed:
          type: number
        dropped:
          type: number
      required:
        - active
        - pending
        - completed
        - dropped
      additionalProperties: false
    __schema1303:
      type: object
      properties:
        active:
          type: number
        total:
          type: number
      additionalProperties: false
    __schema1304:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        userId:
          $ref: "#/components/schemas/userId"
        programId:
          $ref: "#/components/schemas/ProgramId"
        startDate:
          $ref: "#/components/schemas/__schema1305"
        completionDate:
          $ref: "#/components/schemas/__schema1306"
        status:
          $ref: "#/components/schemas/__schema1307"
        droppedDate:
          $ref: "#/components/schemas/__schema1308"
        user:
          $ref: "#/components/schemas/tinyUserOutput"
        program:
          $ref: "#/components/schemas/__schema1310"
      required:
        - userId
        - programId
        - startDate
        - status
        - user
        - program
      additionalProperties: false
    __schema1305:
      type: number
    __schema1306:
      type: number
    __schema1307:
      type: string
      enum:
        - active
        - completed
        - pending
        - dropped
    __schema1308:
      description: Date the user dropped the program, if applicable
      $ref: "#/components/schemas/__schema1309"
    __schema1309:
      type: number
    __schema1310:
      type: object
      properties:
        programId:
          $ref: "#/components/schemas/ProgramId"
        name:
          $ref: "#/components/schemas/__schema1264"
        ownerId:
          $ref: "#/components/schemas/userId"
        teamIds:
          $ref: "#/components/schemas/__schema1268"
        totalDays:
          $ref: "#/components/schemas/__schema1287"
        completion:
          $ref: "#/components/schemas/__schema1289"
      required:
        - programId
        - name
        - ownerId
      additionalProperties: false
    __schema1311:
      type: object
      properties:
        counts:
          $ref: "#/components/schemas/__schema1312"
        allowsLateCompletion:
          type: boolean
          description: Whether any task in the program can still be completed after its
            due date. When false no task is ever overdue, because an unfinished
            task goes straight from open to missed on its due date
        assigned:
          type: number
          description: Tasks assigned to the user so far
        total:
          type: number
          description: "Tasks the program will assign to the user in all: those assigned
            so far plus those still scheduled"
        completionRate:
          type: number
          minimum: 0
          maximum: 100
          description: Completed and late tasks as a percentage. In a taskCompletion
            program it is out of total. In a timeline program it is out of
            assigned, every task assigned so far including open ones, so a user
            is at 100 only once every assigned task is done
        currentDay:
          description: Day of the program (from 1), only while the enrollment is active in
            a timeline program with totalDays
          $ref: "#/components/schemas/__schema1313"
        totalDays:
          type: number
        startDate:
          type: number
        endDate:
          description: When the enrollment was completed or dropped
          $ref: "#/components/schemas/__schema1314"
      required:
        - counts
        - allowsLateCompletion
        - assigned
        - total
        - completionRate
        - startDate
      additionalProperties: false
    __schema1312:
      type: object
      properties:
        completed:
          type: number
        late:
          type: number
        missed:
          type: number
        overdue:
          type: number
        open:
          type: number
      required:
        - completed
        - late
        - missed
        - overdue
        - open
      additionalProperties: false
    __schema1313:
      type: number
    __schema1314:
      type: number
    __schema1315:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        ownerId:
          $ref: "#/components/schemas/userId"
        targetId:
          $ref: "#/components/schemas/userId"
        type:
          $ref: "#/components/schemas/__schema1271"
        subject:
          type: string
          description: short sentence case title for this task
        body:
          description: longer explanation for this task (what, why, and how). Displays
            below the title so don't repeat that.
          $ref: "#/components/schemas/__schema1316"
        dueDate:
          description: When the task is due, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema1317"
        required:
          type: boolean
          description: must this task be completed today?
        rejectable:
          description: "can this task be rejected? (default: true)"
          $ref: "#/components/schemas/__schema1318"
        closable:
          description: can this task be marked as completed by the user?
          $ref: "#/components/schemas/__schema1319"
        actions:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              link:
                type: string
              value:
                type:
                  - string
                  - number
                  - boolean
            required:
              - label
            additionalProperties: false
        priority:
          type: number
          description: priority to describe the importance (and urgency) of a task
        originTaskId:
          anyOf:
            - $ref: "#/components/schemas/MTId"
            - $ref: "#/components/schemas/PTId"
        programId:
          $ref: "#/components/schemas/ProgramId"
        criteria:
          $ref: "#/components/schemas/__schema1275"
        nextTaskId:
          deprecated: true
          $ref: "#/components/schemas/TaskId"
        nextTaskIds:
          type: array
          items:
            $ref: "#/components/schemas/TaskId"
        openSince:
          description: When the task opened, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema1320"
        expiration:
          $ref: "#/components/schemas/__schema1283"
        taskId:
          $ref: "#/components/schemas/TaskId"
        from:
          description: populated asynchronously from fromId during transformation
          $ref: "#/components/schemas/tinyUserOutput"
        owner:
          description: populated asynchronously from ownerId during transformation
          $ref: "#/components/schemas/tinyUserOutput"
        status:
          $ref: "#/components/schemas/__schema1322"
        completedAt:
          description: When the task was completed, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema1323"
        ownerFeedback:
          type: string
        snoozeUntil:
          description: When the snooze ends, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema1324"
        progress:
          description: For tasks that have criteria to complete (i.e. Pitch 3 houses) the
            progress is how many have been completed
          $ref: "#/components/schemas/__schema1325"
      required:
        - ownerId
        - type
        - subject
        - required
        - actions
        - priority
        - taskId
        - status
      additionalProperties: false
    __schema1316:
      type: string
    __schema1317:
      type: number
    __schema1318:
      type: boolean
    __schema1319:
      type: boolean
    __schema1320:
      type: number
    __schema1321:
      type: boolean
    __schema1322:
      type: string
      enum:
        - Created
        - Submitted
        - Completed
        - Rejected
    __schema1323:
      type: number
    __schema1324:
      type: number
    __schema1325:
      type: number
    __schema1326:
      allOf:
        - type: object
          properties:
            modifiedBy:
              $ref: "#/components/schemas/__schema807"
            createdAt:
              $ref: "#/components/schemas/auditPropsCreatedAtOutput"
            createdBy:
              $ref: "#/components/schemas/auditPropsCreatedBy"
            updatedAt:
              $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
            updatedBy:
              $ref: "#/components/schemas/auditPropsUpdatedBy"
            lastUpdateProcess:
              $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
            version:
              $ref: "#/components/schemas/auditPropsVersionOutput"
            ratioId:
              $ref: "#/components/schemas/RatioId"
            scopeId:
              description: Company, team, or user the custom stat belongs to.
              $ref: "#/components/schemas/__schema1261"
          required:
            - ratioId
            - scopeId
          additionalProperties: false
        - oneOf:
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1327"
                type:
                  type: string
                  enum:
                    - formula
                  description: "`formula` evaluates `formula` with the variables defined in
                    `scopes`."
                description:
                  $ref: "#/components/schemas/__schema1328"
                short:
                  $ref: "#/components/schemas/__schema1330"
                plural:
                  $ref: "#/components/schemas/__schema1332"
                scopeId:
                  $ref: "#/components/schemas/__schema1334"
                workflowId:
                  $ref: "#/components/schemas/__schema1335"
                formula:
                  type: string
                  minLength: 1
                  description: Arithmetic expression over the `$` variables defined in `scopes`,
                    for example `$pitches * 2 + $meetings`.
                scopes:
                  type: object
                  propertyNames:
                    $ref: "#/components/schemas/__schema1336"
                  additionalProperties:
                    $ref: "#/components/schemas/__schema1337"
                  description: "Maps each `$` variable used in `formula` to its input. A numeric
                    report KPI: a `value` of a `type: number` column from
                    /report/column, such as `contact.pitches` or
                    `meetingAttendance.count`, or the `ratioId` of another
                    custom stat."
                formatter:
                  description: How the report formats the result.
                  $ref: "#/components/schemas/__schema1338"
                accumulator:
                  description: How the report combines rows into a total. Defaults to `avg`.
                  $ref: "#/components/schemas/__schema1339"
              required:
                - name
                - type
                - formula
                - scopes
              additionalProperties: false
            - type: object
              properties:
                name:
                  $ref: "#/components/schemas/__schema1327"
                type:
                  type: string
                  enum:
                    - ratio
                    - percentage
                  description: "`ratio` shows `numerator` divided by `denominator`; `percentage`
                    shows it as a percentage."
                description:
                  $ref: "#/components/schemas/__schema1328"
                short:
                  $ref: "#/components/schemas/__schema1330"
                plural:
                  $ref: "#/components/schemas/__schema1332"
                scopeId:
                  $ref: "#/components/schemas/__schema1334"
                workflowId:
                  $ref: "#/components/schemas/__schema1335"
                numerator:
                  type: string
                  minLength: 1
                  description: "A numeric report KPI: a `value` of a `type: number` column from
                    /report/column, such as `contact.pitches` or
                    `meetingAttendance.count`, or the `ratioId` of another
                    custom stat."
                denominator:
                  type: string
                  minLength: 1
                  description: "A numeric report KPI: a `value` of a `type: number` column from
                    /report/column, such as `contact.pitches` or
                    `meetingAttendance.count`, or the `ratioId` of another
                    custom stat."
              required:
                - name
                - type
                - numerator
                - denominator
              additionalProperties: false
          type: object
    __schema1327:
      type: string
      minLength: 1
      description: Name shown as the report column label.
    __schema1328:
      description: Report column description. Defaults to the inputs for ratio and
        percentage stats, and to the name for formula stats.
      $ref: "#/components/schemas/__schema1329"
    __schema1329:
      type: string
    __schema1330:
      description: Short name.
      $ref: "#/components/schemas/__schema1331"
    __schema1331:
      type: string
    __schema1332:
      description: Plural name.
      $ref: "#/components/schemas/__schema1333"
    __schema1333:
      type: string
    __schema1334:
      description: Company, team, or user the custom stat belongs to. Omit it on
        /ratio/add to use the caller's company.
      $ref: "#/components/schemas/__schema1261"
    __schema1335:
      description: Show the custom stat only with this workflow. Omit it for a global
        custom stat.
      $ref: "#/components/schemas/WFId"
    __schema1336:
      type: string
      pattern: ^(\$)[\s\S]{0,}$
    __schema1337:
      type: string
    __schema1338:
      anyOf:
        - type: string
          enum:
            - round
            - ceiling
            - floor
            - daysSince
            - timeOfDay
        - type: string
          enum:
            - ratio
            - percentage
            - formula
        - $ref: "#/components/schemas/__schema1088"
    __schema1339:
      type: string
      enum:
        - sum
        - min
        - max
        - avg
        - median
        - distinct
        - query
    __schema1340:
      type: string
    __schema1341:
      type: string
    __schema1342:
      type: string
      enum:
        - string
        - number
        - boolean
        - timestamp
        - group
    __schema1343:
      description: Pass unchanged to /report/kpi. groupBy returns the grouped entity.
      $ref: "#/components/schemas/__schema1344"
    __schema1344:
      type: string
    __schema1345:
      type: number
    __schema1346:
      type: number
    __schema1347:
      $ref: "#/components/schemas/__schema1339"
    __schema1348:
      type: array
      items:
        $ref: "#/components/schemas/__schema1338"
    __schema1349:
      type: array
      items:
        type: object
        properties:
          label:
            type: string
          value:
            description: KPI used when primary values tie.
            $ref: "#/components/schemas/__schema1344"
          type:
            $ref: "#/components/schemas/__schema1342"
          formatters:
            type: array
            items:
              $ref: "#/components/schemas/__schema1338"
          direction:
            type: string
            enum:
              - asc
              - desc
        required:
          - label
          - value
          - type
          - direction
        additionalProperties: false
    __schema1350:
      type: string
    __schema1351:
      type: boolean
    __schema1352:
      type: object
      properties:
        id:
          type: string
          description: Groups switchable columns.
        option:
          type: string
          description: Variant key, e.g. actor.
      required:
        - id
        - option
      additionalProperties: false
    __schema1353:
      type: array
      items:
        type: string
    __schema1354:
      description: "Account filter types that narrow this column. location: states,
        cities, zipCodes and polygon. customField: customFields. assignment:
        users."
      $ref: "#/components/schemas/__schema1355"
    __schema1355:
      type: array
      items:
        type: string
        enum:
          - location
          - customField
          - assignment
    __schema1356:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: "null"
        - $ref: "#/components/schemas/tinyUserOutput"
        - $ref: "#/components/schemas/__schema989"
        - type: object
          properties:
            companyId:
              $ref: "#/components/schemas/companyId"
            name:
              $ref: "#/components/schemas/__schema1009"
            kind:
              $ref: "#/components/schemas/__schema1357"
            accessStatus:
              $ref: "#/components/schemas/__schema1002"
            industries:
              $ref: "#/components/schemas/__schema1006"
            modifiedBy:
              $ref: "#/components/schemas/__schema807"
            demoState:
              $ref: "#/components/schemas/__schema1358"
            avatarUrl:
              $ref: "#/components/schemas/companyAvatarUrl"
            avatarBlurhash:
              $ref: "#/components/schemas/companyAvatarBlurhash"
            maxUsers:
              $ref: "#/components/schemas/__schema1361"
            activeUserCount:
              $ref: "#/components/schemas/__schema1362"
            salesforceAccountId:
              $ref: "#/components/schemas/__schema1363"
            internalOwnerId:
              $ref: "#/components/schemas/__schema1365"
          required:
            - companyId
            - name
            - kind
            - accessStatus
          additionalProperties: false
        - type: object
          properties:
            taskId:
              $ref: "#/components/schemas/PTId"
            name:
              type: string
            body:
              type: string
          required:
            - taskId
            - name
          additionalProperties: false
        - type: object
          properties:
            taskId:
              $ref: "#/components/schemas/MTId"
            name:
              type: string
            body:
              type: string
          required:
            - taskId
            - name
          additionalProperties: false
    __schema1357:
      $ref: "#/components/schemas/companyKind"
    __schema1358:
      $ref: "#/components/schemas/demoProgressState"
    __schema1359:
      type: string
    __schema1360:
      type: string
    __schema1361:
      type: integer
      minimum: -9007199254740991
      maximum: 9007199254740991
    __schema1362:
      type: number
    __schema1363:
      description: Salesforce account ID linked to this company
      $ref: "#/components/schemas/__schema1364"
    __schema1364:
      type: string
    __schema1365:
      $ref: "#/components/schemas/userId"
    __schema1366:
      type: string
    __schema1367:
      type: number
    __schema1368:
      type: object
      properties:
        key:
          type: string
        value:
          $ref: "#/components/schemas/__schema1356"
        label:
          type: string
      required:
        - key
        - value
      additionalProperties: false
    __schema1369:
      type: array
      items:
        $ref: "#/components/schemas/__schema1370"
    __schema1370:
      anyOf:
        - $ref: "#/components/schemas/__schema1371"
        - type: "null"
    __schema1371:
      type: number
    __schema1372:
      type: string
    __schema1373:
      type: string
      enum:
        - user
        - team
    __schema1374:
      description: Whether the current user can assign this role
      $ref: "#/components/schemas/__schema1375"
    __schema1375:
      type: boolean
    __schema1376:
      type: array
      items:
        $ref: "#/components/schemas/tinyUserOutput"
    __schema1377:
      type: array
      items:
        type: object
        properties:
          user:
            $ref: "#/components/schemas/tinyUserOutput"
          teamId:
            $ref: "#/components/schemas/__schema1378"
          teamName:
            $ref: "#/components/schemas/__schema1379"
        required:
          - user
        additionalProperties: false
    __schema1378:
      description: Team the role is applied on; omitted for a direct role
      $ref: "#/components/schemas/teamId"
    __schema1379:
      type: string
    __schema1380:
      type: number
    __schema1381:
      type: array
      items:
        type: object
        properties:
          programId:
            $ref: "#/components/schemas/ProgramId"
          name:
            type: string
        required:
          - programId
          - name
        additionalProperties: false
    __schema1382:
      type: string
    __schema1383:
      type: string
    __schema1384:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        customFields:
          $ref: "#/components/schemas/__schema811"
        name:
          $ref: "#/components/schemas/teamName"
        parentId:
          $ref: "#/components/schemas/parentTeamId"
        level:
          $ref: "#/components/schemas/teamLevel"
        externalId:
          $ref: "#/components/schemas/teamExternalIdOutput"
        description:
          $ref: "#/components/schemas/teamDescriptionOutput"
        teamId:
          $ref: "#/components/schemas/teamId"
        timeZone:
          $ref: "#/components/schemas/teamTimezoneOutput"
        officeLocation:
          $ref: "#/components/schemas/teamOfficeLocationOutput"
        officeAddress:
          $ref: "#/components/schemas/teamOfficeAddressOutput"
        meetingTimes:
          $ref: "#/components/schemas/teamMeetingTimesOutput"
        isCloserBoundary:
          $ref: "#/components/schemas/teamIsCloserBoundaryOutput"
        restrictVisibility:
          $ref: "#/components/schemas/teamRestrictVisibilityOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/teamAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/teamAvatarUrlOutput"
        parentTeamIds:
          $ref: "#/components/schemas/teamParentIds"
        uploadAvatarUrl:
          $ref: "#/components/schemas/teamUploadAvatarUrlOutput"
        childTeamIds:
          $ref: "#/components/schemas/teamChildTeamIds"
        isLeaf:
          $ref: "#/components/schemas/teamIsLeaf"
        levelName:
          $ref: "#/components/schemas/teamLevelName"
      required:
        - name
        - level
        - teamId
        - parentTeamIds
        - childTeamIds
        - isLeaf
      additionalProperties: false
    __schema1385:
      type: string
    __schema1386:
      type: string
    __schema1387:
      type: string
    __schema1388:
      type: boolean
    __schema1389:
      type: string
    __schema1390:
      type: string
    __schema1391:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        user:
          $ref: "#/components/schemas/userData"
        membership:
          type: string
          deprecated: true
          description: Use roleIds instead.
        locked:
          description: Locked team memberships can't be deleted by automated processes
          $ref: "#/components/schemas/__schema1440"
        roleIds:
          type: array
          items:
            $ref: "#/components/schemas/RoleId"
        lastInterviewDate:
          description: When the member was last interviewed, in UTC epoch milliseconds; -1
            marks a member who still needs an interview
          $ref: "#/components/schemas/__schema1441"
        lastShadowDate:
          description: When the member last shadowed, in UTC epoch milliseconds
          $ref: "#/components/schemas/__schema1442"
      required:
        - user
        - membership
      additionalProperties: false
    __schema1392:
      type: string
      pattern: ^C((\.)|(:))[\s\S]{0,}$
      description: Company ID the user belongs to
      example: C:company123
      $ref: "#/components/schemas/companyId"
    __schema1393:
      default: true
      type: boolean
    __schema1394:
      description: User's self-reported manager selection
      $ref: "#/components/schemas/selfReportedManagerOutput"
    __schema1395:
      description: User's primary team assignment
      $ref: "#/components/schemas/primaryTeamOutput"
    __schema1396:
      type: string
      pattern: ^Team((\.)|(:))[\s\S]{0,}$
      description: Team ID for the primary team
      example: Team:abc123
      $ref: "#/components/schemas/teamId"
    __schema1397:
      type: number
      description: When the team assignment becomes stale, in UTC epoch milliseconds
    __schema1398:
      type: boolean
    __schema1399:
      type: string
    __schema1400:
      type: array
      items:
        $ref: "#/components/schemas/languageCode"
    __schema1401:
      type: string
    __schema1402:
      type: number
    __schema1403:
      description: User's custom fields for additional data
      example:
        CF.1: value1
        CF.2: value2
      $ref: "#/components/schemas/__schema812"
    __schema1404:
      description: The accountId the user is associated with, only applicable for
        recruiting feature
      $ref: "#/components/schemas/accountId"
    __schema1405:
      type: boolean
    __schema1406:
      description: User's closer settings and preferences
      $ref: "#/components/schemas/__schema1407"
    __schema1407:
      type: object
      properties:
        order:
          description: Ranking of the closer, used to sort closers when displaying timeslots
          $ref: "#/components/schemas/__schema1408"
        taskLockout:
          description: Decorated field from preferences
          $ref: "#/components/schemas/__schema1409"
        bookingPercent:
          description: Decorated field from preferences
          $ref: "#/components/schemas/__schema1410"
        meetingDuration:
          description: Length of the meeting in minutes
          example: 60
          $ref: "#/components/schemas/__schema1411"
        timeBetweenAppointments:
          description: Buffer time between appointments in minutes
          example: 30
          $ref: "#/components/schemas/__schema1412"
        serviceCenter:
          description: The center of the closer's serviceable area
          example:
            lat: 37.7749
            lng: -122.4194
          $ref: "#/components/schemas/latlngOutput"
        serviceRadius:
          description: Farthest distance the closer is willing to travel in meters
          example: 50000
          $ref: "#/components/schemas/__schema1413"
        minimumNotice:
          description: Minimum notice time before appointment in hours
          example: 24
          $ref: "#/components/schemas/__schema1414"
        maximumNotice:
          description: Maximum notice time before appointment in days
          example: 14
          default: 14
          $ref: "#/components/schemas/__schema1415"
        timeslots:
          description: Available time slots organized by day
          example:
            mon:
              - 540
              - 600
              - 660
            tue:
              - 480
              - 540
              - 600
          $ref: "#/components/schemas/__schema1416"
        excludes:
          description: Time slots to exclude (minutes from midnight)
          example:
            - 720
            - 780
            - 840
          $ref: "#/components/schemas/__schema1417"
        includes:
          description: Time slots to include (minutes from midnight)
          example:
            - 540
            - 600
            - 660
            - 720
          $ref: "#/components/schemas/__schema1418"
        lastUpdatedDate:
          description: When closer settings were last updated, in UTC epoch milliseconds
          example: 1672531200000
          $ref: "#/components/schemas/utcMillisecondsOutput"
      additionalProperties: false
    __schema1408:
      type: number
    __schema1409:
      type: boolean
    __schema1410:
      type: number
    __schema1411:
      type: number
    __schema1412:
      type: number
    __schema1413:
      type: number
    __schema1414:
      type: number
    __schema1415:
      type: number
    __schema1416:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema1292"
      additionalProperties:
        type: array
        items:
          type: number
      required:
        - sun
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
    __schema1417:
      type: array
      items:
        type: number
    __schema1418:
      type: array
      items:
        type: number
    __schema1419:
      type: string
      pattern: ^U((\.)|(:))[\s\S]{0,}$
      description: Unique user identifier
      example: U:user123
      $ref: "#/components/schemas/userId"
    __schema1420:
      type: number
    __schema1421:
      type: number
    __schema1422:
      type: string
    __schema1423:
      description: User's team memberships data. Dynamic team level keys are included
        as team{level}, such as team1, team2, or team12.
      example:
        manages:
          - Team:manager
        directMemberOf:
          - teamId: Team:direct
            name: Direct Team
            level: 1
        memberOf:
          - teamId: Team:member
            name: Member Team
            level: 1
        managers:
          - userId: U:manager
            firstName: Jane
            lastName: Manager
        team1:
          - teamId: Team:member
            name: Member Team
            level: 1
        team12:
          - teamId: Team:regional
            name: Regional Team
            level: 12
      $ref: "#/components/schemas/__schema1424"
    __schema1424:
      allOf:
        - type: object
          properties:
            manages:
              default: []
              type: array
              items:
                $ref: "#/components/schemas/teamId"
            directMemberOf:
              default: []
              type: array
              items:
                $ref: "#/components/schemas/__schema989"
            memberOf:
              default: []
              description: Includes all upline teams
              $ref: "#/components/schemas/__schema1425"
            managers:
              default: []
              description: All possible managers for this user
              $ref: "#/components/schemas/__schema1426"
            manager:
              description: User's primary manager details
              $ref: "#/components/schemas/tinyUserOutput"
            groups:
              default: []
              description: All groups the user belongs to
              deprecated: true
              $ref: "#/components/schemas/__schema1427"
          required:
            - manages
            - directMemberOf
            - memberOf
            - managers
            - groups
          additionalProperties: false
        - $ref: "#/components/schemas/userTeamsByLevel"
    __schema1425:
      type: array
      items:
        $ref: "#/components/schemas/__schema989"
    __schema1426:
      type: array
      items:
        $ref: "#/components/schemas/tinyUserOutput"
    __schema1427:
      type: array
      items:
        $ref: "#/components/schemas/__schema989"
    __schema1428:
      description: User's assigned roles
      $ref: "#/components/schemas/__schema1429"
    __schema1429:
      type: array
      items:
        $ref: "#/components/schemas/__schema857"
    __schema1430:
      type: string
    __schema1431:
      description: User's notification preferences
      $ref: "#/components/schemas/__schema1432"
    __schema1432:
      type: object
      properties:
        all:
          $ref: "#/components/schemas/__schema1433"
        demoSetupFailed:
          $ref: "#/components/schemas/__schema1433"
        demoSetupComplete:
          $ref: "#/components/schemas/__schema1433"
        dispatcherAssignment:
          $ref: "#/components/schemas/__schema1433"
        closeEvents:
          $ref: "#/components/schemas/__schema1433"
        shadowEvents:
          $ref: "#/components/schemas/__schema1433"
        submitPlan:
          $ref: "#/components/schemas/__schema1433"
        planSubmitted:
          $ref: "#/components/schemas/__schema1433"
        planReviewed:
          $ref: "#/components/schemas/__schema1433"
        interviews:
          $ref: "#/components/schemas/__schema1433"
        meetings:
          $ref: "#/components/schemas/__schema1433"
        evaluationAssignment:
          $ref: "#/components/schemas/__schema1433"
        evaluationRequest:
          $ref: "#/components/schemas/__schema1433"
        evaluationReview:
          $ref: "#/components/schemas/__schema1433"
        evaluationUpdate:
          $ref: "#/components/schemas/__schema1433"
        tasks:
          $ref: "#/components/schemas/__schema1433"
        messages:
          $ref: "#/components/schemas/__schema1433"
        areaAssignment:
          $ref: "#/components/schemas/__schema1433"
        teamAreaAssignment:
          $ref: "#/components/schemas/__schema1433"
        game:
          $ref: "#/components/schemas/__schema1433"
        recordingScored:
          $ref: "#/components/schemas/__schema1433"
        recordingAssigned:
          $ref: "#/components/schemas/__schema1433"
        recordingFeedbackAdded:
          $ref: "#/components/schemas/__schema1433"
        recordingEventSuggestion:
          $ref: "#/components/schemas/__schema1433"
        cardViewed:
          $ref: "#/components/schemas/__schema1433"
        cardContactSaved:
          $ref: "#/components/schemas/__schema1433"
      additionalProperties: false
    __schema1433:
      type: object
      properties:
        push:
          type: boolean
        email:
          type: boolean
      additionalProperties: false
    __schema1434:
      description: Timestamp when user agreed to terms
      example: 1672531200000
      $ref: "#/components/schemas/__schema1435"
    __schema1435:
      type: number
    __schema1436:
      description: Timestamp when user agreed to licensing
      example: 1672531200000
      $ref: "#/components/schemas/__schema1437"
    __schema1437:
      type: number
    __schema1438:
      description: Whether the user agreed to AI training on their pitch recordings
      $ref: "#/components/schemas/__schema1439"
    __schema1439:
      type: boolean
    __schema1440:
      type: boolean
    __schema1441:
      type: number
    __schema1442:
      type: number
    __schema1443:
      type: object
      properties:
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        customFields:
          $ref: "#/components/schemas/__schema811"
        name:
          $ref: "#/components/schemas/teamName"
        parentId:
          $ref: "#/components/schemas/parentTeamId"
        level:
          $ref: "#/components/schemas/teamLevel"
        externalId:
          $ref: "#/components/schemas/teamExternalIdOutput"
        description:
          $ref: "#/components/schemas/teamDescriptionOutput"
        teamId:
          $ref: "#/components/schemas/teamId"
        timeZone:
          $ref: "#/components/schemas/teamTimezoneOutput"
        officeLocation:
          $ref: "#/components/schemas/teamOfficeLocationOutput"
        officeAddress:
          $ref: "#/components/schemas/teamOfficeAddressOutput"
        meetingTimes:
          $ref: "#/components/schemas/teamMeetingTimesOutput"
        isCloserBoundary:
          $ref: "#/components/schemas/teamIsCloserBoundaryOutput"
        restrictVisibility:
          $ref: "#/components/schemas/teamRestrictVisibilityOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/teamAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/teamAvatarUrlOutput"
        parentTeamIds:
          $ref: "#/components/schemas/teamParentIds"
        uploadAvatarUrl:
          $ref: "#/components/schemas/teamUploadAvatarUrlOutput"
      required:
        - name
        - level
        - teamId
        - parentTeamIds
      additionalProperties: false
    __schema1444:
      $ref: "#/components/schemas/__schema1263"
    __schema1445:
      description: User's mailing address
      $ref: "#/components/schemas/__schema1446"
    __schema1446:
      type: object
      properties:
        country:
          $ref: "#/components/schemas/addressCountry"
        countrySubd:
          $ref: "#/components/schemas/addressCountrySubd"
        line1:
          $ref: "#/components/schemas/addressLine1"
        line2:
          $ref: "#/components/schemas/addressLine2"
        locality:
          $ref: "#/components/schemas/addressLocality"
        oneLine:
          $ref: "#/components/schemas/addressOneLine"
        postal1:
          $ref: "#/components/schemas/addressPostal1"
        postal2:
          $ref: "#/components/schemas/addressPostal2Output"
        postal3:
          $ref: "#/components/schemas/addressPostal3Output"
        unitNbr:
          $ref: "#/components/schemas/addressUnitNbrOutput"
        unitType:
          $ref: "#/components/schemas/addressUnitTypeOutput"
      required:
        - country
        - countrySubd
        - line1
        - line2
        - locality
        - oneLine
        - postal1
      additionalProperties: false
    __schema1447:
      description: User's shoe size for company events
      example: "10.5"
      $ref: "#/components/schemas/__schema1448"
    __schema1448:
      type: string
    __schema1449:
      description: User's shirt size for company events
      example: L
      $ref: "#/components/schemas/__schema1450"
    __schema1450:
      type: string
    __schema1451:
      description: User's birth date information
      $ref: "#/components/schemas/__schema1452"
    __schema1452:
      type: object
      properties:
        month:
          type: number
        day:
          type: number
      additionalProperties: false
    __schema1453:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema1454"
    __schema1454:
      type: string
    __schema1455:
      description: List of closer user IDs assigned to this user
      $ref: "#/components/schemas/__schema1456"
    __schema1456:
      type: array
      items:
        $ref: "#/components/schemas/userId"
    __schema1457:
      description: User's directly assigned roles, not including roles they have on teams
      $ref: "#/components/schemas/__schema1458"
    __schema1458:
      type: array
      items:
        $ref: "#/components/schemas/__schema857"
    __schema1459:
      type: array
      items:
        $ref: "#/components/schemas/userRoleAssignment"
    __schema1460:
      type: string
    __schema1461:
      deprecated: true
      $ref: "#/components/schemas/userId"
    __schema1462:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        accessStatus:
          $ref: "#/components/schemas/accessStatus"
        note:
          type: string
        expiresAt:
          $ref: "#/components/schemas/utcMillisecondsOutput"
      required:
        - accessStatus
        - expiresAt
      additionalProperties: false
    __schema1463:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema1464"
    __schema1464:
      type: string
    __schema1465:
      type: string
    __schema1466:
      type: string
    __schema1467:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema1468"
    __schema1468:
      type: string
    __schema1469:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        entity:
          type: string
          enum:
            - Account
            - Company
            - Contact
            - Evaluation
            - Event
            - Screenshot
            - Task
            - Team
            - User
        url:
          type: string
        target:
          anyOf:
            - type: string
              enum:
                - ENERFLO
                - SALESFORCE
                - JOBNIMBUS
                - SERVICETITAN
                - CONNECT
            - type: "null"
        name:
          type: string
        description:
          type: string
        add:
          type: boolean
        update:
          type: boolean
        remove:
          type: boolean
        params:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: object
                propertyNames:
                  type: string
                additionalProperties: {}
        statusIds:
          type: array
          items:
            $ref: "#/components/schemas/accountStatusId"
        workflowId:
          $ref: "#/components/schemas/WFId"
        workflowStageIds:
          type: array
          items:
            $ref: "#/components/schemas/SId"
        workflowActionIds:
          type: array
          items:
            $ref: "#/components/schemas/AId"
        failureRecipients:
          type: array
          items:
            type: string
            format: email
            pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        webhookId:
          $ref: "#/components/schemas/WebhookId"
      required:
        - entity
        - url
        - webhookId
      additionalProperties: false
    __schema1470:
      anyOf:
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/EvalId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        user:
                          $ref: "#/components/schemas/smallUserOutput"
                        evaluator:
                          $ref: "#/components/schemas/smallUserOutput"
                        evalState:
                          $ref: "#/components/schemas/evaluationEvalState"
                        requestDate:
                          type: string
                        eventDate:
                          type: string
                        evalDate:
                          type: string
                        possible:
                          type: number
                        score:
                          type: number
                        comment:
                          type: string
                        categories:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema1110"
                        address:
                          $ref: "#/components/schemas/__schema1120"
                        id:
                          $ref: "#/components/schemas/EvalId"
                      required:
                        - createdAt
                        - updatedAt
                        - user
                        - evalState
                        - requestDate
                        - possible
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Evaluation
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/__schema1076"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        firstName:
                          type: string
                        lastName:
                          type: string
                        address:
                          $ref: "#/components/schemas/__schema1120"
                        disposition:
                          type: object
                          properties:
                            dispositionId:
                              $ref: "#/components/schemas/__schema907"
                            name:
                              type: string
                          required:
                            - dispositionId
                            - name
                          additionalProperties: false
                        email:
                          type: string
                        creator:
                          type: string
                        leadSource:
                          type: string
                        id:
                          $ref: "#/components/schemas/__schema1076"
                      required:
                        - createdAt
                        - updatedAt
                        - creator
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Contact
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/accountId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        accountStatus:
                          type: string
                          enum:
                            - Lead
                            - Set
                            - Sit
                            - Closed
                            - Approved
                            - Permit Submitted
                            - Permit Approved
                            - Installed
                            - Archived
                            - Do Not Contact
                        status:
                          deprecated: true
                          $ref: "#/components/schemas/__schema1473"
                        workflowState:
                          $ref: "#/components/schemas/__schema1474"
                        owner:
                          $ref: "#/components/schemas/smallUserOutput"
                        closer:
                          $ref: "#/components/schemas/smallUserOutput"
                        address:
                          $ref: "#/components/schemas/__schema1120"
                        dealSize:
                          deprecated: true
                          $ref: "#/components/schemas/__schema1475"
                        rescheduleCount:
                          deprecated: true
                          $ref: "#/components/schemas/__schema1476"
                        resident:
                          $ref: "#/components/schemas/tinyResidentOutput"
                        note:
                          type: string
                        notes:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema910"
                        externalLeadId:
                          description: External lead ID from another system
                          $ref: "#/components/schemas/__schema1477"
                        customFieldMap:
                          $ref: "#/components/schemas/__schema812"
                        id:
                          $ref: "#/components/schemas/accountId"
                      required:
                        - createdAt
                        - updatedAt
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Account
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/companyId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        name:
                          $ref: "#/components/schemas/__schema1009"
                        kind:
                          $ref: "#/components/schemas/__schema1357"
                        accessStatus:
                          $ref: "#/components/schemas/__schema1002"
                        industries:
                          $ref: "#/components/schemas/__schema1006"
                        modifiedBy:
                          $ref: "#/components/schemas/__schema807"
                        demoState:
                          $ref: "#/components/schemas/__schema1358"
                        avatarUrl:
                          $ref: "#/components/schemas/companyAvatarUrl"
                        avatarBlurhash:
                          $ref: "#/components/schemas/companyAvatarBlurhash"
                        maxUsers:
                          $ref: "#/components/schemas/__schema1361"
                        activeUserCount:
                          $ref: "#/components/schemas/__schema1362"
                        salesforceAccountId:
                          $ref: "#/components/schemas/__schema1363"
                        internalOwnerId:
                          $ref: "#/components/schemas/__schema1365"
                        id:
                          $ref: "#/components/schemas/companyId"
                      required:
                        - createdAt
                        - updatedAt
                        - name
                        - kind
                        - accessStatus
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Company
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/EventId"
                        sourceId:
                          $ref: "#/components/schemas/__schema1478"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        owner:
                          $ref: "#/components/schemas/smallUserOutput"
                        eventDate:
                          type: string
                        account:
                          type: object
                          properties:
                            accountId:
                              $ref: "#/components/schemas/accountId"
                            statusId:
                              $ref: "#/components/schemas/accountStatusId"
                            workflowState:
                              $ref: "#/components/schemas/__schema1474"
                            residents:
                              type: array
                              items:
                                $ref: "#/components/schemas/tinyResidentOutput"
                            externalLeadId:
                              description: External lead ID from another system
                              $ref: "#/components/schemas/__schema1480"
                          required:
                            - accountId
                            - residents
                          additionalProperties: false
                        duration:
                          type: number
                        title:
                          type: string
                        eventType:
                          $ref: "#/components/schemas/eventType"
                        address:
                          $ref: "#/components/schemas/__schema1120"
                        note:
                          type: string
                        attendee:
                          $ref: "#/components/schemas/smallUserOutput"
                        occurred:
                          type: boolean
                        resident:
                          $ref: "#/components/schemas/tinyResidentOutput"
                        status:
                          type: string
                        closed:
                          type: boolean
                        id:
                          $ref: "#/components/schemas/EventId"
                        sourceId:
                          $ref: "#/components/schemas/__schema1478"
                      required:
                        - createdAt
                        - updatedAt
                        - eventDate
                        - duration
                        - title
                        - eventType
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Event
              required:
                - entity
              additionalProperties: false
        - type: object
          properties:
            entity:
              type: string
              const: Screenshot
            action:
              type: string
              const: add
            data:
              type: object
              properties:
                device:
                  type: string
                userId:
                  $ref: "#/components/schemas/userId"
                companyId:
                  $ref: "#/components/schemas/companyId"
                sessionId:
                  description: ID of the app session in which the screenshot was taken
                  $ref: "#/components/schemas/__schema1481"
                id:
                  $ref: "#/components/schemas/ScreenshotId"
                createdAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                updatedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
              required:
                - userId
                - companyId
                - id
                - createdAt
                - updatedAt
              additionalProperties: false
          required:
            - entity
            - action
            - data
          additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/TaskId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        status:
                          $ref: "#/components/schemas/__schema1322"
                        owner:
                          $ref: "#/components/schemas/smallUserOutput"
                        from:
                          $ref: "#/components/schemas/smallUserOutput"
                        subject:
                          type: string
                        body:
                          type: string
                        dueDate:
                          type: string
                        openSince:
                          type: string
                        completedAt:
                          type: string
                        program:
                          $ref: "#/components/schemas/__schema1310"
                        criteriaType:
                          type: string
                          enum:
                            - activity
                            - workflow
                            - video
                            - videoChat
                            - shadow
                            - evaluation
                            - convo
                            - externalLink
                            - quiz
                            - quickLink
                        id:
                          $ref: "#/components/schemas/TaskId"
                      required:
                        - createdAt
                        - updatedAt
                        - status
                        - owner
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Task
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/teamId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        name:
                          type: string
                        description:
                          type: string
                        externalId:
                          description: Team ID in your external system
                          $ref: "#/components/schemas/__schema1482"
                        parentId:
                          $ref: "#/components/schemas/teamId"
                        level:
                          $ref: "#/components/schemas/teamLevel"
                        restrictVisibility:
                          type: boolean
                        isCloserBoundary:
                          type: boolean
                        timeZone:
                          type: string
                        officeAddress:
                          type: string
                        officeLocation:
                          $ref: "#/components/schemas/latlngOutput"
                        meetingTimes:
                          type: array
                          items:
                            $ref: "#/components/schemas/__schema995"
                        customFields:
                          $ref: "#/components/schemas/__schema812"
                        members:
                          type: array
                          items:
                            $ref: "#/components/schemas/tinyUserOutput"
                        id:
                          $ref: "#/components/schemas/teamId"
                      required:
                        - createdAt
                        - updatedAt
                        - name
                        - level
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: Team
              required:
                - entity
              additionalProperties: false
        - allOf:
            - oneOf:
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookRemoveAction"
                    data:
                      type: object
                      properties:
                        id:
                          $ref: "#/components/schemas/userId"
                      required:
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      $ref: "#/components/schemas/webhookAddUpdateActionOutput"
                    data:
                      type: object
                      properties:
                        createdAt:
                          $ref: "#/components/schemas/auditDatesCreatedAt"
                        updatedAt:
                          $ref: "#/components/schemas/auditDatesUpdatedAt"
                        firstName:
                          type: string
                        lastName:
                          type: string
                        email:
                          type: string
                        phone:
                          type: string
                        clientUserId:
                          description: User ID in your external system
                          $ref: "#/components/schemas/__schema1483"
                        preferredName:
                          type: string
                        timeZone:
                          type: string
                        closerStatus:
                          $ref: "#/components/schemas/closerStatus"
                        isDeleted:
                          type: boolean
                        customFields:
                          $ref: "#/components/schemas/__schema812"
                        id:
                          $ref: "#/components/schemas/userId"
                      required:
                        - createdAt
                        - updatedAt
                        - firstName
                        - lastName
                        - email
                        - id
                      additionalProperties: false
                  required:
                    - action
                    - data
                  additionalProperties: false
              type: object
            - type: object
              properties:
                entity:
                  type: string
                  const: User
              required:
                - entity
              additionalProperties: false
    __schema1471:
      type: string
      const: add
    __schema1472:
      type: string
      const: update
    __schema1473:
      type: object
      properties:
        name:
          type: string
          description: Label or name for a single account in this status
        statusId:
          $ref: "#/components/schemas/accountStatusId"
      required:
        - name
        - statusId
      additionalProperties: false
    __schema1474:
      type: object
      properties:
        actionId:
          $ref: "#/components/schemas/AId"
        stageId:
          $ref: "#/components/schemas/SId"
        workflowId:
          $ref: "#/components/schemas/WFId"
        stageName:
          type: string
        actionName:
          type: string
        sourceStage:
          type: string
      required:
        - stageId
        - workflowId
      additionalProperties: false
    __schema1475:
      type: number
    __schema1476:
      type: number
    __schema1477:
      type: string
    __schema1478:
      description: External system ID of the event
      $ref: "#/components/schemas/__schema1479"
    __schema1479:
      type: string
    __schema1480:
      type: string
    __schema1481:
      type: string
    __schema1482:
      type: string
    __schema1483:
      type: string
    __schema1484:
      type: object
      properties:
        modifiedBy:
          $ref: "#/components/schemas/__schema807"
        createdAt:
          $ref: "#/components/schemas/auditPropsCreatedAtOutput"
        createdBy:
          $ref: "#/components/schemas/auditPropsCreatedBy"
        updatedAt:
          $ref: "#/components/schemas/auditPropsUpdatedAtOutput"
        updatedBy:
          $ref: "#/components/schemas/auditPropsUpdatedBy"
        lastUpdateProcess:
          $ref: "#/components/schemas/auditPropsLastUpdateProcessOutput"
        version:
          $ref: "#/components/schemas/auditPropsVersionOutput"
        isDeleted:
          $ref: "#/components/schemas/isDeletedOutput"
        companyId:
          $ref: "#/components/schemas/companyId"
        name:
          $ref: "#/components/schemas/__schema1485"
        stages:
          $ref: "#/components/schemas/__schema1486"
        actions:
          $ref: "#/components/schemas/__schema1536"
        integrationMappings:
          $ref: "#/components/schemas/__schema1546"
        migrationMappings:
          $ref: "#/components/schemas/__schema1548"
        isMigrated:
          $ref: "#/components/schemas/__schema1550"
        visibleTo:
          $ref: "#/components/schemas/__schema1552"
        entity:
          $ref: "#/components/schemas/__schema1553"
        removeEntitlements:
          $ref: "#/components/schemas/__schema1554"
        preferences:
          $ref: "#/components/schemas/__schema1555"
        workflowId:
          $ref: "#/components/schemas/WFId"
      required:
        - companyId
        - name
        - stages
        - actions
        - workflowId
      additionalProperties: false
    __schema1485:
      type: string
      minLength: 1
      description: Name of the workflow
    __schema1486:
      type: array
      items:
        type: object
        properties:
          stageId:
            $ref: "#/components/schemas/SId"
          legacyId:
            $ref: "#/components/schemas/accountStatusId"
          order:
            description: Order of the stage in the workflow
            $ref: "#/components/schemas/__schema1487"
          name:
            type: string
          description:
            type: string
          autoTrigger:
            type: object
            properties:
              hours:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              days:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              years:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              stageId:
                $ref: "#/components/schemas/SId"
            required:
              - stageId
            additionalProperties: false
          short:
            type: string
          plural:
            type: string
          icon:
            type: string
            deprecated: true
          color:
            type: string
          restricted:
            type: boolean
          actionIds:
            description: The outgoing actions from this stage
            $ref: "#/components/schemas/__schema1488"
          scope:
            type: string
            enum:
              - self
              - downline
              - withinRestrictions
              - company
          setter:
            $ref: "#/components/schemas/__schema1489"
          closer:
            $ref: "#/components/schemas/__schema1489"
          selfgen:
            $ref: "#/components/schemas/__schema1489"
          requiredFields:
            type: array
            items:
              anyOf:
                - type: string
                  enum:
                    - firstName
                    - lastName
                    - email
                    - phone
                - $ref: "#/components/schemas/CFId"
          ioType:
            type: string
            enum:
              - Input
              - Output
              - Both
          aiConfig:
            type: object
            properties:
              enabled:
                description: When true, AI classification is enabled for this stage. Ignored
                  when `flagRecordings` is true.
                $ref: "#/components/schemas/__schema1492"
              shouldGrade:
                $ref: "#/components/schemas/__schema1493"
              prompt:
                $ref: "#/components/schemas/__schema1495"
              flagRecordings:
                description: When true, recordings made at a location with an account in this
                  stage are flagged, and AI classification (`enabled`) is
                  ignored for this stage. Off by default.
                $ref: "#/components/schemas/__schema1497"
            additionalProperties: false
          reportConfig:
            type: object
            properties:
              count:
                $ref: "#/components/schemas/__schema1498"
              daysSince:
                $ref: "#/components/schemas/__schema1499"
              timeOfDay:
                $ref: "#/components/schemas/__schema1500"
              reportOn:
                $ref: "#/components/schemas/__schema1501"
              variantsShown:
                $ref: "#/components/schemas/__schema1502"
            additionalProperties: false
          advancedConfig:
            type: object
            properties:
              actionCredit:
                description: When disabled, the person who took the action that moved the entity
                  to this stage does not receive credit for it
                $ref: "#/components/schemas/__schema1503"
              changePrimaryOwnership:
                description: Whether this stage changes primary ownership of the entity
                $ref: "#/components/schemas/__schema1504"
              futurePipelineCredit:
                description: When enabled, the person who took the action that moved the entity
                  to this stage receives credit for all future pipeline stages
                  in the workflow from that point on
                $ref: "#/components/schemas/__schema1505"
              who:
                type: string
                enum:
                  - none
                  - setter
                  - closer
              allowCreditAfterDays:
                type: integer
                minimum: -1
                maximum: 9007199254740991
            additionalProperties: false
          taskConfig:
            type: object
            properties:
              required:
                description: Whether the task is required, by default its optional
                $ref: "#/components/schemas/__schema1506"
              priority:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              assignTo:
                description: Who the task will be assigned to, by default its actionRoles
                $ref: "#/components/schemas/__schema1507"
              dateField:
                anyOf:
                  - type: string
                    const: appointmentDate
                  - $ref: "#/components/schemas/AId"
                  - $ref: "#/components/schemas/SId"
              dateOffset:
                description: Time offset configuration relative to the dateField
                $ref: "#/components/schemas/__schema1508"
            additionalProperties: false
          eventConfig:
            type: object
            properties:
              scheduleAppointment:
                $ref: "#/components/schemas/__schema1510"
              appointmentType:
                $ref: "#/components/schemas/__schema1511"
              scheduleRestriction:
                $ref: "#/components/schemas/__schema1512"
            additionalProperties: false
          noteConfig:
            description: Note requirement configuration for this stage. Can be overridden
              per action.
            $ref: "#/components/schemas/__schema1514"
          hooks:
            description: Hooks to execute around this stage
            $ref: "#/components/schemas/__schema1517"
          rollback:
            description: Rollback behavior for this stage. Unset = accounts in this stage
              can be rolled back.
            $ref: "#/components/schemas/__schema1535"
          isDeleted:
            $ref: "#/components/schemas/isDeletedOutput"
          modifiedBy:
            $ref: "#/components/schemas/__schema807"
        required:
          - stageId
          - name
          - icon
          - color
          - scope
        additionalProperties: false
    __schema1487:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema1488:
      type: array
      items:
        $ref: "#/components/schemas/AId"
    __schema1489:
      type: object
      properties:
        includeOnPlan:
          description: Whether to include this on quarterly plans
          $ref: "#/components/schemas/__schema1490"
        allowPayment:
          description: Whether to allow payment calculation on quarterly plans
          $ref: "#/components/schemas/__schema1491"
      additionalProperties: false
    __schema1490:
      type: boolean
    __schema1491:
      type: boolean
    __schema1492:
      type: boolean
    __schema1493:
      description: Whether this action should trigger grading of the conversation by AI
      $ref: "#/components/schemas/__schema1494"
    __schema1494:
      type: boolean
    __schema1495:
      description: The prompt to use for the AI when evaluating this action
      $ref: "#/components/schemas/__schema1496"
    __schema1496:
      type: string
    __schema1497:
      type: boolean
    __schema1498:
      type: boolean
    __schema1499:
      type: boolean
    __schema1500:
      type: boolean
    __schema1501:
      type: array
      items:
        type: string
        enum:
          - contributor
          - actor
    __schema1502:
      type: string
      enum:
        - none
        - setter
        - closer
        - both
    __schema1503:
      type: boolean
    __schema1504:
      type: boolean
    __schema1505:
      type: boolean
    __schema1506:
      type: boolean
    __schema1507:
      type: string
      enum:
        - owner
        - closer
        - actionRoles
    __schema1508:
      oneOf:
        - type: object
          properties:
            direction:
              type: string
              const: on
            unit:
              $ref: "#/components/schemas/__schema1509"
          required:
            - direction
            - unit
          additionalProperties: false
        - type: object
          properties:
            direction:
              type: string
              enum:
                - before
                - after
            value:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
              description: Number of time units
            unit:
              description: Time unit for the offset
              $ref: "#/components/schemas/__schema1509"
          required:
            - direction
            - value
            - unit
          additionalProperties: false
      type: object
    __schema1509:
      type: string
      enum:
        - hour
        - day
        - week
        - month
    __schema1510:
      type: boolean
    __schema1511:
      type: string
      enum:
        - personal
        - closer
    __schema1512:
      description: User can only schedule closer events in this time window. User with
        event:manage permission can bypass this restriction.
      $ref: "#/components/schemas/__schema1513"
    __schema1513:
      type: object
      properties:
        operator:
          type: string
          enum:
            - gte
            - lte
        milliseconds:
          type: integer
          minimum: 0
          maximum: 9007199254740991
      required:
        - operator
        - milliseconds
      additionalProperties: false
    __schema1514:
      type: object
      properties:
        required:
          description: When enabled, users must add a note when performing this action
          $ref: "#/components/schemas/__schema1515"
        timeframeMs:
          description: If a note was left within this timeframe (ms), skip the
            requirement. Defaults to 24 hours
          $ref: "#/components/schemas/__schema1516"
      additionalProperties: false
    __schema1515:
      type: boolean
    __schema1516:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema1517:
      type: object
      properties:
        post:
          type: array
          items:
            $ref: "#/components/schemas/__schema1518"
      additionalProperties: false
    __schema1518:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: launch
            behavior:
              $ref: "#/components/schemas/__schema1519"
            launcher:
              type: object
              properties:
                baseUrl:
                  $ref: "#/components/schemas/__schema1520"
                pathParams:
                  $ref: "#/components/schemas/__schema1521"
                params:
                  $ref: "#/components/schemas/__schema1523"
                openMode:
                  $ref: "#/components/schemas/__schema1532"
                completionUrlPattern:
                  $ref: "#/components/schemas/__schema1533"
              required:
                - baseUrl
                - params
                - openMode
              additionalProperties: false
          required:
            - type
            - behavior
            - launcher
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: user
            behavior:
              type: string
              const: always
            action:
              type: string
              enum:
                - create
                - archive
          required:
            - type
            - behavior
            - action
          additionalProperties: false
      type: object
    __schema1519:
      type: string
      enum:
        - ask
        - always
    __schema1520:
      type: string
      format: uri
    __schema1521:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            pattern: ^[A-Za-z][A-Za-z0-9_]*$
          source:
            $ref: "#/components/schemas/__schema1522"
          fallbackValue:
            type: string
            minLength: 1
        required:
          - name
          - source
          - fallbackValue
        additionalProperties: false
    __schema1522:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: field
            field:
              type: string
              enum:
                - residentFirstName
                - residentLastName
                - residentFullName
                - residentPhone
                - residentEmail
                - residentPrescreenDecision
                - residentIndividualId
                - addressFull
                - addressLine1
                - addressCity
                - addressState
                - addressZip
                - latitude
                - longitude
                - accountId
                - locationId
                - deviceLatitude
                - deviceLongitude
                - userFullName
                - userEmail
                - userClientUserId
                - userId
                - userToken
                - returnUrl
          required:
            - type
            - field
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: customField
            customFieldId:
              $ref: "#/components/schemas/CFId"
          required:
            - type
            - customFieldId
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: static
            value:
              type: string
          required:
            - type
            - value
          additionalProperties: false
      type: object
    __schema1523:
      type: array
      items:
        type: object
        properties:
          name:
            $ref: "#/components/schemas/__schema1524"
          source:
            $ref: "#/components/schemas/__schema1525"
          whenEmpty:
            $ref: "#/components/schemas/__schema1529"
          fallbackValue:
            $ref: "#/components/schemas/__schema1531"
        required:
          - name
          - source
          - whenEmpty
        additionalProperties: false
    __schema1524:
      type: string
      minLength: 1
    __schema1525:
      anyOf:
        - $ref: "#/components/schemas/__schema1522"
        - type: object
          properties:
            type:
              $ref: "#/components/schemas/__schema1526"
            properties:
              $ref: "#/components/schemas/__schema1527"
          required:
            - type
            - properties
          additionalProperties: false
    __schema1526:
      type: string
      const: object
    __schema1527:
      type: array
      items:
        type: object
        properties:
          name:
            $ref: "#/components/schemas/__schema1528"
          source:
            $ref: "#/components/schemas/__schema1525"
          whenEmpty:
            $ref: "#/components/schemas/__schema1529"
          fallbackValue:
            $ref: "#/components/schemas/__schema1530"
        required:
          - name
          - source
          - whenEmpty
        additionalProperties: false
    __schema1528:
      type: string
      minLength: 1
    __schema1529:
      type: string
      enum:
        - exclude
        - emptyString
        - fallback
        - require
    __schema1530:
      type: string
    __schema1531:
      type: string
    __schema1532:
      type: string
      enum:
        - external
        - inAppBrowser
        - embedded
    __schema1533:
      description: Client-side completion URL prefix. Navigated URLs starting with
        this value complete the launcher.
      $ref: "#/components/schemas/__schema1534"
    __schema1534:
      type: string
    __schema1535:
      type: string
      enum:
        - target
        - protected
    __schema1536:
      type: array
      items:
        type: object
        properties:
          actionId:
            $ref: "#/components/schemas/AId"
          legacyId:
            anyOf:
              - $ref: "#/components/schemas/__schema907"
              - $ref: "#/components/schemas/__schema958"
          toStageId:
            $ref: "#/components/schemas/SId"
          fromStages:
            type: array
            items:
              $ref: "#/components/schemas/SId"
            deprecated: true
          name:
            type: string
            minLength: 1
          description:
            type: string
          short:
            type: string
          plural:
            type: string
          icon:
            type: string
          color:
            type: string
            description: Hex color code for the action display. Defaults to the target stage
              color if not set. Empty string means no color override.
          conditions:
            type: array
            items:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      const: action_count
                    actionId:
                      $ref: "#/components/schemas/AId"
                    count:
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    operator:
                      default: gte
                      type: string
                      enum:
                        - eq
                        - lt
                        - lte
                        - gt
                        - gte
                  required:
                    - type
                    - count
                    - operator
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: distance_from_property
                    meters:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                  required:
                    - type
                    - meters
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: distance_from_action
                    on:
                      type: string
                      enum:
                        - this
                        - any
                    meters:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    actionId:
                      description: The action to measure distance from, defaults to the current action
                      $ref: "#/components/schemas/AId"
                  required:
                    - type
                    - on
                    - meters
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: time_since
                    on:
                      type: string
                      enum:
                        - this
                        - any
                    milliseconds:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    actionId:
                      description: The action to measure distance from, defaults to the current action
                      $ref: "#/components/schemas/AId"
                  required:
                    - type
                    - on
                    - milliseconds
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      $ref: "#/components/schemas/__schema1537"
                    minutesStart:
                      $ref: "#/components/schemas/__schema1538"
                    minutesEnd:
                      $ref: "#/components/schemas/__schema1539"
                  required:
                    - type
                    - minutesStart
                    - minutesEnd
                  additionalProperties: false
              type: object
          aiConfig:
            deprecated: true
            $ref: "#/components/schemas/__schema1540"
          accountConfig:
            type: object
            properties:
              scheduleAppointment:
                $ref: "#/components/schemas/__schema1510"
              appointmentType:
                $ref: "#/components/schemas/__schema1511"
              scheduleRestriction:
                $ref: "#/components/schemas/__schema1512"
              trackUserLocation:
                description: Whether this action requires tracking the user's location
                $ref: "#/components/schemas/__schema1541"
              undoAction:
                $ref: "#/components/schemas/__schema1542"
              noteConfig:
                description: Note requirement configuration for this action
                $ref: "#/components/schemas/__schema1514"
            additionalProperties: false
          eventConfig:
            type: object
            properties:
              occurred:
                type: boolean
              reschedule:
                type: boolean
              closed:
                type: boolean
              show:
                type: string
                enum:
                  - before
                  - after
              fault:
                type: string
                enum:
                  - setter
                  - closer
            additionalProperties: false
          reportConfig:
            type: object
            properties:
              count:
                $ref: "#/components/schemas/__schema1498"
              daysSince:
                $ref: "#/components/schemas/__schema1499"
              timeOfDay:
                $ref: "#/components/schemas/__schema1500"
              hoursWorked:
                type: object
                properties:
                  enabled:
                    type: boolean
                required:
                  - enabled
                additionalProperties: false
              reportOn:
                $ref: "#/components/schemas/__schema1501"
              variantsShown:
                $ref: "#/components/schemas/__schema1502"
            additionalProperties: false
          checkpoints:
            description: 'Legacy, replaced by `hooks.pre`. Map of stageId to `{ behavior:
              "always" | "ask" | "never" }`: before this action, the account
              passes through these stages as stage-only history entries, so no
              action is credited for them.'
            $ref: "#/components/schemas/__schema1544"
          hooks:
            description: 'Hooks to execute around this action. `pre` is an array of `{ type:
              "action", actionId, behavior: "always" | "ask" }`: actions
              recorded just before this one, each credited and condition-checked
              as its own action.'
            $ref: "#/components/schemas/__schema1545"
          roles:
            type: array
            items:
              $ref: "#/components/schemas/RoleId"
          order:
            description: Order of the action in the workflow
            $ref: "#/components/schemas/__schema1487"
          isDeleted:
            $ref: "#/components/schemas/isDeletedOutput"
          modifiedBy:
            $ref: "#/components/schemas/__schema807"
        required:
          - actionId
          - fromStages
          - name
          - icon
          - color
        additionalProperties: false
    __schema1537:
      type: string
      const: time_of_day
    __schema1538:
      type: integer
      minimum: 0
      maximum: 1439
      description: Start time in minutes from midnight (0-1439)
    __schema1539:
      type: integer
      minimum: 0
      maximum: 1439
      description: End time in minutes from midnight (0-1439)
    __schema1540:
      type: object
      properties:
        enabled:
          type: boolean
        shouldGrade:
          $ref: "#/components/schemas/__schema1493"
        prompt:
          $ref: "#/components/schemas/__schema1495"
      additionalProperties: false
    __schema1541:
      type: boolean
    __schema1542:
      type: object
      properties:
        distanceFromLocation:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        timeSince:
          description: Minutes since the last activity after which the action can no
            longer be undone; 0 turns the time check off. A duration, so no time
            zone applies.
          $ref: "#/components/schemas/__schema1543"
      additionalProperties: false
    __schema1543:
      type: integer
      minimum: 0
      maximum: 9007199254740991
    __schema1544:
      type: object
      propertyNames:
        $ref: "#/components/schemas/SId"
      additionalProperties:
        type: object
        properties:
          behavior:
            type: string
            enum:
              - always
              - ask
              - never
        additionalProperties: false
    __schema1545:
      type: object
      properties:
        pre:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - action
              actionId:
                $ref: "#/components/schemas/AId"
              behavior:
                $ref: "#/components/schemas/__schema1519"
            required:
              - type
              - actionId
              - behavior
            additionalProperties: false
        post:
          type: array
          items:
            $ref: "#/components/schemas/__schema1518"
      additionalProperties: false
    __schema1546:
      type: array
      items:
        $ref: "#/components/schemas/__schema1547"
    __schema1547:
      type: object
      properties:
        sourceStage:
          type: string
        targetId:
          anyOf:
            - $ref: "#/components/schemas/SId"
            - $ref: "#/components/schemas/AId"
      required:
        - sourceStage
        - targetId
      additionalProperties: false
    __schema1548:
      description: "Maps a legacy ID (`sourceStage`: an account status, disposition or
        event outcome ID, or a legacy metric such as `pitch`) to the stage or
        action that replaces it (`targetId`). Imports, CRM syncs, plans,
        programs and reports still read it to translate legacy IDs. Unrelated to
        checkpoints."
      $ref: "#/components/schemas/__schema1549"
    __schema1549:
      type: array
      items:
        $ref: "#/components/schemas/__schema1547"
    __schema1550:
      description: Whether the company's legacy setup (account statuses, dispositions,
        event outcomes) has been fully migrated to this workflow. It does not
        say whether actions use `checkpoints` or `hooks.pre`. Read-only through
        `/workflow/update`.
      $ref: "#/components/schemas/__schema1551"
    __schema1551:
      type: boolean
    __schema1552:
      type: array
      items:
        anyOf:
          - $ref: "#/components/schemas/companyId"
          - $ref: "#/components/schemas/teamId"
          - $ref: "#/components/schemas/RoleId"
    __schema1553:
      type: string
      enum:
        - account
        - user
        - subAccount
      description: The entity this workflow applies to
    __schema1554:
      type: array
      items:
        type: string
        enum:
          - canvass
          - user_manage
          - team_manage
          - calendar
          - setter_closer
          - integrations
          - videos
          - chat
          - recording
          - gamification
          - stats
          - demo
          - programs
          - tasks
          - dashboards
          - recruiting
          - account_assignment
          - shadow
          - one_on_one
          - team_meeting
          - compliance
          - wirecenter_data
    __schema1555:
      type: object
      properties:
        undoAction:
          $ref: "#/components/schemas/__schema1542"
        deleteOnUndo:
          description: When enabled, prompt users to delete an account when undoing the
            last activity results in an empty activity history
          $ref: "#/components/schemas/__schema1556"
        hidePreviousActivity:
          description: Hide account activity prior to the current assignment for these roles
          $ref: "#/components/schemas/__schema1557"
        closerEventFlow:
          default:
            type: residentFirst
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: residentFirst
              required:
                - type
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: timeslotFirst
              required:
                - type
              additionalProperties: false
          type: object
        mapControlKpis:
          description: Up to 2 report KPI columns to display in the mobile map control
            alongside Active
          $ref: "#/components/schemas/__schema1558"
        showAllCustomFieldsInResidentForm:
          description: Show all editable account custom fields in the mobile resident form
          $ref: "#/components/schemas/__schema1560"
        defaultEventConfig:
          description: Default schedule restriction applied when no stage/action-level
            scheduleRestriction is configured.
          $ref: "#/components/schemas/__schema1561"
        rollback:
          description: Account stage rollback configuration
          $ref: "#/components/schemas/__schema1562"
      additionalProperties: false
    __schema1556:
      type: boolean
    __schema1557:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    __schema1558:
      maxItems: 2
      type: array
      items:
        $ref: "#/components/schemas/__schema1559"
    __schema1559:
      type: object
      properties:
        value:
          description: groupBy returns the grouped entity.
          $ref: "#/components/schemas/__schema1344"
        accumulator:
          $ref: "#/components/schemas/__schema1339"
      required:
        - value
      additionalProperties: false
    __schema1560:
      type: boolean
    __schema1561:
      type: object
      properties:
        scheduleRestriction:
          $ref: "#/components/schemas/__schema1512"
      additionalProperties: false
    __schema1562:
      type: object
      properties:
        enabled:
          type: boolean
        defaultStageId:
          description: Fallback when an account has no target stage in its history. Must
            be a target stage.
          $ref: "#/components/schemas/SId"
        roleIds:
          description: Roles allowed to roll back accounts
          $ref: "#/components/schemas/__schema1563"
      required:
        - enabled
      additionalProperties: false
    __schema1563:
      type: array
      items:
        $ref: "#/components/schemas/RoleId"
    utcMillisecondsOutput:
      title: Timestamp
      description: A timestamp in UTC milliseconds
      example: 1784224980123
      $ref: "#/components/schemas/__schema808"
    auditPropsCreatedAtOutput:
      deprecated: true
      $ref: "#/components/schemas/utcMillisecondsOutput"
    auditPropsUpdatedAtOutput:
      $ref: "#/components/schemas/utcMillisecondsOutput"
    auditPropsLastUpdateProcessOutput:
      $ref: "#/components/schemas/__schema809"
    auditPropsVersionOutput:
      $ref: "#/components/schemas/__schema810"
    latlngOutput:
      type: object
      properties:
        latitude:
          $ref: "#/components/schemas/latitude"
        longitude:
          $ref: "#/components/schemas/longitude"
      required:
        - latitude
        - longitude
      additionalProperties: false
      title: Latitude and Longitude
      description: Geographical coordinates
    locationIdOutput:
      anyOf:
        - $ref: "#/components/schemas/CanId"
        - $ref: "#/components/schemas/LocNewId"
        - $ref: "#/components/schemas/__schema835"
        - $ref: "#/components/schemas/TLocId"
        - $ref: "#/components/schemas/FAId"
        - $ref: "#/components/schemas/PRId"
      title: Location ID
      description: Unique identifier for the location. Usually a Terros location ID
        such as `TLoc.123-4aBc_d`. Custom locations use `LocNew.`, and other
        address sources use `Can.`, `FA.`, `PR.`, or legacy `Loc:` prefixes.
      example: TLoc.123-4aBc_d
    addressPostal2Output:
      description: Secondary postal code segment, such as the four-digit suffix of a ZIP+4
      example: "1234"
      $ref: "#/components/schemas/__schema837"
    addressPostal3Output:
      description: Tertiary postal code segment, used by some non-US postal systems
      $ref: "#/components/schemas/__schema838"
    addressUnitNbrOutput:
      description: Unit, apartment, or suite number for the address
      example: 5B
      $ref: "#/components/schemas/__schema839"
    addressUnitTypeOutput:
      description: Optional import column for the unit type, such as Unit, Apt, or
        Suite. Persisted with the location data and unused for matching.
      example: Unit
      $ref: "#/components/schemas/__schema840"
    userClientUserIdOutput:
      description: External client system user ID
      example: EMP001
      $ref: "#/components/schemas/__schema844"
    userPreferredNameOutput:
      description: User's preferred name
      example: Johnny
      $ref: "#/components/schemas/__schema845"
    userAvatarBlurhashOutput:
      description: BlurHash for user's avatar
      $ref: "#/components/schemas/__schema846"
    userAvatarUrlOutput:
      description: URL to user's avatar image
      $ref: "#/components/schemas/__schema847"
    userLastAccessOutput:
      description: Timestamp of last access
      example: 1672531200000
      $ref: "#/components/schemas/__schema848"
    userIsDeletedOutput:
      description: Whether the user is deleted
      $ref: "#/components/schemas/__schema849"
    tinyUserColorOutput:
      description: Preferred color for area assignment
      $ref: "#/components/schemas/__schema850"
    userPhoneOutput:
      description: User's phone number
      example: "5551234567"
      $ref: "#/components/schemas/__schema851"
    userTitleOutput:
      description: User's job title
      example: Sales Representative
      $ref: "#/components/schemas/__schema852"
    userTimeZoneOutput:
      description: User's timezone
      example: America/Los_Angeles
      $ref: "#/components/schemas/__schema853"
    userCreatedDateOutput:
      description: When the user was created, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/__schema861"
    tinyResidentOutput:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/__schema865"
        firstName:
          $ref: "#/components/schemas/__schema866"
        lastName:
          $ref: "#/components/schemas/__schema867"
        email:
          $ref: "#/components/schemas/__schema868"
        phone:
          $ref: "#/components/schemas/__schema870"
        phone2:
          $ref: "#/components/schemas/__schema873"
        businessName:
          $ref: "#/components/schemas/__schema874"
        age:
          $ref: "#/components/schemas/__schema879"
        creditScore:
          $ref: "#/components/schemas/__schema880"
        hasAge:
          $ref: "#/components/schemas/__schema881"
        hasCreditScore:
          $ref: "#/components/schemas/__schema882"
      additionalProperties: false
      title: Tiny Resident
      description: Minimal resident information
    tinyUserOutput:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema947"
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        isDeleted:
          $ref: "#/components/schemas/userIsDeletedOutput"
        color:
          $ref: "#/components/schemas/tinyUserColorOutput"
      required:
        - userId
        - firstName
        - lastName
      additionalProperties: false
      title: Tiny User
      description: Minimal user information for display purposes
    isDeletedOutput:
      description: Indicates if the item is deleted
      $ref: "#/components/schemas/__schema950"
    calendarEventSourceIdOutput:
      description: External client system event ID
      $ref: "#/components/schemas/__schema957"
    calendarEventOutcomeIdOutput:
      description: ID for the Outcome of the event
      $ref: "#/components/schemas/__schema958"
    calendarEventLocationIdOutput:
      description: Location ID
      example: Location:home123
      $ref: "#/components/schemas/locationIdOutput"
    calendarEventOccurredOwnerOutput:
      description: Whether the owner attended the event
      $ref: "#/components/schemas/__schema966"
    calendarEventOccurredAttendeeOutput:
      description: Whether the attendee attended the event
      $ref: "#/components/schemas/__schema967"
    calendarEventNotesOutput:
      description: Event notes. If using Workflows this will be migrated to account notes.
      example: Customer was very interested in the product
      deprecated: true
      $ref: "#/components/schemas/__schema968"
    calendarEventOccurredOutput:
      description: Whether this event occurred
      $ref: "#/components/schemas/__schema976"
    calendarEventClosedOutput:
      description: Whether the account was closed during this event
      $ref: "#/components/schemas/__schema977"
    calendarEventReasonNotOccurredOutput:
      description: Reason the event did not occur (does not necessarily indicate that
        the event did not occur)
      example: Customer rescheduled
      $ref: "#/components/schemas/__schema978"
    calendarEventFaultOutput:
      description: Fault information for the event
      example: setter
      $ref: "#/components/schemas/__schema979"
    calendarEventAllDayOutput:
      description: Whether this is an all-day event
      $ref: "#/components/schemas/__schema980"
    calendarEventCanDeleteOutput:
      description: Whether the current user can delete this event
      $ref: "#/components/schemas/__schema981"
    smallUserOutput:
      type: object
      properties:
        userId:
          $ref: "#/components/schemas/__schema947"
        clientUserId:
          $ref: "#/components/schemas/userClientUserIdOutput"
        firstName:
          $ref: "#/components/schemas/userFirstName"
        lastName:
          $ref: "#/components/schemas/userLastName"
        preferredName:
          $ref: "#/components/schemas/userPreferredNameOutput"
        avatarBlurhash:
          $ref: "#/components/schemas/userAvatarBlurhashOutput"
        avatarUrl:
          $ref: "#/components/schemas/userAvatarUrlOutput"
        lastAccess:
          $ref: "#/components/schemas/userLastAccessOutput"
        isDeleted:
          $ref: "#/components/schemas/userIsDeletedOutput"
        color:
          $ref: "#/components/schemas/tinyUserColorOutput"
        email:
          $ref: "#/components/schemas/userEmail"
        phone:
          $ref: "#/components/schemas/userPhoneOutput"
        title:
          $ref: "#/components/schemas/userTitleOutput"
        timeZone:
          $ref: "#/components/schemas/userTimeZoneOutput"
        teamIds:
          $ref: "#/components/schemas/__schema854"
        closerStatus:
          $ref: "#/components/schemas/userCloserStatus"
        roles:
          $ref: "#/components/schemas/__schema856"
        memberOf:
          $ref: "#/components/schemas/__schema985"
        companyId:
          $ref: "#/components/schemas/__schema860"
        createdDate:
          $ref: "#/components/schemas/userCreatedDateOutput"
      required:
        - userId
        - firstName
        - lastName
        - email
      additionalProperties: false
      title: Small User
      description: User information with basic contact details
    teamExternalIdOutput:
      description: External ID of the team
      example: "12345"
      $ref: "#/components/schemas/__schema990"
    teamAvatarBlurhashOutput:
      description: Blurhash representation of the team avatar.
      $ref: "#/components/schemas/__schema991"
    teamAvatarUrlOutput:
      description: URL of the team avatar.
      $ref: "#/components/schemas/__schema992"
    teamRestrictVisibilityOutput:
      description: If true, team is not visible to other teams.
      $ref: "#/components/schemas/__schema993"
    teamMeetingTimesOutput:
      description: Legacy scheduled meeting times for the team; new meeting
        configuration clients use /meeting/list
      example:
        - day: 1
          start: 600
          end: 660
      $ref: "#/components/schemas/__schema994"
    appAvatarUrlOutput:
      $ref: "#/components/schemas/__schema1026"
    appAvatarBlurhashOutput:
      $ref: "#/components/schemas/__schema1027"
    evaluationEventDateOutput:
      description: When the behavior occurred (the recording was submitted), in UTC
        epoch milliseconds. This could be EMPTY_DATE if this is a Pending
        evaluation.
      $ref: "#/components/schemas/__schema1113"
    evaluationEvaluatorOutput:
      description: The user who conducted (or will conduct) this eval
      $ref: "#/components/schemas/tinyUserOutput"
    evaluationEvalDateOutput:
      description: When the evaluation was graded, in UTC epoch milliseconds
      $ref: "#/components/schemas/__schema1114"
    evaluationScoreOutput:
      $ref: "#/components/schemas/__schema1115"
    evaluationCommentOutput:
      description: If the evaluation was rejected, this is the reason
      $ref: "#/components/schemas/__schema1116"
    evaluationDownloadUrlOutput:
      $ref: "#/components/schemas/__schema1117"
    evaluationUploadUrlOutput:
      $ref: "#/components/schemas/__schema1118"
    ColumnMappingOutput:
      type: object
      propertyNames:
        $ref: "#/components/schemas/__schema1216"
      additionalProperties:
        $ref: "#/components/schemas/__schema1217"
      description: Maps CSV column names (keys) to the expected header names the
        parser should read them as (values).
    teamDescriptionOutput:
      description: Description of the team
      example: This is a team.
      $ref: "#/components/schemas/__schema1385"
    teamTimezoneOutput:
      description: Timezone the team operates in
      example: America/Los_Angeles
      $ref: "#/components/schemas/__schema1386"
    teamOfficeLocationOutput:
      description: Location of the team
      example:
        lat: 33.7
        lng: -117.8
      $ref: "#/components/schemas/latlngOutput"
    teamOfficeAddressOutput:
      description: Street address of the team
      example: 1234 Main St, Irvine, CA 92780
      $ref: "#/components/schemas/__schema1387"
    teamIsCloserBoundaryOutput:
      description: If true, closer search will not propagate to parent teams.
      $ref: "#/components/schemas/__schema1388"
    teamUploadAvatarUrlOutput:
      description: present when `includeUploadUrls` is true or omitted (for now) and
        the caller can edit this entity; presigned PUT URL, expires in about 1h
      $ref: "#/components/schemas/__schema1389"
    userHasManagerOutput:
      description: Whether the user reports having a manager
      example: true
      $ref: "#/components/schemas/__schema1393"
    selfReportedManagerOutput:
      type: object
      properties:
        managerId:
          $ref: "#/components/schemas/selfReportedManagerId"
        updatedAt:
          $ref: "#/components/schemas/selfReportedManagerUpdatedAtOutput"
      required:
        - updatedAt
      additionalProperties: false
      title: Self Reported Manager
      description: Manager selection reported directly by the user
    selfReportedManagerUpdatedAtOutput:
      description: When the self-reported manager was last updated, in UTC epoch
        milliseconds
      $ref: "#/components/schemas/utcMillisecondsOutput"
    primaryTeamOutput:
      type: object
      properties:
        teamId:
          $ref: "#/components/schemas/__schema1396"
        staleAfter:
          $ref: "#/components/schemas/__schema1397"
      required:
        - teamId
        - staleAfter
      additionalProperties: false
      title: Primary Team
      description: Primary team assignment for a user
    userBetaProgramOutput:
      description: Whether the user is enrolled in the Terros Beta program
      example: true
      $ref: "#/components/schemas/__schema1398"
    userLanguageOutput:
      description: User's preferred language
      example: en_US
      $ref: "#/components/schemas/__schema1399"
    userSecondaryLanguagesOutput:
      description: Languages spoken by user
      example: en
      $ref: "#/components/schemas/__schema1400"
    userColorOutput:
      description: UI color theme for the user
      example: "#3B82F6"
      $ref: "#/components/schemas/__schema1401"
    userSuperuserScoreOutput:
      description: Score indicating superuser status, used for internal ranking
      example: 42.12
      $ref: "#/components/schemas/__schema1402"
    userWhitelistOutput:
      description: Whether the user is whitelisted, not allowing them to be archived
      example: false
      $ref: "#/components/schemas/__schema1405"
    userStartDateOutput:
      description: User's employment start date, in UTC epoch milliseconds
      example: 1672531200000
      $ref: "#/components/schemas/__schema1421"
    userBiographyOutput:
      description: User's biography or personal description
      example: Experienced sales professional...
      $ref: "#/components/schemas/__schema1430"
    webhookAddUpdateActionOutput:
      anyOf:
        - $ref: "#/components/schemas/__schema1471"
        - $ref: "#/components/schemas/__schema1472"
  responses:
    Error4XX:
      description: Unauthorized
      content:
        application/json:
          example:
            message: Unauthorized
          schema:
            $ref: "#/components/schemas/lambdaResponseError"
    WebhookResponse:
      description: Webhook received successfully
  securitySchemes:
    TerrosApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication.  
                Include the header as: Authorization: "ApiKey YOUR_API_KEY".
                The value must be prefixed with "ApiKey" followed by a space and then your actual API key.
