Comments - Delete API

Delete the specified Comment.

Method DELETE

Parameters

Name Details Type Required
id The ID of the Comment. integer Yes

How to Use

fetch('https://simplecrudapi.com/api/comments/1', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json'
  }
})
	.then(response => response.json())
	.then(data => console.log(data))
	.catch(error => console.error(error))

Response

{
    "data": {
        "id": 1,
        "content": "This is a beautifully crafted comment, expressing a thoughtful and engaging response to the post. It highlights key points and adds valuable insight to the conversation.",
        "post": {
            "id": 1,
            "title": "The Future of AI in Education",
            "content": "Exploring the impact of artificial intelligence on modern education systems.",
            "tags": [
                {
                    "id": 3,
                    "name": "nostrum",
                    "description": "Ab nam voluptas rem velit ratione quidem quo."
                },
                {
                    "id": 9,
                    "name": "aut",
                    "description": "Corrupti soluta provident sapiente soluta."
                }
            ],
            "created_at": "2024-11-10T13:58:06.000000Z",
            "updated_at": "2024-11-10T13:58:06.000000Z"
        }
    }
}

Try Now

fetch('https://simplecrudapi.com/api/comments/1', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json'
  }
})
	.then(response => response.json())
	.then(data => console.log(data))
	.catch(error => console.error(error))

Test with Open API

View Open API

Previous
Posts API

Our Proudly Sponsors 🎉

© 2025 Simple CRUD API. All rights reserved.