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

# Update cron job

> **Token scope:** `account` · `org` · `project` — read-only tokens refused (not a GET).

Update a cron job. Requires If-Match: <revision>. Gated — cron.write.



## OpenAPI

````yaml /openapi/project.json patch /projects/{projectId}/cron-jobs/{id}
openapi: 3.1.0
info:
  title: InstaCloud API — Project level
  version: 0.1.0
  description: >-
    Endpoints under `/projects/{projectId}`: branches, services, deploys,
    secrets, databases, storage, cron, observability, governance. Callable with
    any token whose binding covers the project.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Projects inside an organization.
  - name: Branches
    description: >-
      Branch environments of a project: isolated database, storage and compute
      per branch.
  - name: Services
    description: 'Services on a branch: compute, postgres, storage and managed databases.'
  - name: Deploy
    description: Deploy an image or a source to a compute service.
  - name: Compute
    description: Build output of a compute service.
  - name: Secrets
    description: User secrets, service credentials and how they bind into compute env.
  - name: Database
    description: Postgres databases, extensions, credentials and ad-hoc SQL.
  - name: Storage
    description: Objects in a storage service.
  - name: Backups
    description: Database backups and restores.
  - name: Cron
    description: Scheduled HTTP calls against a service or an external URL.
  - name: Observability
    description: Logs, metrics, deploy events and database insight.
  - name: Governance
    description: Per-project agent policy and the approval queue.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /projects/{projectId}/cron-jobs/{id}:
    patch:
      tags:
        - Cron
      summary: Update cron job
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        refused (not a GET).


        Update a cron job. Requires If-Match: <revision>. Gated — cron.write.
      operationId: updateCronJob
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: projectId
          required: true
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
        - schema:
            type: string
          in: header
          name: if-match
          required: true
          description: the job’s current `revision`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  minLength: 1
                  maxLength: 64
                  type: string
                expression:
                  minLength: 1
                  maxLength: 256
                  type: string
                enabled:
                  description: >-
                    false pauses the job; in-flight runs are blocked at the send
                    boundary
                  type: boolean
                target:
                  description: >-
                    Where the job sends its request. An internal target names
                    the SERVICE, never a URL: the worker resolves the live route
                    at send time, so a redeploy or a region move cannot leave a
                    job firing at a dead host.
                  anyOf:
                    - required:
                        - kind
                        - url
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - external
                        url:
                          description: absolute http(s) URL
                          type: string
                    - required:
                        - kind
                        - serviceId
                        - path
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - service
                        serviceId:
                          format: uuid
                          description: a compute service in this project’s organization
                          type: string
                        path:
                          description: >-
                            request path on that service, leading slash required
                            (e.g. /tasks/nightly)
                          type: string
                request:
                  description: >-
                    Stored encrypted; its VALUES are never returned. Send the
                    whole object to replace it — reads answer with `request`
                    (method and header names only).
                  type: object
                  properties:
                    method:
                      description: default GET
                      type: string
                      enum:
                        - GET
                        - POST
                    headers:
                      description: literal headers; put credentials in secretRefs instead
                      type: object
                      additionalProperties:
                        type: string
                    body:
                      description: request body (POST only)
                      type: string
                    secretRefs:
                      description: >-
                        header name → project secret NAME. Resolved per attempt
                        from whatever is current, so rotating a secret does not
                        change the identity a retry runs under.
                      type: object
                      additionalProperties:
                        type: string
                requestTimeoutMs:
                  minimum: 1000
                  maximum: 300000
                  type: integer
                retry:
                  type: object
                  properties:
                    platformMaxRetries:
                      minimum: 0
                      maximum: 10
                      description: >-
                        retries for failures where nothing was sent
                        (wake/transport). Default 2.
                      type: integer
                    applicationMaxRetries:
                      minimum: 0
                      maximum: 10
                      description: >-
                        retries for a non-2xx answer. Default 0 — a broken
                        endpoint should not be hammered.
                      type: integer
                    retryableStatuses:
                      maxItems: 20
                      description: e.g. [429, 503]; empty means none
                      type: array
                      items:
                        minimum: 100
                        maximum: 599
                        type: integer
                    maxRunAgeMs:
                      minimum: 0
                      description: >-
                        give up on the run once it is this old, whatever the
                        retry budget says
                      type: integer
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  job:
                    description: >-
                      A cron schedule. Header values are write-only; `request`
                      describes the stored request without them.
                    type: object
                    properties:
                      id:
                        format: uuid
                        type: string
                      project_id:
                        format: uuid
                        type: string
                      branch_id:
                        format: uuid
                        type: string
                      branch:
                        description: >-
                          branch name, joined for readability — the id is the
                          identity
                        type: string
                      name:
                        type: string
                      expression:
                        type: string
                      timezone:
                        description: >-
                          UTC in v1, so preview and the materializer can never
                          disagree
                        type: string
                      enabled:
                        type: boolean
                      revision:
                        description: the If-Match guard for PATCH
                        type: integer
                      next_run_at:
                        format: date-time
                        type:
                          - string
                          - 'null'
                      target:
                        description: >-
                          Where the job sends its request. An internal target
                          names the SERVICE, never a URL: the worker resolves
                          the live route at send time, so a redeploy or a region
                          move cannot leave a job firing at a dead host.
                        anyOf:
                          - required:
                              - kind
                              - url
                            type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - external
                              url:
                                description: absolute http(s) URL
                                type: string
                          - required:
                              - kind
                              - serviceId
                              - path
                            type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - service
                              serviceId:
                                format: uuid
                                description: >-
                                  a compute service in this project’s
                                  organization
                                type: string
                              path:
                                description: >-
                                  request path on that service, leading slash
                                  required (e.g. /tasks/nightly)
                                type: string
                      request:
                        required:
                          - method
                          - headerNames
                        description: The non-secret description of the job’s request.
                        type: object
                        properties:
                          method:
                            type: string
                            enum:
                              - GET
                              - POST
                          headerNames:
                            description: >-
                              names only, literal and secret-backed alike —
                              never values
                            type: array
                            items:
                              type: string
                      request_timeout_ms:
                        type: integer
                      retry_policy:
                        type: object
                        properties:
                          platformMaxRetries:
                            minimum: 0
                            maximum: 10
                            description: >-
                              retries for failures where nothing was sent
                              (wake/transport). Default 2.
                            type: integer
                          applicationMaxRetries:
                            minimum: 0
                            maximum: 10
                            description: >-
                              retries for a non-2xx answer. Default 0 — a broken
                              endpoint should not be hammered.
                            type: integer
                          retryableStatuses:
                            maxItems: 20
                            description: e.g. [429, 503]; empty means none
                            type: array
                            items:
                              minimum: 100
                              maximum: 599
                              type: integer
                          maxRunAgeMs:
                            minimum: 0
                            description: >-
                              give up on the run once it is this old, whatever
                              the retry budget says
                            type: integer
                      created_at:
                        format: date-time
                        type: string
                      updated_at:
                        format: date-time
                        type: string
                    required:
                      - id
                      - project_id
                      - branch_id
                      - branch
                      - name
                      - expression
                      - timezone
                      - enabled
                      - revision
                      - next_run_at
                      - target
                      - request
                      - request_timeout_ms
                      - retry_policy
                      - created_at
                      - updated_at
                required:
                  - job
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequired'
        '400':
          description: missing/invalid If-Match, or an invalid expression or target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: missing/invalid If-Match, or an invalid expression or target
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: the job changed since that revision — re-read it and retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                description: the job changed since that revision — re-read it and retry
components:
  schemas:
    ApprovalRequired:
      type: object
      properties:
        status:
          type: string
          enum:
            - approval_required
        approvalId:
          format: uuid
          type: string
        action:
          description: the gated action, or a comma-joined compound set — prefer `actions`
          type: string
        actions:
          description: every capability this approval covers
          type: array
          items:
            type: string
        message:
          type: string
        url:
          description: the console page where a project admin reviews this request
          type: string
        nextActions:
          type: array
          items:
            $ref: '#/components/schemas/NextAction'
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    NextAction:
      type: object
      properties:
        op:
          description: >-
            Neutral logical action id, e.g. "service.add" — NOT an operationId
            or a CLI/MCP tool name; each client maps it to its own surface.
          type: string
        reason:
          description: Natural-language, human/LLM-facing "why do this now".
          type: string
        args:
          description: >-
            Suggested, flat named arguments; "<placeholder>"s where a value is
            unknown.
          type: object
          additionalProperties: true
        gated:
          description: True if the action passes a governance gate.
          type: boolean
      required:
        - op
        - reason
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````