API Key for Authentication
Generate organization-scoped API keys in the dApp and authenticate your backend with Trustless Work using the x-api-key header.
Connect your wallet
Sign in to the dApp with your Stellar wallet (SEP-10). New wallets register with name and email.
Select an organization
Choose or create an organization in the team switcher. API keys are scoped to the active organization.
Open API Keys
Go to Integrations → API Keys in the sidebar and create a key for your backend.
Copy and store securely
The secret is shown once. Use it server-side as the x-api-key header against mainnet or testnet API URLs.
Roles in Trustless Work
Each role has a distinct function within the escrow process, defining who can perform specific actions and how parties interact with the smart contract.
Learn More About Roles
Discover how each role interacts within the escrow lifecycle and understand the complete workflow.
Open in-app HelpQuick Integration Setup
Get started with Trustless Work API in minutes. Learn how to authenticate and make your first API call.
x-api-key header. Keep the key on your server — never in the browser.Base URL
https://api.trustlesswork.comhttps://api.dev.trustlesswork.comHeader
"x-api-key": your_api_key,React Library
npm i @trustless-work/escrow/escrow/single-release/fund-escrow// Initialize API client (Core v2)
const API_BASE_URL = 'https://beta.api.trustlesswork.com';
const API_KEY = process.env.NEXT_PUBLIC_API_KEY || "";
const headers = {
'Content-Type': 'application/json',
"x-api-key": your_api_key,
};
// Example: Fund Escrow (build unsigned XDR)
const fundEscrow = async (contractId, signer, amount) => {
try {
const response = await fetch(
`${API_BASE_URL}/escrow/single-release/v2/fund`,
{
method: 'POST',
headers,
body: JSON.stringify({
contractId,
signer,
amount
})
}
);
const data = await response.json();
// { unsignedXdr, txHash }
return data;
} catch (error) {
console.error('Error funding escrow:', error);
}
};Escrow Transaction Flow
Understand the complete process from payload preparation to transaction execution
Prepare Payload
Create the transaction payload with required parameters
Execute Endpoint
Send the payload to the Trustless Work API endpoint
Get Unsigned TX
Receive the unsigned transaction from the API
Sign Transaction
Sign the transaction using wallet or passkey
Send Transaction
Submit the signed transaction to the blockchain
Transaction Flow Summary
This 5-step process ensures secure and transparent escrow transactions