---
title: "Delete agent"
method: DELETE
path: "/agents/{agentName}"
tags: ["agents"]
---

# Delete agent

`DELETE /agents/{agentName}`

Permanently deletes an agent and all its deployment history. The agent's inference endpoint will immediately stop responding. This action cannot be undone.

## Response `200`

successful operation

- Agent — Serverless AI agent deployment that runs your custom agent code as an auto-scaling API endpoint. Agents are deployed from your code repository and expose a global inference URL for querying.
  - `events` CoreEvent[] — Events happening on a resource deployed on Blaxel
    - `canaryRevision` string — Canary revisionID link to the event
    - `message` string — Event message
    - `revision` string — RevisionID link to the event
    - `status` string — Event status
    - `time` string — Event time
    - `type` string — Event type
  - `metadata` Metadata, required — Owner fields for Persistence
    - `createdAt` string — The date and time when the resource was created
    - `updatedAt` string — The date and time when the resource was updated
    - `createdBy` string — The user or service account who created the resource
    - `updatedBy` string — The user or service account who updated the resource
    - `displayName` string — Human-readable name for display in the UI. Can contain spaces and special characters, max 63 characters.
    - `externalId` string — Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.
    - `labels` MetadataLabels — Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.
    - `name` string, required — Unique identifier for the resource within the workspace. Must be lowercase alphanumeric with hyphens, max 49 characters. Immutable after creation.
    - `plan` string — Billing plan tier applied to this resource (inherited from workspace account)
    - `url` string — Auto-generated endpoint URL for accessing this resource (for agents, functions, models, sandboxes)
    - `workspace` string — Name of the workspace this resource belongs to (read-only, set automatically)
  - `spec` AgentSpec, required — Configuration for an AI agent including runtime settings, repository source, and deployment triggers
    - `enabled` boolean — When false, the agent is disabled and will not serve inference requests
    - `policies` string[]
    - `public` boolean — When true, the agent is publicly accessible without authentication. Only available for mk3 generation.
    - `region` string — Region where the agent should be deployed (e.g. us-pdx-1, eu-lon-1). Required when volumes are attached.
    - `repository` Repository — Repository
      - `type` string — Repository type
      - `url` string — Repository URL
    - `revision` RevisionConfiguration — Revision configuration
      - `active` string — Active revision id
      - `canary` string — Canary revision id
      - `canaryPercent` integer — Canary revision percent
      - `stickySessionTtl` integer — Sticky session TTL in seconds (0 = disabled)
      - `traffic` integer — Traffic percentage
    - `runtime` AgentRuntime — Runtime configuration defining how the AI agent is deployed and scaled globally
      - `envs` Env[] — Environment variables injected into the agent. Supports Kubernetes EnvVar format with valueFrom references.
        - `name` string — Name of the environment variable
        - `secret` boolean — Whether the value is a secret
        - `value` string — Value of the environment variable
      - `generation` 'mk2' | 'mk3' — Infrastructure generation: mk2 (containers, 2-10s cold starts, 15+ global regions) or mk3 (microVMs, sub-25ms cold starts)
      - `image` string — Container image built by Blaxel when deploying with 'bl deploy'. This field is auto-populated during deployment.
      - `maxScale` integer — Maximum number of concurrent agent instances for auto-scaling under load
      - `memory` integer — Memory allocation in megabytes. Also determines CPU allocation (CPU cores = memory in MB / 2048, e.g., 4096MB = 2 CPUs).
      - `minScale` integer — Minimum instances to keep warm. Set to 1+ to eliminate cold starts, 0 for scale-to-zero.
    - `triggers` Trigger[] — Triggers to use your agent
      - `configuration` TriggerConfiguration — Trigger configuration
        - `authenticationType` string — The authentication type of the trigger
        - `callbackSecret` string — The callback secret for async triggers (auto-generated, encrypted)
        - `callbackUrl` string — The callback URL for async triggers (optional)
        - `path` string — The path of the trigger
        - `retry` integer — The retry of the trigger
        - `schedule` string — The schedule of the trigger, cron expression * * * * *
        - `tasks` TriggerConfigurationTask[] — The tasks configuration of the cronjob
        - `timeout` integer — The timeout in seconds for async triggers (max 900s, MK3 only)
      - `enabled` boolean — Enable or disable the trigger (default: true)
      - `id` string — Identifier of the trigger. Optional — the server auto-generates a unique id when one is not provided, and disambiguates duplicates within a resource.
      - `type` 'http' | 'http-async' | 'cron' — The type of trigger, can be http or http-async
    - `volumes` VolumeAttachment[]
      - `mountPath` string — Absolute filesystem path where the volume will be mounted inside the sandbox
      - `name` string — Name of the volume resource to attach (must exist in the same workspace and region)
      - `readOnly` boolean — If true, the volume is mounted read-only and cannot be modified by the sandbox
  - `status` 'DELETING' | 'TERMINATED' | 'FAILED' | 'DEACTIVATED' | 'DEACTIVATING' | 'UPLOADING' | 'BUILDING' | 'DEPLOYING' | 'DEPLOYED' | 'BUILT' — Deployment status of a resource deployed on Blaxel

## Other responses

- `401` — Unauthorized - Invalid or missing authentication credentials
- `403` — Forbidden - Insufficient permissions to delete this agent
- `404` — Not found - Agent does not exist
- `500` — Internal server error

---

[API](https://skmtc.net/blaxel/apis/blaxel-control-plane.md) · [All operations](https://skmtc.net/blaxel/apis/blaxel-control-plane/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blaxel/blaxel-control-plane/versions/dfa264bc72ee/schema)
