How do I block or mark contact as spam sender?

I would like to mark a contact as spam or blocked thru REST API. I don’t see any properties in contact record or API in Contacts REST API doc that would indicate how to do this.

In the Freshdesk App, when I mark a ticket as ‘SPAM’, it asks if I want to mark the contact as SPAM which I think results in not getting further emails from that contact. How can I emulate this behavior in REST API?

I looked at the contact properties of a contact who was mark as spam in this way and no attributes appear to indicate they are not allowed to send email. the status is deleted - is this how that works?

    "active": false,
    "address": null,
    "description": null,
    "email": "***",
    "id": 69062935660,
    "job_title": null,
    "language": "en",
    "mobile": null,
    "name": "***",
    "phone": null,
    "time_zone": "Pacific Time (US & Canada)",
    "twitter_id": null,
    "custom_fields": {
        "contact_type": null,
        "country": null,
        "state": null,
        "region": null,
        "territory": null,
        "sales_owner_email": null,
        "crm_id": null,
        "updated_by": null,
        "updated_at": null
    },
    "tags": [],
    "other_emails": [],
    "facebook_id": null,
    "created_at": "2023-11-15T13:16:16Z",
    "updated_at": "2023-11-16T01:02:02Z",
    "csat_rating": null,
    "preferred_source": "email",
    "company_id": null,
    "view_all_tickets": null,
    "other_companies": [],
    "deleted": true,
    "unique_external_id": null,
    "twitter_profile_status": null,
    "twitter_followers_count": null,
    "avatar": null
}

When I do mark a contact as SPAM, they do not appear in the "blocked’ contacts list. I can’t see any way to put someone in this list. (default filter shown below) Is that possible?

1 Like

Hey @stevemc,
Like you pointed you, marking a contact as spam is not available as an API.

However, did you check soft delete contact API, not sure if that serves your purpose? If not, I can share it with the Freshdesk support team and they will be able to answer you better.

1 Like

Hey @stevemc,
Like @zach_jones_noel wrote, I guess to delete a contact would be the solution to go for.
I also don’t know what the “Blocked Contacts” filter is all about and how to move contacts in there.
But I am pretty sure, that soft deleting a contact will mark every future email from that contact as spam automatically.

Best
Tom

2 Likes

Thanks @zach_jones_noel , @ThomasH ,

I tested and indeed setting contact as deleted does result in future email being tagged as SPAM. So that’s the solution I will go with.

2 Likes

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.