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

# Delete recording

> Deletes a recording. The recording file will be removed from storage asynchronously.



## OpenAPI

````yaml DELETE /recordings/{id}
openapi: 3.1.1
info:
  title: Surge
  version: '1.0'
servers:
  - url: https://api.surge.app
security:
  - authorization: []
paths:
  /recordings/{id}:
    delete:
      tags:
        - Recordings
      summary: Delete a recording
      description: >-
        Deletes a recording. The recording file will be removed from storage
        asynchronously.
      operationId: DeleteRecording
      parameters:
        - in: path
          name: id
          required: true
          schema:
            description: The ID of the recording.
            example: rec_01kfyc9dgdec1avkgs7tng8htg
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Recording'
          description: Deleted recording
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Surge from '@surgeapi/node';


            const client = new Surge({
              apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
            });


            const recording = await
            client.recordings.delete('rec_01kfyc9dgdec1avkgs7tng8htg');


            console.log(recording.id);
        - lang: Python
          source: |-
            import os
            from surge import Surge

            client = Surge(
                api_key=os.environ.get("SURGE_API_KEY"),  # This is the default and can be omitted
            )
            recording = client.recordings.delete(
                "rec_01kfyc9dgdec1avkgs7tng8htg",
            )
            print(recording.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/surge-go\"\n\t\"github.com/stainless-sdks/surge-go/option\"\n)\n\nfunc main() {\n\tclient := surge.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trecording, err := client.Recordings.Delete(context.TODO(), \"rec_01kfyc9dgdec1avkgs7tng8htg\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", recording.ID)\n}\n"
        - lang: Ruby
          source: >-
            require "surge_api"


            surge = SurgeAPI::Client.new(api_key: "My API Key")


            recording =
            surge.recordings.delete("rec_01kfyc9dgdec1avkgs7tng8htg")


            puts(recording)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Surge\Client;

            use Surge\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API
            Key');


            try {
              $recording = $client->recordings->delete('rec_01kfyc9dgdec1avkgs7tng8htg');

              var_dump($recording);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
components:
  schemas:
    Recording:
      description: A call recording
      example:
        call:
          contact:
            email: dom@toretto.family
            first_name: Dominic
            id: ctc_01ja88cboqffhswjx8zbak3ykk
            last_name: Toretto
            metadata:
              car: 1970 Dodge Charger R/T
            phone_number: '+18015551234'
          duration: 184
          id: call_01jjnn7s0zfx5tdcsxjfy93et2
          initiated_at: '2025-03-31T21:01:37Z'
          status: completed
        duration: 124
        id: rec_01kfyc9dgdec1avkgs7tng8htg
      properties:
        call:
          description: The call that produced this recording
          properties:
            contact:
              $ref: '#/components/schemas/Contact'
            duration:
              description: The duration of the call in seconds
              type: integer
            id:
              description: The unique identifier for the call
              type: string
            initiated_at:
              description: When the call was initiated
              format: date-time
              type: string
            status:
              description: The status of the call
              enum:
                - busy
                - canceled
                - completed
                - failed
                - in_progress
                - missed
                - no_answer
                - queued
                - ringing
              type: string
          required:
            - id
            - contact
            - duration
            - initiated_at
            - status
          type: object
        duration:
          description: The duration of the recording in seconds
          type: integer
        id:
          description: The unique identifier for the recording
          type: string
      required:
        - id
        - duration
        - call
      title: Recording
      type: object
    ErrorResponse:
      description: An error response
      example:
        error:
          message: The requested resource could not be found.
          type: not_found
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      title: ErrorResponse
      type: object
    Contact:
      description: A contact who has consented to receive messages
      example:
        email: dom@toretto.family
        first_name: Dominic
        id: ctc_01j9dy8mdzfn3r0e8x1tbdrdrf
        last_name: Toretto
        metadata:
          car: 1970 Dodge Charger R/T
        phone_number: '+18015551234'
      properties:
        email:
          description: The contact's email address.
          format: email
          type: string
        first_name:
          description: The contact's first name.
          type: string
        id:
          description: Unique identifier for the object.
          type: string
        last_name:
          description: The contact's last name.
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
        phone_number:
          description: The contact's phone number in E.164 format.
          example: '+18015551234'
          format: phone-number
          pattern: ^\+[1-9]\d{6,14}$
          type: string
      required:
        - id
        - phone_number
      title: Contact
      type: object
    Error:
      description: An error response
      example:
        message: The requested resource was not found.
        type: not_found
      properties:
        detail:
          additionalProperties: true
          description: Additional details about the error.
          type: object
        message:
          description: A human-readable error message.
          example: The requested resource was not found.
          type: string
        type:
          description: A unique error code.
          example: not_found
          type: string
      required:
        - type
        - message
      title: Error
      type: object
    Metadata:
      additionalProperties:
        maxLength: 500
        type: string
      description: Set of key-value pairs that will be stored with the object.
      maxProperties: 50
      properties: {}
      title: Metadata
      type: object
  securitySchemes:
    authorization:
      bearerFormat: Surge API token
      scheme: bearer
      type: http

````