How to remove an attachment from created draft?

How can I remove an attachment from a created draft?

e.g.:

The draft:

{
            "starred": false,
            "unread": false,
            "folders": [
                "AQMkADAwATMwMAItNjYANTUALSBkYTgtMDACLTAwCgAuAAADqSWuKoLY3EOljHVnE5dJ8wEAoFhUr_mju0iwYgsYVmTm2QAAAgEPAAAB"
            ],
            "subject": "Draft created with attachment",
            "threadId": "AQQkADAwATMwMAItNjYANTUALTBkYTgtMDACLTAwCgAQABGiWCpgB6xAvFFjVzgFfjE=",
            "body": "<html><head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body><a href=\"https://tracking.us.nylas.com/l/c77468403e244ff3b596cba968f93238/0/8f8ac97bb94f52758a6bf315cf3556fd1e9c56964793a1296871deb0944b8d40?cache_buster=1720803744\">Um link para o Google!</a> Bem vindo!<img width=\"1\" height=\"1\" alt=\"tracking\" src=\"https://tracking.us.nylas.com/o/5f152f32e3dd4cf8b401e4ee143ce359/1ce29cc815f6328839f3aab4e97621cdba9b223aeaf6b027920519452a5ed79a?cache_buster=1720803744\" style=\"border:0; width:1; height:1; display:none\"> </body></html>",
            "id": "AAkBLgAAAAAAHYQOEaxmEc2byACqAC-EWg0AoFhUr_mju0iwYgsYVmTm2QAAvsRNpAAA",
            "object": "draft",
            "snippet": "Um link para o Google! Bem vindo!",
            "bcc": [],
            "cc": [],
            "attachments": [
                {
                    "isInline": false,
                    "id": "AAkALgAAAAAAHYQDEapmEc2byACqAC-EWg0AoFhUr_mju0iwYgsYVmTa2QAAvsRNpAAAARIAEABLnM6etrKBS7cHxNm6Ixzi",
                    "filename": "Video maneiro.mp4",
                    "contentType": "application/octet-stream",
                    "size": 2645195
                }
            ],
            "from": [
                {
                    "email": "myemail@outlook.com"
                }
            ],
            "replyTo": [],
            "to": [
                {
                    "name": "Victor",
                    "email": "myanotheremail@gmail.com"
                }
            ],
            "date": 1720803746
        }

Using the PUT /drafts/<draft-id>, how can I remove the attachment?

1 Like

@VictorMonteiro7 Are you using an SDK? I haven’t tried it myself yet…so I want to try a few things…I will come back to you :wink:

@Blag Yep! I’m using Node SDK.

Hello @VictorMonteiro7 I’m not a Node user so I tried with the Kotlin SDK and sadly found out, that currently that feature is not working as expected. I have already reported as a bug and it will be fixed as soon as possible. Will keep you posted.

Ok @Blag. I’ll be waiting for.

@Blag do you know if there is an answer to this?

Hello @VictorMonteiro7 There’s an open ticket for this and our engineers are working on getting it solved…this in the API side, not the SDK so it might take a bit as extensive testing needs to be performed to make sure everything is working fine…I will keep you posted :slight_smile:

2 Likes

@Blag @ram any solve?

hey @VictorMonteiro7, this bug has not been fixed yet but it’s prioritized to get picked up soon.

In the meantime, our recommended workaround is to delete the draft and recreate it without the attachment you want to delete.

appreciate the patience :slight_smile:

1 Like