---
title: "AppendSchedulerResourceHistoryRun"
method: POST
path: "/v1/namespaces/{tenant_meta.namespace}/scheduler-resource-histories:appendRun"
tags: ["SchedulerResourceHistoryService"]
---

# AppendSchedulerResourceHistoryRun

`POST /v1/namespaces/{tenant_meta.namespace}/scheduler-resource-histories:appendRun`

## Request

- Base URL: `https://api.endorlabs.com`
- URL: `https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scheduler-resource-histories:appendRun`
- Auth: none declared

Atomically appends a run summary to the record's bounded ring buffer,
creating the record if absent, and stores the recomputed recommendation.
Used by the scheduler resource recorder on job completion.

## Path parameters

- `tenant_meta.namespace` string, required

## Request body

- SchedulerResourceHistoryServiceAppendSchedulerResourceHistoryRunBody: Request to atomically append a single run summary to a scheduler resource history's bounded ring buffer, creating the record on first write.
  - `kind` string: Scheduler job kind the history record is keyed to.
  - `project_uuid` string: Project the history record is keyed to.
  - `recommendation` SchedulerResourceHistoryRecommendation: Recommendation holds the computed resource request for the next job launch, derived from the run history via max + headroom heuristics.
    - `cpu_milli` integer: Recommended CPU request in millicores.
    - `mem_bytes` string, int64: Recommended memory request in bytes.
    - `source` string: How the recommendation was derived: "history", "default", "spike", or "eviction_bump".
    - `updated_at` string, date-time: When this recommendation was last recomputed.
  - `run` SchedulerResourceHistoryRunSummary: RunSummary captures the resource usage of a single completed scheduler job.
    - `cpu_peak_millicores` integer: Peak CPU usage observed during the job, in millicores.
    - `duration_seconds` integer: Wall-clock duration of the job in seconds.
    - `endorctl_version` string: The endorctl binary version that ran the job.
    - `job_name` string: The Kubernetes job name.
    - `mem_peak_bytes` string, int64: Peak memory working set observed during the job, in bytes.
    - `outcome` string: How the job terminated: "success", "evicted", "fail", or "timeout".
    - `requested_cpu_milli` integer: CPU request the job was launched with, in millicores.
    - `requested_mem_bytes` string, int64: Memory request the job was launched with, in bytes.
    - `throttled` boolean: Whether CFS CPU throttling was detected during the job.
    - `ts` string, date-time: When the job completed.
  - `tenant_meta` object: Tenant the history record belongs to.
  - `window_size` integer: Maximum number of runs to retain; the ring buffer keeps the newest N. Unset or non-positive falls back to the handler default window.

## Response `200`

A successful response.

- V1AppendSchedulerResourceHistoryRunResponse: Response for AppendSchedulerResourceHistoryRun.

## Other responses

- `default`: An unexpected error response.

## Changes

- **2026-11-03** `4acd9fe15140`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/endorlabs/apis/endor-labs-rest-api-reference/changes/v1/namespaces/:tenant_meta.namespace/scheduler-resource-histories:appendRun/post.md)

---

[API](https://skmtc.dev/endorlabs/apis/endor-labs-rest-api-reference.md) - [All operations](https://skmtc.dev/endorlabs/apis/endor-labs-rest-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/endorlabs/apis/endor-labs-rest-api-reference/revisions/4acd9fe15140?raw)
