> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frogbot.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace an API key

> Revokes the key and answers a new token with the same name. Needs a browser sign-in or a key with `canMint`. Errors use the plugin's own `{ error }` shape: `401`, `403` ("session required") and `404`.



## OpenAPI

````yaml https://dojo.frogbot.ai/api/openapi.json post /api/api-keys/{id}/rotate
openapi: 3.1.0
info:
  title: Dojo API
  version: '1'
  description: >-
    Everything Dojo's pages do, for scripts and agents. Sign in with an API key
    as `Authorization: Bearer fb_…`. Paying and accepting the terms happen at a
    link a route answers, for a person to open.
servers:
  - url: https://dojo.frogbot.ai
security:
  - apiKey: []
tags:
  - name: Sign-in
  - name: Workspaces
  - name: Projects
  - name: Apps
  - name: Templates
  - name: Sharing
  - name: Deployments
  - name: Environment variables
  - name: Domains
  - name: Data
  - name: Billing
  - name: API keys
paths:
  /api/api-keys/{id}/rotate:
    post:
      tags:
        - API keys
      summary: Replace an API key
      description: >-
        Revokes the key and answers a new token with the same name. Needs a
        browser sign-in or a key with `canMint`. Errors use the plugin's own `{
        error }` shape: `401`, `403` ("session required") and `404`.
      operationId: post/api/api-keys/:id/rotate
      parameters:
        - name: id
          in: path
          required: true
          description: The API key's id.
          schema:
            type: string
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: A document id.
                  name:
                    type: string
                  prefix:
                    type: string
                  token:
                    type: string
                required:
                  - id
                  - prefix
                  - token
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from `frogbot deploy`'s sign-in, `/api/cli/device/token`, or
        the API keys page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.