Canonical Oauth2 API

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

Operations 3

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1/oauth2/token Issue access and refresh tokens · Issue both access token and refresh token for a client #
Ask an LLM
“How does a client get a JWT carrying its queue and priority permissions?”
“Can I obtain an access token and a refresh token in one call?”
Tell an agent
Issue an access token and refresh token for my client.
Get a new JWT with my client's permissions.
POST /v1/oauth2/revoke Revoke a refresh token · Revoke a refresh token. Only admins can perform this action #
Ask an LLM
“How can an admin revoke a client's refresh token?”
“Who is allowed to revoke refresh tokens?”
Tell an agent destructive · confirm first
Revoke refresh token {refresh_token}.
Invalidate the refresh token {refresh_token} as an admin.
POST /v1/oauth2/refresh Refresh an access token · Refresh access token using a valid refresh token #
Ask an LLM
“My access token expired; can I get a new one without logging in again?”
“What do I need to send to renew an access token?”
Tell an agent
Refresh my access token using {refresh_token}.
Exchange refresh token {refresh_token} for a fresh access token.

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:canonical-oauth2-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-oauth2-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Testflinger Oauth2 API
  version: 1.0.0
servers:
- url: https://testflinger.ps7.canonical.com/
tags:
- name: OAuth2
paths:
  /v1/oauth2/token:
    post:
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful response
      tags:
      - OAuth2
      summary: Issue both access token and refresh token for a client
      description: 'Get JWT with priority and queue permissions.


        Before being encrypted, the JWT can contain fields like:

        {

        exp: ,

        iat: ,

        sub: ,

        permissions: {

        max_priority: ,

        allowed_queues: ,

        max_reservation_time: ,

        }

        }'
      operationId: postV1Oauth2Token
      x-operation-id-source: derived
  /v1/oauth2/revoke:
    post:
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
      tags:
      - OAuth2
      summary: Revoke a refresh token. Only admins can perform this action
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshTokenIn'
      operationId: postV1Oauth2Revoke
      x-operation-id-source: derived
  /v1/oauth2/refresh:
    post:
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
      tags:
      - OAuth2
      summary: Refresh access token using a valid refresh token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshTokenIn'
      operationId: postV1Oauth2Refresh
      x-operation-id-source: derived
components:
  schemas:
    RefreshTokenIn:
      type: object
      properties:
        refresh_token:
          type: string
          minLength: 1
      required:
      - refresh_token
      additionalProperties: false
    ValidationError:
      properties:
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
        message:
          type: string
      type: object