menu button

Optional calls

Delete Audio by Protocol Slug


Sometimes you may need to delete the audio file associated with a protocol for privacy reasons, storage management, or compliance requirements. The audio files are stored on Amazon S3 and can be permanently removed using this mutation.

GraphQL Mutation

mutation DeleteAudioByProtocolSlug($protocolSlug: String!) {
  deleteAudioByProtocolSlug(protocolSlug: $protocolSlug) {
    success
    protocol {
      slug
    }
  }
}

Parameters for deleteAudioByProtocolSlug Mutation


1. protocolSlug

  • A unique identifier (slug) for the protocol (meeting or document) whose audio file you want to delete.

Response Structure

The mutation returns:

  • success: A boolean indicating whether the deletion was successful
  • protocol: An object containing:
    • slug: The protocol slug that was processed

Example JS Code

import axios from "axios";

async function deleteAudioByProtocolSlug(protocolSlug) {

  const dataObj = {
    query: DELETE_AUDIO_BY_PROTOCOL_SLUG,
    variables: {
      protocolSlug: protocolSlug,
    },
  };

  return await axios({
    method: "post",
    url: "https://api-v2.speechmind.com/external/v2/graphql",
    data: JSON.stringify(dataObj),
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.SPEECHMIND_API_KEY,
    },
  })
    .then((response) => {
      const responseData = response.data.data.deleteAudioByProtocolSlug;
      
      if (responseData.success) {
        console.log('Audio deleted successfully for protocol:', responseData.protocol.slug);
      } else {
        console.log('Failed to delete audio for protocol:', protocolSlug);
      }
      
      return responseData;
    })
    .catch((error) => {
      console.error('Error deleting audio:', error);
      throw error;
    });
}

// Example usage
deleteAudioByProtocolSlug("PROTOCOL_SLUG");

Example Response

{
  "data": {
    "deleteAudioByProtocolSlug": {
      "success": true,
      "protocol": {
        "slug": "PROTOCOL_SLUG",
      }
    }
  }
}

Important Notes

  • Permanent Action: This operation permanently deletes the audio file from S3 storage and cannot be undone.
  • Privacy Compliance: Use this mutation when you need to comply with data retention policies or privacy regulations.
  • Storage Management: Helps reduce storage costs by removing unnecessary audio files.
  • Protocol Integrity: The protocol and its analysis results remain intact; only the audio file is removed.

Have questions?

Still have questions? Talk to support.