Docs
Workflows and transactions

POST /v1/workflows/prepare

Prepare and preflight an explicit Torq workflow

AvailabilityPrivate Preview
Method and pathPOST /v1/workflows/prepare
API version1.0.0-private-preview
Base URLhttps://api.torq.finance
AuthenticationSecretKey, WalletSession, PublishableKey
IdempotencyRequired header: Idempotency-Key.
Rate limitsRead x-ratelimit-* and x-request-id response headers. Do not hard-code a quota.

Authentication requirements

  • SecretKey
  • WalletSession
  • PublishableKey

Request examples

terminal
curl -X POST 'https://api.torq.finance/v1/workflows/prepare' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer $TORQ_SECRET_KEY' \
  -H 'x-torq-wallet-session: $TORQ_WALLET_SESSION' \
  -H 'Idempotency-Key: $TORQ_IDEMPOTENCY_KEY' \
  -H 'Content-Type: application/json' \
  --data '{"workflowType":"borrow","chainId":11155111,"input":{"marketAddress":"0x4ac10f0186719528ae77B1cf6186AE83002C450D","amount":"1000000"}}'
Run a safe sample

This calls the docs preview and returns sample data shaped by the governed OpenAPI response. It never accepts credentials or changes protocol state.

Run the sample call to inspect a schema-shaped response without credentials or side effects.
Request bodyWorkflowPrepareRequest

Parameters

NameInRequiredType
Idempotency-KeyheaderYesstring

Request schema

WorkflowPrepareRequest WorkflowPrepareRequest

PropertyTypeRequiredDescription
workflowTypestringYes
chainIdintegerYes
deploymentNamespacestring | nullNo
principalAddressstringNo
inputobjectYes
constraintsobjectNo
Inspect nested properties

workflowType string · required

one of: borrow, claimWithdrawal, deposit, depositCollateral, liquidate, repay, requestWithdrawal, role.allocator.vaultAllocate, role.allocator.vaultDeallocate, role.allocator.vaultReallocationBatch, role.asset_issuer.assetSubmissionRequestCreate, role.asset_manager.distressedRecoveryAcquisitionV3Bid, role.asset_manager.distressedRecoveryFundV3ChannelPolicySet, role.asset_manager.distressedRecoveryFundV3SelfLaunch, role.asset_manager.vaultDeploy, role.asset_manager.vaultShareMobilityManagerAction, role.borrower.borrowerBorrow, role.borrower.borrowerDepositCollateral, role.borrower.borrowerRepay, role.borrower.borrowerWithdrawCollateral, role.curator.partnerChannelBlockedUpdate, role.curator.partnerChannelDeploy, role.curator.vaultMarketListingSave, role.investor.partnerWrapperDeposit, role.investor.partnerWrapperRedeem, role.lender.distressedRecoveryFundV3AuctionBid, role.lender.distressedRecoveryFundV3RfqCancelBid, role.lender.distressedRecoveryFundV3RfqClaimRefund, role.lender.distressedRecoveryFundV3RfqFinalize, role.lender.distressedRecoveryFundV3RfqPlaceBid, role.lender.distressedRecoveryFundV3RfqReplaceBid, role.lender.investorFulfillRedeem, role.lender.investorRequestRedeem, role.lender.vaultShareMobilityInvestorAction, role.liquidator.liquidate, role.liquidator.settleLiquidationClaim, role.nav_reporter.navReportSignAndSubmit, role.partner.partnerBorrowerFeeClaim, role.partner.partnerChannelDeploy, role.partner.partnerFeeSharesClaim, role.partner.partnerSubmitApplication, role.partner.partnerWrapperDeposit, role.partner.partnerWrapperRedeem, role.vault_manager.partnerChannelDeploy, role.vault_owner.attachMarketToVault, role.vault_owner.vaultAllocate, role.vault_owner.vaultAllocatorUpdate, role.vault_owner.vaultCuratorCapsSettingsSave, role.vault_owner.vaultCuratorFeeSettingsSave, role.vault_owner.vaultDeallocate, role.vault_owner.vaultFeeConfigUpdate, role.vault_owner.vaultManagementSettingsSave, role.vault_owner.vaultOwnerSettingsSave, role.vault_owner.vaultOwnerTransferUpdate, role.vault_owner.vaultReallocationBatch, role.vault_owner.vaultRoleSettingsSave, role.vault_owner.vaultRoutingUpdate, role.vault_owner.vaultSettingsUpdate, settleLiquidationClaim, withdrawCollateral, withdrawNow

