# Invalid client id when trying to revoke token

**URL:** <https://devforum.zoom.us/t/invalid-client-id-when-trying-to-revoke-token/119056>\
**Category:** Authentication\
**Tags:** api-requests, api\
**Created:** [October 13, 2024, 1:15pm UTC](https://devforum.zoom.us/t/invalid-client-id-when-trying-to-revoke-token/119056 "2024-10-13T13:15:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer40](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@developer40](https://devforum.zoom.us/u/developer40)\
**Post date:** [October 13, 2024, 1:15pm UTC](https://devforum.zoom.us/t/invalid-client-id-when-trying-to-revoke-token/119056/1 "2024-10-13T13:15:26Z")

</div>

Hello I have a website that connects to my zoom app to revoke the token when someone disconnects their zoom account but I am getting error 400 invalid client  
[Error:400,{“reason”:”Invalid client\_id or client\_secret”,”error”:”invalid\_client”}]  
I know my client id and secret are correct because I use them to connect the zoom accounts with no problem

this is my revoke function:

```auto
func revokeZoomAccount(token *oauth2.Token, dp dataprovider.Provider) (err *utils.Error) {
	revokeUrl := "https://zoom.us/oauth/revoke"
	// Create client with the token
	client := ZoomOAuthConfig.Client(context.Background(), token)

	// Prepare the form data (URL-encoded)
	formData := url.Values{}
	formData.Set("token", token.AccessToken) // Assuming token.AccessToken is the actual token string

	// Create the request
	req, rErr := http.NewRequest("POST", revokeUrl, strings.NewReader(formData.Encode()))
	if rErr != nil {
		return &utils.Error{Code: http.StatusInternalServerError, Message: "failed to create request"}
	}

	// Set the headers
	clientId, _ := os.LookupEnv(env.ZoomClientId)
	clientSecret, _ := os.LookupEnv(env.ZoomClientSecret)
	auth := base64.StdEncoding.EncodeToString([]byte(clientId + ":" + clientSecret))
	req.Header.Set("Authorization", "Basic "+auth)
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	resp, rErr := client.Do(req)
	if rErr != nil {
		err = &utils.Error{Code: http.StatusInternalServerError,
			Message: rErr.Error(),
		}
		return
	}
	defer resp.Body.Close()

	var responseBody map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&responseBody)
	if resp.StatusCode != http.StatusOK {
		err = &utils.Error{Code: http.StatusInternalServerError, Message: "failed to revoke token"}
	}
	return
}

```

does anyone know what is going on?
