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

# Unlink an Environment

> DELETE /agents/{agentName}/parent unlinks an environment from its project, leaving an ordinary agent running as before.



## OpenAPI

````yaml DELETE /agents/{agentName}/parent
openapi: 3.0.0
info:
  title: Pipecat Cloud
  version: 1.0.0
  description: >-
    REST API for Pipecat Cloud. The public API (`/v1/public`, authenticated with
    a public API key) starts agent sessions and proxies requests to them. The
    private API (`/v1`, authenticated with a private API key) manages agents,
    secrets, builds, regions, and organization settings.
servers:
  - url: https://api.pipecat.daily.co/v1
    description: Private API server
security: []
paths:
  /agents/{agentName}/parent:
    delete:
      summary: Unlink an environment
      description: >-
        Removes the link between an environment and its project. The agent
        stays, running as before, and becomes a project of its own; the
        project's watch paths it had been following become its own, so it goes
        on deploying as it did.


        Idempotent: an agent that is not an environment answers 200. A PR
        preview cannot be unlinked, since its link belongs to its pull request.
      operationId: unlinkEnvironment
      parameters:
        - name: agentName
          in: path
          required: true
          description: Name of the environment's agent
          schema:
            type: string
      responses:
        '200':
          description: The agent is no longer an environment
          content:
            application/json:
              schema:
                type: object
                properties:
                  serviceName:
                    type: string
                    description: The agent that was linked
                  parent:
                    type: string
                    nullable: true
                    description: The project it belongs to, or null when unlinked
                  environmentName:
                    type: string
                    nullable: true
                    description: >-
                      Its name among the project's environments, or null when
                      unlinked
              example:
                serviceName: my-bot-staging
                parent: null
                environmentName: null
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Service not found
                code: '404'
        '409':
          description: The agent is a PR preview, whose link is managed by its pull request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: A PR preview's link is managed by its pull request
                code: '409'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Internal server error
                code: '500'
      security:
        - PrivateKeyAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        code:
          type: string
          description: >-
            Error code for programmatic handling. For general errors it is the
            HTTP status as a string, such as `"404"`. Deployment-related codes
            (PCC-*) are documented at
            https://docs.pipecat.ai/pipecat-cloud/fundamentals/error-codes
      required:
        - error
        - code
  securitySchemes:
    PrivateKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication requires a Pipecat Cloud Private API token.


        Generate a Private API key from your Dashboard (Settings > API Keys >
        Private > Create key) and include it as a Bearer token in the
        Authorization header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.