---
title: "Get volume by external ID"
method: GET
path: "/volumes/by-external-id/{externalId}"
tags: ["volumes"]
---

# Get volume by external ID

`GET /volumes/by-external-id/{externalId}`

## Request

- Base URL: `https://api.blaxel.ai/v0`
- URL: `https://api.blaxel.ai/v0/volumes/by-external-id/{externalId}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Client credentials
    - Token URL: `/oauth/token` scopes: `volumes:get`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blaxel/apis/blaxel-control-plane/docs/volumes/by-external-id/:externalId/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns an active volume matching the given external ID. If no active volume is found, returns 404.

## Response `200`

successful operation

- Volume: Persistent storage volume that can be attached to sandboxes for durable file storage across sessions. Volumes survive sandbox deletion and can be reattached to new sandboxes.
  - `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` VolumeSpec, required: Immutable volume configuration set at creation time (size and region cannot be changed after creation)
    - `infrastructureId` string: The internal infrastructure resource identifier for this volume
    - `region` string: Deployment region for the volume (e.g., us-pdx-1, eu-lon-1). Must match the region of sandboxes it attaches to.
    - `size` integer: Storage capacity in megabytes. Can be increased after creation but not decreased.
    - `template` string: Volume template to initialize from, with optional revision (e.g., "mytemplate:1" or "mytemplate:latest")
  - `state` VolumeState: Current runtime state of the volume including attachment status
    - `attachedTo` string: Resource currently using this volume in format "type:name" (e.g., "sandbox:my-sandbox"). Empty if not attached.
  - `status` string: Volume status computed from events
  - `terminatedAt` string: Timestamp when the volume was marked for termination

## Other responses

- `401`: Unauthorized - Invalid or missing authentication credentials
- `403`: Forbidden - Insufficient permissions to view volumes
- `404`: Not found - No active volume with this external ID
- `500`: Internal server error

---

[API](https://skmtc.dev/blaxel/apis/blaxel-control-plane.md) - [All operations](https://skmtc.dev/blaxel/apis/blaxel-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/blaxel/apis/blaxel-control-plane/revisions/dfa264bc72ee?raw)
