DELETE /api/v1/projects/{id}

Soft-delete a project. Returns 409 PROJECT_HAS_ACTIVE_WORKSPACES if any active workspace exists in the project (the user must delete those workspaces first); otherwise tears down the per-project TenantEnvironment and cleans up role assignments / API keys / policies.

Path parameters

  • id string Required

    Project ID

Responses

  • Unsupported or malformed API version, an operation unavailable in the selected published contract, or an unacceptable representation (including unsupported media-type parameters or excluded SSE). Existing authentication, authorization, and rate-limit failures take precedence.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Optional validation details defined by the standard error schema; API negotiation errors do not emit this field.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Fields with validation failures.

        Hide fields attributes Show fields attributes object

        A field and its validation failure.

        • description string Required

          Human-readable validation failure.

        • field string Required

          Name or path of the invalid request field.

    • detail string Required

      Human-readable error details.

    • error integer Required

      HTTP status code.

    • errorCode string Required

      Machine-readable error code.

    • parameters array[string]

      Request parameter names associated with the error; omitted when none apply.

    • reason string Required

      HTTP status reason phrase.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Optional validation details defined by the standard error schema; API negotiation errors do not emit this field.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Fields with validation failures.

        Hide fields attributes Show fields attributes object

        A field and its validation failure.

        • description string Required

          Human-readable validation failure.

        • field string Required

          Name or path of the invalid request field.

    • detail string Required

      Human-readable error details.

    • error integer Required

      HTTP status code.

    • errorCode string Required

      Machine-readable error code.

    • parameters array[string]

      Request parameter names associated with the error; omitted when none apply.

    • reason string Required

      HTTP status reason phrase.

  • 204

    No Content

  • Bad Request

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
  • 409

    Conflict

    Hide response attributes Show response attributes object
    • code string
    • detail string

      alias of Error for UI ApiError compatibility

    • details object
      Hide details attributes Show details attributes object
      • truncated boolean

        Truncated is true when WorkspaceCount exceeds the cap and the preview is partial.

      • workspace_count integer

        WorkspaceCount is the total active workspace count in the project.

      • workspace_ids array[string]

        WorkspaceIDs is the first N (currently 10) active workspace IDs. Capped to keep the response bounded for projects with many workspaces.

    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • detail string

      alias of Error for UI ApiError compatibility

    • details object
      Hide details attributes Show details attributes object
      • truncated boolean

        Truncated is true when WorkspaceCount exceeds the cap and the preview is partial.

      • workspace_count integer

        WorkspaceCount is the total active workspace count in the project.

      • workspace_ids array[string]

        WorkspaceIDs is the first N (currently 10) active workspace IDs. Capped to keep the response bounded for projects with many workspaces.

    • error string
    • success boolean
  • Internal Server Error

    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
    Hide response attributes Show response attributes object
    • code string
    • error string
    • success boolean
DELETE /api/v1/projects/{id}
curl \
 --request DELETE 'https://agentengine.mongodb.com/api/v1/projects/{id}' \
 --header "Authorization: $API_KEY"
Response examples (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
Response examples (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (409)
{
  "code": "string",
  "detail": "string",
  "details": {
    "truncated": true,
    "workspace_count": 42,
    "workspace_ids": [
      "string"
    ]
  },
  "error": "string",
  "success": true
}
Response examples (409)
{
  "code": "string",
  "detail": "string",
  "details": {
    "truncated": true,
    "workspace_count": 42,
    "workspace_ids": [
      "string"
    ]
  },
  "error": "string",
  "success": true
}
Response examples (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
Response examples (500)
{
  "code": "string",
  "error": "string",
  "success": true
}