---
title: "Add a new debug configuration for squash server."
method: POST
path: "/debugconfig"
tags: ["debugconfig"]
---

# Add a new debug configuration for squash server.

`POST /debugconfig`

Add a debug config to squash. A debug config instrucs squash what containers should be debugged, and now. DebugConfig object consists of:
  - Attachment: The object we are attaching to. either a specific container, or a service. 
  in the case of the service, the squash will attach to the first container that hits a debug event.
  - Breakpoints: A list of breakpoints. When "immediately" set to false, squash will wait for a debug event
  (i.e a program crash) before giving the user access to the remote debugger. If breakpoints is set, squash will place them and will notify when the first breakpoint hits.
  - image: The container image we are debugging. this is used for extra validation, as placing breakpoints on the wrong binary can lead to unexpected results.
  - debugger: Type of debugger to use. "dlv" and "gdb" are supported now.
  - immediately: Weather to attach immediatly or wait for debug event. can only be set to true if attachment type is container.

## Request body

- DebugConfig
  - `id` string
  - `attachment` Attachment, required
    - `type` 'service' | 'container', required
    - `name` string, required
  - `breakpoints` Breakpoint[]
    - `location` string, required
  - `image` string, required
  - `debugger` string
  - `immediately` boolean
  - `active` boolean

## Response `201`

Debug config created

- DebugConfig
  - `id` string
  - `attachment` Attachment, required
    - `type` 'service' | 'container', required
    - `name` string, required
  - `breakpoints` Breakpoint[]
    - `location` string, required
  - `image` string, required
  - `debugger` string
  - `immediately` boolean
  - `active` boolean

## Other responses

- `400` — Bad request
- `404` — Attachment not found
- `422` — Invalid input
- `503` — Service Unavailable

## Changes

- **2017-08-22** `7d244be4e5ca` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/solo-io/apis/squash-server/changes/debugconfig/post.md)

---

[API](https://skmtc.dev/solo-io/apis/squash-server.md) · [All operations](https://skmtc.dev/solo-io/apis/squash-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/solo-io/squash-server/revisions/7d244be4e5ca/schema)
