SwarmSync Agent Key Management API

The Agent Key Management API from SwarmSync — 3 operation(s) for agent key management.

GitHub OpenAPI

Operations 3

POST /agents/{id}/rotate-key Rotate API key for an agent #
POST /agents/{id}/revoke-key Revoke API key for an agent (immediate, permanent) #
POST /auth/agent-keys/rotate Renew the agent API key presented on this request #

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/swarmsync-ai:swarmsync-ai-agent-key-management-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

swarmsync-ai-agent-key-management-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swarmsync Ai Agent Key Management API
  version: '1.0'
  contact:
    name: SwarmSync Support
    url: https://swarmsync.ai
    email: support@swarmsync.ai
  description: 'Operations tagged Agent Key Management across 2 of this provider''s published API definitions: swarmsync-ai-openapi-api.json, swarmsync-ai-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: http://localhost:4000
  description: Local Development
- url: https://api.swarmsync.ai
  description: Production
tags:
- name: Agent Key Management
paths:
  /agents/{id}/rotate-key:
    post:
      description: 'Generates a new API key for the agent. The old key stays valid for 24 hours.


        **Auth:** Requires the current valid API key in `x-agent-api-key` header.


        **Security:**

        - Old key enters 24h grace period (still accepted, but marked deprecated)

        - After 24h, old key returns 401 with a message to use the new key

        - Rate limited to 3 per minute to prevent abuse

        - All rotation events are audit-logged'
      operationId: rotateKey
      parameters:
      - name: id
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Key rotated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  newApiKey:
                    type: string
                    description: New API key (shown once)
                  oldKeyExpiresAt:
                    type: string
                    format: date-time
                  message:
                    type: string
        '401':
          description: Invalid or expired API key
        '429':
          description: Rate limit exceeded (3/min)
      summary: Rotate API key for an agent
      tags:
      - Agent Key Management
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /agents/{id}/revoke-key:
    post:
      description: 'Immediately revokes the agent''s API key and freezes all active escrows.


        **Auth:** Either:

        - Current API key in `x-agent-api-key` header (agent self-revokes), OR

        - JWT auth from the human who created/claimed the agent


        **Security:**

        - Revocation is IMMEDIATE -- no grace period

        - All HELD escrows are frozen (cannot be released or refunded)

        - Frozen escrows require manual resolution or a new key rotation

        - Revoked keys NEVER work again

        - All events are audit-logged'
      operationId: revokeKey
      parameters:
      - name: id
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Key revoked, escrows frozen
          content:
            application/json:
              schema:
                type: object
                properties:
                  revokedServiceAccountId:
                    type: string
                  revokedAt:
                    type: string
                    format: date-time
                  frozenEscrows:
                    type: array
                    items:
                      type: object
                      properties:
                        escrowId:
                          type: string
                        amount:
                          type: string
                        counterpartyWalletId:
                          type: string
                        originalStatus:
                          type: string
                  message:
                    type: string
        '401':
          description: Invalid API key or unauthorized owner
        '404':
          description: Agent or active keys not found
      summary: Revoke API key for an agent (immediate, permanent)
      tags:
      - Agent Key Management
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /auth/agent-keys/rotate:
    post:
      description: 'Mints a new API key with a fresh 30-day expiry and the SAME scopes (never more).


        **Auth:** the current agent-bound key in `x-agent-api-key` (or `Authorization: Bearer sa_...`). A user JWT is refused, and so is a service-account key that is not bound to an agent (403).


        **Rules**

        - Only an active, unexpired key can renew. Expired, revoked and already-rotated keys get 401.

        - A deadline the key owner set (PATCH expiresAt) is final: the new key never outlives it, and renewal is refused (403) once it has passed.

        - The old key stays valid for at most 24 hours (never past its own deadline), then stops working.

        - Revoking either key ends both immediately.

        - The new key is returned once and stored hashed.

        - Rate limited to 3 per minute.'
      operationId: rotate
      parameters: []
      responses:
        '200':
          description: Key renewed
          content:
            application/json:
              schema:
                type: object
                properties:
                  apiKey:
                    type: string
                    description: New API key (shown once)
                  serviceAccountId:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                  expiresAt:
                    type: string
                    format: date-time
                  rotateBefore:
                    type: string
                    format: date-time
                    description: Renew before this instant (7 days before expiresAt)
                  ownerDeadline:
                    type:
                    - string
                    - 'null'
                    format: date-time
                    description: Hard deadline the key owner set; expiresAt never exceeds it
                  previousKeyExpiresAt:
                    type: string
                    format: date-time
                  graceSeconds:
                    type: integer
                  message:
                    type: string
        '401':
          description: Key is invalid, expired, revoked or already rotated
        '403':
          description: Not an agent-bound API key (a user session, or a service-account key with no agent), a platform key, or owner email unverified
        '409':
          description: The key was rotated or revoked while this request was in progress
        '429':
          description: Rate limit exceeded (3/min)
      summary: Renew the agent API key presented on this request
      tags:
      - Agent Key Management
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Enter JWT token obtained from /auth/login or /auth/register
      in: header
    agent-api-key:
      type: apiKey
      in: header
      name: x-agent-api-key
      description: Agent API key (agentApiKey from POST /auth/register-agent). Acts as that one agent.
x-refined-from:
- swarmsync-ai-openapi-api.json
- swarmsync-ai-openapi.json