> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/xyb-platform-1/xyb-ledger/api-reference-guides/operational-and-rule-management-apis/operation-and-job-execution-apis.md).

# Operation and Job Execution APIs

## Operations API

The Operations API is responsible for creating, updating, and managing operations within the Ledger system. Each operation is defined with a unique type and definition, enabling the execution of specific tasks. The Operations API automates and manages tasks like reporting, reconciliation, and anomaly detection, enabling centralized control and scheduling.

### 1. Create or Update Operation

The **Create or Update Operation** endpoint lets you set up or change tasks like data checks, replication, or reporting. It helps keep processes updated as business needs change.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/" method="put" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

<br>

### 2. Retrieve Specific Operation

Fetches details of a specific operation based on its type and definition.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/{type:\[^*]+}/{definition:\[^*]+}" method="get" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 3. Retrieve All Ledger Operation

The **Retrieve All Ledger Operations** endpoint is used to get a list of all operations, helping to monitor, filter, and manage tasks across the ledger. This is useful for tracking ongoing processes or reviewing completed operations.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/" method="get" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

***

## Job Execution APIs

The **Job Execution API** manages tasks within operations, providing real-time monitoring, role-based control, error handling, and dynamic task management. Jobs are specific tasks with assigned roles and parameters.

### 1. Create or Update Job

The **Create or Update Job** endpoint is used to define or modify specific tasks within an operation, including their parameters, roles, and execution settings. This is useful for customizing job workflows, such as setting up a data reconciliation task with specific parameters or updating an existing job to change its execution logic or roles.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/{type:\[^*]+}/{definition:\[^*]+}" method="put" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 2. Retrieve Job

The **Retrieve Job** endpoint is used to fetch details of a specific job within an operation, including its parameters, status, and associated roles. This is useful for monitoring a job’s progress, reviewing its configuration, or troubleshooting issues during its execution.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/{type:\[^*]+}/{definition:\[^*]+}/{name:\[^\*]+}" method="get" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 2. Delete Job

The **Delete Job** endpoint is used to remove a specific job within an operation, ensuring outdated or unnecessary tasks are no longer executed. This is useful for maintaining a clean workflow by eliminating jobs that are no longer relevant or required.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/{type:\[^*]+}/{definition:\[^*]+}/{name:\[^\*]+}" method="delete" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 3. Transition Job Status

The **Transition Job Status** endpoint is used to update the status of a job, such as starting, pausing, resuming, or stopping its execution. This is useful for dynamically managing jobs based on real-time requirements, such as pausing a job during system maintenance or resuming it afterward.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/{type:\[^*]+}/{definition:\[^*]+}/{name:\[^\*]+}" method="post" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 4. List Jobs

The **List Jobs** endpoint is used to retrieve a list of all jobs within an operation, with optional filtering, sorting, and pagination. This is useful for monitoring multiple jobs, reviewing their statuses, and managing workflows efficiently.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/*/*/" method="get" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

### 5. Retrieve Job Executions

The **Retrieve Job Executions** endpoint is used to list all executions of a specific job, including their statuses, results, and timestamps. This is useful for tracking the history of a job’s runs, analyzing its performance, and identifying any failures or bottlenecks.

{% openapi src="/files/5af2rdQ5h4ZxHvDZfiyJ" path="/api/v1/operation/*/*/\*" method="get" %}
[openapi-ledger.json](https://content.gitbook.com/content/akJn6TxWIBAbZwLlYoVP/blobs/S917VQZQHm6OZGrj1mf5/openapi-ledger.json)
{% endopenapi %}

#### Additional Notes:

* **Security**: Endpoints require appropriate headers (e.g., `request-id`, `source`).
* **Error Handling**: All endpoints return structured error messages with a `500` status code for internal server errors.
* **Scalability**: Supports pagination for large datasets.

This documentation provides an overview of the key endpoints and their usage for managing operations and job executions within the Ledger system.

The Operations API is responsible for creating, updating, and managing operations within the Ledger system. Each operation is defined with a unique type and definition, enabling the execution of specific tasks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/xyb-platform-1/xyb-ledger/api-reference-guides/operational-and-rule-management-apis/operation-and-job-execution-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
