Skip to main content
When your contract needs to send private data (e.g., PII — name, date of birth, email, etc.) to a third-party API, it does not read the values and inline them. Instead it uses the http-with-placeholders host interface: you put {{profile.<field>}} markers in the request, and the host resolves them from the calling user’s profile inside the enclave, just before the request goes out. The plaintext never enters your WASM.
Your contract in Rust (here, submitting a customer to a third-party identity-verification API at api.example.com):
hwp::call returns a typed HttpError, so a failure never leaks a resolved value — match on it for clear messages:
The contract imports host:interfaces/http-with-placeholders@2.4.0 (plus http@2.4.0 for calls without PII), which puts it in the tenant-http-placeholders world on testnet-v1.0.12. Key points:
  • Synchronous. Like plain http, you get the upstream response back in the same invocation — there’s no deferred queue.
  • Profile access is gated by the user’s delegation. The markers resolve only when the calling agent is authorized to act for that user (see Member Delegation). A marker your contract isn’t permitted to resolve fails with placeholder not permitted: <marker>.
  • Egress follows the same grant rule as http — see Outbound HTTP authenticated by user.
  • Markers reference the user profile schema — e.g. {{profile.first_name}}, {{profile.date_of_birth}}, {{profile.verified_contacts.email.value}}. Fields the schema doesn’t carry yet (passport number, title) can’t be templated.