Logo

Modal

Authentication Type: Service Account
Description: Make HTTP requests to Modal.run endpoints securely with custom headers, body, and configurable timeouts.


Requests

HTTP request operations for Modal.run endpoints.

Make an HTTP request to a Modal.run endpoint with custom headers and body content.

Operation Type: Mutation (Write)

Parameters:

  • endpoint string (required): The Modal endpoint name (e.g., "my-function--data-processor-api" - will be automatically appended with .modal.run)
  • method string (required): HTTP method to use (GET, POST, PUT, PATCH, DELETE) (default: POST)
  • headers object (nullable): HTTP headers to include in the request as key-value pairs
  • body string (nullable): Request body (JSON string or raw data)
  • timeout number (required): Request timeout in milliseconds (default: 30000)

Returns:

  • status number: HTTP status code (e.g., 200, 404, 500)
  • statusText string: HTTP status text (e.g., "OK", "Not Found")
  • headers object: Response headers as key-value pairs
  • data string: Response body as string

Example Usage:

{
  "endpoint": "my-function--data-processor-api",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "your-api-key"
  },
  "body": "{\"url\": \"https://example.com\", \"options\": {\"waitForSelector\": \".content\"}}",
  "timeout": 60000
}

Common Use Cases

Web Scraping & Data Extraction:

  • Execute Modal serverless functions for web scraping operations
  • Extract structured data from websites using custom endpoints
  • Process scraped data with configurable timeout limits for long-running operations

API Integration & Orchestration:

  • Connect to Modal serverless functions from external workflows
  • Chain multiple Modal endpoints for complex data processing pipelines
  • Integrate Modal's serverless capabilities into existing automation systems

Serverless Function Execution:

  • Trigger Modal serverless functions with custom parameters and headers
  • Execute computational tasks on Modal's infrastructure
  • Handle responses from Modal functions for downstream processing

Batch Processing & Jobs:

  • Submit batch processing jobs to Modal endpoints
  • Monitor long-running jobs with extended timeout configurations
  • Process large datasets using Modal's distributed computing capabilities