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

# Kill one subprocess

> Sends a signal to the process group of `spid` inside the
running instance.  Without the `signal` parameter the group
gets SIGKILL.  Termination is observable, not returned: the
`exit` event lands in the event log and
`GET /operations/{operationId}/subprocesses/{spid}` reports
the terminal `state` (`signal` set, `exit_code` -1 when killed).

Killing `spid=1` (the main process) effectively ends the
operation, like letting the command fail.




## OpenAPI

````yaml https://eu-north.nebius.computer/static/api.yaml delete /operations/{operationId}/subprocesses/{spid}
openapi: 3.0.0
info:
  title: Contree API
  description: >
    Contree is a container management system combining virtual machine isolation
    with container operational efficiency. 

    Designed for security-sensitive workloads requiring hardware-enforced
    boundaries while maintaining

    container workflow compatibility.
  version: 1.0.0
servers:
  - url: '{baseUrl}/v1'
    description: |
      Nebius IAM-fronted endpoint (use `IAMBearerAuth` + `IAMProjectHeader`).
      Override `baseUrl` to point at a different deployment.
    variables:
      baseUrl:
        default: https://api.tokenfactory.nebius.com/sandboxes
        description: |
          Base URL of the contree service. Defaults to the public Nebius
          IAM-fronted endpoint; set to your self-hosted contree origin
          (e.g. `https://contree.example.com`) when running elsewhere.
security:
  - IAMBearerAuth: []
    IAMProjectHeader: []
tags:
  - name: images
    description: Operations related to container images
  - name: files
    description: Operations related to file uploads
  - name: instances
    description: Operations related to container instances
  - name: inspect
    description: Operations related to inspecting container images
  - name: operations
    description: Operations related to long-running operations
  - name: auth
    description: Authentication and token introspection
paths:
  /operations/{operationId}/subprocesses/{spid}:
    delete:
      tags:
        - operation
      summary: Kill one subprocess
      description: |
        Sends a signal to the process group of `spid` inside the
        running instance.  Without the `signal` parameter the group
        gets SIGKILL.  Termination is observable, not returned: the
        `exit` event lands in the event log and
        `GET /operations/{operationId}/subprocesses/{spid}` reports
        the terminal `state` (`signal` set, `exit_code` -1 when killed).

        Killing `spid=1` (the main process) effectively ends the
        operation, like letting the command fail.
      operationId: operationSubprocessKill
      parameters:
        - name: operationId
          in: path
          required: true
          description: The ID of the operation
          schema:
            $ref: '#/components/schemas/UUIDSchema'
        - in: path
          name: spid
          required: true
          schema:
            type: integer
            minimum: 1
          description: Spawn id (1 = main process; ≥2 = exec'd children).
        - in: query
          name: signal
          required: false
          schema:
            type: string
          description: |
            Signal to send instead of SIGKILL — a number (`15`) or a
            name with or without the SIG prefix (`TERM`, `SIGTERM`).
          example: SIGTERM
      responses:
        '204':
          description: Signal delivered to the subprocess's process group.
        '400':
          description: Invalid spid or unknown `signal` value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: |
            Not Found — the operation does not exist, or the worker has
            no live process with that spid (never spawned or already
            exited).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: |
            Conflict — the operation exists but is not an instance, or
            is not currently EXECUTING / ASSIGNED.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '425':
          description: |
            Too Early — no worker holds the operation yet.  Retry after
            `Retry-After`.
          headers:
            Retry-After:
              schema:
                type: integer
components:
  schemas:
    UUIDSchema:
      type: string
      format: uuid
      description: A UUID string
      example: 12345678-9abc-baba-deda-0123456789ab
    Error:
      type: object
      required:
        - error
      properties:
        error:
          oneOf:
            - type: string
            - type: object
            - type: array
              items:
                type: object
          description: Error message or structured validation errors
          example: Some error occurred, this is an example of error message
        status:
          type: integer
          description: HTTP status code
          example: 500
        traceback:
          type: array
          items:
            type: string
  responses:
    Unauthorized:
      description: |
        Unauthorized - Invalid or missing authentication credentials.
        Either the `Authorization` bearer token is missing or invalid, or
        the `Project` header is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden - Token does not have sufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IAMBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: IAM
      description: |
        IAM bearer token issued by the Nebius IAM service. Sent as
        `Authorization: Bearer <iam-token>`. Must be combined with the
        `Project` header (see `IAMProjectHeader`).

        This is the recommended authentication scheme for new clients.
    IAMProjectHeader:
      type: apiKey
      in: header
      name: Project
      description: |
        Nebius project ID associated with the IAM token. Required together
        with `IAMBearerAuth`. Identifies the project context the request is
        scoped to.

````