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

# Upload Debug Symbols

Upload debug symbol files (.pdb) to enhance the accuracy of security analysis. Debug symbols provide additional context that helps identify more vulnerabilities.

## When to Use This Endpoint

Upload debug symbols after uploading your binary image when:

* You have .pdb files available from your build process
* You want more accurate vulnerability detection
* You need better source code correlation in findings

> **Tip:** Debug symbols significantly improve analysis accuracy. Always upload them when available.

## Request

**Endpoint**

```
POST <BINARLY_API_URL>/api/v4/products/{product_id}/images/{image_id}/files
```

**Path Parameters**

| Parameter    | Description                                                |
| ------------ | ---------------------------------------------------------- |
| `product_id` | The product ID (e.g., `prod_abc123`)                       |
| `image_id`   | The image ID from the upload response (e.g., `img_abc123`) |

**Headers**

| Header          | Value                   |
| --------------- | ----------------------- |
| `Authorization` | `Bearer <access_token>` |
| `Content-Type`  | `multipart/form-data`   |

**Form Fields**

| Field  | Required | Description                  |
| ------ | -------- | ---------------------------- |
| `file` | ✅        | The debug symbol file (.pdb) |

## Example Request - Single File

```bash theme={null}
# Set your variables
BINARLY_PRODUCT_ID="prod_abc123"
IMAGE_ID="img_abc123"
PDB_FILE="/path/to/firmware.pdb"

# Upload the debug symbol file
curl -X POST \
  -H "Authorization: Bearer ${TOKEN}" \
  -F "file=@${PDB_FILE}" \
  "${BINARLY_API_URL}/api/v4/products/${BINARLY_PRODUCT_ID}/images/${IMAGE_ID}/files"
```

## Example Request - Batch Upload

If you have multiple .pdb files, upload them in a loop:

```bash theme={null}
# Set your variables
BINARLY_PRODUCT_ID="prod_abc123"
IMAGE_ID="img_abc123"
SYMBOLS_DIR="/path/to/symbols"

# Find and upload all .pdb files
find "$SYMBOLS_DIR" -name "*.pdb" | while read PDB_FILE; do
  echo "Uploading: $PDB_FILE"
  
  RESPONSE=$(curl -s -X POST \
    -H "Authorization: Bearer ${TOKEN}" \
    -F "file=@${PDB_FILE}" \
    "${BINARLY_API_URL}/api/v4/products/${BINARLY_PRODUCT_ID}/images/${IMAGE_ID}/files")
  
  # Check if upload succeeded
  if echo "$RESPONSE" | jq -e '.id' > /dev/null 2>&1; then
    echo "✅ Uploaded successfully"
  else
    echo "❌ Upload failed: $RESPONSE"
  fi
done
```

## Response

Returns the created file object with upload confirmation.

```json theme={null}
{
  "id": "01ABC123DEF456...",
  "filename": "firmware.pdb",
  "createTime": "2026-01-28T12:00:00Z"
}
```

| Field        | Description                          |
| ------------ | ------------------------------------ |
| `id`         | Unique file identifier (ULID format) |
| `filename`   | The uploaded file name               |
| `createTime` | Timestamp when file was uploaded     |

## Best Practices

| Practice                  | Description                                                           |
| ------------------------- | --------------------------------------------------------------------- |
| **Upload after firmware** | Always upload debug symbols after the firmware image                  |
| **Include all symbols**   | Upload all available .pdb files from your build                       |
| **Automate in CI/CD**     | Integrate symbol upload into your build pipeline                      |
| **Keep symbols secure**   | Debug symbols contain sensitive information - transfer via HTTPS only |

## Related

**User Guides**

* [Debugging Symbols Guide](/resource-center/debugging-symbols) - UI walkthrough for uploading and verifying PDB files
