openapi: 3.2.0 info: title: Sweep Territories API description: This is a publicly available Sweep API. version: '0.1' contact: {} servers: - url: https://api.sweep.io description: Sweep production API — the host this document was harvested from (GET /api-json); /health responds here tags: - name: Territories paths: /territories: get: operationId: TerritoriesController_getTerritories parameters: [] responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/ReadTerritoryDto' security: - bearer: [] tags: - Territories post: operationId: TerritoriesController_createTerritory parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertTerritoryDto' responses: '201': description: '' content: application/json: schema: $ref: '#/components/schemas/Territory' security: - bearer: [] tags: - Territories /territories/{territoryId}: put: operationId: TerritoriesController_updateTerritory parameters: - name: territoryId required: true in: path schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpsertTerritoryDto' responses: '200': description: '' security: - bearer: [] tags: - Territories delete: operationId: TerritoriesController_deleteTerritory parameters: - name: territoryId required: true in: path schema: type: string responses: '200': description: '' content: application/json: schema: type: boolean security: - bearer: [] tags: - Territories components: schemas: SweepFieldReference: type: object properties: fieldIds: type: array items: type: string fieldSource: type: string required: - fieldIds ReadCriteriaDto: type: object properties: criterionId: type: string fieldName: type: string operator: type: string value: type: string required: - criterionId - fieldName - operator - value FunnelDetailsDto: type: object properties: leadingObject: $ref: '#/components/schemas/LeadingObjectDto' stages: type: array items: $ref: '#/components/schemas/SweepStage' _firstStageId: type: string plugins: default: {} allOf: - $ref: '#/components/schemas/FunnelPluginsDto' funnelLinks: type: array items: $ref: '#/components/schemas/FunnelLinkDto' stageMetadata: type: array items: type: object required: - leadingObject - stages - plugins SweepAssignmentRule: type: object properties: assignmentId: type: string ruleName: type: string assignedTo: type: string assignedToType: type: string criteriaLogic: type: string criteria: type: array items: type: object required: - assignmentId - ruleName - assignedTo - assignedToType - criteriaLogic - criteria User: type: object properties: id: type: string sub: type: string email: type: string account: $ref: '#/components/schemas/Account' preferences: type: object name: type: string emoji: type: string imageUrl: type: string jobTitle: type: string roleGroup: $ref: '#/components/schemas/RoleGroup' roleGroupId: type: string createdAt: format: date-time type: string updatedAt: format: date-time type: string deletedAt: format: date-time type: string lastSeen: format: date-time type: string required: - id - sub - email - account - preferences - name - emoji - imageUrl - jobTitle - roleGroup - roleGroupId - createdAt - updatedAt SweepExitCriteria: type: object properties: _exitCriteriaId: type: string _nextStageId: type: string isAutoMoveToNextStage: type: boolean guidance: type: string criteria: type: array items: type: object criteriaLogic: type: string required: - _exitCriteriaId - criteria - criteriaLogic FunnelLinkDto: type: object properties: _id: type: string _type: type: string enum: - salesforce - thirdParty - recordType - hubspot - metadataElement funnelId: type: string stageId: type: string required: - _id - _type - funnelId UpsertTerritoryDto: type: object properties: name: type: string criteria: type: array items: $ref: '#/components/schemas/CreateTerritoryCriterionDto' criteriaLogic: type: string required: - name - criteria - criteriaLogic FunnelSnapshot: type: object properties: id: type: string ord: type: number createdById: type: string createdBy: $ref: '#/components/schemas/User' apiName: type: string accountId: type: string account: $ref: '#/components/schemas/Account' name: type: string funnelName: type: string description: type: string recordTypeName: type: string restoredFromSnapshot: type: number funnelDetails: $ref: '#/components/schemas/FunnelDetailsDto' deployments: type: array items: $ref: '#/components/schemas/FunnelDeployment' createdAt: format: date-time type: string required: - id - ord - createdById - createdBy - apiName - accountId - account - name - funnelName - description - recordTypeName - restoredFromSnapshot - funnelDetails - deployments - createdAt RoleGroup: type: object properties: id: type: string accountId: type: string account: $ref: '#/components/schemas/Account' type: type: string enum: - SYSTEM - USER_CREATED accountRoles: type: array items: $ref: '#/components/schemas/RoleGroupAccountRole' orgRoles: type: array items: $ref: '#/components/schemas/RoleGroupOrgRole' createdById: type: string createdBy: $ref: '#/components/schemas/User' createdAt: format: date-time type: string updatedById: type: string updatedBy: $ref: '#/components/schemas/User' updatedAt: format: date-time type: string name: type: string description: type: string required: - id - accountId - account - type - accountRoles - orgRoles - createdById - createdBy - createdAt - updatedById - updatedBy - updatedAt - name LeadingObjectDto: type: object properties: objectName: type: string fieldName: type: string _leadingFieldLabels: type: array items: type: string _leadingFieldId: type: string required: - objectName - fieldName - _leadingFieldId RoleGroupAccountRole: type: object properties: role: type: object roleGroupId: type: string roleGroup: $ref: '#/components/schemas/RoleGroup' required: - role - roleGroupId - roleGroup CreateTerritoryCriterionDto: type: object properties: criterionId: type: string fieldName: type: string operator: type: string value: type: string required: - criterionId - fieldName - operator - value FunnelDeployment: type: object properties: id: type: string crmOrgId: type: string crmOrg: $ref: '#/components/schemas/CrmOrg' snapshotId: type: string snapshot: $ref: '#/components/schemas/FunnelSnapshot' deployedById: type: string deployedBy: $ref: '#/components/schemas/User' deployedAt: format: date-time type: string status: type: object required: - id - crmOrgId - crmOrg - snapshotId - snapshot - deployedById - deployedBy - deployedAt - status Territory: type: object properties: id: type: string accountId: type: string account: $ref: '#/components/schemas/Account' name: type: string createdById: type: string createdBy: $ref: '#/components/schemas/User' createdAt: format: date-time type: string updatedById: type: string updatedBy: $ref: '#/components/schemas/User' updatedAt: format: date-time type: string criteria: type: array items: $ref: '#/components/schemas/TerritoryCriterion' criteriaLogic: type: string required: - id - accountId - account - name - createdById - createdBy - createdAt - updatedById - updatedBy - updatedAt - criteria - criteriaLogic CrmOrg: type: object properties: id: type: string org: $ref: '#/components/schemas/Org' name: type: string platform: type: string instanceUrl: type: string isSandbox: type: boolean isMain: type: boolean isDemo: type: boolean isConnected: type: object default: false createdById: type: string createdBy: $ref: '#/components/schemas/User' fetchStatus: enum: - fetching - initial_fetching - error - fetched - invalid_credentials type: string lastSuccessfulFetchTs: type: number disconnectedAt: format: date-time type: - string - 'null' createdAt: format: date-time type: string updatedAt: format: date-time type: string accountId: type: string connectedUser: type: string account: $ref: '#/components/schemas/Account' deployments: type: array items: $ref: '#/components/schemas/FunnelDeployment' optMonitoring: type: boolean graphVersion: type: - string - 'null' graphDbReleaseChannel: enum: - stable - beta - shadow type: - string - 'null' tier: enum: - T0 - T1 type: string required: - id - org - name - platform - instanceUrl - isSandbox - isMain - isDemo - isConnected - createdById - createdBy - fetchStatus - lastSuccessfulFetchTs - disconnectedAt - createdAt - updatedAt - accountId - connectedUser - account - deployments - optMonitoring - graphVersion - graphDbReleaseChannel - tier Account: type: object properties: id: type: string name: type: string authZeroOrgId: type: string createdAt: format: date-time type: string updatedAt: format: date-time type: string deletedAt: format: date-time type: string onboardingStep: type: string enum: - ConnectOrg - Completed trialStartDate: format: date-time type: string trialEndDate: format: date-time type: string type: type: string enum: - Customer - POC - Inactive - SI - Free - Internal roleGroups: type: array items: $ref: '#/components/schemas/RoleGroup' users: type: array items: $ref: '#/components/schemas/User' disableAi: type: boolean isBuildModeEnabled: type: boolean lastSeen: format: date-time type: string allowedIpRanges: type: - array - 'null' items: type: string required: - id - name - authZeroOrgId - createdAt - updatedAt - deletedAt - onboardingStep - trialStartDate - trialEndDate - type - roleGroups - users - disableAi - isBuildModeEnabled - lastSeen - allowedIpRanges Org: type: object properties: id: type: string accountId: type: string account: $ref: '#/components/schemas/Account' required: - id - accountId - account SweepStage: type: object properties: stageName: type: string _stageId: type: string stageDescription: type: string _branchIndex: type: number _stageColumnIndex: type: number exitCriteria: type: array items: $ref: '#/components/schemas/SweepExitCriteria' assignmentRules: type: array items: $ref: '#/components/schemas/SweepAssignmentRule' _team: type: string stageType: type: string enum: - regular - lost - nurturing preventBackwardStages: type: boolean funnelLinks: type: array items: $ref: '#/components/schemas/FunnelLinkDto' additionalFields: default: [] type: array items: $ref: '#/components/schemas/SweepFieldReference' required: - stageName - _stageId - stageDescription - exitCriteria - assignmentRules ReadTerritoryDto: type: object properties: criteria: type: array items: $ref: '#/components/schemas/ReadCriteriaDto' criteriaLogic: type: string name: type: string updatedAt: format: date-time type: string updatedById: type: string required: - criteria - criteriaLogic - name - updatedAt - updatedById RoleGroupOrgRole: type: object properties: role: type: object crmOrgId: type: string crmOrg: $ref: '#/components/schemas/CrmOrg' roleGroupId: type: string roleGroup: $ref: '#/components/schemas/RoleGroup' required: - role - crmOrgId - crmOrg - roleGroupId - roleGroup TerritoryCriterion: type: object properties: criterionId: type: string fieldName: type: string operator: type: string value: type: string required: - criterionId - fieldName - operator - value FunnelPluginsDto: type: object properties: {} securitySchemes: bearer: scheme: bearer bearerFormat: JWT type: http