Skip to main content
The HTTP trigger lets you submit documents to a pipe via API, enabling programmatic integration with your applications.

Prerequisites

  • A pipe with an HTTP trigger node in its pipeline
  • An API key with trigger permissions

Endpoint

POST https://api.docpipe.ai/pipes/{pipeId}/http-trigger

Authentication

Include your API key in the X-Api-Key header:
X-Api-Key: dp_your_api_key_here
See authentication for details on API key management.

Request

Send the document as multipart/form-data with the file in the file field.

cURL

curl -X POST "https://api.docpipe.ai/pipes/3fa85f64-5717-4562-b3fc-2c963f66afa6/http-trigger" \
  -H "X-Api-Key: dp_your_api_key_here" \
  -F "file=@invoice.pdf"

JavaScript

const formData = new FormData();
formData.append("file", fileBlob, "invoice.pdf");

const response = await fetch(
  "https://api.docpipe.ai/pipes/3fa85f64-5717-4562-b3fc-2c963f66afa6/http-trigger",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "dp_your_api_key_here",
    },
    body: formData,
  }
);

const result = await response.json();

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "dp_your_api_key_here");

using var content = new MultipartFormDataContent();
using var fileStream = File.OpenRead("invoice.pdf");
content.Add(new StreamContent(fileStream), "file", "invoice.pdf");

var response = await client.PostAsync(
    "https://api.docpipe.ai/pipes/3fa85f64-5717-4562-b3fc-2c963f66afa6/http-trigger",
    content
);

Python

import requests

url = "https://api.docpipe.ai/pipes/3fa85f64-5717-4562-b3fc-2c963f66afa6/http-trigger"
headers = {"X-Api-Key": "dp_your_api_key_here"}
files = {"file": ("invoice.pdf", open("invoice.pdf", "rb"), "application/pdf")}

response = requests.post(url, headers=headers, files=files)
result = response.json()

Response

A successful request returns the trigger result with details about the created run.

Error handling

Common errors:
StatusCause
401Missing or invalid API key
400Unsupported file format or file exceeds size limit
404Pipe not found or not active

HTTP trigger configuration

The HTTP trigger node in your pipeline can be configured with:
  • Allowed origins: restrict which origins can submit files (CORS)
  • Accepted formats: limit accepted file types
  • Max size (MB): set a maximum file size
See the API reference for the complete endpoint specification.