---
title: "Rotate token"
method: POST
path: "/projects/{project_id}/agent/rotate_token"
tags: ["Agent"]
---

# Rotate token

`POST /projects/{project_id}/agent/rotate_token`

## Request

- Base URL: `https://api.beyondwords.io/v1`
- URL: `https://api.beyondwords.io/v1/projects/{project_id}/agent/rotate_token`
- Auth: API key in header `X-Api-Key`

Rotate the MCP credential used by the live agent

## Response `200`

rotates the MCP token

- AgentModel
  - `enabled` boolean: Whether the Agent is enabled for this project.
  - `status` 'disabled' | 'indexing' | 'enabled' | 'error': Overall lifecycle status of the Agent.
  - `indexed_date` string, date-time, nullable
  - `enabled_date` string, date-time, nullable
  - `error` string, nullable
  - `conversational_agent` object
    - `enabled` boolean: Whether the conversational voice agent is enabled for this project.
    - `name` string, nullable: The display name of the conversational agent.
    - `base_prompt` string: Platform-owned system prompt, read-only.
    - `first_message` string, nullable
    - `additional_prompt` string, nullable
    - `language` object
      - `code` string
      - `name` string
      - `accent` string, nullable
      - `two_letter_code` string
    - `voice` object
      - `id` integer
      - `name` string
    - `model` string, nullable
    - `status` 'synced' | 'pending' | 'error'
    - `elevenlabs_agent_id` string, nullable
    - `synced_date` string, date-time, nullable
    - `error` string, nullable
    - `tools` string[]: Tools the conversational voice agent may call.
    - `expressive_mode` boolean: Whether expressive audio tags are applied. Only effective on v3/v4 TTS models; always false for other models.
    - `first_message_interruptible` boolean: Whether the user can interrupt the agent while the first message is being delivered.
    - `silence_end_call_timeout` number: Seconds of user silence before the call is ended. -1 disables it; otherwise 1 to 7200.
    - `max_duration_seconds` integer: Maximum conversation duration in seconds.
    - `max_conversation_duration_message` string: Message sent when the conversation reaches its maximum duration. Blank sends nothing.
    - `guardrails` object
      - `focus` object
        - `enabled` boolean: Reinforces the agent's system prompt so it stays on-topic in long conversations.
      - `manipulation` object
        - `enabled` boolean: Detects and blocks attempts to manipulate the agent into bypassing its instructions.
      - `content` object: Per-category content moderation, each independently toggleable.
        - `sexual` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high': Confidence threshold; lower is stricter filtering, higher is more lenient.
        - `violence` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
        - `harassment` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
        - `self_harm` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
        - `profanity` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
        - `religion_or_politics` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
        - `medical_and_legal_information` object
          - `enabled` boolean
          - `threshold` 'low' | 'medium' | 'high'
      - `custom` object[]: Custom guardrails, each defined by a natural-language rule prompt.
        - `name` string
        - `prompt` string
        - `enabled` boolean
        - `execution_mode` 'blocking' | 'streaming'
        - `trigger_action` object
          - `type` 'end_call' | 'retry'
          - `feedback` string, nullable
  - `player_agent_overrides` object: Overrides applied to the conversational agent's fields for the player-facing output only.
    - `first_message` string, nullable
    - `additional_prompt` string, nullable
    - `language` object, nullable
      - `code` string
      - `name` string
      - `accent` string, nullable
      - `two_letter_code` string
    - `voice` object, nullable
      - `id` integer
      - `name` string
    - `model` string, nullable
  - `ai_assistants` object
    - `enabled` boolean: Whether AI assistant (MCP) access is enabled for this project.
    - `custom_domain` string, nullable: Branded subdomain serving the MCP, such as mcp.example.com.
    - `custom_domain_status` 'pending_dns' | 'pending_certificate' | 'active' | 'failed', nullable
    - `custom_domain_error` string, nullable
    - `custom_domain_checked_at` string, nullable
    - `auth_enabled` boolean: Whether end users must authenticate as a subscriber before AI assistant tools serve content.
    - `mcp_url` string
    - `tools` string[]: Tools AI assistants (connectors) may call through the MCP.

## Other responses

- `401`: Invalid authentication token
- `404`: Agent beta not enabled for this organization
- `422`: agent has no MCP server provisioned

## Changes

- **2026-11-03** `994b9853e685`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/changes/projects/:project_id/agent/rotate_token/post.md)

---

[API](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api.md) - [All operations](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/revisions/994b9853e685?raw)
