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

# Rebuild agents

> Refresh agents with their latest configuration. Provide either agentId or copilotId (copilotId rebuilds all agents in the active deployment).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/rebuild
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/rebuild:
    post:
      tags:
        - System
      summary: Rebuild agents
      description: >-
        Refresh agents with their latest configuration. Provide either agentId
        or copilotId (copilotId rebuilds all agents in the active deployment).
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agentId:
                  type: string
                  description: Agent id or agent version id
                  example: 6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10
                copilotId:
                  type: string
                  description: Network id to rebuild all agents in the active deployment
                  example: a5e91c07-3f24-4b68-9d15-8c72e0b4a396
      responses:
        '200':
          description: Agents rebuilt successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      rebuilt:
                        type: number
                      failed:
                        type: number
                      agents:
                        type: array
                        items:
                          type: object
                      totalBuildTime:
                        type: number
        '400':
          description: Bad request - missing required fields
        '403':
          description: Forbidden - agent/network does not belong to organization
        '404':
          description: Agent/network not found or no active deployment
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````