APIs & Integrations

raphink
Member

/contacts/v1/lists/:list_id/add seems broken

Hello,

 

I've been using /contacts/v1/lists/:list_id/add (https://developers.hubspot.com/docs/reference/api/crm/lists/v1-contacts#add-existing-contacts-to-a-l...) for years without a problem, passing emails as contact identifiers.

Today, I noticed I was getting 404 responses for lists that exist.

Is there an issue with this API endpoint at the moment?

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

/contacts/v1/lists/:list_id/add seems broken

Hey, @raphink I don't see anything on the status page. I see these v1 List endpoints are set for depreciation in a few months (May 30th, 2025) but nothing about them not working before that. Can you share an example request and response? I'd like to try to reproduce in Postman.

 

Best,

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
raphink
Member

/contacts/v1/lists/:list_id/add seems broken

Thanks for the reply.

My code looks like this:

func (c *Client) AddContactToList(email string, listId string) error {
	url := fmt.Sprintf("https://api.hubapi.com/contacts/v1/lists/%s/add", listId)
	params := map[string]interface{}{
		"emails": []string{
			email,
		},
	}
	reqBody, err := json.Marshal(params)
	if err != nil {
		return fmt.Errorf("Failed to marshal filter: %v", err)
	}

	req, err := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
	if err != nil {
		return err
	}

	req.Header.Set("Content-Type", "application/json")

	resp, err := c.HTTPClient.Do(req)
	if err != nil {
		return err
	}

	defer resp.Body.Close()

	// Check the response status code
	if resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusOK {
		return fmt.Errorf("API request failed with status code: %d", resp.StatusCode)
	}

	return nil
}

 

It has worked great for months, but now is returning with a 404, using lists that actually exist.

 

If this API is going to be deprecated, what is the replacement for it?

0 Upvotes