> ## 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 from the latest configuration

> 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:
        - V1
      summary: Rebuild agents from the latest configuration
      description: >-
        Refresh agents with their latest configuration. Provide either agentId
        or copilotId (copilotId rebuilds all agents in the active deployment).
      parameters:
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            type: string
          description: Organization to scope the request to.
        - name: X-User-Id
          in: header
          required: false
          schema:
            type: string
          description: >-
            End-user identity for the request. Required by endpoints that read
            or write user-scoped resources (threads, messages, memory). A
            `userId` query param (or body field, where documented) is accepted
            as a fallback.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agentId:
                  type: string
                  description: Agent id or agent version id
                copilotId:
                  type: string
                  description: Network id to rebuild all agents in the active deployment
      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: >-
        API key generated in studio.sidenet.ai. Scopes the request to its
        organization.

````