menu button

Chapter 6: Deletion

Delete Audio by Protocol Slug

This API guides you to delete the audio file associated with a protocol that was stored on S3


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.

Example GraphQL Mutation

export const DELETE_AUDIO_BY_PROTOCOL_SLUG = `
    mutation DeleteAudioByProtocolSlug($protocolSlug: String!){
        deleteAudioByProtocolSlug(protocolSlug:$protocolSlug){
            success
            protocol{
                slug
                bucketAws
            }
        }
    }
`;

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
    • bucketAws: The AWS bucket information (will be empty after successful deletion)

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: process.env.VUE_APP_GRAPHQL_API,
    data: JSON.stringify(dataObj),
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.VUE_APP_API_KEY,
    },
  })
    .then((response) => {
      const responseData = response.data.data.deleteAudioByProtocolSlug;
      
      if (responseData.success) {
        console.log('Audio deleted successfully for protocol:', responseData.protocol.slug);
        console.log('Bucket status:', responseData.protocol.bucketAws);
      } 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("<example-protocol-slug>");

Example Response

{
  "data": {
    "deleteAudioByProtocolSlug": {
      "success": true,
      "protocol": {
        "slug": "<example-protocol-slug>",
        "bucketAws": ""
      }
    }
  }
}

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.