Canonical Exec API

The exec API from Canonical — 1 operation(s) for exec.

Operations 1

POST /v1/exec Execute a command #

Documentation

Specifications

Other Resources

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/canonical-exec-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

canonical-exec-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pebble Exec API
  version: v1
tags:
- name: Exec
paths:
  /v1/exec:
    post:
      summary: Execute a command
      tags:
      - Exec
      description: 'Start a command with the given options and return a value representing the process.


        This API returns a `task-id` (see the response schema and the example below),

        then you need to call `/v1/tasks/{task-id}/websocket/control` and `/v1/tasks/{task-id}/websocket/stdio`

        (also `/v1/tasks/{task-id}/websocket/stderr` if `split-stderr` is true) with the returned `task-id`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostExecRequest'
            example:
              command:
              - /bin/ls
              - -l
      responses:
        '202':
          description: Command execution initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostExecResponse'
              example:
                type: async
                status-code: 202
                status: Accepted
                change: '4'
                result:
                  environment:
                    HOME: /home/ubuntu
                  task-id: '7'
                  working-dir: /home/ubuntu
      operationId: postV1Exec
      x-operation-id-source: derived
components:
  schemas:
    BaseAsyncResponse:
      allOf:
      - $ref: '#/components/schemas/BaseResponse'
      - type: object
        properties:
          change:
            type: string
            description: The Change ID of the asynchronous change.
    BaseResponse:
      type: object
      properties:
        type:
          type: string
          description: Response type, "sync".
        status-code:
          type: integer
          description: HTTP response status code.
        status:
          type: string
          description: 'The description of the HTTP status code.


            See the [IANA list](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).

            '
    PostExecRequest:
      type: object
      properties:
        command:
          type: array
          items:
            type: string
          description: The command to execute (including arguments).
        service-context:
          type: string
          description: The service context to use for execution.
        environment:
          type: object
          additionalProperties:
            type: string
          description: Environment variables to set for the command.
        working-dir:
          type: string
          description: The working directory for the command.
        timeout:
          type: string
          description: The timeout for the command execution (e.g., "60s", "1m").
        user-id:
          type: integer
          description: The user ID to run the command as.
        user:
          type: string
          description: The username to run the command as.
        group-id:
          type: integer
          description: The group ID to run the command as.
        group:
          type: string
          description: The group name to run the command as.
        terminal:
          type: boolean
          description: Whether to allocate a pseudo-terminal.
        interactive:
          type: boolean
          description: Whether the command is interactive.
        split-stderr:
          type: boolean
          description: Whether to split stderr from stdout.
        width:
          type: integer
          description: The width of the terminal (if applicable).
        height:
          type: integer
          description: The height of the terminal (if applicable).
      required:
      - command
    PostExecResponse:
      allOf:
      - $ref: '#/components/schemas/BaseAsyncResponse'
      - type: object
        properties:
          result:
            type: object
            properties:
              environment:
                type: object
                additionalProperties:
                  type: string
                description: The environment variables.
              task-id:
                type: string
                format: uuid
                description: The ID of the executed task.
              working-dir:
                type: string
                description: The working directory.