DELETE
/
api
/
v1
/
chat
/
conversations
/
:id
Delete a conversation (delete-for-me)
curl --request DELETE \
  --url https://api.example.com/api/v1/chat/conversations/:id
import requests

url = "https://api.example.com/api/v1/chat/conversations/:id"

response = requests.delete(url)

print(response.text)
const options = {method: 'DELETE'};

fetch('https://api.example.com/api/v1/chat/conversations/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/chat/conversations/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/v1/chat/conversations/:id"

req, _ := http.NewRequest("DELETE", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.example.com/api/v1/chat/conversations/:id")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/chat/conversations/:id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body

Overview

Performs a per-user “delete for me”: the conversation is hidden from the caller’s inbox only. The other participant still sees the conversation and its full message history. No messages are ever destroyed. This matches the standard chat-app delete-for-me semantics:
  • The conversation disappears from GET /chat/conversations for the caller.
  • The peer’s inbox is unchanged.
  • All messages remain readable via list-messages (the gate is participation, not the clear marker).
  • The conversation reappears in the caller’s inbox automatically if a newer message arrives after the delete (i.e. lastMessageAt > clearedAt).
Internally this stamps a clearedAt timestamp on the caller’s participantState entry; it does not delete the conversations row or any messages rows.
There is intentionally no “delete for everyone” / hard-delete endpoint. Deletion is always scoped to the calling user.

Authentication

Bearer <accessToken> required. requireOnboarded middleware applied.

Path parameters

NameTypeRequiredNotesExample
idstringyes24-char hex ObjectId of the conversation. The caller must be a participant.66400a8f1c2b4d5e6f7a9000

Query parameters

None.

Request body

None.

Response — 204 No Content

Empty body. The call is idempotent — deleting an already-deleted conversation re-stamps clearedAt and still returns 204.

Error responses

StatusCodeMeaning
401UNAUTHENTICATEDMissing, malformed, or expired access token.
403ONBOARDING_INCOMPLETECaller has not finished onboarding.
403FORBIDDENCaller is not a participant of this conversation.
404NOT_FOUNDNo conversation with that id (or id is not a 24-char hex ObjectId).

Side effects

  • Sets clearedAt (server time) on the caller’s participantState entry.
  • No change to the peer’s participantState, the conversations row’s status, or any messages.

Bulk delete

There is no bulk endpoint — to delete several conversations the client issues one DELETE per conversation (the mobile app’s multi-select “trash” action loops over the selected ids). Each call is independent and idempotent.

See also

  • List conversations — the inbox this endpoint hides a row from.
  • Get conversation — still returns the conversation (delete is inbox-scoped, not an access revocation).
  • Block a user — a stronger action that prevents future messaging in both directions.

curl

curl -X DELETE https://api.swappr.co.uk/api/v1/chat/conversations/66400a8f1c2b4d5e6f7a9000 \
  -H "Authorization: Bearer $ACCESS_TOKEN"