chainId integer · required

minimum: 1

deploymentNamespace string | null · optional

nullable

principalAddress string · optional

pattern: ^0x[a-fA-F0-9]{40}$

input object · required

constraints object · optional

Responses

StatusMeaningSchema
200Successful responsePreparedWorkflow
400Invalid requestTorqApiError
401Authentication requiredTorqApiError
403Insufficient scope or authorityTorqApiError
409State or idempotency conflictTorqApiError
429Rate limit exceededTorqApiError
500Internal failureTorqApiError

200 response schema

PreparedWorkflow PreparedWorkflow

PropertyTypeRequiredDescription
okbooleanYes
requestIdstringYes
workflowTypeenumYes
statusenumYes
executionModeenumYes
custodyBoundaryenumYes
snapshotHashstringYes
expiresAtstring (date-time)Yes
preflightWorkflowPreflightYes
transactionsTransactionIntent[]Yes
canonicalPostconditionsCanonicalPostcondition[]Yes
Inspect nested properties

ok boolean · required

requestId string · required

minimum length: 1 · maximum length: 200

workflowType enum · required

one of: borrow, claimWithdrawal, deposit, depositCollateral, liquidate, repay, requestWithdrawal, role.allocator.vaultAllocate, role.allocator.vaultDeallocate, role.allocator.vaultReallocationBatch, role.asset_issuer.assetSubmissionRequestCreate, role.asset_manager.distressedRecoveryAcquisitionV3Bid, role.asset_manager.distressedRecoveryFundV3ChannelPolicySet, role.asset_manager.distressedRecoveryFundV3SelfLaunch, role.asset_manager.vaultDeploy, role.asset_manager.vaultShareMobilityManagerAction, role.borrower.borrowerBorrow, role.borrower.borrowerDepositCollateral, role.borrower.borrowerRepay, role.borrower.borrowerWithdrawCollateral, role.curator.partnerChannelBlockedUpdate, role.curator.partnerChannelDeploy, role.curator.vaultMarketListingSave, role.investor.partnerWrapperDeposit, role.investor.partnerWrapperRedeem, role.lender.distressedRecoveryFundV3AuctionBid, role.lender.distressedRecoveryFundV3RfqCancelBid, role.lender.distressedRecoveryFundV3RfqClaimRefund, role.lender.distressedRecoveryFundV3RfqFinalize, role.lender.distressedRecoveryFundV3RfqPlaceBid, role.lender.distressedRecoveryFundV3RfqReplaceBid, role.lender.investorFulfillRedeem, role.lender.investorRequestRedeem, role.lender.vaultShareMobilityInvestorAction, role.liquidator.liquidate, role.liquidator.settleLiquidationClaim, role.nav_reporter.navReportSignAndSubmit, role.partner.partnerBorrowerFeeClaim, role.partner.partnerChannelDeploy, role.partner.partnerFeeSharesClaim, role.partner.partnerSubmitApplication, role.partner.partnerWrapperDeposit, role.partner.partnerWrapperRedeem, role.vault_manager.partnerChannelDeploy, role.vault_owner.attachMarketToVault, role.vault_owner.vaultAllocate, role.vault_owner.vaultAllocatorUpdate, role.vault_owner.vaultCuratorCapsSettingsSave, role.vault_owner.vaultCuratorFeeSettingsSave, role.vault_owner.vaultDeallocate, role.vault_owner.vaultFeeConfigUpdate, role.vault_owner.vaultManagementSettingsSave, role.vault_owner.vaultOwnerSettingsSave, role.vault_owner.vaultOwnerTransferUpdate, role.vault_owner.vaultReallocationBatch, role.vault_owner.vaultRoleSettingsSave, role.vault_owner.vaultRoutingUpdate, role.vault_owner.vaultSettingsUpdate, settleLiquidationClaim, withdrawCollateral, withdrawNow

