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.

Most secure HTTP integrations involve two parties:

Sender workflow (CRE): runs on a schedule or trigger, does your logic, then creates and ships the report:

  1. Run business logic and encode your payload.
  2. Call runtime.report() / GenerateReport() so the DON signs the report.
  3. Call sendReport() to POST the report to your URL.

Receiver: a separate system that gets that HTTP POST (your API, or another CRE workflow with an HTTP trigger):

  1. Verify signatures with Report.parse() / ParseReport(), then use the payload. See Verifying CRE Reports Offchain.

The sender creates the report in step 2; you do not fetch it from somewhere else first. The receiver must verify before trusting the data: the sender does not do that for you.

Guides

Get the latest Chainlink content straight to your inbox.