Klanex Executions API

The Executions API from Klanex — 7 operation(s) for executions.

GitHub OpenAPI

Operations 8

POST /v1/executions Submit a tool-use intent for asynchronous execution #
GET /v1/executions List the tenant's executions, newest first #
GET /v1/executions/{id} Fetch current execution state (credentials always redacted) #
POST /v1/executions/{id}/replay Re-run a terminal execution byte-exact as a new execution #
GET /v1/executions/{id}/deliveries Webhook delivery log for an execution #
POST /v1/executions/{id}/redeliver Re-send a terminal execution's webhook #
POST /v1/executions/{id}/approve Approve a PENDING_APPROVAL execution (moves to QUEUED) #
POST /v1/executions/{id}/reject Reject a PENDING_APPROVAL execution (terminal APPROVAL_REJECTED) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/klanexai-com:klanexai-com-executions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

klanexai-com-executions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: klanex Executions API
  version: 0.7.0
  description: 'Tool orchestration engine for AI agents. Submit tool-use intents for

    reliable asynchronous execution: schema gating, retries with backoff,

    circuit breakers, encrypted credentials, human-in-the-loop approvals,

    replay, and HMAC-signed webhooks.


    Prose companion: docs/api.md. Client SDKs: klanex-js (@klanex/sdk),

    klanex-python (klanex).'
servers:
- url: https://api.klanexai.com
  description: production
- url: https://api.sandbox.klanexai.com
  description: sandbox — same code, Stripe test mode, separate accounts/data
security:
- ApiKeyAuth: []
tags:
- name: Executions
paths:
  /v1/executions:
    post:
      operationId: createExecution
      summary: Submit a tool-use intent for asynchronous execution
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExecutionRequest'
      responses:
        '202':
          description: Validated and queued (or paused in PENDING_APPROVAL).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
        '200':
          description: 'Idempotent replay: this idempotency_key was already used; the original execution is returned with its current status. Nothing was re-queued.

            '
          headers:
            X-Klanex-Idempotent-Replay:
              schema:
                type: string
                enum:
                - 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '422':
          description: 'Payload failed the JSON Schema gate. Feed error.llm_hint back to the agent and resubmit.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/EnqueueFailed'
      tags:
      - Executions
    get:
      operationId: listExecutions
      summary: List the tenant's executions, newest first
      parameters:
      - name: status
        in: query
        schema:
          $ref: '#/components/schemas/ExecutionStatus'
      - name: since
        in: query
        description: Inclusive lower bound on created_at.
        schema:
          type: string
          format: date-time
      - name: until
        in: query
        description: Exclusive upper bound on created_at.
        schema:
          type: string
          format: date-time
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
      - name: cursor
        in: query
        description: Opaque cursor from a previous response's next_cursor.
        schema:
          type: string
      responses:
        '200':
          description: A page of executions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  executions:
                    type: array
                    items:
                      $ref: '#/components/schemas/Execution'
                  next_cursor:
                    type: string
                    description: Present only when the page was full.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Executions
  /v1/executions/{id}:
    get:
      operationId: getExecution
      summary: Fetch current execution state (credentials always redacted)
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      responses:
        '200':
          description: Current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Execution'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Executions
  /v1/executions/{id}/replay:
    post:
      operationId: replayExecution
      summary: Re-run a terminal execution byte-exact as a new execution
      description: Clones target, byte-exact payload, and sealed credentials with a fresh attempt counter. Replays of approval-gated executions pause in PENDING_APPROVAL again. Not idempotent by design.
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      responses:
        '202':
          description: Clone created (QUEUED, or PENDING_APPROVAL if gated).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplayResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Execution is not in a terminal state (NOT_TERMINAL).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/EnqueueFailed'
      tags:
      - Executions
  /v1/executions/{id}/deliveries:
    get:
      operationId: listDeliveries
      summary: Webhook delivery log for an execution
      description: Every callback attempt klanex has made (or is still making) for this execution, newest first, with the receiver's last response.
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      responses:
        '200':
          description: The delivery log (empty array when none).
          content:
            application/json:
              schema:
                type: object
                properties:
                  execution_id:
                    type: string
                  deliveries:
                    type: array
                    items:
                      $ref: '#/components/schemas/Delivery'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Executions
  /v1/executions/{id}/redeliver:
    post:
      operationId: redeliverExecution
      summary: Re-send a terminal execution's webhook
      description: Mints a fresh delivery of the execution's terminal event with its own retry budget — recovery when the receiver was down past the automatic retry window. The event body is the frozen terminal snapshot; the signature is computed fresh with the current webhook secret.
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      responses:
        '202':
          description: Redelivery enqueued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Delivery'
        '400':
          description: Execution has no callback_url (NO_CALLBACK).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Execution is not in a terminal state (NOT_TERMINAL).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Executions
  /v1/executions/{id}/approve:
    post:
      operationId: approveExecution
      summary: Approve a PENDING_APPROVAL execution (moves to QUEUED)
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      requestBody:
        $ref: '#/components/requestBodies/Decision'
      responses:
        '200':
          description: Approved and queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/NotPending'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/EnqueueFailed'
      tags:
      - Executions
  /v1/executions/{id}/reject:
    post:
      operationId: rejectExecution
      summary: Reject a PENDING_APPROVAL execution (terminal APPROVAL_REJECTED)
      parameters:
      - $ref: '#/components/parameters/ExecutionID'
      requestBody:
        $ref: '#/components/requestBodies/Decision'
      responses:
        '200':
          description: Rejected; execution.failed webhook fired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/NotPending'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Executions
