medium · Capability

Medium OAuth2 API — Tokens

Medium OAuth2 API — Tokens. 2 operations. Lead operation: Exchange authorization code for tokens. Self-contained Naftiko capability covering one Medium business surface.

Run with Naftiko MediumTokens

What You Can Do

POST
Exchangeauthorizationcode — Exchange authorization code for tokens
/v1/tokens
POST
Refreshaccesstoken — Refresh an access token
/v1/tokens/refresh

MCP Tools

exchange-authorization-code-tokens

Exchange authorization code for tokens

refresh-access-token

Refresh an access token

Capability Spec

oauth2-tokens.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Medium OAuth2 API — Tokens
  description: 'Medium OAuth2 API — Tokens. 2 operations. Lead operation: Exchange authorization code for tokens. Self-contained
    Naftiko capability covering one Medium business surface.'
  tags:
  - Medium
  - Tokens
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MEDIUM_API_KEY: MEDIUM_API_KEY
capability:
  consumes:
  - type: http
    namespace: oauth2-tokens
    baseUri: https://medium.com/m/oauth
    description: Medium OAuth2 API — Tokens business capability. Self-contained, no shared references.
    resources:
    - name: tokens
      path: /tokens
      operations:
      - name: exchangeauthorizationcode
        method: POST
        description: Exchange authorization code for tokens
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: tokens-refresh
      path: /tokens/refresh
      operations:
      - name: refreshaccesstoken
        method: POST
        description: Refresh an access token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: oauth2-tokens-rest
    port: 8080
    description: REST adapter for Medium OAuth2 API — Tokens. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/tokens
      name: tokens
      description: REST surface for tokens.
      operations:
      - method: POST
        name: exchangeauthorizationcode
        description: Exchange authorization code for tokens
        call: oauth2-tokens.exchangeauthorizationcode
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/tokens/refresh
      name: tokens-refresh
      description: REST surface for tokens-refresh.
      operations:
      - method: POST
        name: refreshaccesstoken
        description: Refresh an access token
        call: oauth2-tokens.refreshaccesstoken
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: oauth2-tokens-mcp
    port: 9090
    transport: http
    description: MCP adapter for Medium OAuth2 API — Tokens. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: exchange-authorization-code-tokens
      description: Exchange authorization code for tokens
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: oauth2-tokens.exchangeauthorizationcode
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: refresh-access-token
      description: Refresh an access token
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: oauth2-tokens.refreshaccesstoken
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.