status enum · required

one of: prepared, final_success

executionMode enum · required

one of: onchain_transaction, metadata_only

custodyBoundary enum · required

one of: external_wallet_required, wallet_session_authenticated

snapshotHash string · required

pattern: ^0x[a-fA-F0-9]{64}$

expiresAt string (date-time) · required

preflight WorkflowPreflight · required

PropertyTypeRequiredDescription
statusenumYes
blockedReasonsstring[]Yes
freshnessFreshnessEvidenceYes
revalidateAtExecutionstring[]Yes
Inspect nested properties

status enum · required

one of: passed, blocked

blockedReasons string[] · required

items string

freshness FreshnessEvidence · required

PropertyTypeRequiredDescription
statusenumYes
lagSecondsintegerYes
blockNumberstring | nullNo
blockTimestampstring | null (date-time)No
projectedAtstring | null (date-time)No
snapshotAtstring | null (date-time)No
reasonstring | nullNo
Inspect nested properties

status enum · required

one of: current, healthy, stale, missing, blocked

lagSeconds integer · required

minimum: 0

blockNumber string | null · optional

nullable

blockTimestamp string | null (date-time) · optional

nullable

projectedAt string | null (date-time) · optional

nullable

snapshotAt string | null (date-time) · optional

nullable

reason string | null · optional

nullable

revalidateAtExecution string[] · required

items string

transactions TransactionIntent[] · required

items TransactionIntent

PropertyTypeRequiredDescription
orderintegerYes
chainIdintegerYes
transactionKindenumYes
targetstring | nullYes
calldatastringYes
valuestringYes
labelstringYes
simulationRequiredbooleanYes
signingEip712SigningInstructionNo
Inspect nested properties

order integer · required

minimum: 0

chainId integer · required

minimum: 1

transactionKind enum · required

one of: contract_call, contract_deployment

target string | null · required

pattern: ^0x[a-fA-F0-9]{40}$ · nullable

calldata string · required

pattern: ^0x[a-fA-F0-9]*$

value string · required

pattern: ^[0-9]+$

label string · required

minimum length: 1 · maximum length: 200

simulationRequired boolean · required

signing Eip712SigningInstruction · optional

PropertyTypeRequiredDescription
kindstringYes
typedDataEip712TypedDataYes
signaturePlacementstringYes

canonicalPostconditions CanonicalPostcondition[] · required

items CanonicalPostcondition

PropertyTypeRequiredDescription
entityTypestringYes
entityIdstringYes
fieldstringYes
expectedunknownYes
Inspect nested properties

entityType string · required

minimum length: 1 · maximum length: 200

entityId string · required

minimum length: 1 · maximum length: 200

field string · required

minimum length: 1 · maximum length: 200

expected unknown · required

400, 401, 403, 409, 429, 500 response schema

TorqApiError TorqApiError

PropertyTypeRequiredDescription
okbooleanYes
codestringYes
messagestringYes
requestIdstringYes
retryablebooleanYes
blockedReasonstring | nullNo
docsUrlstring (uri)No
Inspect nested properties

ok boolean · required

code string · required

minimum length: 1 · maximum length: 200

message string · required

minimum length: 1 · maximum length: 200

requestId string · required

minimum length: 1 · maximum length: 200

retryable boolean · required

blockedReason string | null · optional

nullable

docsUrl string (uri) · optional

Related guides

For retry behavior and blocked-state handling, see Errors and rate limits.