---
title: "Create Debug Session"
url: "https://nov18-dev.movespot.fyi/apis/konnect-dolly-apis-dev-1/versions/4ba55f2d-e3a2-486c-a018-16faa4e1afe4/operations/dolly-create-debug-session"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-dolly-apis-dev-1/versions/4ba55f2d-e3a2-486c-a018-16faa4e1afe4.md

# Create Debug Session

`POST` `/control-planes/{controlPlaneId}/o11y/debug-sessions`

Operation ID: `dolly-create-debug-session`

Create Debug Session

## Path parameters

- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Debug Session Response
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `415` - Unsupported Media Type

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Konnect Dolly APIs
  version: 1.0.0
servers:
  - url: https://us.api.konghq.com/v1
    description: United-States Production region
  - url: https://eu.api.konghq.com/v1
    description: Europe Production region
  - url: https://au.api.konghq.com/v1
    description: Australia Production region
  - url: https://me.api.konghq.com/v1
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v1
    description: India Production region
  - url: https://sg.api.konghq.com/v1
    description: Singapore Production region
paths:
  /control-planes/{controlPlaneId}/o11y/debug-sessions:
    post:
      operationId: dolly-create-debug-session
      summary: Create Debug Session
      description: Create Debug Session
      parameters:
        - $ref: "#/components/parameters/controlPlaneId"
      requestBody:
        $ref: "#/components/requestBodies/CreateDebugSessionRequest"
      responses:
        "201":
          $ref: "#/components/responses/DebugSessionResponse"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "415":
          $ref: "#/components/responses/UnsupportedMediaType"
      tags:
        - Tracing Sessions
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    controlPlaneId:
      name: controlPlaneId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The UUID of your control plane. This variable is available in the
        Konnect manager.
  requestBodies:
    CreateDebugSessionRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DebugSession"
          examples:
            CreateDebugSessionRequestExample:
              $ref: "#/components/examples/CreateDebugSessionRequestExample"
  responses:
    DebugSessionResponse:
      description: Debug Session Response
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/DebugSession"
              - required:
                  - id
                  - max_samples
                  - duration_secs
                  - created_at
                  - targets
                properties:
                  target_status:
                    description: Feature support and status for each node instance based on its
                      version
                    type: array
                    items:
                      $ref: "#/components/schemas/TargetStatus"
          examples:
            Create Debug Session Response:
              $ref: "#/components/examples/DebugSessionExample"
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/UnauthorizedExample"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/ForbiddenExample"
    UnsupportedMediaType:
      description: Unsupported Media Type
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnsupportedMediaTypeError"
          examples:
            UnsupportedMediaTypeExample:
              $ref: "#/components/examples/UnsupportedMediaTypeExample"
  schemas:
    DebugSession:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        name:
          description: The optional session name.
          type: string
        max_samples:
          description: The maximum amount of samples to collect per data plane.
          type: integer
          example: 10
          default: 200
          maximum: 200
          minimum: 1
        sampling_rule:
          description: An expression used to filter the requests to sample.
          type: string
          example: http.path == "/my-path"
          nullable: true
        duration_secs:
          description: The duration of the debug session in seconds.
          type: integer
          example: 300
          default: 300
          maximum: 1800
          minimum: 10
        capture_content:
          type: array
          items:
            $ref: "#/components/schemas/CaptureContentType"
        capture_log:
          type: array
          items:
            $ref: "#/components/schemas/CaptureLogType"
        capture_traces:
          description: Determines if Traces should be captured for this session.
          type: boolean
          example: true
          default: true
        capture_profile:
          $ref: "#/components/schemas/CaptureProfileInfo"
        started_at:
          description: An ISO-8601 timestamp representation of start date.
          type: string
          format: date-time
          example: 2024-11-04T20:10:06.927Z
          readOnly: true
        stopped_at:
          description: An ISO-8601 timestamp representation of stop date.
          type: string
          format: date-time
          example: 2022-11-04T20:10:06.927Z
          readOnly: true
        completed_at:
          description: An ISO-8601 timestamp representation of completion date.
          type: string
          format: date-time
          example: 2022-11-04T20:10:06.927Z
          readOnly: true
        timed_out:
          description: Determines whether the target did not respond in time before the
            sampling time elapsed.
          type: boolean
          readOnly: true
        created_at:
          $ref: "#/components/schemas/CreatedAt"
        updated_at:
          $ref: "#/components/schemas/UpdatedAt"
        targets:
          description: The data plane nodes to collect samples from.
          type: array
          items:
            type: string
            format: uuid
            example: 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7
            description: Unique identifier of the data plane node.
          minItems: 1
        payload_sanitization:
          $ref: "#/components/schemas/PayloadSanitizationConfig"
    TargetStatus:
      description: Represents the status of supported features for a node instance
        based on its version
      type: object
      properties:
        target_id:
          description: Unique identifier of the data plane node.
          type: string
          format: uuid
          example: 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7
        version:
          description: Version of the node instance
          type: string
          example: "3.11"
        compatible_features:
          description: List of debugger features that are compatible
          type: array
          items:
            $ref: "#/components/schemas/DebuggerFeatures"
          example:
            - logs
            - traces
          uniqueItems: true
        incompatible_features:
          description: List of debugger features that are incompatible
          type: array
          items:
            $ref: "#/components/schemas/DebuggerFeatures"
          example:
            - logs
          uniqueItems: true
      required:
        - target_id
        - version
        - compatible_features
        - incompatible_features
    BadRequestError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          required:
            - invalid_parameters
          properties:
            invalid_parameters:
              $ref: "#/components/schemas/InvalidParameters"
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 401
            title:
              example: Unauthorized
            type:
              example: https://httpstatuses.com/401
            instance:
              example: kong:trace:1234567890
            detail:
              example: Invalid credentials
    ForbiddenError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 403
            title:
              example: Forbidden
            type:
              example: https://httpstatuses.com/403
            instance:
              example: kong:trace:1234567890
            detail:
              example: Forbidden
    UnsupportedMediaTypeError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 415
            title:
              example: UnsupportedMediaType
            type:
              example: https://httpstatuses.com/415
            instance:
              example: kong:trace:1234567890
            detail:
              example: UnsupportedMediaType
    UUID:
      description: Contains a unique identifier used for this resource.
      type: string
      format: uuid
      example: 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7
      readOnly: true
    CaptureContentType:
      type: string
      enum:
        - headers
        - body
    CaptureLogType:
      type: string
      enum:
        - error
        - access
    CaptureProfileInfo:
      description: CaptureProfile contains the information around the profile that
        needs to be captured. Currently supports CPU profiling, with potential
        for memory profiling in the future.
      type: object
      properties:
        cpu:
          $ref: "#/components/schemas/CPUProfile"
    CreatedAt:
      description: An ISO-8601 timestamp representation of entity creation date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    UpdatedAt:
      description: An ISO-8601 timestamp representation of entity update date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    PayloadSanitizationConfig:
      description: Configuration for sanitizing sensitive data in captured payloads
      type: object
      properties:
        user_defined_rules:
          $ref: "#/components/schemas/UserDefinedRules"
    DebuggerFeatures:
      type: string
      enum:
        - logs
        - traces
        - payload_sanitization
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
    InvalidParameters:
      description: invalid parameters
      type: array
      items:
        oneOf:
          - $ref: "#/components/schemas/InvalidParameterStandard"
          - $ref: "#/components/schemas/InvalidParameterMinimumLength"
          - $ref: "#/components/schemas/InvalidParameterMaximumLength"
          - $ref: "#/components/schemas/InvalidParameterChoiceItem"
          - $ref: "#/components/schemas/InvalidParameterDependentItem"
      minItems: 1
      nullable: false
      uniqueItems: true
    CPUProfile:
      description: CPUProfile contains parameters for cpu profile collection
      type: object
      properties:
        mode:
          description: The mode of cpu profile
          type: string
          example: time
          enum:
            - time
            - instruction
        sampling_interval:
          description: The interval for sampling. If the mode is 'time', this value is in
            microseconds. If the mode is 'instruction', this value is the step
            count.
          type: integer
          format: int64
          example: 1000
      required:
        - mode
    UserDefinedRules:
      description: User-defined payload sanitization rules
      type: object
      properties:
        headers:
          description: Rules for sanitizing HTTP headers
          type: array
          items:
            $ref: "#/components/schemas/HeaderSanitizationRule"
        body:
          description: Rules for sanitizing request/response body content
          type: array
          items:
            $ref: "#/components/schemas/BodySanitizationRule"
    InvalidParameterStandard:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          $ref: "#/components/schemas/InvalidRules"
        source:
          type: string
          example: body
        reason:
          type: string
          example: is a required field
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
    InvalidParameterMinimumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - min_length
            - min_digits
            - min_lowercase
            - min_uppercase
            - min_symbols
            - min_items
            - min
          nullable: false
          readOnly: true
        minimum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must have at least 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - minimum
    InvalidParameterMaximumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - max_length
            - max_items
            - max
          nullable: false
          readOnly: true
        maximum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must not have more than 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - maximum
    InvalidParameterChoiceItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - enum
          nullable: false
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        choices:
          type: array
          items: {}
          minItems: 1
          nullable: false
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - choices
    InvalidParameterDependentItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - dependent_fields
          nullable: true
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        dependents:
          type: array
          items: {}
          nullable: true
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - rule
        - reason
        - dependents
    HeaderSanitizationRule:
      type: object
      properties:
        name:
          description: Optional identifier for this rule
          type: string
          example: api-key
        header_name:
          description: HTTP header name to sanitize (case-insensitive)
          type: string
          example: auth-token
        scope:
          $ref: "#/components/schemas/SanitizationScope"
        action:
          $ref: "#/components/schemas/SanitizationAction"
      required:
        - header_name
        - scope
        - action
    BodySanitizationRule:
      type: object
      properties:
        name:
          description: Optional identifier for this rule
          type: string
          example: user-id
        strategy:
          $ref: "#/components/schemas/BodySanitizationStrategy"
        scope:
          $ref: "#/components/schemas/SanitizationScope"
        action:
          $ref: "#/components/schemas/SanitizationAction"
      required:
        - strategy
        - scope
        - action
    InvalidRules:
      description: invalid parameters rules
      type: string
      enum:
        - required
        - is_array
        - is_base64
        - is_boolean
        - is_date_time
        - is_integer
        - is_null
        - is_number
        - is_object
        - is_string
        - is_uuid
        - is_fqdn
        - is_arn
        - unknown_property
        - missing_reference
        - is_label
        - matches_regex
        - invalid
        - is_supported_network_availability_zone_list
        - is_supported_network_cidr_block
        - is_supported_provider_region
        - type
      nullable: true
      readOnly: true
    SanitizationScope:
      description: Where the rule applies
      type: array
      items:
        type: string
        enum:
          - request
          - response
      default:
        - request
        - response
    SanitizationAction:
      description: |
        - mask: Replace with "******"
      type: string
      default: mask
      enum:
        - mask
    BodySanitizationStrategy:
      description: Strategy for body content sanitization.
      oneOf:
        - $ref: "#/components/schemas/JsonPathStrategy"
        - $ref: "#/components/schemas/RegexStrategy"
    JsonPathStrategy:
      description: Strategy using JSONPath expression to locate content for sanitization.
      type: object
      properties:
        json_path:
          $ref: "#/components/schemas/JsonPathExpression"
      additionalProperties: false
      required:
        - json_path
    RegexStrategy:
      description: Strategy using regex pattern to locate content for sanitization.
      type: object
      properties:
        regex:
          $ref: "#/components/schemas/RegexPattern"
      additionalProperties: false
      required:
        - regex
    JsonPathExpression:
      description: JSONPath expression to locate the value.
      type: string
      example: $.user.email
    RegexPattern:
      description: Regex to match to locate the value.
      type: string
      format: regex
      example: \d{4}-\d{4}-\d{4}-\d{4}
  examples:
    CreateDebugSessionRequestExample:
      summary: Create Debug Session Request
      value:
        name: Debug Session 1
        max_samples: 10
        sampling_rule: http.path == "/my-path"
        duration_secs: 300
        capture_content:
          - headers
          - body
        capture_log:
          - error
          - access
        capture_traces: true
        capture_profile:
          cpu:
            mode: time
            sampling_interval: 1000
        targets:
          - ae853602-23c7-4218-9071-82fdef3a1efe
        payload_sanitization:
          user_defined_rules:
            headers:
              - header_name: auth-token
                scope:
                  - request
                  - response
                action: mask
            body:
              - strategy:
                  json_path: $.user.email
                scope:
                  - response
                action: mask
    DebugSessionExample:
      value:
        id: e7a4f6c0-5777-4a37-bcb9-2d37d3b362ee
        name: Debug Session 1
        max_samples: 10
        sampling_rule: http.path == "/my-path"
        duration_secs: 300
        capture_content:
          - headers
          - body
        capture_log:
          - error
          - access
        capture_traces: true
        capture_profile:
          cpu:
            mode: time
            sampling_interval: 1000
        targets:
          - ae853602-23c7-4218-9071-82fdef3a1efe
          - 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7
        created_at: 2024-10-01T20:10:00.000Z
        updated_at: 2024-10-01T20:10:00.000Z
        target_status:
          - target_id: 5f9fd312-a987-4628-b4c5-bb4f4fddd5f7
            version: "3.9"
            compatible_features:
              - traces
            incompatible_features:
              - logs
          - target_id: ae853602-23c7-4218-9071-82fdef3a1efe
            version: "3.11"
            compatible_features:
              - traces
              - logs
            incompatible_features: []
        payload_sanitization:
          user_defined_rules:
            headers:
              - header_name: auth-token
                scope:
                  - request
                  - response
                action: mask
            body:
              - strategy:
                  json_path: $.user.email
                scope:
                  - response
                action: mask
    UnauthorizedExample:
      value:
        status: 401
        title: Unauthorized
        instance: kong:trace:8347343766220159418
        detail: Unauthorized
    ForbiddenExample:
      value:
        status: 403
        title: Forbidden
        instance: kong:trace:2723154947768991354
        detail: You do not have permission to perform this action
    UnsupportedMediaTypeExample:
      value:
        status: 415
        title: Unsupported Media Type
        instance: kong:trace:8347343766220159418
        detail: "This API only supports requests with `Content-Type: application/json`"
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs.

        You can generate a Personal Access Token (PAT) from the [personal access
        token page](https://cloud.konghq.com/global/account/tokens/) in the
        Konnect dashboard.

        The PAT token must be passed in the header of a request, for example:

        `curl -X GET 'https://global.api.konghq.com/v2/users/' --header
        'Authorization: Bearer kpat_xgfT...'`
```