webhooks:
  executionEvent:
    post:
      summary: Signed event delivered to the execution's callback_url
      description: 'Events: execution.pending_approval (awaiting a human decision),

        execution.completed, execution.failed. Verify the signature before

        trusting the body: X-Klanex-Signature = "sha256=" +

        hex(HMAC-SHA256(webhook_secret, ".")).

        Reject stale timestamps (default tolerance 300s). Respond 2xx.

        Delivery is durable and at-least-once: network errors, 5xx, 408 and

        429 are retried with exponential backoff (10s-600s, up to 10

        attempts); any other 4xx stops retries. Deduplicate on

        X-Klanex-Delivery-Id. See GET /v1/executions/{id}/deliveries for the

        delivery log and POST /v1/executions/{id}/redeliver to re-send.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent'
      responses:
        '200':
          description: Acknowledged.
      tags:
      - Executions
components:
  schemas:
    ExecError:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
        llm_hint:
          type: string
          description: Paste into the agent's context for self-correction.
    Approval:
      type: object
      properties:
        decision:
          type: string
          enum:
          - approved
          - rejected
        reason:
          type: string
        decided_at:
          type: string
          format: date-time
    ExecutionStatus:
      type: string
      enum:
      - PENDING_APPROVAL
      - QUEUED
      - RUNNING
      - RETRYING
      - SUCCEEDED
      - FAILED
    ExecutionResult:
      type: object
      properties:
        status_code:
          type: integer
        body:
          type: string
          description: Target response body, truncated to 64 KiB.
    Execution:
      type: object
      properties:
        execution_id:
          type: string
        status:
          $ref: '#/components/schemas/ExecutionStatus'
        attempts:
          type: integer
        max_attempts:
          type: integer
        target:
          $ref: '#/components/schemas/Target'
        callback_url:
          type: string
        result:
          $ref: '#/components/schemas/ExecutionResult'
        error:
          $ref: '#/components/schemas/ExecError'
        replay_of:
          type: string
        requires_approval:
          type: boolean
        approval:
          $ref: '#/components/schemas/Approval'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: 'When the execution becomes eligible for deletion — submission time plus the plan''s retention window (Free 7 days, Starter 30, Pro 90).

            '
    CreateExecutionRequest:
      type: object
      required:
      - target
      properties:
        target:
          $ref: '#/components/schemas/Target'
        payload:
          description: Agent-generated JSON body; stored byte-exact for replay.
        payload_schema:
          description: JSON Schema; failing payloads are rejected with 422 + llm_hint.
        callback_url:
          type: string
          format: uri
        max_attempts:
          type: integer
          minimum: 1
          maximum: 10
          default: 5
        idempotency_key:
          type: string
          maxLength: 255
          description: Tenant-scoped; duplicate submits return the original execution.
        requires_approval:
          type: boolean
          default: false
          description: Pause in PENDING_APPROVAL until /approve or /reject.
    Target:
      type: object
      required:
      - url
      properties:
        method:
          type: string
          enum:
          - GET
          - POST
          - PUT
          - PATCH
          - DELETE
          default: POST
        url:
          type: string
          format: uri
          description: Absolute http(s) URL of the third-party API.
        headers:
          type: object
          additionalProperties:
            type: string
          description: 'Your third-party credentials. Encrypted at rest; values are REDACTED in all reads.

            '
        connection_id:
          type: string
          description: 'Reference a vault connection; its managed token is injected at execution time instead of passing credentials in headers.

            '
        timeout_ms:
          type: integer
          default: 30000
          maximum: 120000
          description: Per-attempt timeout.
    AcceptedResponse:
      type: object
      properties:
        execution_id:
          type: string
        status:
          $ref: '#/components/schemas/ExecutionStatus'
    WebhookEvent:
      type: object
      properties:
        event:
          type: string
          enum:
          - execution.pending_approval
          - execution.completed
          - execution.failed
        execution_id:
          type: string
        status:
          $ref: '#/components/schemas/ExecutionStatus'
        attempts:
          type: integer
        result:
          $ref: '#/components/schemas/ExecutionResult'
        error:
          $ref: '#/components/schemas/ExecError'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            problems:
              type: array
              items:
                type: string
            llm_hint:
              type: string
    Delivery:
      type: object
      description: 'A durable webhook delivery record. Delivery is at-least-once; receivers deduplicate on delivery_id (also sent as the X-Klanex-Delivery-Id header).

        '
      properties:
        delivery_id:
          type: string
        execution_id:
          type: string
        event:
          type: string
          example: execution.completed
        url:
          type: string
          description: Callback destination
          frozen at enqueue time.: null
        status:
          type: string
          enum:
          - PENDING
          - DELIVERED
          - FAILED
        attempts:
          type: integer
        max_attempts:
          type: integer
        last_status_code:
          type: integer
          description: Receiver's most recent HTTP status (0 = no response).
        last_error:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        delivered_at:
          type: string
          format: date-time
    ReplayResponse:
      type: object
      properties:
        execution_id:
          type: string
        status:
          $ref: '#/components/schemas/ExecutionStatus'
        replay_of:
          type: string
    ErrorCode:
      type: string
      enum:
      - SCHEMA_INVALID
      - TARGET_TIMEOUT
      - TARGET_RATE_LIMITED
      - TARGET_UNAVAILABLE
      - TARGET_REJECTED
      - CIRCUIT_OPEN
      - ATTEMPTS_EXHAUSTED
      - APPROVAL_REJECTED
      - CONNECTION_UNAUTHORIZED
      - INTERNAL
  responses:
    BadRequest:
      description: Malformed request (bad URL, unsupported method, invalid JSON, bad filter).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotPending:
      description: Execution is not PENDING_APPROVAL (NOT_PENDING).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Per-tenant rate limit exceeded; retry after Retry-After seconds.
      headers:
        Retry-After:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthenticated:
      description: Missing or invalid X-API-Key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    EnqueueFailed:
      description: Persisted but could not be enqueued; safe to retry the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: No such execution for this tenant.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  parameters:
    ExecutionID:
      name: id
      in: path
      required: true
      schema:
        type: string
      example: exe_9b1c2f6a-...
  requestBodies:
    Decision:
      required: false
      content:
        application/json:
          schema:
            type: object
            properties:
              reason:
                type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Tenant API key issued at onboarding: "klx_live_..." (production) or "klx_test_..." (sandbox). Using a key against the other environment returns 401 WRONG_ENVIRONMENT. Legacy bare "klx_..." keys are accepted.

        '