> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a schedule

> Stops the clock firing this schedule. This is a cancel, not a destroy: the row stays readable here and in the listing, carrying every fire it made and every refusal it recorded, because the sessions it created are read backwards from it.
It is ONE WAY, and nothing here undoes it — a schedule that should run again is created again, with a new id. Cancelling a schedule that is already cancelled is not an error: the state asked for holds. A fire already in flight is not recalled; what stops is every fire after it.



## OpenAPI

````yaml /pt/openapi/v3-current/narya.yaml delete /v1/schedules/{scheduleId}
openapi: 3.1.0
info:
  title: Narya Host API
  version: 1.0.0
  description: >-
    The contract between the Narya host and every client. On your own machine,
    one long-lived host serves this API over a Unix socket in your Narya home.
    The terminal client and the one-shot command that Lerian ships drive this
    API, and a client you write drives the same one.


    Requests authenticate with a bearer token issued by the identity provider
    the host is configured with. On your own machine, the host also accepts a
    request with no token from your own operating system user. Once signed-in
    work has claimed the home for an organization, it does so only while this
    machine is signed in to that organization. Such a request gets 401 with
    NRY-0011 on work that reaches your organization beyond the machine. An
    operation that declares another security scheme also accepts that
    credential. Any other request without a valid credential gets 401 with
    NRY-0011. A caller whose role lacks the permission an operation needs gets
    403 with NRY-0028.


    Submitting a message returns 202 with a turn id. Everything the turn
    produces streams over GET /v1/events as server-sent events with a typed
    envelope, and a stream resumes from a Last-Event-ID header.


    One error envelope: code, title and message. Codes are NRY- followed by four
    digits. Cursors are opaque.
servers: []
security:
  - bearerAuth: []
tags:
  - name: host
    description: The host process itself — version, uptime, mode, store.
  - name: sessions
    description: Durable conversation containers. Archive, never destroy.
  - name: messages
    description: Submitting work into a session and interrupting it.
  - name: events
    description: The server-sent event stream every client consumes.
  - name: lanes
    description: Parallel tracks inside a session — main, subagent, side.
  - name: agents
    description: Named recipes — instructions, tools, model, policy. Read-only in v1.
  - name: ladder
    description: >-
      What a person can type: the skills and command files in force for one
      repository, and expanding one into text. Five origins merged, nearest
      winning a name, the repository's own rungs gated on trust.
  - name: permissions
    description: Pending permission asks, decisions, and the decision audit.
  - name: intercom
    description: Sessions on one machine finding and messaging each other.
  - name: packages
    description: The one thing a user installs — resources, Go code, or both.
  - name: extensions
    description: >-
      Host-side extensions and the operations each exposes over the wire. This
      is the generic lane a host extension uses to serve its own client half (a
      TUI component, a web panel) or any API-only consumer, without adding
      routes to this contract.
  - name: workflows
    description: Deterministic multi-agent orchestration runs.
  - name: providers
    description: Model suppliers, their auth state, and the model catalogue.
  - name: monitors
    description: >-
      Long-running watchers a session keeps beside its conversation — a test
      runner in watch mode, a build, a log being followed. Started by the model
      or by the person, always listed, always killable.
  - name: records
    description: The queryable local record of everything that happened.
  - name: environments
    description: >-
      Where a session's code lives and its commands run — this machine, or a
      container narya operates. A session that names none runs here.
  - name: schedules
    description: >-
      Work the host's own clock starts with nobody present — a repository, a
      prompt, a rule and what one fire may spend. Cancel, never destroy.
  - name: sharing
    description: >-
      Publishing a session from a developer's own home to the organisation's,
      and what is held back before a byte leaves the machine.
  - name: refinements
    description: >-
      What this owner has taught narya and allowed it to keep — distilled facts,
      and the skills, agents and commands the model wrote for itself. Propose,
      read, consent, roll back. Nothing here fires until a person answers.
  - name: platform
    description: >-
      Calls Lerian's control plane made to a home it hosts, as this home
      recorded them.
