HTTP
You can send data to your Pipeline via HTTP. By default, HTTP is enabled on all Pipelines. When you create a Pipeline, it will generate an HTTP endpoint †hat you can make POST requests to.
$ npx wrangler pipelines create [PIPELINE-NAME] --r2 [R2-BUCKET-NAME] --access-key-id [ACCESS-KEY-ID] --secret-access-key [SECRET-ACCESS-KEY]
🌀 Creating pipeline named "[PIPELINE-NAME]"✅ Successfully created pipeline [PIPELINE-NAME] with ID [PIPELINE-ID]
You can now send data to your pipeline with: curl "https://<PIPELINE-ID>.pipelines.cloudflare.com/" -d '[{ ...JSON_DATA... }]'By default, ingestion via HTTP is turned on for all Pipelines. You can turn it off by setting --http false when creating or updating a Pipeline.
$ npx wrangler pipelines create [PIPELINE-NAME] --r2 [R2-BUCKET-NAME] --access-key-id [ACCESS-KEY-ID] --secret-access-key [SECRET-ACCESS-KEY] --http falseIngestion URLs are tied to your Pipeline ID. Turning HTTP off, and then turning it back on, will not change the URL.
You can secure your HTTP ingestion endpoint using Cloudflare API tokens. By default, authentication is turned off. To enable authentication, use --authentication true while creating or updating a Pipeline.
$ npx wrangler pipelines create [PIPELINE-NAME] --r2 [R2-BUCKET-NAME] --access-key-id [ACCESS-KEY-ID] --secret-access-key [SECRET-ACCESS-KEY] --authentication trueOnce authentication is turned on, you will need to include a Cloudflare API token in your request headers.
- Log in to the Cloudflare dashboard ↗ and select your account.
- Navigate to your API Keys ↗
- Select Create Token
- Choose the template for Workers Pipelines. Click on continue to summary, and finally on create token. Make sure to copy the API token, and save it securely.
Include the API token you created in the previous step in the headers for your request:
curl https://<PIPELINE-ID>.pipelines.cloudflare.com -H "Content-Type: application/json" \ -H "Authorization: Bearer ${API_TOKEN}" \ -d '[ {"key1": "value1", "key2": "value2"}, {"key1": "value3", "key2": "value4"} ]'