Canonical Devices API

The devices API from Canonical — 3 operation(s) for devices.

Operations 9

GET /api/v1/devices/ List devices #
POST /api/v1/devices/ Register a device #
GET /api/v1/devices/{uid}/ Get a device #
PUT /api/v1/devices/{uid}/ Update a device completely #
PATCH /api/v1/devices/{uid}/ Update a device partially #
DELETE /api/v1/devices/{uid}/ Delete a device #
GET /api/v1/devices/{uid}/certificate/ Check certificate signing status #
POST /api/v1/devices/{uid}/certificate/ Submit a Certificate Signing Request (CSR) #
PATCH /api/v1/devices/{uid}/certificate/ Update certificate status (internal use) #

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-devices-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-devices-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: COS registration server Devices API
  version: '1'
  description: COS registration server API documentation
tags:
- name: Devices
paths:
  /api/v1/devices/:
    get:
      operationId: devices_list
      description: List all registered devices and their attribute
      summary: List devices
      parameters:
      - in: query
        name: fields
        schema:
          type: string
        description: 'Filter the fields provided.Will only output the fields listed in the parameter.Example: ?fields=uid,create_date'
      tags:
      - Devices
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Device'
          description: ''
    post:
      operationId: devices_create
      description: Register a device by its ID
      summary: Register a device
      tags:
      - Devices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Device'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Device'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: string
              examples:
                DateParseError:
                  value:
                    field_name: error details
                  summary: Date parse error
          description: ''
  /api/v1/devices/{uid}/:
    get:
      operationId: devices_retrieve
      description: Retrieve all the fields of a device by its ID
      summary: Get a device
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
          description: ''
        '404':
          description: UID not found
    put:
      operationId: devices_update
      description: Update all the fields of a given device
      summary: Update a device completely
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Device'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Device'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: string
              examples:
                DateParseError:
                  value:
                    field_name: error details
                  summary: Date parse error
          description: ''
        '404':
          description: UID not found
    patch:
      operationId: devices_partial_update
      description: Update the provided fields of a given device
      summary: Update a device partially
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDevice'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDevice'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: string
              examples:
                DateParseError:
                  value:
                    field_name: error details
                  summary: Date parse error
          description: ''
        '404':
          description: UID not found
    delete:
      operationId: devices_destroy
      description: Delete a registered device
      summary: Delete a device
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      security:
      - {}
      responses:
        '204':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Device'
          description: ''
        '404':
          description: UID not found
  /api/v1/devices/{uid}/certificate/:
    get:
      operationId: devices_certificate_retrieve
      description: Retrieve the status of the certificate request and the signed certificate if available.
      summary: Check certificate signing status
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCertificate'
          description: Certificate status retrieved
        '404':
          description: UID not found
    post:
      operationId: devices_certificate_create
      description: Submit a CSR for the device. The server stores it and marks status as pending.
      summary: Submit a Certificate Signing Request (CSR)
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceCertificate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DeviceCertificate'
        required: true
      security:
      - {}
      responses:
        '202':
          description: CSR accepted for processing
        '400':
          description: Invalid CSR format
        '404':
          description: UID not found
    patch:
      operationId: devices_certificate_partial_update
      description: Internal endpoint for the charm to update certificate status and provide signed certificate.
      summary: Update certificate status (internal use)
      parameters:
      - in: path
        name: uid
        schema:
          type: string
        required: true
      tags:
      - Devices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDeviceCertificate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDeviceCertificate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceCertificate'
          description: Certificate updated successfully
        '400':
          description: Invalid request data
        '404':
          description: Device not found
components:
  schemas:
    PatchedDevice:
      type: object
      description: Device Serializer class.
      properties:
        uid:
          type: string
          maxLength: 200
        creation_date:
          type: string
          format: date-time
          readOnly: true
        address:
          type: string
          title: Device IP
        public_ssh_key:
          type: string
          title: Device public SSH key
        grafana_dashboards:
          type: array
          items:
            type: string
        foxglove_dashboards:
          type: array
          items:
            type: string
        prometheus_alert_rule_files:
          type: array
          items:
            type: string
        loki_alert_rule_files:
          type: array
          items:
            type: string
        certificate:
          allOf:
          - $ref: '#/components/schemas/DeviceCertificate'
          readOnly: true
    PatchedDeviceCertificate:
      type: object
      description: Device Certificate Serializer class.
      properties:
        csr:
          type: string
          title: Device Certificate Signing Request
        certificate:
          type: string
          title: Signed Device Certificate
        ca:
          type: string
          title: Device Certificate Authority
        chain:
          type: string
          title: Device Certificate Chain
        status:
          oneOf:
          - $ref: '#/components/schemas/StatusEnum'
          - $ref: '#/components/schemas/BlankEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Device Certificate request created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Device Certificate last updated
    Device:
      type: object
      description: Device Serializer class.
      properties:
        uid:
          type: string
          maxLength: 200
        creation_date:
          type: string
          format: date-time
          readOnly: true
        address:
          type: string
          title: Device IP
        public_ssh_key:
          type: string
          title: Device public SSH key
        grafana_dashboards:
          type: array
          items:
            type: string
        foxglove_dashboards:
          type: array
          items:
            type: string
        prometheus_alert_rule_files:
          type: array
          items:
            type: string
        loki_alert_rule_files:
          type: array
          items:
            type: string
        certificate:
          allOf:
          - $ref: '#/components/schemas/DeviceCertificate'
          readOnly: true
      required:
      - address
      - certificate
      - creation_date
      - uid
    DeviceCertificate:
      type: object
      description: Device Certificate Serializer class.
      properties:
        csr:
          type: string
          title: Device Certificate Signing Request
        certificate:
          type: string
          title: Signed Device Certificate
        ca:
          type: string
          title: Device Certificate Authority
        chain:
          type: string
          title: Device Certificate Chain
        status:
          oneOf:
          - $ref: '#/components/schemas/StatusEnum'
          - $ref: '#/components/schemas/BlankEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Device Certificate request created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Device Certificate last updated
      required:
      - created_at
      - csr
      - updated_at
    BlankEnum:
      enum:
      - ''
    StatusEnum:
      enum:
      - pending
      - signed
      - denied
      type: string
      description: '* `pending` - Pending

        * `signed` - Signed

        * `denied` - Denied'