paths:
  /v1/schedules/{scheduleId}:
    parameters:
      - $ref: '#/components/parameters/ScheduleIdParam'
    delete:
      tags:
        - schedules
      summary: Cancel a schedule
      description: >-
        Stops the clock firing this schedule. This is a cancel, not a destroy:
        the row stays readable here and in the listing, carrying every fire it
        made and every refusal it recorded, because the sessions it created are
        read backwards from it.

        It is ONE WAY, and nothing here undoes it — a schedule that should run
        again is created again, with a new id. Cancelling a schedule that is
        already cancelled is not an error: the state asked for holds. A fire
        already in flight is not recalled; what stops is every fire after it.
      operationId: cancelSchedule
      responses:
        '200':
          description: The schedule, cancelled and still readable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    ScheduleIdParam:
      name: scheduleId
      in: path
      required: true
      description: The schedule's id.
      schema:
        type: string
        format: uuid
  schemas:
    Schedule:
      type: object
      description: >-
        Work the host's own clock starts, with nobody present.

        A schedule is durable configuration, never swept: what a fire produces
        is a session, governed by the rules sessions already have, while the
        schedule itself stays until somebody cancels it. The owner is never
        something a caller names — a fire has to be attributable to somebody who
        is not there, and an attribution the reader cannot check reads exactly
        like a true one.
      required:
        - id
        - owner
        - repository
        - prompt
        - rule
        - status
        - createdAt
        - runCount
      properties:
        id:
          type: string
          format: uuid
        owner:
          type: string
          description: >-
            Who this schedule's fires are billed to and attributed to: the
            person who created it, as the host authenticated them. A fire runs
            with nobody present, so this is read from the row rather than from
            whoever is signed in at the time — which is what lets a schedule
            outlive its author being away.
        repository:
          type: string
          description: >-
            The directory a fired session runs in, relative to the workspace on
            a hosted home. Somebody has vouched for it — creation refuses one
            nobody has — and the host reads that answer again at every fire,
            because trust is revocable.
        prompt:
          type: string
          description: What the fired session is asked to do.
        agent:
          type: string
          description: The agent recipe a fire runs under. Absent runs the host's default.
        environment:
          $ref: '#/components/schemas/EnvironmentId'
          description: >-
            The environment every fire runs inside, read again at each fire.
            Absent is a schedule whose fires run on the host's own machine, or
            on a hosted home in a container of each fire's own.
        clone:
          type: string
          description: >-
            The repository cloned afresh into each fire's own container on a
            hosted home, which is also the schedule's `repository`.
        rule:
          $ref: '#/components/schemas/ScheduleRule'
        status:
          type: string
          description: >-
            active fires; completed is what a single-instant schedule becomes
            once that instant is spent; cancelled is what a person does to one,
            and it stops the fires without removing the record; paused keeps the
            row and stops the fires, which is the difference between changing
            your mind and changing it back.
          enum:
            - active
            - paused
            - completed
            - cancelled
        ceilingUsd:
          type: number
          format: double
          minimum: 0
          description: >-
            What ONE fire may spend. A hard stop on the turn rather than a price
            — see setScheduleBudget for what it does and does not bound. Absent
            means this schedule has no ceiling and its fires run as any
            unbounded turn does. Zero means this schedule does not fire. A fire
            on a model this host has no price for runs without it, and notice
            says so.
        createdAt:
          type: string
          format: date-time
        nextRunAt:
          type: string
          format: date-time
          description: >-
            The instant a fire is owed at. Absent once a single instant has been
            spent. A cancelled schedule KEEPS the instant it was going to run at
            — its status is what stops the fire, and the instant is what
            somebody reads when they wonder whether they stopped the right one.
            It is advanced from the moment of the fire rather than from the
            instant that was missed, which is why a host that was off for three
            days fires once rather than three times.
        lastRunAt:
          type: string
          format: date-time
          description: >-
            When this schedule last CLAIMED an instant. Absent until it has. It
            is stamped at the claim, before the fire's session exists, so it
            says when the host last acted on this schedule rather than when work
            last started: a fire refused for a missing repository or a missing
            key moves it too, and lastError says which.
        lastFiredSessionId:
          type: string
          format: uuid
          description: >-
            The session the last fire created, which is where the morning's
            reading starts. It may name a session that has since been purged.
        lastSkippedAt:
          type: string
          format: date-time
          description: >-
            When a due fire was refused, with lastSkipReason saying which
            refusal it was. Recorded rather than silent: a skip nobody can read
            is indistinguishable from a scheduler that stopped working. Written
            once while the refusal lasts, so it answers "since when", and
            cleared by any fire that gets through.
        lastSkipReason:
          type: string
        lastError:
          type: string
          description: >-
            How a fire that had already claimed its instant failed to reach a
            session. The instant stays spent, so this is what the morning reads
            instead of an unexplained gap.
        notice:
          type: string
          description: >-
            What the last fire that opened a session says about how this
            schedule's fires run, absent when it says nothing. Two facts earn
            it: the model the fires run on has no price on this host, so they
            run with no spend ceiling until a fire on a priced model clears it;
            or the agent they run comes from the repository each fire's turn
            clones, so its price is judged when the turn clones and a priced
            model keeps the ceiling.
        runCount:
          type: integer
          minimum: 0
          description: >-
            How many instants this schedule has CLAIMED, including fires that
            never reached a session. The count is incremented inside the same
            transaction that spends the instant, which is what makes a fire
            unrepeatable across a crash — so a fire refused after the claim, or
            a host that died in the gap before the session existed, is counted
            here and explained in lastError. A consumer counting SESSIONS wants
            the sessions themselves, not this.
      examples:
        - id: 8f2c1a4e-6b0d-4e2f-9a3c-5d7e1f0b2a4c
          owner: user_01HZX3Q8N4KDPYV2A7C9M5T6RB
          repository: /Users/dana/repos/midaz
          prompt: read yesterday's failed builds and write the summary
          rule:
            kind: every
            everySeconds: 86400
          status: active
          ceilingUsd: 5
          createdAt: '2026-09-03T09:00:00.000Z'
          nextRunAt: '2026-09-04T09:00:00.000Z'
          runCount: 0
    EnvironmentId:
      type: string
      minLength: 1
      maxLength: 64
      pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
      description: >-
        An environment's identifier, chosen by whoever creates it and unique on
        this host. It travels as one path segment, so its shape is bounded to
        what a path segment carries unchanged, exactly as a monitor's name is: a
        "/" would address no route and a "?" or "#" would end the segment early
        and address something else. One beginning `conversation-` is a hosted
        home's own, and a create naming it is 422.
    ScheduleRule:
      type: object
      description: >-
        When a schedule fires: a kind and the one parameter that kind takes.
        Exactly one parameter is ever set.

        There is no cron expression here and the absence is a decision, not a
        gap: a cron expression drags a timezone, a daylight-saving policy and a
        no-match semantics behind it, and an agent turn costs money and takes
        minutes, so the units that matter are hours and days.
      required:
        - kind
      properties:
        kind:
          type: string
          enum:
            - every
            - at
          x-enum-varnames:
            - ScheduleRuleKindEvery
            - ScheduleRuleKindAt
        everySeconds:
          type: integer
          minimum: 1
          description: >-
            The gap between fires, present only when kind is every. Seconds
            rather than the duration a person typed, because the only arithmetic
            anybody does with it is addition.
        at:
          type: string
          format: date-time
          description: >-
            The single instant, present only when kind is at. It is what the
            person asked for and stays put after the fire, while nextRunAt is
            what the clock did.
    Error:
      type: object
      description: >-
        The single error envelope every operation returns. Codes are NRY-
        followed by four digits and are catalogued in the top-level
        x-error-catalog extension.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          pattern: ^NRY-[0-9]{4}$
          description: Machine-readable error code from the NRY catalogue.
        title:
          type: string
          maxLength: 256
          description: Short human-readable summary of the error class.
        message:
          type: string
          maxLength: 4096
          description: Specific, actionable description of what went wrong.
        fields:
          type: object
          description: Per-field validation problems.
          additionalProperties:
            type: string
      examples:
        - code: NRY-0002
          title: Session not found
          message: >-
            No session with id 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d exists on
            this host.
  responses:
    BadRequest:
      description: Malformed request — invalid parameter, cursor, or JSON body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The caller is authenticated and is not allowed this operation (NRY-0028
        or NRY-0030).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The addressed resource does not exist on this host.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The host failed — including a store that refuses writes (NRY-0012).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Enforced on every transport, with no exempt operation. A person's
        request must carry a JWT issued by the configured identity provider,
        which the host verifies itself against that issuer's key set: signature,
        issuer, expiry, and the person and organisation it names. Requests
        without a valid one receive 401 NRY-0011 — except a request with no
        token on a laptop's socket from the OS user the kernel names as the
        host's own, which is that machine's user.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.