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

# Admit immutable snapshot bytes as a durable job

> The server decodes and readmits this exact body through ExecutionService and never interprets a caller filesystem path. Idempotency binds to the exact snapshot payload bytes.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/jobs
openapi: 3.1.0
info:
  description: >-
    Authenticated loopback remote execution and declarative schedules.
    Artifacts, schedule list/delete/trigger/backfill, /v1/arm, and POST /v1/run
    are absent.
  title: nika serve
  version: 0.116.2
servers:
  - url: http://127.0.0.1
security:
  - bearerAuth: []
paths:
  /v1/jobs:
    post:
      summary: Admit immutable snapshot bytes as a durable job
      description: >-
        The server decodes and readmits this exact body through ExecutionService
        and never interprets a caller filesystem path. Idempotency binds to the
        exact snapshot payload bytes.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecutionSnapshot'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
          description: Idempotent replay
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid idempotency key
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '408':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Request deadline
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Idempotency key already bound to another request
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Encoded body or decoded snapshot resource limit
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Content-Type or Content-Encoding refused
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed, unsupported, tampered, or semantically refused snapshot
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Execution queue or durable store unavailable
        '507':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Durable job capacity exhausted
components:
  parameters:
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        maxLength: 255
        minLength: 1
        type: string
  schemas:
    ExecutionSnapshot:
      additionalProperties: false
      description: >-
        Immutable byte-owned execution world. Unit bytes are canonical lowercase
        hexadecimal and digests are canonical lowercase SHA-256. The decoded
        unit aggregate is limited to 16 MiB and the complete encoded request to
        33 MiB. This object is the request body itself, not a path-bearing
        wrapper.
      properties:
        digest:
          pattern: ^[0-9a-f]{64}$
          type: string
        format_version:
          const: 1
          type: integer
        root:
          maxLength: 4096
          minLength: 1
          type: string
        units:
          items:
            additionalProperties: false
            properties:
              bytes_hex:
                pattern: ^(?:[0-9a-f]{2})*$
                type: string
              digest:
                pattern: ^[0-9a-f]{64}$
                type: string
              kind:
                maximum: 3
                minimum: 0
                type: integer
              path:
                maxLength: 4096
                minLength: 1
                type: string
            required:
              - path
              - kind
              - digest
              - bytes_hex
            type: object
          maxItems: 256
          type: array
      required:
        - format_version
        - root
        - digest
        - units
      type: object
    Job:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
        execution_id:
          type: string
        id:
          format: uuid
          type: string
        outputs:
          additionalProperties: true
          description: >-
            Declared workflow outputs; present only after settlement when
            supplied by the execution adapter
          type: object
        receipt:
          $ref: '#/components/schemas/JobReceipt'
        status:
          $ref: '#/components/schemas/JobStatus'
        trace_id:
          type: string
      required:
        - id
        - status
      type: object
    Error:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    JobReceipt:
      additionalProperties: false
      description: Terminal binding to the exact immutable admitted execution
      properties:
        chain_head:
          minLength: 1
          type: string
        execution_id:
          minLength: 1
          type: string
        job_id:
          format: uuid
          type: string
        origin:
          $ref: '#/components/schemas/JobOrigin'
        snapshot_digest:
          pattern: ^[0-9a-f]{64}$
          type: string
        trace_id:
          minLength: 1
          type: string
      required:
        - job_id
        - execution_id
        - trace_id
        - snapshot_digest
      type: object
    JobStatus:
      enum:
        - queued
        - running
        - interrupted
        - paused
        - succeeded
        - failed
        - cancelled
      type: string
    JobOrigin:
      oneOf:
        - additionalProperties: false
          properties:
            kind:
              const: manual
              type: string
          required:
            - kind
          type: object
        - additionalProperties: false
          properties:
            arm_generation:
              pattern: ^[0-9a-f]{64}$
              type: string
            decision:
              enum:
                - scheduled
                - catch_up
              type: string
            fired_at:
              format: date-time
              type: string
            kind:
              const: schedule
              type: string
            schedule_id:
              description: >-
                Origin-local identifier, bounded to 255 UTF-8 bytes by the
                server
              maxLength: 255
              minLength: 1
              type: string
            schedule_origin:
              enum:
                - project
                - api
              type: string
            schedule_revision:
              pattern: ^sha256:[0-9a-f]{64}$
              type: string
            scheduled_for:
              format: date-time
              type: string
            slot_id:
              pattern: ^[0-9a-f]{64}$
              type: string
          required:
            - kind
            - schedule_origin
            - schedule_id
            - schedule_revision
            - slot_id
            - decision
            - scheduled_for
            - fired_at
            - arm_generation
          type: object
  securitySchemes:
    bearerAuth:
      description: 'Exactly one Authorization: Bearer value from the token file'
      scheme: bearer
      type: http

````