Issue with Workflow Enrollment API Returning 204 Response

AravinthKumar
Member

Hi Team,

I’m attempting to enroll a contact into a HubSpot workflow using the following API endpoint:

https://api.hubapi.com/automation/v2/workflows/{workflowId}/enrollments/contacts/{contactId}

 

The request consistently returns a 204 No Content response. For example, when I intentionally pass an invalid contact ID, I would expect to receive an error code, but the API still responds with 204.

In the HubSpot Admin panel, the enrollment appears to be skipped, even though the API call reports success.

 

Please let me know the issue.

 

Regards,

Aravinth

 

 

 

 

0 Upvotes
4 Replies 4
RubenBurdin
Guide

Hi @AravinthKumar , this behavior is confusing, but it’s actually expected with the Automation v2 enrollment endpoint you’re using. A 204 No Content response from POST/automation/v2/workflows/{workflowId}/enrollments/contacts/{contactId} only means that HubSpot accepted the request, not that the contact was successfully enrolled. The API does not validate things like contact existence, enrollment criteria, suppression rules, or re-enrollment settings synchronously.

 

All of that logic runs later inside the workflow engine, which is why you see the enrollment marked as “skipped” in the UI even though the API call returned 204.

This also explains why passing an invalid contact ID still returns 204. The v2 endpoint does not perform strict input validation or return enrollment errors. HubSpot documents this implicitly by listing 204 as the successful response and not documenting error payloads for failed enrollments (https://developers.hubspot.com/docs/api-reference/automation-automation-v4-v4/guide )

 

A safer pattern is:

  • Validate that the contact exists first using the CRM Contacts API.

  • Make the enrollment call.

  • Then confirm enrollment status by checking workflow enrollment history or workflow logs, rather than relying on the HTTP response alone.

If you need more explicit control and visibility, you may also want to look at the newer Automation v4 APIs, which are designed around more modern workflow operations, although enrollment is still not fully synchronous there either (https://developers.hubspot.com/docs/api-reference/automation-actions-v4-v4/guide )

One quick check: is this workflow using enrollment triggers, or is it configured for manual/API enrollment only? Trigger-based workflows are the most common reason enrollments appear as “skipped” even when the API call succeeds.

Did my answer help? Please mark it as a solution to help others find it too.

Ruben Burdin Ruben Burdin
HubSpot Advisor
Founder @ Stacksync
Real-Time Data Sync between any CRM and Database
Stacksync Banner
0 Upvotes
AravinthKumar
Member

Hi @RubenBurdin ,

Thank you for your response. Yes, we use trigger‑based workflows. We’ve disabled reenrollment and are now looking for the API to return a response indicating that the user is already enrolled.

 

Regards,

Aravinth

0 Upvotes
BérangèreL
Community Manager
Community Manager

Hi @AravinthKumar and thanks so much for sharing those details!
 

A 204 (No Content) response usually means your request went through successfully, but there’s no additional data to return. For trigger-based workflows where reenrollment is disabled, the API doesn’t currently provide a specific response code or message if a contact is already enrolled.
 

Here are a couple of approaches you might find helpful:
 

- You can use the legacy endpoint GET /automation/v2/workflows/enrollments/contacts/{vid} to check which workflows a contact is already enrolled in before attempting enrollment.
- Alternatively, check the contact’s enrollment status separately before making the enrollment request.

If this doesn’t quite address your needs, I’d recommend sharing this as a feature request in our Ideas Forum, the feedback is always appreciated.
 

Hope this helps point you in the right direction!
Bérangère

This post was created with the assistance of AI tools





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
BérangèreL
Community Manager
Community Manager

Hi @AravinthKumar and welcome, it's a pleasure to have you here! 🤗

Thanks for reaching out to the HubSpot Community!

To start with, here are some resources that migth help you:

Automation API | Automation v4 API (BETA)
- Enroll contact

Also, let's invite our Top Experts to join this discussion: Hi @sylvain_tirreau@Anton and @SteveHTM do you have any tips to share with @AravinthKumar, please?

Thanks so much and have a fantastic day! 🌞
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes