Skip to main content

Projects

Projects in Scheduler0 are organizational containers that help you group and manage related scheduled jobs. They provide a way to organize your cron jobs logically, making it easier to manage complex scheduling scenarios.

Overview

A project serves as a top-level organizational unit that contains multiple jobs. Each project belongs to an account and can have a name and description to help you identify its purpose.

Project Structure

{
"id": 1,
"accountId": 123,
"name": "Data Processing Pipeline",
"description": "Daily data processing and cleanup tasks",
"dateCreated": "2024-01-15T10:30:00Z",
"dateModified": null,
"createdBy": "user123",
"modifiedBy": null,
"deletedBy": null
}

Fields

  • id: Unique identifier for the project (integer)
  • accountId: ID of the account that owns this project (integer)
  • name: Human-readable name for the project
  • description: Detailed description of what the project contains
  • dateCreated: Timestamp when the project was created (RFC3339 format)
  • dateModified: Timestamp when the project was last modified (RFC3339 format, optional)
  • createdBy: Identifier of the user who created the project
  • modifiedBy: Identifier of the user who last modified the project (optional)
  • deletedBy: Identifier of the user who deleted the project (optional)

Creating Projects

Projects can be created through the Scheduler0 API or web interface. When creating a project, you need to provide:

  • name: A descriptive name for your project
  • description: A detailed description of the project's purpose
  • createdBy: Identifier of the user creating the project

Example API Request

curl -X POST "https://api.scheduler0.com/v1/projects" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_API_SECRET" \
-d '{
"name": "E-commerce Automation",
"description": "Automated tasks for order processing and inventory management",
"createdBy": "user123"
}'

Node.js Client Example

const Scheduler0Client = require('@scheduler0/node-client');

const client = new Scheduler0Client({
apiKey: 'your_api_key',
apiSecret: 'your_secret_key',
baseURL: 'https://api.scheduler0.com/v1'
});

// Create a new project
const project = await client.projects.create({
name: "E-commerce Automation",
description: "Automated tasks for order processing and inventory management",
createdBy: "user123"
});

console.log('Created project:', project.data);

Managing Projects

Listing Projects

You can retrieve a paginated list of all projects in your account with optional sorting:

curl -X GET "https://api.scheduler0.com/v1/projects?limit=10&offset=0&orderBy=date_created&orderByDirection=desc" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_API_SECRET" \
-H "X-Account-ID: YOUR_ACCOUNT_ID"

Query Parameters:

  • limit (required): Maximum number of results (1-100, default: 10)
  • offset (required): Number of results to skip (default: 0)
  • orderBy (optional): Field to sort by (date_created, date_modified, created_by, modified_by, deleted_by). Default: date_created
  • orderByDirection (optional): Sort direction (asc, desc). Default: desc

Node.js Client Example

// List all projects with sorting
const projects = await client.projects.list(10, 0, "date_created", "desc");
console.log(`Found ${projects.data.projects.length} projects`);

Updating Projects

Update project information using the project ID:

curl -X PUT "https://api.scheduler0.com/v1/projects/1" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_API_SECRET" \
-d '{
"description": "Updated description for the project",
"modifiedBy": "user123"
}'

Node.js Client Example

// Update a project
const updatedProject = await client.projects.update(1, {
description: "Updated description for the project",
modifiedBy: "user123"
});

console.log('Updated project:', updatedProject.data);

Deleting Projects

Delete a project and all its associated jobs:

curl -X DELETE "https://api.scheduler0.com/v1/projects/1" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_API_SECRET" \
-d '{
"deletedBy": "user123"
}'

Node.js Client Example

// Delete a project
await client.projects.delete(1, {
deletedBy: "user123"
});

console.log('Project deleted successfully');

Best Practices

Project Organization

  1. Logical Grouping: Group related jobs into projects based on functionality or business domain
  2. Clear Naming: Use descriptive names that clearly indicate the project's purpose
  3. Detailed Descriptions: Provide comprehensive descriptions to help team members understand the project's scope

Examples of Good Project Organization

  • "User Management": Jobs for user registration, password resets, account cleanup
  • "Data Analytics": Jobs for data collection, processing, and reporting
  • "Infrastructure": Jobs for system maintenance, backups, monitoring
  • "E-commerce": Jobs for order processing, inventory updates, payment reconciliation

Integration with Jobs

Projects are tightly integrated with jobs in Scheduler0:

  • Every job must belong to a project
  • When you delete a project, all associated jobs are also deleted
  • You can filter and search jobs by project
  • Project-level metrics and monitoring are available

API Reference

For complete API documentation, see the Scheduler0 API Reference.

  • Jobs - Individual scheduled tasks within projects
  • Credentials - Authentication for API access
  • Executors - Execution environments for jobs