API Documentation
A complete reference for the PowerProjects.AI REST API. Upload files, manage data items, fields, and rows — all authenticated with your account API key.
Authentication
All API endpoints require an API key tied to your account. You can find your key in your account settings. Pass it via the X-Api-Key header or as an api_key query parameter.
# Via header (recommended) curl -H "X-Api-Key: your_api_key_here" \ https://powerprojects.ai/api/v1/data-items/ # Via query parameter curl https://powerprojects.ai/api/v1/data-items/?api_key=your_api_key_here
import requests API_KEY = "your_api_key_here" BASE_URL = "https://powerprojects.ai/api/v1" HEADERS = {"X-Api-Key": API_KEY} response = requests.get(f"{BASE_URL}/data-items/", headers=HEADERS) print(response.json())
const API_KEY = "your_api_key_here"; const BASE_URL = "https://powerprojects.ai/api/v1"; const res = await fetch(`${BASE_URL}/data-items/`, { headers: { "X-Api-Key": API_KEY } }); const data = await res.json(); console.log(data);
Base URL
All endpoints are prefixed with:
https://powerprojects.ai/api/v1/
All request and response bodies use JSON, except file upload endpoints which use multipart/form-data.
Error Handling
The API returns standard HTTP status codes. Error responses include a JSON body with an error key describing what went wrong.
| Status | Meaning |
|---|---|
200 | Success |
201 | Created successfully |
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — invalid or missing API key |
404 | Not found — resource doesn't exist or doesn't belong to your account |
405 | Method not allowed |
{
"error": "Invalid or missing API key."
}
Create Data Item from File
Upload a CSV or Excel file to create a new data item. Fields are auto-detected from column headers and data types are inferred from the file content.
| Parameter | Type | Description | |
|---|---|---|---|
data_name |
string | required | Name for the data item |
data_description |
string | optional | Description of the data |
data_file |
file | required | CSV or Excel file (.csv, .xlsx, .xls) |
multipart/form-data, not JSON. Field types (char, decimal, date, boolean, text) are automatically detected from the data.curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -F "data_name=Q1 Sales Report" \ -F "data_description=Quarterly sales by region" \ -F "data_file=@/path/to/sales.csv" \ https://powerprojects.ai/api/v1/data-items/create-from-file/
import requests response = requests.post( f"{BASE_URL}/data-items/create-from-file/", headers=HEADERS, data={ "data_name": "Q1 Sales Report", "data_description": "Quarterly sales by region", }, files={ "data_file": open("sales.csv", "rb") } ) print(response.json())
{
"id": 42,
"data_name": "Q1 Sales Report",
"data_description": "Quarterly sales by region",
"fields": [
{ "id": 101, "field_label": "Region", "field_type": "char", "field_order": 0 },
{ "id": 102, "field_label": "Revenue", "field_type": "decimal", "field_order": 1 },
{ "id": 103, "field_label": "Close Date", "field_type": "date", "field_order": 2 }
],
"rows_created": 1250,
"cells_created": 3750,
"reference_file": { "id": 7, "filename": "sales.csv" }
}
Append Rows from File
Upload a file to add rows to an existing data item. Columns are matched to existing fields by header name (case-insensitive). Unmatched columns are skipped unless add_new_fields is set.
| Parameter | Type | Description | |
|---|---|---|---|
data_file |
file | required | CSV or Excel file |
add_new_fields |
string | optional | Set to "true" to auto-create fields for unmatched columns |
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -F "data_file=@/path/to/more_sales.csv" \ -F "add_new_fields=true" \ https://powerprojects.ai/api/v1/data-items/42/append-from-file/
response = requests.post( f"{BASE_URL}/data-items/42/append-from-file/", headers=HEADERS, data={"add_new_fields": "true"}, files={"data_file": open("more_sales.csv", "rb")} )
{
"id": 42,
"data_name": "Q1 Sales Report",
"rows_appended": 500,
"cells_created": 2000,
"matched_columns": ["Region", "Revenue", "Close Date"],
"skipped_columns": [],
"reference_file": { "id": 8, "filename": "more_sales.csv" }
}
Data Items
Returns all data items belonging to your account.
curl -H "X-Api-Key: your_api_key_here" \
https://powerprojects.ai/api/v1/data-items/
response = requests.get(f"{BASE_URL}/data-items/", headers=HEADERS) items = response.json()["data_items"]
{
"data_items": [
{
"id": 42,
"data_name": "Q1 Sales Report",
"data_description": "Quarterly sales by region",
"field_count": 3,
"created_at": "2026-02-15T10:30:00+00:00",
"updated_at": "2026-02-28T14:22:00+00:00"
}
]
}
Create a new data item with optional field definitions (no file upload). Use this when you want to define the schema manually, then add rows via the API.
| Parameter | Type | Description | |
|---|---|---|---|
data_name |
string | required | Name for the data item |
data_description |
string | optional | Description |
fields |
array | optional | Array of field definitions (see example) |
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "data_name": "Inventory Tracker", "data_description": "Weekly inventory levels", "fields": [ {"field_label": "SKU", "field_type": "char"}, {"field_label": "Quantity", "field_type": "decimal"}, {"field_label": "Last Counted", "field_type": "date"} ] }' \ https://powerprojects.ai/api/v1/data-items/
response = requests.post( f"{BASE_URL}/data-items/", headers={**HEADERS, "Content-Type": "application/json"}, json={ "data_name": "Inventory Tracker", "data_description": "Weekly inventory levels", "fields": [ {"field_label": "SKU", "field_type": "char"}, {"field_label": "Quantity", "field_type": "decimal"}, {"field_label": "Last Counted", "field_type": "date"}, ] } )
field_type values: char, text, decimal, date, booleanGet full details for a data item including its fields, reference files, and row count.
{
"id": 42,
"data_name": "Q1 Sales Report",
"data_description": "Quarterly sales by region",
"created_at": "2026-02-15T10:30:00+00:00",
"updated_at": "2026-02-28T14:22:00+00:00",
"fields": [
{ "id": 101, "field_label": "Region", "field_type": "char", "field_order": 0,
"field_required": false, "field_instructions": "" }
],
"reference_files": [
{ "id": 7, "filename": "sales.csv", "created_at": "2026-02-15T10:30:00+00:00" }
],
"row_count": 1250
}
Update a data item's name or description. Only include the fields you want to change.
curl -X PATCH \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"data_name": "Q1 Sales Report (Updated)"}' \ https://powerprojects.ai/api/v1/data-items/42/
response = requests.patch( f"{BASE_URL}/data-items/42/", headers={**HEADERS, "Content-Type": "application/json"}, json={"data_name": "Q1 Sales Report (Updated)"} )
Permanently delete a data item and all of its fields, rows, and reference files.
curl -X DELETE \
-H "X-Api-Key: your_api_key_here" \
https://powerprojects.ai/api/v1/data-items/42/
{ "deleted": true }
Fields
Fields define the columns/schema of a data item. Each field has a label, a type, and an order.
List all fields for a data item, ordered by field_order.
{
"fields": [
{
"id": 101,
"field_label": "Region",
"field_type": "char",
"field_order": 0,
"field_required": false,
"field_instructions": ""
}
]
}
Add a new field to a data item.
| Parameter | Type | Description | |
|---|---|---|---|
field_label | string | required | Column header name |
field_type | string | optional | One of: char, text, decimal, date, boolean. Default: char |
field_order | integer | optional | Position in the column list |
field_required | boolean | optional | Whether the field is required |
field_instructions | string | optional | Instructions or notes for this field |
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"field_label": "Discount %", "field_type": "decimal"}' \ https://powerprojects.ai/api/v1/data-items/42/fields/
response = requests.post( f"{BASE_URL}/data-items/42/fields/", headers={**HEADERS, "Content-Type": "application/json"}, json={"field_label": "Discount %", "field_type": "decimal"} )
Update a field's label, type, order, or instructions. Only include the fields you want to change.
Delete a field. All values stored in this field will also be removed.
Rows
Rows represent the actual data in your data item. Each row is identified by a _row_ref and contains values keyed by field ID.
Get paginated rows. Values are keyed by field ID as strings.
| Query Param | Type | Description | |
|---|---|---|---|
offset | integer | optional | Start index (default: 0) |
limit | integer | optional | Max rows to return (default: 100, max: 500) |
search | string | optional | Full-text search across all cell values |
curl -H "X-Api-Key: your_api_key_here" \ "https://powerprojects.ai/api/v1/data-items/42/rows/?offset=0&limit=50"
response = requests.get( f"{BASE_URL}/data-items/42/rows/", headers=HEADERS, params={"offset": 0, "limit": 50, "search": "North"} )
{
"total": 1250,
"offset": 0,
"limit": 50,
"rows": [
{
"_row_ref": "0",
"101": "North",
"102": 45200.50,
"103": "2026-01-15"
}
]
}
"101" maps to field with id: 101). Use the Get Detail or List Fields endpoint to map IDs to labels.Add a single row. Pass values keyed by field ID.
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"values": {"101": "West", "102": 31500.00, "103": "2026-03-01"}}' \ https://powerprojects.ai/api/v1/data-items/42/rows/
response = requests.post( f"{BASE_URL}/data-items/42/rows/", headers={**HEADERS, "Content-Type": "application/json"}, json={"values": {"101": "West", "102": 31500.00, "103": "2026-03-01"}} )
{ "row_ref": "1250", "cells_created": 3 }
Insert multiple rows in one request. Ideal for batch data ingestion.
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "rows": [ {"101": "East", "102": 28900.00, "103": "2026-03-01"}, {"101": "South", "102": 42100.75, "103": "2026-03-01"} ] }' \ https://powerprojects.ai/api/v1/data-items/42/rows/bulk/
rows = [
{"101": "East", "102": 28900.00, "103": "2026-03-01"},
{"101": "South", "102": 42100.75, "103": "2026-03-01"},
]
response = requests.post(
f"{BASE_URL}/data-items/42/rows/bulk/",
headers={**HEADERS, "Content-Type": "application/json"},
json={"rows": rows}
)
{ "rows_created": 2, "cells_created": 6 }
Get a single row by its _row_ref.
{
"row": {
"_row_ref": "0",
"101": "North",
"102": 45200.50,
"103": "2026-01-15"
}
}
Update specific cells in a row. Only include the field IDs you want to change.
curl -X PATCH \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"values": {"102": 48000.00}}' \ https://powerprojects.ai/api/v1/data-items/42/rows/0/
response = requests.patch( f"{BASE_URL}/data-items/42/rows/0/", headers={**HEADERS, "Content-Type": "application/json"}, json={"values": {"102": 48000.00}} )
{ "row_ref": "0", "cells_updated": 1, "cells_created": 0 }
Delete an entire row and all of its cell values.
{ "deleted": true, "cells_removed": 3 }
Summary & Statistics
Get aggregate statistics for every field in a data item. Returns type-aware summaries: min/max/sum/avg for decimals, top values for text, date ranges, and boolean counts.
curl -H "X-Api-Key: your_api_key_here" \
https://powerprojects.ai/api/v1/data-items/42/summary/
response = requests.get( f"{BASE_URL}/data-items/42/summary/", headers=HEADERS ) summary = response.json()
{
"id": 42,
"data_name": "Q1 Sales Report",
"row_count": 1250,
"field_count": 3,
"field_summaries": [
{
"field_id": 101,
"field_label": "Region",
"field_type": "char",
"total_values": 1250,
"empty_count": 0,
"unique_count": 4,
"top_values": [
{ "value": "North", "count": 412 },
{ "value": "South", "count": 380 },
{ "value": "East", "count": 298 },
{ "value": "West", "count": 160 }
]
},
{
"field_id": 102,
"field_label": "Revenue",
"field_type": "decimal",
"total_values": 1250,
"empty_count": 0,
"min": 1200.00,
"max": 98500.00,
"sum": 15680432.50,
"avg": 12544.35
},
{
"field_id": 103,
"field_label": "Close Date",
"field_type": "date",
"total_values": 1248,
"empty_count": 2,
"min_date": "2026-01-02",
"max_date": "2026-03-31"
}
]
}
Dashboard Widgets
Widgets define chart visualizations on a data item's dashboard. Each widget references a label field, has one or more series for aggregation, and configurable chart options.
bar, line, pie, doughnut, area, scatter, numberWidget sizes:
sm (1/3 width), md (1/2 width), lg (full width)Date groupings:
day, week, month, quarter, year
List all dashboard widgets for a data item, including their series.
{
"widgets": [
{
"id": 1,
"data_item": 42,
"title": "Revenue by Region",
"description": "",
"chart_type": "bar",
"widget_order": 0,
"widget_size": "md",
"label_field": 101,
"date_grouping": "",
"sort_direction": "",
"row_limit": null,
"filter_config": null,
"chart_options": null,
"created_at": "2026-03-01T12:00:00+00:00",
"updated_at": "2026-03-01T12:00:00+00:00",
"series": [
{
"id": 1,
"value_field": 102,
"aggregation": "sum",
"label": "Total Revenue",
"series_order": 0,
"color": "#0052FF"
}
]
}
]
}
Create a new dashboard widget. You can optionally include a series array to create series in the same request.
| Parameter | Type | Description | |
|---|---|---|---|
title | string | optional | Display title for the widget |
description | string | optional | Description or notes |
chart_type | string | optional | One of: bar, line, pie, doughnut, area, scatter, number |
widget_size | string | optional | One of: sm, md, lg. Default: md |
widget_order | integer | optional | Position in the dashboard layout |
label_field | integer | optional | Field ID to use as the label/x-axis |
date_grouping | string | optional | One of: day, week, month, quarter, year |
sort_direction | string | optional | One of: asc, desc |
row_limit | integer | optional | Max rows to include in the chart |
filter_config | object | optional | JSON filter configuration |
chart_options | object | optional | Additional JSON chart options |
series | array | optional | Array of series objects to create (see Series parameters) |
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "title": "Revenue by Region", "chart_type": "bar", "widget_size": "md", "label_field": 101, "series": [ {"value_field": 102, "aggregation": "sum", "label": "Total Revenue", "color": "#0052FF"} ] }' \ https://powerprojects.ai/api/v1/data-items/42/widgets/
response = requests.post( f"{BASE_URL}/data-items/42/widgets/", headers={**HEADERS, "Content-Type": "application/json"}, json={ "title": "Revenue by Region", "chart_type": "bar", "widget_size": "md", "label_field": 101, "series": [ {"value_field": 102, "aggregation": "sum", "label": "Total Revenue", "color": "#0052FF"} ] } )
{
"id": 1,
"data_item": 42,
"title": "Revenue by Region",
"chart_type": "bar",
"widget_size": "md",
"series": [
{
"id": 1,
"value_field": 102,
"aggregation": "sum",
"label": "Total Revenue",
"series_order": 0,
"color": "#0052FF"
}
],
// ... other widget fields
}
Retrieve a single widget with its series.
Update a widget's properties. Only include the fields you want to change. Series are managed separately via the series endpoints.
curl -X PATCH \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"title": "Updated Title", "chart_type": "line"}' \ https://powerprojects.ai/api/v1/data-items/42/widgets/1/
response = requests.patch( f"{BASE_URL}/data-items/42/widgets/1/", headers={**HEADERS, "Content-Type": "application/json"}, json={"title": "Updated Title", "chart_type": "line"} )
Delete a widget and all its series.
Widget Series
Series define the value aggregations displayed in a widget. Each series references a field and an aggregation function.
count, sum, avg, min, max, distinct_count
List all series for a widget.
{
"series": [
{
"id": 1,
"value_field": 102,
"aggregation": "sum",
"label": "Total Revenue",
"series_order": 0,
"color": "#0052FF"
}
]
}
Add a new series to a widget.
| Parameter | Type | Description | |
|---|---|---|---|
value_field | integer | required | Field ID to aggregate |
aggregation | string | optional | One of: count, sum, avg, min, max, distinct_count. Default: sum |
label | string | optional | Display label for this series |
series_order | integer | optional | Position in the series list |
color | string | optional | Color hex code or name (e.g. #0052FF) |
curl -X POST \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"value_field": 103, "aggregation": "avg", "label": "Avg Cost", "color": "#FB923C"}' \ https://powerprojects.ai/api/v1/data-items/42/widgets/1/series/
response = requests.post( f"{BASE_URL}/data-items/42/widgets/1/series/", headers={**HEADERS, "Content-Type": "application/json"}, json={ "value_field": 103, "aggregation": "avg", "label": "Avg Cost", "color": "#FB923C" } )
Update a series' value field, aggregation, label, order, or color. Only include the fields you want to change.
Remove a series from a widget.