API Reference
Complete reference for the Automated Future REST API.
Base URL: https://api.automatedfuture.co/v1/test
All endpoints (except /status) require an API key passed in the Authorization header. Create one in the dashboard under Team > API Keys.
Authentication
Every request must include your API key:
Authorization: YOUR_API_KEY
API keys are scoped to a team. You can only access resources that belong to your team. Keys carry permissions based on the creating user's role — most keys have full read/write access.
Errors
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid API key |
403 Forbidden | Valid key but insufficient permissions |
All error responses return JSON:
Status
GET /status
Health check. No authentication required.
Response 200 OK
Returns 503 Service Unavailable if the database is unreachable.
Projects
GET /project/
List projects belonging to your team.
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
page_size | integer | 20 | Results per page (1–100) |
page_token | string | — | Cursor from a previous response for the next page |
Response 200 OK
| Field | Type | Description |
|---|---|---|
project_id | string | Unique project identifier |
name | string | Project name (2–255 chars) |
description | string or null | Optional description (up to 1024 chars) |
status | string | Active or Inactive |
created_at | string | ISO 8601 timestamp |
page_token | string or null | Pass as page_token to fetch the next page; null means no more results |
Test Runs
A test run groups related test results together (e.g. a single CI pipeline execution).
POST /run/
Create a new test run.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project to create the run under |
label | string | No | Human-readable label (2–255 chars), e.g. "CI #42" |
metadata | object | No | Arbitrary JSON metadata |
Response 200 OK
POST /run/
Update an existing test run.
Path parameters
| Name | Type | Description |
|---|---|---|
test_run_id | string | The run to update |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | No | New label (2–255 chars) |
status | string | No | Pending, Running, or Completed |
metadata | object | No | Arbitrary JSON metadata |
Setting status to Running records started_at. Setting status to Completed records finished_at and snapshots result counts.
Response 204 No Content
Test Results
A test result represents a single test case within a run.
POST /result/
Create a new test result.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project the result belongs to |
test_run_id | string | No | Test run to attach this result to |
test_name | string | Yes | Test name (2–255 chars) |
status | string | Yes | Pending, Running, Passed, Failed, Skipped, or KnownFail |
started_at | string | No | ISO 8601 timestamp |
metadata | object | No | Arbitrary JSON metadata |
Response 200 OK
GET /result/
Get a single test result by ID.
Response 200 OK
| Field | Type | Description |
|---|---|---|
test_result_id | string | Unique result identifier |
project_id | string | Parent project |
test_run_id | string or null | Parent test run |
test_name | string | Test name |
status | string | Pending, Running, Passed, Failed, Skipped, or KnownFail |
error_message | string or null | Error details (up to 1024 chars) |
metadata | object or null | Arbitrary JSON |
started_at | string or null | ISO 8601 start time |
finished_at | string or null | ISO 8601 finish time |
execution_time_ms | integer or null | Duration in milliseconds |
test_run_label | string or null | Label of the parent test run |
POST /result/
Update a test result.
Request body — all fields optional, only provided fields are updated.
| Field | Type | Description |
|---|---|---|
status | string | New status |
error_message | string | Error message (up to 1024 chars) |
metadata | object | Arbitrary JSON metadata |
started_at | string | ISO 8601 timestamp |
finished_at | string | ISO 8601 timestamp |
execution_time_ms | integer | Duration in milliseconds |
Response 200 OK
POST /result/{test_result_id}/start
Mark a test as started. Sets started_at to the current server time.
Response 200 OK
POST /result/{test_result_id}/finish
Mark a test as finished. Sets finished_at to the current server time and calculates execution_time_ms from started_at.
Request body — all fields optional.
| Field | Type | Description |
|---|---|---|
status | string | Final status |
error_message | string | Error message (up to 1024 chars) |
metadata | object | Arbitrary JSON metadata |
Response 200 OK
DELETE /result/
Delete a test result and its associated artifacts.
Response 200 OK
Artifacts
Artifacts are files attached to a test result — logs, screenshots, videos, etc. Uploading is a three-step process: create the record, upload the file to the returned presigned URL, then confirm.
GET /artifact/
List artifacts for a test result.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
test_result_id | string | Yes | The test result to list artifacts for |
Response 200 OK
| Field | Type | Description |
|---|---|---|
artifact_id | string | Unique artifact identifier |
test_result_id | string | Parent test result |
project_id | string | Parent project |
label | string | Display label (1–255 chars) |
kind | string | Log, Image, Video, or Other |
content_type | string | MIME type |
size_bytes | integer | File size in bytes |
test_step | string or null | Optional test step name |
metadata | object or null | Arbitrary JSON |
expires_at | string | ISO 8601 expiration timestamp |
created_at | string | ISO 8601 creation timestamp |
POST /artifact/
Create an artifact record and get a presigned upload URL.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
test_result_id | string | Yes | Test result to attach the artifact to |
label | string | Yes | Display label (1–255 chars) |
kind | string | Yes | Log, Image, Video, or Other |
content_type | string | Yes | MIME type (1–255 chars) |
size_bytes | integer | Yes | File size in bytes (1–100 MB) |
test_step | string | No | Test step name |
metadata | object | No | Arbitrary JSON metadata |
Limits: Maximum 50 artifacts per test result. The test result must not be older than 7 days.
Response 200 OK
Upload the file
Use the upload_url from the previous step to upload the file with a PUT request. No Authorization header is needed — the URL is pre-authenticated.
POST /artifact/{artifact_id}/confirm
Confirm that the file has been uploaded. The artifact is not visible until confirmed.
Response 200 OK
GET /artifact/{artifact_id}/download
Get a presigned download URL for an artifact.
Response 200 OK
DELETE /artifact/
Delete an artifact and its stored file.
Response 200 OK
Error Codes
| Status | Meaning |
|---|---|
400 Bad Request | Validation failed (missing field, invalid value, limit exceeded) |
401 Unauthorized | Missing or invalid API key |
403 Forbidden | Insufficient permissions or resource not accessible |
404 Not Found | Resource does not exist or belongs to a different team |
500 Internal Server Error | Unexpected server error |
503 Service Unavailable | Database unreachable (returned by /status only) |
All errors return a JSON body:
Full Example
Create a test run, report a result with an artifact, and close the run:
API="https://api.automatedfuture.co/v1/test"
KEY="YOUR_API_KEY"
PROJECT="project_abc123"
# 1. Create a test run
RUN_ID=
# 2. Create a test result
RESULT_ID=
# 3. Upload a log artifact
ARTIFACT=
UPLOAD_URL=
ART_ID=
# 4. Complete the test run