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

# Rotate MCP registry gateway token

> Create or remove a user-local Forge MCP registry install and mint or revoke the gateway token used by local clients.



## OpenAPI

````yaml /openapi/forge-api.yaml post /api/headless/v1/organizations/{organizationId}/mcp-registry/{itemRef}/tokens/{tokenId}/rotate
openapi: 3.0.3
info:
  title: Forge API
  version: 0.1.0
  description: >-
    Automate Forge inventory, investigations, findings, governance, fleet,
    policy, configuration, compliance, MCP, service-account, and audit
    workflows.
servers:
  - url: https://api.forge.ai
    description: Forge production API
security:
  - serviceAccountBearer: []
tags:
  - name: approvals
    description: MCP approvals
  - name: audit
    description: Audit
  - name: capabilities
    description: Capabilities
  - name: compliance
    description: Compliance
  - name: findings
    description: Findings
  - name: fleet
    description: Fleet
  - name: governance
    description: Governance
  - name: inventory
    description: Inventory
  - name: investigation
    description: Investigations
  - name: managed-config
    description: Managed configuration
  - name: mcp
    description: MCP sessions
  - name: mcp-registry
    description: MCP and skill registry
  - name: operations
    description: operations
  - name: policies
    description: Policies and violations
  - name: service-accounts
    description: Service accounts
  - name: settings
    description: Automation settings
paths:
  /api/headless/v1/organizations/{organizationId}/mcp-registry/{itemRef}/tokens/{tokenId}/rotate:
    post:
      tags:
        - mcp-registry
      summary: Rotate MCP registry gateway token
      description: >-
        Create or remove a user-local Forge MCP registry install and mint or
        revoke the gateway token used by local clients.
      operationId: rotateHeadlessMcpRegistryGatewayToken
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - name: itemRef
          in: path
          required: true
          description: Readable MCP registry slug or item identifier.
          schema:
            type: string
        - name: tokenId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                      - mcp:connect
                  minItems: 1
                  maxItems: 1
                  uniqueItems: true
                expiresInDays:
                  type: integer
                  minimum: 1
                  maximum: 365
                  default: 90
      responses:
        '201':
          description: >-
            Replacement one-time gateway token secret; the previous token is
            revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpGatewayTokenIssueResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  parameters:
    OrganizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: string
  schemas:
    McpGatewayTokenIssueResponse:
      type: object
      additionalProperties: false
      required:
        - token
        - gatewayToken
        - message
      properties:
        token:
          $ref: '#/components/schemas/McpGatewayTokenMetadata'
        gatewayToken:
          type: string
          pattern: ^forge_mcp_[A-Za-z0-9_-]+$
          description: One-time plaintext secret. Forge retains only its hash.
        message:
          type: string
    McpGatewayTokenMetadata:
      type: object
      additionalProperties: false
      required:
        - id
        - tokenPrefix
        - scopes
        - clientId
        - clientName
        - registryItemId
        - subjectKind
        - subjectId
        - status
        - createdAt
      properties:
        id:
          type: string
        tokenPrefix:
          type: string
          description: Non-secret prefix for identifying the credential.
        scopes:
          type: array
          items:
            type: string
            enum:
              - mcp:connect
          minItems: 1
          maxItems: 1
        clientId:
          type: string
        clientName:
          type: string
        registryItemId:
          type: string
        subjectKind:
          type: string
          enum:
            - user
        subjectId:
          type: string
        status:
          type: string
          enum:
            - active
            - expired
            - revoked
        expiresAt:
          type: string
          format: date-time
        lastUsedAt:
          type: string
          format: date-time
        revokedAt:
          type: string
          format: date-time
        revokeReason:
          type: string
        createdAt:
          type: string
          format: date-time
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  responses:
    Error:
      description: Stable Forge error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
  securitySchemes:
    serviceAccountBearer:
      type: http
      scheme: bearer
      bearerFormat: Forge service-account or delegated OAuth access token
      description: >-
        Enter a Forge service-account token or delegated OAuth access token.
        Mintlify adds the Bearer prefix.

````