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

# Update command



## OpenAPI

````yaml /api-reference/openapi.json patch /public/api/v1/agents/{agentPublicId}/commands/{commandPublicId}
openapi: 3.1.0
info:
  contact:
    email: support@gennia.ai
    name: Gennia Support
    url: https://gennia.ai
  description: >-
    Workspace-scoped API authenticated via workspace API key (header `X-Api-Key:
    gsk_...` or `Authorization: Bearer gsk_...`).
  title: Gennia Public API
  version: v1
servers:
  - description: Production
    url: https://api.gennia.ai
security:
  - workspaceApiKey: []
tags:
  - description: Slash commands available inside the agent chat.
    name: Agent Commands
  - description: Link skills to an agent.
    name: Agent Skills
  - description: Read/rename/delete workspace knowledge sources.
    name: Knowledge Sources
  - description: Link knowledge sources to an agent.
    name: Agent Knowledge Sources
  - description: Workspace CRUD for HTTP/DB/Custom tools.
    name: HTTP Tools
  - description: Read/write the agent's model selection + capabilities.
    name: Agent Model
  - description: Discover trigger types available for Native MCP toolkits.
    name: Native MCP Triggers
  - description: Discover and toggle capability features.
    name: Agent Features
  - description: Hub access settings.
    name: Hub Access
  - description: Read conversation history and delete conversations.
    name: Conversations
  - description: Send messages to a published agent.
    name: Messages
  - description: Workspace CRUD for External MCP servers.
    name: External MCPs
  - description: Hub billing — plans, coupons, credit packages.
    name: Billing
  - description: External links shown in the hub menu.
    name: Hub External Links
  - description: Link Native MCP (Composio) instances to an agent.
    name: Agent Native MCPs
  - description: Manage AI agents in the workspace bound to the API key.
    name: Agents
  - description: Read published version snapshots and restore.
    name: Agent Versions
  - description: Read/rename/delete workspace skills.
    name: Skills
  - description: Manage hub end-customers (client workspaces).
    name: Clients
  - description: Hub domain (subdomain) management.
    name: Hub Domain
  - description: Read/write the agent's prompt context.
    name: Agent Prompt
  - description: Scheduled / trigger-based runs of an agent.
    name: Agent Automations
  - description: Link HTTP/DB/Custom tools to an agent.
    name: Agent HTTP Tools
  - description: Hub identity, branding, logos and overall configuration.
    name: Hub
  - description: Discover AI models available to this workspace.
    name: AI Models
  - description: Discover channel types and their config schemas.
    name: Channel Types
  - description: Connect agents to messaging surfaces.
    name: Agent Channels
  - description: Link workspace-registered External MCP servers to an agent.
    name: Agent External MCPs
  - description: Workspace-scoped public API (API key authentication)
    name: Public API
  - description: Dynamic-prompt variable definitions.
    name: Agent Variables
  - description: Link sub-agents as delegation targets.
    name: Agent Sub-agents
paths:
  /public/api/v1/agents/{agentPublicId}/commands/{commandPublicId}:
    patch:
      tags:
        - Agent Commands
      summary: Update command
      operationId: updateCommand
      parameters:
        - in: path
          name: agentPublicId
          required: true
          schema:
            format: uuid
            type: string
        - in: path
          name: commandPublicId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePublicAgentCommandDTO'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentCommandDTO'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentCommandDTO'
          description: Validation failed
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentCommandDTO'
          description: Missing or invalid API key
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentCommandDTO'
          description: Agent or command not found (COMMAND_NOT_FOUND)
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentCommandDTO'
          description: >-
            New name or slug already in use on this agent (COMMAND_NAME_TAKEN,
            COMMAND_SLUG_TAKEN)
      security:
        - workspaceApiKey: []
components:
  schemas:
    UpdatePublicAgentCommandDTO:
      description: >-
        Body for updating an existing agent command. All fields are optional;
        only provided fields are updated.
      properties:
        command:
          description: >-
            New slash command identifier. Lowercase alphanumeric with optional
            hyphens (not leading or trailing).
          example: summarize-invoices
          maxLength: 100
          minLength: 0
          pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
          type: string
        description:
          description: Short description shown in the command picker.
          example: Summarizes recent invoices grouped by month.
          maxLength: 500
          minLength: 0
          type: string
        name:
          description: New display name of the command.
          example: Summarize invoices
          maxLength: 150
          minLength: 0
          type: string
        prompt:
          description: New prompt template injected when the command is invoked.
          example: Summarize the user's last 10 invoices grouped by month.
          maxLength: 10000
          minLength: 0
          type: string
        status:
          description: New status of the command (enabled or disabled).
          enum:
            - active
            - inactive
          type: string
      type: object
    PublicAgentCommandDTO:
      description: Slash command on an agent.
      properties:
        command:
          type: string
        createdAt:
          format: date-time
          type: string
        description:
          type: string
        lastUsedAt:
          format: date-time
          type: string
        name:
          type: string
        prompt:
          type: string
        publicId:
          format: uuid
          type: string
        status:
          enum:
            - active
            - inactive
          type: string
        updatedAt:
          format: date-time
          type: string
        usageCount:
          format: int64
          type: integer
      type: object
  securitySchemes:
    workspaceApiKey:
      in: header
      name: X-Api-Key
      type: apiKey

````