How do I delete a vehicle-to-image relation?

When I want to delete a vehicle image I can remove the file, but the image relation is still present, something like:

“image”: {
“_relType”: “files”,
“id”: “2de6952e-4926-45ee-982e-db9d3aa125fc”
},

How do I remove that? Updating the vehicle with a request like

{
“image”:

{
    "id": ""
}

}

didn’t work …

Btw, if I’m at it, how do I delete images not related to a vehicle anymore? When testing it happened that I overwrote the image id of a vehicle with a new one but didn’t delete the old file first. That may clutter the server space, but also it prevents me from uploading the same image again (at least with the same name).

Please try "id": null Instead of "id": ""
It is an object

If you still have the vehicle: you can use the endpoint /directories and get the directory to the vehicle with all its entries. From there you have to identify your picture and get the id. Then you can delete the file in the endpoint /files

With “id”: null I get an error:

error: {status: 400, code: ‘INPUT_IS_THE_WRONG_TYPE’, title: ‘Input is the wrong type’, detail: ‘The input field ‘image.id’ is the wrong type’}

Sorry, my fault:
“image”:null

Ok, that works, thanks.

Hm, about the directories: how do I get the directories of a vehicle? A directory has no reference to a vehicle so I don’t know how to search with the endpoint /directories/search, and a vehicle only has an attribute for assetDirectory. When I upload a file to a vehicle via Calponia it seems to be placed in a /home directory, but how do I get the id of that directory if there is no file yet? To upload a file in my own app I have to know that directory id …

Nvm, since that is a question unrelated to the topic I created a new topic for that.