tic_arq

2.0info: 4.7.0 approval_service description: x-senior-domain: tic_arq x-senior-domain-path: tic_arq x-senior-service-path: approval_service contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: api.senior.com.br /tic_arq/approval_servicesecurityDefinitions: bearerAuth: type: apiKey in: header name: Authorization – application/json – application/jsonparameters: clientId: name: client_id type: string in: header required: true description: Identificação da aplicação cadastrada no portal do desenvolvedor (api.xplatform.com.br)paths: /listHcmUser: post: description: Lists users available for approval substitutions. A full corporate e-mail is also looked up in the HCM, so people who never signed in to Approval can be found. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: search: type: string description: Optional text filter applied to username, name and email; a full e-mail is also looked up in the HCM activeOnly: type: boolean description: When true, returns only active users offset: type: integer description: Zero-based row offset size: type: integer description: Maximum number of users returned responses: 200: description: Ok schema: type: object properties: contents: #/definitions/hcmUserSummary totalPages: type: integer description: Total pages for the applied paging totalElements: type: integer description: Total matching users default: description: Error response schema: #/definitions/genericError get: description: Lists users available for approval substitutions. A full corporate e-mail is also looked up in the HCM, so people who never signed in to Approval can be found. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: search: type: string description: Optional text filter applied to username, name and email; a full e-mail is also looked up in the HCM activeOnly: type: boolean description: When true, returns only active users offset: type: integer description: Zero-based row offset size: type: integer description: Maximum number of users returned responses: 200: description: Ok schema: type: object properties: contents: #/definitions/hcmUserSummary totalPages: type: integer description: Total pages for the applied paging totalElements: type: integer description: Total matching users default: description: Error response schema: #/definitions/genericError /rejectDa080ApprovalRequest: post: description: Rejects the current or informed DA080 approval step and finishes the local workflow as rejected. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – requestId properties: requestId: type: string description: Stored DA080 request identifier. stepOrder: type: integer description: Approval step order. When omitted, the current pending step is used. rejectionReason: type: string description: Business rejection reason stored in the audit history. responses: 200: description: Ok schema: type: object required: – requestId – requestStatus properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. currentStep: #/definitions/da080ApprovalStepStatus steps: #/definitions/da080ApprovalStepStatus history: #/definitions/da080ApprovalHistoryEntry approvalPayload: type: string description: Stored approval workflow payload after the mutation. default: description: Error response schema: #/definitions/genericError /cloneApprovalPolicy: post: description: Clones an existing policy creating a new DRAFT version with version = max(version)+1. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – policyId properties: policyId: type: string description: Policy identifier to be cloned (UUID as string) responses: 200: description: Ok schema: type: object required: – sourcePolicyId – newPolicyId – version properties: sourcePolicyId: type: string description: Origin policy identifier newPolicyId: type: string description: New (cloned) policy identifier type: integer description: New version default: description: Error response schema: #/definitions/genericError /listDa080ApprovalRequestStatus: post: description: Lists persisted DA080 approval requests with workflow status data for approval queue screens. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestStatus: type: string description: Optional request status filter. offset: type: integer description: Zero-based row offset. size: type: integer description: Maximum number of requests returned. responses: 200: description: Ok schema: type: object properties: contents: #/definitions/da080ApprovalRequestStatusOutput totalPages: type: integer description: Total pages for the applied paging. totalElements: type: integer description: Total matching requests. default: description: Error response schema: #/definitions/genericError get: description: Lists persisted DA080 approval requests with workflow status data for approval queue screens. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestStatus: type: string description: Optional request status filter. offset: type: integer description: Zero-based row offset. size: type: integer description: Maximum number of requests returned. responses: 200: description: Ok schema: type: object properties: contents: #/definitions/da080ApprovalRequestStatusOutput totalPages: type: integer description: Total pages for the applied paging. totalElements: type: integer description: Total matching requests. default: description: Error response schema: #/definitions/genericError /listApprovalAccessUsers: post: description: Lists platform users with their current approval access role. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: search: type: string description: Optional text filter applied to username, name and email activeOnly: type: boolean description: When true, returns only active users roleCode: type: string description: Optional active role filter offset: type: integer description: Zero-based row offset size: type: integer description: Maximum number of users returned responses: 200: description: Ok schema: type: object properties: contents: #/definitions/approvalAccessUserSummary roleOptions: #/definitions/approvalAccessRoleOption totalPages: type: integer description: Total pages for the applied paging totalElements: type: integer description: Total matching users default: description: Error response schema: #/definitions/genericError get: description: Lists platform users with their current approval access role. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: search: type: string description: Optional text filter applied to username, name and email activeOnly: type: boolean description: When true, returns only active users roleCode: type: string description: Optional active role filter offset: type: integer description: Zero-based row offset size: type: integer description: Maximum number of users returned responses: 200: description: Ok schema: type: object properties: contents: #/definitions/approvalAccessUserSummary roleOptions: #/definitions/approvalAccessRoleOption totalPages: type: integer description: Total pages for the applied paging totalElements: type: integer description: Total matching users default: description: Error response schema: #/definitions/genericError /rejectDa080ApprovalRequestFromBpm: post: description: Receives a BPM rejection callback and rejects the DA080 local workflow. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestId: type: string description: Stored DA080 request identifier. idSolicitacao: type: string description: Legacy BPM request identifier field. id_solicitacao: type: string description: Legacy BPM request identifier field as sent by old Connect flows. processInstanceId: type: string description: Platform BPM process instance identifier. processInstanceID: type: string description: Platform BPM process instance identifier using the Platform response spelling. approverUserId: type: string description: Approver user login returned by BPM. approverUserName: type: string description: Approver display name returned by BPM. nome_usuario: type: string description: Legacy BPM approver field as sent by old Connect flows. rejectionReason: type: string description: Business rejection reason returned by BPM. responses: 200: description: Ok schema: type: object required: – requestId – requestStatus properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. currentStep: #/definitions/da080ApprovalStepStatus steps: #/definitions/da080ApprovalStepStatus history: #/definitions/da080ApprovalHistoryEntry approvalPayload: type: string description: Stored approval workflow payload after the mutation. default: description: Error response schema: #/definitions/genericError /saveDa080ApprovalRequest: post: description: Persists a DA080 approval request and prepares the local approval workflow. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – system – approvalKey – data properties: system: type: string description: Caller system, for example crm approvalKey: type: string description: Approval business key, for example orders data: #/definitions/da080ApprovalRequestData responses: 200: description: Ok schema: type: object required: – requestId – requestStatus – simulation – legacy properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. hierarchyJobId: type: string description: Hierarchy preparation job identifier, when approval flow will be resolved asynchronously. hierarchyStatus: type: string description: Hierarchy preparation status: NOT_REQUIRED | PENDING | PROCESSING | READY | RETRY | ERROR | DEAD. channelFlow: type: boolean description: Whether this request used the channel approval branch. approvalFlow: #/definitions/da080ApprovalDispatchStep simulation: #/definitions/simulationResult legacy: #/definitions/da080ApprovalLegacyResult default: description: Error response schema: #/definitions/genericError /getDa080ApprovalRequestStatus: post: description: Returns a persisted DA080 approval request with async hierarchy job and resolved HCM/channel approvers. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestId: type: string description: Stored DA080 request identifier. If omitted, proposalNumber is used. proposalNumber: type: string description: Proposal number used to find the latest DA080 request when requestId is omitted. proposalId: type: string description: CRM proposal identifier used together with proposalNumber. responses: 200: description: Ok schema: type: object required: – result properties: result: #/definitions/da080ApprovalRequestStatusOutput default: description: Error response schema: #/definitions/genericError get: description: Returns a persisted DA080 approval request with async hierarchy job and resolved HCM/channel approvers. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestId: type: string description: Stored DA080 request identifier. If omitted, proposalNumber is used. proposalNumber: type: string description: Proposal number used to find the latest DA080 request when requestId is omitted. proposalId: type: string description: CRM proposal identifier used together with proposalNumber. responses: 200: description: Ok schema: type: object required: – result properties: result: #/definitions/da080ApprovalRequestStatusOutput default: description: Error response schema: #/definitions/genericError /saveApprovalPolicyStructure: post: description: Persists a full DRAFT approval policy structure: policy, fields, flow, rule blocks and conditions. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – scopeId – rootCode – name – fields – flowSteps – ruleBlocks – requirements properties: policyId: type: string description: Policy identifier when updating an existing DRAFT policy scopeId: type: string description: Parent approval scope identifier scenarioId: type: string description: Scenario identifier when the policy is scoped to one DA080 scenario rootCode: type: string description: Business root code name: type: string description: Display name description: type: string description: Description effectiveFrom: type: string description: Effective from (ISO date) effectiveTo: type: string description: Effective to (ISO date) fields: type: array items: #/definitions/savePolicyFieldInput description: Fields bound to the policy flowSteps: type: array items: #/definitions/savePolicyFlowStepInput description: Approval flow steps ruleBlocks: type: array items: #/definitions/savePolicyRuleBlockInput description: Rule blocks used by the simulation engine requirements: type: array items: #/definitions/savePolicyApprovalRequirementInput description: Additional approval requirements, channels and fallbacks responses: 200: description: Ok schema: type: object required: – policyId – version – status properties: policyId: type: string description: Policy identifier type: integer description: Policy version status: type: string description: Policy status default: description: Error response schema: #/definitions/genericError /changeApprovalAccessUserRole: post: description: Changes the active approval role of one platform user. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – userId – roleCode properties: userId: type: string description: User account identifier roleCode: type: string description: Approval role code: APPROVAL_VIEWER, APPROVAL_USER or APPROVAL_ADMIN reason: type: string description: Business reason for the role change responses: 200: description: Ok schema: type: object properties: user: #/definitions/approvalAccessUserSummary roleOptions: #/definitions/approvalAccessRoleOption default: description: Error response schema: #/definitions/genericError /cancelDa080ApprovalRequest: post: description: Cancels a persisted DA080 approval request in the local approval workflow. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – system – approvalKey – proposalNumber properties: system: type: string description: Caller system, for example crm approvalKey: type: string description: Approval business key, for example orders requestId: type: string description: Stored DA080 request identifier. If omitted, the latest request for proposalNumber/proposalId is used. proposalNumber: type: string description: Proposal number proposalId: type: string description: CRM proposal identifier cancellationReason: type: string description: Business cancellation reason canceledByUserId: type: string description: Login of the user who canceled in the caller system (shown in the approval history) canceledByUserName: type: string description: Name of the user who canceled in the caller system (shown in the approval history) responses: 200: description: Ok schema: type: object required: – requestStatus properties: requestId: type: string description: Stored DA080 request identifier, when found. requestStatus: type: string description: Current request status. cancelPayload: type: string description: Stored cancellation payload. default: description: Error response schema: #/definitions/genericError /listAuditTrail: post: description: Lists immutable audit log entries generated by approval_service operations. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: actorUserId: type: string description: Filter by actor user login or email. endpoint: type: string description: Filter by endpoint or handler name. operation: type: string description: Filter by business operation name. entityName: type: string description: Filter by affected resource/entity name. entityId: type: string description: Filter by affected resource/entity identifier. requestId: type: string description: Filter by DA080 request identifier. proposalNumber: type: string description: Filter by proposal number. correlationId: type: string description: Filter by correlation/request id. status: type: string description: Filter by execution status: SUCCESS | ERROR. eventTimeFrom: type: string description: Filter events created at or after this timestamp. eventTimeTo: type: string description: Filter events created at or before this timestamp. offset: type: integer description: Zero-based row offset. size: type: integer description: Maximum number of logs returned. responses: 200: description: Ok schema: type: object properties: contents: #/definitions/auditLogOutput totalPages: type: integer description: Total pages for the applied paging. totalElements: type: integer description: Total records for the applied filter. default: description: Error response schema: #/definitions/genericError get: description: Lists immutable audit log entries generated by approval_service operations. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: actorUserId: type: string description: Filter by actor user login or email. endpoint: type: string description: Filter by endpoint or handler name. operation: type: string description: Filter by business operation name. entityName: type: string description: Filter by affected resource/entity name. entityId: type: string description: Filter by affected resource/entity identifier. requestId: type: string description: Filter by DA080 request identifier. proposalNumber: type: string description: Filter by proposal number. correlationId: type: string description: Filter by correlation/request id. status: type: string description: Filter by execution status: SUCCESS | ERROR. eventTimeFrom: type: string description: Filter events created at or after this timestamp. eventTimeTo: type: string description: Filter events created at or before this timestamp. offset: type: integer description: Zero-based row offset. size: type: integer description: Maximum number of logs returned. responses: 200: description: Ok schema: type: object properties: contents: #/definitions/auditLogOutput totalPages: type: integer description: Total pages for the applied paging. totalElements: type: integer description: Total records for the applied filter. default: description: Error response schema: #/definitions/genericError /changeDa080ApprovalApprover: post: description: Changes the approver assigned to a pending DA080 approval step. Requires administrator permission. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – requestId – stepOrder – newApproverUserId properties: requestId: type: string description: Stored DA080 request identifier. stepOrder: type: integer description: Approval step order that will receive another approver. newApproverUserId: type: string description: New approver user login. newApproverUserName: type: string description: New approver display name. newApproverUserEmail: type: string description: New approver email. reason: type: string description: Business reason for the approver change. responses: 200: description: Ok schema: type: object required: – requestId – requestStatus properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. currentStep: #/definitions/da080ApprovalStepStatus steps: #/definitions/da080ApprovalStepStatus history: #/definitions/da080ApprovalHistoryEntry approvalPayload: type: string description: Stored approval workflow payload after the mutation. default: description: Error response schema: #/definitions/genericError /getApprovalPolicyStructure: post: description: Returns a full approval policy structure in one payload for policy edition screens. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – policyId properties: policyId: type: string description: Policy identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – structureJson properties: structureJson: type: string description: JSON object containing policy, fields, flowSteps, ruleBlocks, ruleConditions and requirements default: description: Error response schema: #/definitions/genericError get: description: Returns a full approval policy structure in one payload for policy edition screens. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – policyId properties: policyId: type: string description: Policy identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – structureJson properties: structureJson: type: string description: JSON object containing policy, fields, flowSteps, ruleBlocks, ruleConditions and requirements default: description: Error response schema: #/definitions/genericError /activateApprovalScope: post: description: Activates an approval scope x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – scopeId properties: scopeId: type: string description: Scope identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – scopeId – active properties: scopeId: type: string description: Scope identifier (UUID as string) active: type: boolean description: Current active flag default: description: Error response schema: #/definitions/genericError /approveDa080ApprovalRequestFromBpm: post: description: Receives a BPM approval callback and advances the DA080 local workflow. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object properties: requestId: type: string description: Stored DA080 request identifier. idSolicitacao: type: string description: Legacy BPM request identifier field. id_solicitacao: type: string description: Legacy BPM request identifier field as sent by old Connect flows. processInstanceId: type: string description: Platform BPM process instance identifier. processInstanceID: type: string description: Platform BPM process instance identifier using the Platform response spelling. approverUserId: type: string description: Approver user login returned by BPM. approverUserName: type: string description: Approver display name returned by BPM. nome_usuario: type: string description: Legacy BPM approver field as sent by old Connect flows. comment: type: string description: Optional approval comment returned by BPM. responses: 200: description: Ok schema: type: object required: – requestId – requestStatus properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. currentStep: #/definitions/da080ApprovalStepStatus steps: #/definitions/da080ApprovalStepStatus history: #/definitions/da080ApprovalHistoryEntry approvalPayload: type: string description: Stored approval workflow payload after the mutation. default: description: Error response schema: #/definitions/genericError /approveDa080ApprovalRequest: post: description: Approves the current or informed DA080 approval step and advances the local workflow. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – requestId properties: requestId: type: string description: Stored DA080 request identifier. stepOrder: type: integer description: Approval step order. When omitted, the current pending step is used. comment: type: string description: Optional approval comment stored in the audit history. responses: 200: description: Ok schema: type: object required: – requestId – requestStatus properties: requestId: type: string description: Stored DA080 request identifier. requestStatus: type: string description: Current request status. currentStep: #/definitions/da080ApprovalStepStatus steps: #/definitions/da080ApprovalStepStatus history: #/definitions/da080ApprovalHistoryEntry approvalPayload: type: string description: Stored approval workflow payload after the mutation. default: description: Error response schema: #/definitions/genericError /anonymous/getSystemAccessToken: post: description: x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – in: header name: X-Tenant description: Nome do tenant type: string – in: header name: X-TenantDomain description: Domínio tenant type: string – name: input in: body required: true schema: type: object properties: accessToken: type: string description: responses: 200: description: Ok schema: type: object required: – saraAccess – loginUser properties: saraAccess: #/definitions/recAccess loginUser: #/definitions/loginUserInformation default: description: Error response schema: #/definitions/genericError /inactivateApprovalPolicy: post: description: Inactivates an ACTIVE policy version (no replacement). x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – policyId properties: policyId: type: string description: Policy identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – policyId – status – version properties: policyId: type: string description: Policy identifier (UUID as string) status: type: string description: Current status (DRAFT | ACTIVE | INACTIVE) type: integer description: Policy version default: description: Error response schema: #/definitions/genericError /publishApprovalPolicy: post: description: Publishes a DRAFT policy version. Fails when another ACTIVE policy exists for the same scopeId+rootCode. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – policyId properties: policyId: type: string description: Policy identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – policyId – status – version properties: policyId: type: string description: Policy identifier (UUID as string) status: type: string description: Current status (DRAFT | ACTIVE | INACTIVE) type: integer description: Policy version default: description: Error response schema: #/definitions/genericError /simulateApproval: post: description: Simulates an approval evaluation for a proposal payload using rule blocks and conditions. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – scopeId – rootCode – proposalNumber – items properties: scopeId: type: string description: Scope identifier (UUID as string) scenarioId: type: string description: Scenario identifier when the active policy is scoped to one DA080 scenario scenarioCode: type: string description: Scenario code when the caller does not have scenarioId rootCode: type: string description: Root code (business key) within the scope proposalNumber: type: string description: Proposal number items: type: array items: #/definitions/simulationProposalItem description: Proposal item list to evaluate against the active policy responses: 200: description: Ok schema: type: object required: – proposalNumber – matchedRuleBlocks – approvalPath – ignoredSteps – requirements – messages properties: policyId: type: string description: Active policy identifier used in the simulation policyVersion: type: integer description: Active policy version scenarioId: type: string description: Scenario identifier used in the simulation scenarioCode: type: string description: Scenario code used in the simulation proposalNumber: type: string description: Proposal number targetLevel: #/definitions/simulationTargetLevel matchedRuleBlocks: #/definitions/simulationMatchedRuleBlock appliedException: #/definitions/simulationAppliedException approvalPath: #/definitions/simulationApprovalStep ignoredSteps: #/definitions/simulationApprovalStep requirements: #/definitions/simulationApprovalRequirement messages: type: string description: Human-readable simulation messages default: description: Error response schema: #/definitions/genericError /inactivateApprovalScope: post: description: Inactivates an approval scope (soft delete) x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – scopeId properties: scopeId: type: string description: Scope identifier (UUID as string) responses: 200: description: Ok schema: type: object required: – scopeId – active properties: scopeId: type: string description: Scope identifier (UUID as string) active: type: boolean description: Current active flag default: description: Error response schema: #/definitions/genericError /consultDa080Approval: post: description: Consults the DA080 approval level using the CRM-facing payload. This endpoint does not persist data. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – system – approvalKey – data properties: system: type: string description: Caller system, for example crm approvalKey: type: string description: Approval business key, for example orders data: #/definitions/da080ApprovalRequestData responses: 200: description: Ok schema: type: object required: – result properties: result: #/definitions/da080ApprovalConsultOutput default: description: Error response schema: #/definitions/genericError get: description: Consults the DA080 approval level using the CRM-facing payload. This endpoint does not persist data. x-senior-event: false deprecated: false tags: – Endpoints security: – bearerAuth: [] parameters: – #/parameters/clientId – name: input in: body required: true schema: type: object required: – system – approvalKey – data properties: system: type: string description: Caller system, for example crm approvalKey: type: string description: Approval business key, for example orders data: #/definitions/da080ApprovalRequestData responses: 200: description: Ok schema: type: object required: – result properties: result: #/definitions/da080ApprovalConsultOutput default: description: Error response schema: #/definitions/genericErrordefinitions: hcmUserSummary: type: object required: – id – username properties: id: type: string description: User identifier username: type: string description: User login name: type: string description: User display name email: type: string description: Primary email active: type: boolean description: Whether the user is active roleCode: type: string description: Approval role code resolved from the HCM job title, when known roleName: type: string description: HCM job title or approval role name approvalAccessRoleOption: type: object required: – code – name properties: code: type: string description: Stable role code name: type: string description: Display name description: type: string description: Detailed description defaultRole: type: boolean description: Whether this role is the default rolePriority: type: integer description: Role priority approvalAccessUserSummary: type: object required: – userId – username properties: userId: type: string description: User account identifier username: type: string description: User login accountName: type: string description: Account display name fullName: type: string description: User full name email: type: string description: Primary email active: type: boolean description: Whether the user is active isGlobalAdmin: type: boolean description: Whether the user is a global admin in the platform roleCode: type: string description: Current active approval role code roleName: type: string description: Current active approval role name roleDescription: type: string description: Current active approval role description assignedAt: type: string description: Current role assignment timestamp formatted by the database assignedBy: type: string description: User or system that assigned the role expiresAt: type: string description: Current role expiration timestamp formatted by the database roles: type: array items: type: string description: Application roles assigned to the user permissions: type: array items: type: string description: Application permissions resolved from the user roles auditLogOutput: type: object required: – id properties: id: type: string description: Audit log identifier. eventTime: type: string description: Event timestamp formatted by the database. tenantDomain: type: string description: Tenant/domain where the event happened. domainName: type: string description: Service domain. serviceName: type: string description: Service name. endpoint: type: string description: Endpoint or handler name. operation: type: string description: Business operation name. entityName: type: string description: Affected resource/entity name. entityId: type: string description: Affected resource/entity identifier. requestId: type: string description: DA080 request identifier when related. proposalNumber: type: string description: Proposal number when related. actorUserId: type: string description: Actor user login or email. actorUserName: type: string description: Actor display name. correlationId: type: string description: Correlation/request id used by the platform. status: type: string description: Execution status: SUCCESS | ERROR. errorMessage: type: string description: Error message when status is ERROR. inputPayload: type: string description: Input payload JSON. beforePayload: type: string description: State before the operation as JSON. afterPayload: type: string description: State after the operation as JSON. resultPayload: type: string description: Result payload JSON. metadataPayload: type: string description: Extra metadata JSON. savePolicyFieldInput: type: object required: – fieldId properties: fieldId: type: string description: Dynamic field identifier required: type: boolean description: Whether the field is required for simulation savePolicyFlowStepInput: type: object required: – stepOrder – levelId properties: stepOrder: type: integer description: Step order (1-based) levelId: type: string description: Scope level identifier validationMode: type: string description: Validation mode retained for compatibility with old step conditions description: type: string description: Optional description savePolicyRuleBlockInput: type: object required: – sourceType – name – rulePriority – resultAction – conditions properties: clientReference: type: string description: Optional client reference used to link parent/child blocks in the same save request parentBlockId: type: string description: Persisted parent block identifier for nested expressions parentClientReference: type: string description: Client reference of the parent block in the same save request targetLevelId: type: string description: Target level identifier calculated when this block matches sourceRuleId: type: string description: Legacy DA080 rule identifier sourceType: type: string description: Rule source type name: type: string description: Block display name rulePriority: type: integer description: Evaluation priority connectorToPrevious: type: string description: Connector with the previous block connectorToParent: type: string description: Connector used when this block is evaluated as a child of another block internalConnector: type: string description: Connector used between conditions inside this block channelId: type: string description: Approval channel identifier used by this result resultAction: type: string description: Action generated by this block resultMessage: type: string description: Message generated by this block active: type: boolean description: Whether this block is active ext: type: string description: Extension JSON for source metadata and exception configuration conditions: type: array items: #/definitions/savePolicyRuleConditionInput description: Conditions inside this rule block savePolicyRuleConditionInput: type: object required: – fieldId – conditionOrder – operator properties: fieldId: type: string description: Dynamic field identifier conditionOrder: type: integer description: Condition order inside the block connectorToPrevious: type: string description: Connector with the previous condition operator: type: string description: Operator: EQ | NEQ | GT | GTE | LT | LTE | BETWEEN | CONTAINS | IN valueType: type: string description: Value type used by the simulation engine: TEXT | NUMBER | BOOLEAN | DATE | LIST valueText: type: string description: Value as string (for EQ/NEQ/IN comma-separated) valueNumberMin: type: number description: Numeric lower bound (BETWEEN/GT/GTE) format: double valueNumberMax: type: number description: Numeric upper bound (BETWEEN/LT/LTE) format: double valueBoolean: type: boolean description: Boolean value used by boolean fields valueDate: type: string description: Date value used by date fields format: date valueList: type: string description: List value encoded as JSON array or comma-separated text ext: type: string description: Extension JSON for condition metadata savePolicyApprovalRequirementInput: type: object required: – requirementType properties: scenarioId: type: string description: Scenario identifier, when requirement is scenario-specific triggerRuleBlockId: type: string description: Rule block that triggers this requirement triggerRuleBlockClientReference: type: string description: Client reference of the triggering block in the same save request requirementType: type: string description: Requirement type: SEQUENTIAL | PARALLEL | ADDITIONAL | EXTERNAL | FALLBACK roleName: type: string description: Role name/code expected by the requirement channelId: type: string description: Approval channel identifier reason: type: string description: Business reason shown to the user requiresAttachment: type: boolean description: Whether an attachment is required active: type: boolean description: Whether this requirement is active da080ApprovalRequestData: type: object required: – proposalNumber properties: scopeId: type: string description: Optional scope identifier. Defaults to DA080_PROCESSO_VENDAS scope. scenarioId: type: string description: Optional scenario identifier. scenarioCode: type: string description: Optional scenario code. Defaults from items/ruleType when absent. rootCode: type: string description: Optional root code. Defaults to DA080_PROCESSO_VENDAS. proposalNumber: type: string description: Proposal number. proposalId: type: string description: CRM proposal identifier. opportunityId: type: string description: CRM opportunity identifier. proposalRevision: type: string description: Proposal revision. initialLevel: type: integer description: Initial authority level. Defaults to 5 for CANAL and 6 otherwise. channelFlow: type: boolean description: Whether the request must use the channel approval branch. Defaults from process=CANAL when omitted. responsibleUser: type: string description: Responsible user login. approvalJustification: type: string description: Approval justification. items: type: array items: #/definitions/simulationProposalItem description: Normalized proposal item list. modality: type: string description: Top-level modality used when items is empty. value: type: number description: Top-level rule value used when items is empty. format: double totalValue: type: number description: Top-level total value used when items is empty. format: double ruleType: type: string description: Top-level rule type used when items is empty. valueType: type: string description: Top-level value type used when items is empty. process: type: string description: Top-level process name used when items is empty. interestFreeInstallments: type: integer description: Top-level installments without interest used when items is empty. graceMonths: type: integer description: Top-level grace months used when items is empty. monthlyFeeDiscountPercent: type: number description: Top-level monthly fee discount percentage used when items is empty. format: double graceDiscountPercent: type: number description: Top-level grace discount percentage used when items is empty. format: double travelFlexibilizationType: type: string description: Top-level travel flexibilization type used when items is empty. branchManagerExists: type: boolean description: Whether branch manager exists for fallback evaluation. campaignPromotionApplied: type: boolean description: Whether campaign/promotion is applied. competitor: type: string description: Competitor information. justification: type: string description: Business justification. requestDescription: type: string description: Request description. data: type: string description: Flexible JSON payload with extra DA080 fields. simulationProposalItem: type: object properties: modality: type: string description: Commercial modality value: type: number description: Rule value format: double totalValue: type: number description: Total value format: double ruleType: type: string description: Rule type valueType: type: string description: Value type process: type: string description: Process name interestFreeInstallments: type: integer description: Installments without interest graceMonths: type: integer description: Grace months monthlyFeeDiscountPercent: type: number description: Monthly fee discount percentage format: double graceDiscountPercent: type: number description: Grace discount percentage format: double travelFlexibilizationType: type: string description: Travel flexibilization type branchManagerExists: type: boolean description: Whether branch manager exists for fallback evaluation campaignPromotionApplied: type: boolean description: Whether campaign/promotion is applied competitor: type: string description: Competitor information justification: type: string description: Business justification requestDescription: type: string description: Request description data: type: string description: Flexible JSON payload with extra DA080 fields da080ApprovalLegacyResult: type: object required: – requiresApproval – approvalStatus properties: level: type: integer description: Numeric DA080 level returned by the policy evaluation. message: type: string description: Human-readable message compatible with the previous DA080 response. rule: type: string description: Matched rule block identifier. object: type: string description: Legacy proprietary object string with the most restrictive proposal item. requiresApproval: type: boolean description: Whether the CRM should send the request to approval. approvalStatus: type: string description: Suggested CRM approval status: APPROVED, PENDING, BLOCKED or NO_RULE. initialLevel: type: integer description: Initial level used in the decision. da080ApprovalDispatchStep: type: object required: – stepOrder – source – originalUserId – effectiveUserId properties: stepOrder: type: integer description: Flow step order used for approval dispatch. source: type: string description: Source used to resolve this approver: HCM_SUPERIOR or CHANNEL_MANAGER. levelId: type: string description: Resolved level identifier, when the role is registered in DA080. levelNumber: type: integer description: Business level number. levelName: type: string description: Resolved level name. roleCode: type: string description: Role code used to check substitutions. roleName: type: string description: Role display name. originalUserId: type: string description: Original approver user login. originalUserName: type: string description: Original approver display name. originalUserEmail: type: string description: Original approver email. effectiveUserId: type: string description: User login that must receive the approval task. effectiveUserName: type: string description: User display name that must receive the approval task. effectiveUserEmail: type: string description: User email that must receive the approval task. assignedUserId: type: string description: Current assigned user login after manual approver changes. assignedUserName: type: string description: Current assigned user display name after manual approver changes. assignedUserEmail: type: string description: Current assigned user email after manual approver changes. status: type: string description: Step status when this dispatch step was materialized: WAITING | PENDING | APPROVED | REJECTED | CANCELED. decisionUserId: type: string description: User that approved or rejected this step. decisionUserName: type: string description: Decision user display name. decisionAt: type: string description: Decision timestamp formatted by the database. decisionComment: type: string description: Decision comment or rejection reason. lastChangedBy: type: string description: Last administrator that changed the assigned approver. lastChangedAt: type: string description: Last approver change timestamp formatted by the database. changeReason: type: string description: Last approver change reason. substituted: type: boolean description: Whether a current userSubstitution rule changed the effective user. substitutionId: type: string description: Applied userSubstitution identifier. bpmProcessId: type: string description: BPM process identifier used by this approval step. bpmProcessInstanceId: type: string description: Platform BPM process instance identifier for this approval step. bpmStatus: type: string description: Latest BPM integration status for this approval step. bpmLastError: type: string description: Latest BPM integration error for this approval step, when any. da080ApprovalConsultOutput: type: object required: – simulation – legacy properties: scopeId: type: string description: Normalized scope identifier used in the simulation. scenarioCode: type: string description: Normalized scenario code used in the simulation. rootCode: type: string description: Normalized root code used in the simulation. simulation: #/definitions/simulationResult legacy: #/definitions/da080ApprovalLegacyResult simulationResult: type: object required: – proposalNumber – matchedRuleBlocks – approvalPath – ignoredSteps – requirements – messages properties: policyId: type: string description: Active policy identifier used in the simulation policyVersion: type: integer description: Active policy version scenarioId: type: string description: Scenario identifier used in the simulation scenarioCode: type: string description: Scenario code used in the simulation proposalNumber: type: string description: Proposal number targetLevel: #/definitions/simulationTargetLevel matchedRuleBlocks: type: array items: #/definitions/simulationMatchedRuleBlock description: Rule blocks matched during evaluation appliedException: #/definitions/simulationAppliedException approvalPath: type: array items: #/definitions/simulationApprovalStep description: Sequential approval path up to target level ignoredSteps: type: array items: #/definitions/simulationApprovalStep description: Flow steps ignored because they are below the target level requirements: type: array items: #/definitions/simulationApprovalRequirement description: Additional approval requirements, channels and fallbacks returned by matched blocks messages: type: array items: type: string description: Human-readable simulation messages simulationTargetLevel: type: object properties: levelId: type: string description: Resolved level identifier levelNumber: type: integer description: Business level number name: type: string description: Resolved level name simulationMatchedRuleBlock: type: object required: – ruleBlockId – name – rulePriority properties: ruleBlockId: type: string description: Rule block identifier name: type: string description: Block display name rulePriority: type: integer description: Evaluation priority targetLevelId: type: string description: Target level identifier targetLevelName: type: string description: Target level name resultAction: type: string description: Action generated by this rule block channelId: type: string description: Approval channel identifier returned by this block simulationAppliedException: type: object properties: sourceRuleId: type: string description: Exception source rule identifier message: type: string description: Result message simulationApprovalStep: type: object required: – stepOrder – levelId – levelName – roleCodes properties: stepOrder: type: integer description: Flow step order levelId: type: string description: Resolved level identifier levelNumber: type: integer description: Business level number levelName: type: string description: Resolved level name roleCodes: type: array items: type: string description: List of role codes that may approve this step simulationApprovalRequirement: type: object required: – requirementType properties: requirementId: type: string description: Requirement identifier triggerRuleBlockId: type: string description: Rule block that triggered the requirement requirementType: type: string description: Requirement type roleName: type: string description: Role name/code expected by the requirement channelId: type: string description: Approval channel identifier reason: type: string description: Business reason requiresAttachment: type: boolean description: Whether an attachment is required da080ApprovalRequestStatusOutput: type: object required: – requestId – proposalNumber – requestStatus – requiresApproval properties: requestId: type: string description: Stored DA080 request identifier. externalSystem: type: string description: Caller system, for example crm. approvalKey: type: string description: Approval business key, for example orders. scenarioId: type: string description: Scenario identifier used for simulation. scenarioCode: type: string description: Scenario code used for simulation. rootCode: type: string description: Root code used for simulation. proposalNumber: type: string description: Proposal number. proposalId: type: string description: CRM proposal identifier. requestStatus: type: string description: Current request status. bpmProcessId: type: string description: Latest BPM process identifier used by the request. bpmProcessInstanceId: type: string description: Latest Platform BPM process instance identifier. bpmStatus: type: string description: Latest BPM integration status for the request. bpmLastError: type: string description: Latest BPM integration error for the request, when any. createdAt: type: string description: Request creation timestamp formatted by the database. targetLevelNumber: type: integer description: Target DA080 approval level. requiresApproval: type: boolean description: Whether this request requires approval. channelFlow: type: boolean description: Whether this request used the channel approval branch. hierarchyStatus: type: string description: Hierarchy preparation status read from the latest job or stored payload. hierarchyJobId: type: string description: Hierarchy preparation job identifier. hierarchyJob: #/definitions/da080ApprovalHierarchyJobOutput hierarchy: type: array items: #/definitions/da080ApprovalHierarchyEntry description: Persisted HCM/channel hierarchy rows. approvalFlow: type: array items: #/definitions/da080ApprovalDispatchStep description: Dispatchable original/effective approvers prepared for approval. currentStep: #/definitions/da080ApprovalStepStatus steps: type: array items: #/definitions/da080ApprovalStepStatus description: Persisted approval steps and their decision status. history: type: array items: #/definitions/da080ApprovalHistoryEntry description: Functional audit history for approvals, rejections and approver changes. approvalPayload: type: string description: Stored approval workflow payload after hierarchy status updates. da080ApprovalHierarchyJobOutput: type: object required: – jobId – status properties: jobId: type: string description: Hierarchy preparation job identifier. status: type: string description: Current job status: PENDING | PROCESSING | READY | RETRY | ERROR | DEAD. attempts: type: integer description: Current retry attempt count. maxAttempts: type: integer description: Maximum retry attempts. nextRetryAt: type: string description: Next retry timestamp formatted by the database. lockedAt: type: string description: Job lock timestamp formatted by the database. finishedAt: type: string description: Job finish timestamp formatted by the database. lastError: type: string description: Last retry/dead-letter error. da080ApprovalHierarchyEntry: type: object required: – sourceOrder – source – originalUserId – effectiveUserId properties: sourceOrder: type: integer description: Source order returned by the hierarchy provider. source: type: string description: Source used to resolve this approver: HCM_SUPERIOR or CHANNEL_MANAGER. originalUserId: type: string description: Original approver user login. originalUserName: type: string description: Original approver display name. originalRoleName: type: string description: Original role name returned by HCM/channel configuration. roleCode: type: string description: Resolved role code used for substitutions. roleName: type: string description: Resolved role display name. levelNumber: type: integer description: Business level number. effectiveUserId: type: string description: User login that must receive the approval task. effectiveUserName: type: string description: User display name that must receive the approval task. substituted: type: boolean description: Whether a current userSubstitution rule changed the effective user. substitutionId: type: string description: Applied userSubstitution identifier. dispatchable: type: boolean description: Whether this row is part of the approval dispatch flow. da080ApprovalStepStatus: type: object required: – stepId – stepOrder – assignedUserId – status properties: stepId: type: string description: Approval step identifier. stepOrder: type: integer description: Step order inside the DA080 approval workflow. source: type: string description: Source used to resolve this approver: HCM_SUPERIOR or CHANNEL_MANAGER. levelId: type: string description: Resolved level identifier. levelNumber: type: integer description: Business level number. levelName: type: string description: Resolved level name. roleCode: type: string description: Role code used by the approval step. roleName: type: string description: Role display name. originalUserId: type: string description: Original approver user login returned by HCM/channel configuration. originalUserName: type: string description: Original approver display name. originalUserEmail: type: string description: Original approver email. effectiveUserId: type: string description: Approver after automatic substitution rules. effectiveUserName: type: string description: Display name after automatic substitution rules. effectiveUserEmail: type: string description: Email after automatic substitution rules. assignedUserId: type: string description: Current user assigned to decide this step. assignedUserName: type: string description: Current assigned user display name. assignedUserEmail: type: string description: Current assigned user email. substituted: type: boolean description: Whether a current userSubstitution rule changed the effective user. substitutionId: type: string description: Applied userSubstitution identifier. status: type: string description: Step status: WAITING | PENDING | APPROVED | REJECTED | CANCELED. decisionUserId: type: string description: User that approved or rejected this step. decisionUserName: type: string description: Decision user display name. decisionAt: type: string description: Decision timestamp formatted by the database. decisionComment: type: string description: Decision comment or rejection reason. lastChangedBy: type: string description: Last administrator that changed the assigned approver. lastChangedAt: type: string description: Last approver change timestamp formatted by the database. changeReason: type: string description: Last approver change reason. bpmProcessId: type: string description: BPM process identifier used by this approval step. bpmProcessInstanceId: type: string description: Platform BPM process instance identifier for this approval step. bpmStatus: type: string description: Latest BPM integration status for this approval step. bpmLastError: type: string description: Latest BPM integration error for this approval step, when any. da080ApprovalHistoryEntry: type: object required: – eventId – requestId – eventType properties: eventId: type: string description: Audit event identifier. requestId: type: string description: Stored DA080 request identifier. stepId: type: string description: Approval step identifier, when the event is step-related. stepOrder: type: integer description: Approval step order, when the event is step-related. eventType: type: string description: Event type: STEP_CREATED | STEP_APPROVED | STEP_REJECTED | APPROVER_CHANGED | REQUEST_APPROVED | REQUEST_REJECTED. actorUserId: type: string description: User login that executed the event. actorUserName: type: string description: Actor display name. fromUserId: type: string description: Previous assigned approver user login, when changed. fromUserName: type: string description: Previous assigned approver display name, when changed. fromUserEmail: type: string description: Previous assigned approver email, when changed. toUserId: type: string description: New assigned approver user login, when changed. toUserName: type: string description: New assigned approver display name, when changed. toUserEmail: type: string description: New assigned approver email, when changed. statusFrom: type: string description: Previous status, when applicable. statusTo: type: string description: New status, when applicable. comment: type: string description: Decision comment, rejection reason or change reason. createdAt: type: string description: Event creation timestamp formatted by the database. eventPayload: type: string description: Additional event payload. recAccess: type: object required: – accessToken – credential properties: accessToken: type: string description: credential: type: string description: loginUserInformation: type: object required: – photo – username – fullName – locale – active – isGlobalAdmin properties: photo: type: string description: username: type: string description: fullName: type: string description: locale: type: string description: active: type: boolean description: isGlobalAdmin: type: boolean description: roles: type: array items: type: string description: Application roles assigned to the logged user permissions: type: array items: type: string description: Application permissions resolved from the logged user roles genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE