Projects API
The Projects API allows you to manage projects within workspaces, including creation, import/export, and template management.
Save Project
Create or update a project in a workspace.
- Python SDK
- REST API
import prometheux_chain as px
# Create a new project
project_id = px.save_project(project_name="my_project")
# Update an existing project
updated_project_id = px.save_project(
project_id="existing_id",
project_name="updated_name"
)
Function Signature
def save_project(
project_id=None,
project_name=None,
project_scope="user"
)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | str | No | The project identifier. If None, a new project will be created |
project_name | str | Yes* | The name of the project. Required when creating a new project |
project_scope | str | No | The scope of the project. Defaults to "user" |
Returns
The project ID of the created or updated project.
HTTP Request
POST /api/v1/projects/save
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| project | object | Yes | Project data object |
The project object should contain:
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | No | Project ID (auto-generated if not provided) |
| name | string | Yes | Project name |
| description | string | No | Project description |
| metadata | object | No | Additional project metadata |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/save" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"project": {
"name": "Financial Risk Analysis",
"description": "Project for analyzing financial risk factors",
"metadata": {
"department": "risk_management",
"priority": "high"
}
}
}'
List Projects
List all projects in a workspace.
- Python SDK
- REST API
import prometheux_chain as px
# List all user projects
projects = px.list_projects()
# List projects with specific scopes
projects = px.list_projects(project_scopes=["user", "shared"])
Function Signature
def list_projects(
project_scopes=["user"]
)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_scopes | list | No | List of project scopes to filter by. Defaults to ["user"] |
Returns
A list of project data dictionaries.
HTTP Request
GET /api/v1/projects/list?scopes=user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| scopes | string | No | Comma-separated list of scopes (default: "user") |
cURL Example
curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/list?scopes=user,organization" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Load Project
Load a specific project by ID.
- Python SDK
- REST API
import prometheux_chain as px
# Load a specific project
project_data = px.load_project(project_id="my_project_id")
Function Signature
def load_project(
project_id,
project_scope="user"
)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | str | Yes | The project identifier to load |
project_scope | str | No | The scope of the project. Defaults to "user" |
Returns
The project data dictionary.
HTTP Request
GET /api/v1/projects/load?project_id={project_id}&scope=user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Yes | The project ID to load |
| scope | string | No | Project scope (default: "user") |
cURL Example
curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/load?project_id=proj_12345&scope=user" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
List Templates
List all available project templates from the marketplace.
- Python SDK
- REST API
import prometheux_chain as px
# List all available project templates
templates = px.list_templates()
for template in templates:
print(f"Template: {template['name']} (ID: {template['id']})")
Response
{
"data": [
{
"id": "template_001",
"name": "Financial Analysis Template",
"description": "Template for financial data analysis",
"category": "finance"
},
{
"id": "template_002",
"name": "Customer Analytics Template",
"description": "Template for customer behavior analysis",
"category": "marketing"
}
],
"message": "Templates retrieved successfully",
"status": "success"
}
Import Template
Import a project from a marketplace template.
- Python SDK
- REST API
import prometheux_chain as px
# Import a template as a new project
result = px.import_template(
template_id="template_001",
new_project_name="My Financial Analysis"
)
print(f"Template imported as project: {result['name']}")
HTTP Request
POST /api/v1/projects/import-template
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| template_id | string | Yes | The template ID to import |
| new_project_name | string | No | Custom name for the new project |
| project_scope | string | No | Project scope (default: "user") |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/import-template" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"template_id": "template_001",
"new_project_name": "My Financial Analysis",
"project_scope": "user"
}'
Response
{
"data": {
"id": "proj_67890",
"name": "My Financial Analysis",
"description": "Project created from Financial Analysis Template",
"scope": "user"
},
"message": "Template imported successfully as project 'My Financial Analysis'",
"status": "success"
}
Create Project from Context
Create a new project by analyzing text context and optional file attachments using AI.
- Python SDK
- REST API
import prometheux_chain as px
# Create a project from context
context = """
Analyze customer purchase patterns and identify high-value segments
for targeted marketing campaigns. Focus on seasonal trends and
customer lifetime value calculations.
"""
files = ["customer_data.csv", "marketing_report.pdf"]
result = px.create_project_from_context(
context=context,
files=files
)
print(f"Created project: {result['name']}")
HTTP Request
POST /api/v1/projects/create-from-context
Parameters (Form Data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| context | string | No | Text context describing the domain or task |
| scope | string | No | Project scope (default: "user") |
| files | file[] | No | Optional file attachments (PDF, CSV, TXT, images) |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/create-from-context" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-F "context=Analyze customer purchase patterns and identify high-value segments for targeted marketing campaigns" \
-F "scope=user" \
-F "files=@customer_data.csv" \
-F "files=@marketing_report.pdf"
Export Project
Export a project including all its data and metadata.
- Python SDK
- REST API
import prometheux_chain as px
import json
# Export a project
export_data = px.export_project(
project_id="proj_12345"
)
print(f"Exported {export_data['summary']['total_tables']} tables")
# Save export data for later import
with open("project_export.json", "w") as f:
json.dump(export_data, f)
HTTP Request
POST /api/v1/projects/export-project
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Yes | The project ID to export |
| scope | string | No | Export scope (default: "user") |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/export-project" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"project_id": "proj_12345",
"scope": "user"
}'
Import Project
Import a previously exported project into a workspace.
- Python SDK
- REST API
import prometheux_chain as px
import json
# Load previously exported data
with open("project_export.json", "r") as f:
export_data = json.load(f)
# Import the project
result = px.import_project(
export_data=export_data
)
print(f"Imported project with new ID: {result['new_project_id']}")
HTTP Request
POST /api/v1/projects/import-project
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| export_data | object | Yes | Previously exported project data |
| scope | string | No | Import scope (default: "user") |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/import-project" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"export_data": {...},
"scope": "user"
}'
Copy Project
Copy a project within or between workspaces.
- Python SDK
- REST API
import prometheux_chain as px
# Copy a project
result = px.copy_project(
project_id="proj_12345",
new_project_name="Copy of Financial Analysis"
)
print(f"Project copied with new ID: {result['new_project_id']}")
HTTP Request
POST /api/v1/projects/copy
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Yes | Source project ID |
| new_project_name | string | No | Name for the copied project |
| target_scope | string | No | Target scope (default: "user") |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/copy" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"project_id": "proj_12345",
"new_project_name": "Copy of Financial Analysis",
"target_scope": "user"
}'
Cleanup Projects
Delete projects from a workspace.
- Python SDK
- REST API
import prometheux_chain as px
# Clean up all user projects
px.cleanup_projects()
# Clean up a specific project
px.cleanup_projects(project_id="my_project_id")
Function Signature
def cleanup_projects(
project_id=None,
project_scope="user"
)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | str | No | The project identifier. If None, cleans up all project resources for the user |
project_scope | str | No | The scope of the project. Defaults to "user" |
HTTP Request
POST /api/v1/projects/cleanup
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| project | object | No | Project specification for deletion |
The project object can contain:
| Field | Type | Description |
|---|---|---|
| id | string | Specific project ID to delete |
| scope | string | Project scope (default: "user") |
cURL Example
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/cleanup" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"project": {
"id": "proj_12345",
"scope": "user"
}
}'
Complete Workflow Example
- Python SDK
- REST API
import prometheux_chain as px
import os
# Set up authentication and configuration
os.environ['PMTX_TOKEN'] = 'my_pmtx_token'
px.config.set('JARVISPY_URL', "https://api.prometheux.ai/jarvispy/my-org/my-user")
# Create a new project
project_id = px.save_project(project_name="test_project")
# List all projects
projects = px.list_projects()
print(f"Available projects: {projects}")
# Load the created project
project_data = px.load_project(project_id)
# Clean up when done
px.cleanup_projects(project_id=project_id)
# Create a project
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/save" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"project": {"name": "test_project"}}'
# List projects
curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/list?scopes=user" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Load a specific project
curl -X GET "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/load?project_id=proj_12345" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Cleanup
curl -X POST "https://api.prometheux.ai/jarvispy/my-org/my-user/api/v1/projects/cleanup" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"project": {"id": "proj_12345", "scope": "user"}}'