Skip to main content

Credentials

Credentials in Scheduler0 provide secure authentication for API access. They consist of API keys and secrets that allow applications and users to authenticate with the Scheduler0 API and manage their scheduled jobs.

Overview

Credentials are essential for accessing the Scheduler0 API. They provide secure authentication mechanisms that ensure only authorized users and applications can create, modify, or delete jobs, projects, and executors.

After sign up a default credential is created in your account. There should be at least one credential for your account.

Authentication Methods

Scheduler0 supports two authentication methods:

  1. API Key + Secret Authentication (Default for managed service)

    • Used for all standard API operations
    • Requires X-API-Key and X-Secret-Key headers
    • Most endpoints also require X-Account-ID header
  2. Basic Authentication (Self-hosting only)

    • Only available for users self-hosting Scheduler0
    • Used for system-level operations (accounts, features, async tasks management)
    • Requires username and password from Scheduler0 configuration
    • Requires X-Peer header with value 'cmd' or 'peer'
    • Note: This authentication method is not available for managed service users

Credential Structure

{
"id": 1,
"accountId": 123,
"archived": false,
"apiKey": "1234567890abcdef",
"apiSecret": "secret_abcdef1234567890",
"dateCreated": "2024-01-15T10:30:00Z",
"dateModified": null,
"dateDeleted": null,
"createdBy": "user123",
"deletedBy": null
}

Fields

  • id: Unique identifier for the credential
  • accountId: ID of the account that owns this credential
  • archived: Whether the credential is archived (disabled)
  • apiKey: Public API key used for authentication
  • apiSecret: Secret key used for signing requests
  • dateCreated: Timestamp when the credential was created
  • dateModified: Timestamp when the credential was last modified
  • dateDeleted: Timestamp when the credential was deleted
  • createdBy: Identifier of the user who created the credential
  • deletedBy: Identifier of the user who deleted the credential

Creating Credentials

Through the Web Interface

  1. Navigate to the Credentials section in your Scheduler0 dashboard
  2. Click "Create New Credential"
  3. Provide a descriptive name for the credential
  4. Copy and securely store the generated API key and secret

Using Credentials

Scheduler0 uses X-API-Key and X-Secret-Key headers for authentication. Include both headers in your API requests:

curl -X GET "https://api.scheduler0.com/v1/projects" \
-H "X-API-Key: your_api_key" \
-H "X-Secret-Key: your_secret_key"

Scheduler0 uses X-API-Key and X-Secret-Key headers for authentication. Include both headers in your API requests:

curl -X GET "https://api.scheduler0.com/v1/projects" \
-H "X-API-Key: your_api_key" \
-H "X-Secret-Key: your_secret_key"
package main

import (
"fmt"
"github.com/scheduler0/scheduler0-go-client"
)

func main() {
client, err := scheduler0_go_client.NewClient(
"https://api.scheduler0.com",
"v1",
scheduler0_go_client.WithAPIKey("your_api_key"),
scheduler0_go_client.WithAPISecret("your_secret_key"),
scheduler0_go_client.WithAccountID("your_account_id"),
)
if err != nil {
panic(err)
}

// Use the client to make API calls
projects, err := client.ListProjects(10, 0, "date_created", "desc")
if err != nil {
panic(err)
}

fmt.Printf("Found %d projects\n", len(projects.Data.Projects))
}

Node.js Client

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

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

// Use the client
client.projects.list()
.then(projects => {
console.log(`Found ${projects.data.projects.length} projects`);
})
.catch(error => {
console.error('Error:', error);
});

Managing Credentials

Archiving Credentials

You can archive credentials to disable them without deleting them:

curl -X POST "https://api.scheduler0.com/v1/credentials/1/archive" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_API_SECRET" \
-H "X-Account-ID: YOUR_ACCOUNT_ID" \
-d '{
"archivedBy": "user123"
}'

Note: Archived credentials cannot be used for authentication but are retained in the system for audit purposes.

Listing Credentials

Retrieve credentials with pagination and sorting:

curl -X GET "https://api.scheduler0.com/v1/credentials?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)
  • orderByDirection (optional): Sort direction (asc, desc). Default: desc

Troubleshooting

Common Issues

  1. Invalid Credentials: Double-check API key and secret
  2. Archived Credentials: Ensure credentials are not archived
  3. Network Issues: Verify network connectivity and firewall settings
  4. Rate Limiting: Implement proper rate limiting in your application

API Reference

For complete API documentation, see the Scheduler0 API Reference.

  • Projects - Organizational units for jobs
  • Jobs - Individual scheduled tasks
  • Executors - Execution environments for jobs