# Scheduler

## Get execution history for scheduled task

> Returns recent execution history for a scheduled background task, including success/failure status and retry information.\
> \
> \## Authorization\
> Requires \`Scheduler.History\` scope.\
> \
> \## Use Cases\
> \- Task monitoring dashboards\
> \- Failure investigation\
> \- Performance analysis\
> \- Retry pattern verification

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Scheduler"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"Execution":{"required":["duration","id","retryIndex","startDate","success"],"type":"object","properties":{"id":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"retryIndex":{"type":"integer","format":"int32"},"success":{"type":["null","boolean"]},"duration":{"type":["null","string"],"format":"date-span"}},"additionalProperties":false},"ExecutionSummary":{"required":["taskId","taskType"],"type":"object","allOf":[{"$ref":"#/components/schemas/Execution"}],"properties":{"taskId":{"type":"string","description":"Identifier of the scheduled task (as declared in scheduler.yml), extracted from the CorrelationId."},"taskType":{"type":["null","string"],"description":"Task type (handler) reported by the scheduler telemetry."}},"additionalProperties":false},"ExecutionDetail":{"required":["logs"],"type":"object","allOf":[{"$ref":"#/components/schemas/Execution"}],"properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionLog"}}},"additionalProperties":false},"ExecutionLog":{"required":["data","entryType","eventDate","id"],"type":"object","properties":{"id":{"type":"string"},"eventDate":{"type":"string","format":"date-time"},"entryType":{"type":"string"},"data":{"type":["null","string"]}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/scheduler/{taskId}/executions":{"get":{"tags":["Scheduler"],"summary":"Get execution history for scheduled task","description":"Returns recent execution history for a scheduled background task, including success/failure status and retry information.\n\n## Authorization\nRequires `Scheduler.History` scope.\n\n## Use Cases\n- Task monitoring dashboards\n- Failure investigation\n- Performance analysis\n- Retry pattern verification","parameters":[{"name":"taskId","in":"path","description":"Id of the scheduled task (as declared in scheduler.yml).","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Execution history retrieved successfully","content":{"text/plain":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Execution"},{"$ref":"#/components/schemas/ExecutionSummary"},{"$ref":"#/components/schemas/ExecutionDetail"}]}}},"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Execution"},{"$ref":"#/components/schemas/ExecutionSummary"},{"$ref":"#/components/schemas/ExecutionDetail"}]}}},"text/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/Execution"},{"$ref":"#/components/schemas/ExecutionSummary"},{"$ref":"#/components/schemas/ExecutionDetail"}]}}}}},"400":{"description":"Invalid taskId format","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while retrieving execution history"}}}}}}
```

## Retrieve a specific scheduler execution with its associated logs.

> Returns comprehensive execution details including all trace and dependency logs collected from Application Insights. Useful for debugging scheduled task issues and monitoring execution performance.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Scheduler"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ExecutionDetail":{"required":["logs"],"type":"object","allOf":[{"$ref":"#/components/schemas/Execution"}],"properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionLog"}}},"additionalProperties":false},"Execution":{"required":["duration","id","retryIndex","startDate","success"],"type":"object","properties":{"id":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"retryIndex":{"type":"integer","format":"int32"},"success":{"type":["null","boolean"]},"duration":{"type":["null","string"],"format":"date-span"}},"additionalProperties":false},"ExecutionLog":{"required":["data","entryType","eventDate","id"],"type":"object","properties":{"id":{"type":"string"},"eventDate":{"type":"string","format":"date-time"},"entryType":{"type":"string"},"data":{"type":["null","string"]}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/scheduler/{taskId}/executions/{executionId}":{"get":{"tags":["Scheduler"],"summary":"Retrieve a specific scheduler execution with its associated logs.","description":"Returns comprehensive execution details including all trace and dependency logs collected from Application Insights. Useful for debugging scheduled task issues and monitoring execution performance.","parameters":[{"name":"taskId","in":"path","description":"CorrelationId of the scheduled task.","required":true,"schema":{"type":"string"}},{"name":"executionId","in":"path","description":"Execution Id reported by Application Insights.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Execution details with logs retrieved successfully","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}},"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}},"text/json":{"schema":{"$ref":"#/components/schemas/ExecutionDetail"}}}},"400":{"description":"Invalid taskId or executionId format","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Execution not found","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while retrieving execution detail"}}}}}}
```

## List recent scheduler executions for the tenant

> Returns the most recent scheduler task executions across all configured tasks for the tenant.\
> Useful to monitor scheduler health, spot failing tasks and drill into individual executions.\
> &#x20;           \
> \*\*Sorting:\*\* By \`startDate\`, \`taskId\`, \`taskType\`, \`duration\`, or \`retryIndex\`.\
> &#x20;           \
> \*\*Pagination:\*\* Zero-based \`pageIndex\` and \`pageSize\`. Total count in \`x-pagination-total\` header.\
> &#x20;           \
> \## Authorization\
> Requires \`Scheduler.History\` scope.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Scheduler"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"SchedulerSortModel":{"type":"object","properties":{"field":{"type":"string","description":"Field to sort by (startDate, taskId, taskType, duration, retryIndex)."},"direction":{"description":"Sort direction (ASC or DESC).","$ref":"#/components/schemas/SchedulerSortModelDirection"}},"additionalProperties":false,"description":"Sort specification for scheduler execution queries."},"SchedulerSortModelDirection":{"enum":[0,1],"type":"integer","description":"Sort direction for scheduler execution list queries.","format":"int32"},"ExecutionSummary":{"required":["taskId","taskType"],"type":"object","allOf":[{"$ref":"#/components/schemas/Execution"}],"properties":{"taskId":{"type":"string","description":"Identifier of the scheduled task (as declared in scheduler.yml), extracted from the CorrelationId."},"taskType":{"type":["null","string"],"description":"Task type (handler) reported by the scheduler telemetry."}},"additionalProperties":false},"Execution":{"required":["duration","id","retryIndex","startDate","success"],"type":"object","properties":{"id":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"retryIndex":{"type":"integer","format":"int32"},"success":{"type":["null","boolean"]},"duration":{"type":["null","string"],"format":"date-span"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/scheduler/executions":{"get":{"tags":["Scheduler"],"summary":"List recent scheduler executions for the tenant","description":"Returns the most recent scheduler task executions across all configured tasks for the tenant.\nUseful to monitor scheduler health, spot failing tasks and drill into individual executions.\n            \n**Sorting:** By `startDate`, `taskId`, `taskType`, `duration`, or `retryIndex`.\n            \n**Pagination:** Zero-based `pageIndex` and `pageSize`. Total count in `x-pagination-total` header.\n            \n## Authorization\nRequires `Scheduler.History` scope.","parameters":[{"name":"pageIndex","in":"query","description":"Zero-based page index.","schema":{"type":"integer","format":"int32","default":0}},{"name":"pageSize","in":"query","description":"Number of executions per page.","schema":{"type":"integer","format":"int32","default":20}},{"name":"sortBy","in":"query","description":"Optional sort descriptors. Defaults to startDate DESC.","schema":{"type":"array","items":{"description":"Sort specification for scheduler execution queries.","$ref":"#/components/schemas/SchedulerSortModel"}}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Execution list retrieved successfully","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionSummary"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionSummary"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionSummary"}}}}},"400":{"description":"Invalid query parameter","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while retrieving executions"}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.thewalletcrew.io/docs/fr/developper/api-reference/tenant-config/scheduler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
