API Interactions
The CRE SDK provides an HTTP client that allows your workflows to interact with external APIs. Use it to fetch offchain data, send results to other systems, or trigger external events.
These guides will walk you through the common use cases for the HTTP client.
CRE reports over HTTP
A CRE report is a DON-signed package your workflow creates with runtime.report() (TypeScript) or runtime.GenerateReport() (Go). It contains your encoded payload, workflow metadata, and cryptographic signatures. It is not a Data Streams report—those come from a different product.
Most secure HTTP integrations use two roles:
flowchart LR
subgraph sender ["Sender workflow (this guide's focus)"]
A[Trigger] --> B[Your logic]
B --> C["runtime.report()"]
C --> D["sendReport() → HTTP POST"]
end
subgraph receiver ["Receiver (separate system)"]
D --> E[Your API or CRE HTTP trigger]
E --> F["Report.parse() before trusting data"]
end
| Step | Who | What happens |
|---|---|---|
| 1 | Sender (CRE workflow) | Run business logic, encode payload |
| 2 | Sender | runtime.report() — DON agrees and signs |
| 3 | Sender | sendReport() — POST report bytes to your URL |
| 4 | Receiver | Verify signatures, then use payload — see Verifying CRE Reports Offchain |
You do not download a report from elsewhere before submitting. The sender workflow creates it in step 2. Validation always happens on the receiver side (CRE workflow, your API, or an onchain forwarder).
Guides
- Making GET Requests: Learn how to fetch data from a public API using a
GETrequest. - Making POST Requests: Learn how to send data to an external endpoint using a
POSTrequest. - Submitting Reports via HTTP: Learn how to submit cryptographically signed reports to an external HTTP endpoint.
- Verifying CRE Reports Offchain: Verify report signatures and read workflow metadata when receiving reports over HTTP or other offchain channels.