Ingest API Schema
Documentation for sending custom pipeline metrics to RunWatch's ingestion API
Overview
The RunWatch Ingest API allows you to send pipeline and job metrics directly from any CI/CD platform or custom script. This is useful for:
- Integrating CI/CD platforms that don't have official reporters
- Building custom reporting solutions
- Sending metrics from scripts or automation tools
- Testing and debugging metric collection
Note: For GitHub Actions and GitLab CI/CD, we recommend using the official reporter actions/components. See the Reporter Actions documentation for details.
Endpoint
POST https://api.runwatch.io/functions/v1/ingestThe ingestion endpoint accepts POST requests with JSON payloads containing pipeline metrics.
Authentication
Authenticate requests using your organization's API key. You can create and manage API keys in the Access Keys section of the dashboard.
Headers:
X-API-Key: your_api_key_hereRequest Schema
The request body must be a JSON object matching the following schema:
{
"provider": "github" | "gitlab" | "bitbucket" | "circleci" | "other",
"repository": "owner/repo-name",
"pipeline_id": "string (optional)",
"pipeline_name": "string",
"run_id": number,
"run_attempt": number,
"run_name": "string (optional)",
"run_url": "string (optional)",
"status": "success" | "failure" | "cancelled" | "running" |
"queued" | "pending" | "skipped" | "timed_out",
"mode": "inline" | "external",
"compute_seconds": number (optional),
"duration_seconds": number (optional),
"started_at": "ISO 8601 timestamp",
"completed_at": "ISO 8601 timestamp (optional)",
"triggered_by": "string",
"actor": "string",
"branch": "string (optional)",
"jobs": [
{
"name": "string",
"job_id": "string (optional)",
"job_url": "string (optional)",
"status": "success" | "failure" | "cancelled" | "running" |
"queued" | "pending" | "skipped" | "timed_out",
"duration_seconds": number (optional),
"started_at": "ISO 8601 timestamp (optional)",
"completed_at": "ISO 8601 timestamp (optional)"
}
]
}Field Descriptions
Pipeline/Workflow Fields
providerrequiredCI/CD platform identifier: "github", "gitlab", "bitbucket", "circleci", or "other"
repositoryrequiredFull repository name in format "owner/repo-name" (e.g., "acme/cool-project")
pipeline_namerequiredDisplay name of the pipeline/workflow (e.g., "CI Pipeline", "Deploy to Prod")
run_idrequiredUnique numeric identifier for this pipeline run (must be unique per pipeline)
run_attemptrequiredAttempt number for this run (starts at 1, increments on retries)
statusrequiredCurrent status of the pipeline run. Must be one of: "success", "failure", "cancelled", "running", "queued", "pending", "skipped", "timed_out"
started_atrequiredISO 8601 timestamp when the pipeline run started (e.g., "2024-01-15T10:30:00Z")
triggered_byrequiredEvent or source that triggered the pipeline (e.g., "push", "pull_request", "manual", "schedule")
actorrequiredUser or system that triggered the pipeline (username, email, or system identifier)
pipeline_idoptionalPlatform-specific pipeline/workflow identifier
run_nameoptionalDisplay name or title for this specific run
run_urloptionalDirect URL to view this run in the CI/CD platform's UI
modeoptionalHow metrics were collected: "inline" (as part of pipeline) or "external" (separate reporting step)
compute_secondsoptionalTotal compute time across all jobs (useful for cost analysis, accounts for parallel execution)
duration_secondsoptionalTotal pipeline execution time in seconds. If not provided, calculated from started_at and completed_at
completed_atoptionalISO 8601 timestamp when the pipeline run completed. Required for completed runs
branchoptionalGit branch name that triggered this run
Job Fields
namerequiredDisplay name of the job (e.g., "build", "test", "deploy")
statusrequiredCurrent status of the job. Same values as pipeline status
job_idoptionalPlatform-specific job identifier
job_urloptionalDirect URL to view this job in the CI/CD platform's UI
duration_secondsoptionalJob execution time in seconds. If not provided, calculated from started_at and completed_at
started_atoptionalISO 8601 timestamp when the job started
completed_atoptionalISO 8601 timestamp when the job completed
Example Request
curl -X POST https://api.runwatch.io/functions/v1/ingest \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"provider": "github",
"repository": "acme/cool-project",
"pipeline_name": "CI Pipeline",
"run_id": 789012345,
"run_attempt": 1,
"run_name": "Fix login bug",
"run_url": "https://github.com/acme/cool-project/actions/runs/789012345",
"status": "success",
"mode": "inline",
"compute_seconds": 245,
"duration_seconds": 312,
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:35:12Z",
"triggered_by": "push",
"actor": "octocat",
"branch": "main",
"jobs": [
{
"name": "build",
"job_id": "456789",
"job_url": "https://github.com/acme/cool-project/actions/runs/789012345/job/456789",
"status": "success",
"duration_seconds": 120,
"started_at": "2024-01-15T10:30:05Z",
"completed_at": "2024-01-15T10:32:05Z"
},
{
"name": "test",
"job_id": "456790",
"job_url": "https://github.com/acme/cool-project/actions/runs/789012345/job/456790",
"status": "success",
"duration_seconds": 125,
"started_at": "2024-01-15T10:32:10Z",
"completed_at": "2024-01-15T10:34:15Z"
}
]
}'Response
Success (200):
{
"success": true,
"pipeline_run_id": "uuid"
}Error (4xx/5xx):
{
"error": "Error message description"
}Error Codes
401Unauthorized - Invalid or missing API key
400Bad Request - Invalid request format or missing required fields
402Payment Required - Plan limits exceeded (repository or run limits)
500Internal Server Error - Server-side error processing the request
CORS
The ingestion API supports CORS (Cross-Origin Resource Sharing) for browser-based integrations. The API accepts requests from any origin and includes appropriate CORS headers in responses.