{% extends "base.html" %} {% block title %}API Tokens - Job Scheduler{% endblock %} {% block content %}
Name Token Created Expires Actions
Loading...

API Documentation

Authenticate requests using the header: Authorization: Bearer <your_token>

GET /isHealthy Health Check

Public endpoint to check server status. No auth required.

Returns {"status": "ok", "timestamp": "..."}

GET /api/publicKey Get Public Key

Retrieve the public key to encrypt passwords.

Returns: {"publicKey": "..."}

POST /api/login User Login

Authenticate with username and password.

JSON Body

{
  "username": "admin",
  "password": "password"
}

Returns: {"status": "ok", "token": "...", "userId": 1}

GET /api/stats System Statistics

Get overall system execution stats.

Returns: {"tasks": 10, "total": 100, "running": 1, "success": 90, "failed": 9}

POST /api/save_task Create or Update Task

Create a new task or update an existing one.

Query Parameters

  • id (int): Task ID. Use -1 or omit for a new task.

JSON Body

JSON serialized Task object.

POST /api/toggle_task Toggle Task Enabled/Disabled

Enable or disable a specific task.

Query Parameters

  • id (int): Task ID
  • enabled (bool): true or false
POST /api/trigger_task Trigger a Task

Manually trigger a full task execution immediately.

Query Parameters

  • id (int): Task ID
POST /api/delete_task Delete a Task

Permanently delete a task from the system.

Query Parameters

  • id (int): Task ID
POST /api/trigger_job Trigger a Job

Manually trigger a single specific job.

Query Parameters

  • id (int): Job ID
POST /api/execution_log Get Execution Log Details

Retrieve the text log output of an execution.

Query Parameters

  • id (int): Execution ID

Returns: {"content": "log text"}

GET /api/download_log Download Execution Log

Download the execution log file as an attachment.

Query Parameters

  • id (int): Execution ID
POST /api/cancel_execution Cancel an Execution

Attempt to kill a running execution process (sending SIGTERM/SIGKILL).

Query Parameters

  • id (int): Execution ID
POST /api/delete_execution Delete an Execution Record

Cancel an execution if running, then delete the record and its log file.

Query Parameters

  • id (int): Execution ID
POST /api/create_user Create User

Create a new user in the system.

JSON Body

JSON serialized User object including password (plain text, will be hashed server-side).

POST /api/update_user_password Update User Password

Update a user's password.

JSON Body

{
  "userId": 1,
  "password": "new_password"
}
POST /api/delete_user Delete User

Delete a user from the system.

JSON Body

{
  "userId": 1
}
POST /api/create_token Create API Token

Create a new API token for the current user.

JSON Body

{
  "name": "My Token",
  "expiresAt": 1700000000000
}

expiresAt is optional and specified in milliseconds since epoch.

Returns: {"status": "ok", "token": "..."}

POST /api/delete_token Delete API Token

Revoke and delete an API token.

JSON Body

{
  "tokenId": 123
}
{% endblock %} {% block scripts %} {% endblock %}