APIs & Integrations

03558
Member

Trying to un-enroll contact from workflow via API

Hi,

 

I am getting a 500 internal error while executing the following request 
`DELETE /automation/v2/workflows/:workflowId/enrollments/contacts/:email`

Error: `{"status":"error","message":"internal error","correlationId":"b01af03c-7ed3-4ce3-8649-10e945a2ed7b"}`

I tested endpoint with incorrect params, and in those cases a different error is returned:

- A request with an incorrect `workflow_id` returns a 401 error.
- A request with a non-enrolled `email` returns a 404 error.

 

Is this endpoint still available and maintained?

 

0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Trying to un-enroll contact from workflow via API

Hey, @03558 👋 Thanks for your question. Hopefully, you got this worked out, and I'll leave my example here in case it's helpful.

 

Here's how I set up my quick test using Postman:

  • Created a workflow with one action — a delay
  • Manually enrolled a contact — Mort
  • Made a request to the enrollment endpoint to verify he's enrolled
    GET https://api.hubapi.com/automation/v2/workflows/enrollments/contacts/1601
    ​
    [
        {
            "id": 73377676,
            "portalId": 22245342,
            "insertedAt": 1738770352756,
            "updatedAt": 1738770427637,
            "name": "Delay to unenroll",
            "triggers": [],
            ...
        }
    ]
  • Made the DELETE request to unenroll him
    https://api.hubapi.com/automation/v2/workflows/73377676/enrollments/contacts/mort@bobsburgers.com​
  • Received the expected response of 204
  • Double-checked the enrollment endpoint to verify his removal
    GET https://api.hubapi.com/automation/v2/workflows/enrollments/contacts/1601​
    []

I hope this helps get you moving forward! — Jaycee


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes