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

# Delete Scheduled Stream

> Remove a scheduled stream if its status is WAITING and api key matches

<Note>
  This endpoint allows you to delete a scheduled stream that is in WAITING status. Only streams that haven't started yet can be deleted.
</Note>

## Overview

The Delete Scheduled Stream endpoint allows you to remove a scheduled stream from the system. This is useful when you need to cancel a stream that hasn't started yet.

## Endpoint Details

* **Method:** `DELETE`
* **Endpoint:** `/v1/scheduled_streams/{schedule_id}`
* **Authentication:** Required (API Key)
* **Content-Type:** `application/json`

## Parameters

<ParamField header="schedule_id" type="string" required>
  The unique identifier of the scheduled stream to delete. This ID is returned when you create a scheduled stream.
</ParamField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://streaming.lingopal.ai/v1/scheduled_streams/schedule_12345" \
    -H "X-API-Key: your-api-key-here" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  url = "https://streaming.lingopal.ai/v1/scheduled_streams/schedule_12345"
  headers = {
      "X-API-Key": "your-api-key-here",
      "Content-Type": "application/json"
  }

  response = requests.delete(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const scheduleId = 'schedule_12345';
  const apiKey = 'your-api-key-here';

  fetch(`https://streaming.lingopal.ai/v1/scheduled_streams/${scheduleId}`, {
    method: 'DELETE',
    headers: {
      'X-API-Key': apiKey,
      'Content-Type': 'application/json'
    }
  })
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseExample>
  ```json theme={null}
  {
    "message": "Scheduled stream deleted successfully",
    "schedule_id": "schedule_12345"
  }
  ```
</ResponseExample>

<ResponseField name="message" type="string">
  A success message confirming the deletion
</ResponseField>

<ResponseField name="schedule_id" type="string">
  The ID of the deleted scheduled stream
</ResponseField>

### Error Responses

#### Validation Error (422)

<ResponseExample>
  ```json theme={null}
  {
    "detail": [
      {
        "loc": ["schedule_id", 0],
        "msg": "Invalid schedule ID format",
        "type": "value_error"
      }
    ]
  }
  ```
</ResponseExample>

<ResponseField name="detail" type="array">
  Array of validation error details
</ResponseField>

<ResponseField name="detail[].loc" type="array">
  Location of the error in the request
</ResponseField>

<ResponseField name="detail[].msg" type="string">
  Error message describing the validation issue
</ResponseField>

<ResponseField name="detail[].type" type="string">
  Type of validation error
</ResponseField>

## Use Cases

* **Cancel Future Streams:** Remove scheduled streams that are no longer needed
* **Clean Up:** Delete test or outdated scheduled streams
* **Resource Management:** Free up system resources by removing unused scheduled streams

## Important Notes

<Warning>
  Only scheduled streams with status "WAITING" can be deleted. Streams that are already running or completed cannot be deleted.
</Warning>

<Info>
  The schedule\_id is returned when you create a scheduled stream using the POST /v1/scheduled\_streams endpoint.
</Info>

## Related Endpoints

* [List Scheduled Streams](/api-reference/endpoint/list-scheduled-streams) - Get all scheduled streams
* [Schedule Stream](/api-reference/endpoint/scheduled-streams) - Create a new scheduled stream
* [List Streams](/api-reference/endpoint/list-streams) - Get all active streams


## OpenAPI

````yaml DELETE /v1/scheduled_streams/{schedule_id}
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  x-ignore-stats:
    get:
      summary: Get Translation Statistics
      description: Get translation statistics for a stream.
      security:
        - ApiKeyAuth: []
      parameters:
        - name: stream_id
          in: path
          description: Stream ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_translations:
                    type: integer
                  edited_translations:
                    type: integer
                  unique_languages:
                    type: array
                    items:
                      type: string
                  edit_percentage:
                    type: number
                  language_stats:
                    type: object
                    additionalProperties: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            type: string
                        msg:
                          type: string
                        type:
                          type: string
  x-translations-temp:
    get:
      summary: Get Translations
      description: Get paginated translations for a stream.
      security:
        - ApiKeyAuth: []
      parameters:
        - name: stream_id
          in: path
          description: Stream ID
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Items per page
          required: false
          schema:
            type: integer
            default: 50
        - name: order
          in: query
          description: 'Sort order: ''asc'' for oldest first, ''desc'' for latest first'
          required: false
          schema:
            type: string
            default: desc
        - name: language_id
          in: query
          description: Filter by language ID
          required: false
          schema:
            type: string
        - name: edited
          in: query
          description: Filter by edit status
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  translations:
                    type: array
                    items:
                      type: object
                      properties:
                        stream_id:
                          type: string
                        language_id:
                          type: string
                        segment_id:
                          type: integer
                        timestamp:
                          type: string
                        end_time:
                          type: string
                        original_content:
                          type: string
                        speaker:
                          type: string
                        id:
                          type: integer
                        content:
                          type: string
                        edited:
                          type: boolean
                        created_at:
                          type: string
                        updated_at:
                          type: string
                  total:
                    type: integer
                  page:
                    type: integer
                  per_page:
                    type: integer
                  has_next:
                    type: boolean
                  has_prev:
                    type: boolean
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            type: string
                        msg:
                          type: string
                        type:
                          type: string
  version: 1.0.0
servers:
  - url: https://streaming.lingopal.ai
  - url: https://streaming.lingopal-dev.com
security:
  - ApiKeyAuth: []
paths:
  /v1/scheduled_streams/{schedule_id}:
    delete:
      summary: Delete Scheduled Stream
      description: Remove a scheduled stream if its status is WAITING and api key matches
      parameters:
        - name: schedule_id
          in: path
          description: schedule_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message
                  schedule_id:
                    type: string
                    description: ID of the deleted scheduled stream
              example:
                message: Scheduled stream deleted successfully
                schedule_id: schedule_12345
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            oneOf:
                              - type: string
                              - type: number
                        msg:
                          type: string
                        type:
                          type: string
              example:
                detail:
                  - loc:
                      - schedule_id
                      - 0
                    msg: Invalid schedule ID format
                    type: value_error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````