Skip to content

Delete Bulk Users doesn't appear to work with queryString #149

@oottinger

Description

@oottinger

It looks like the code for bulk user deletions is not correct. It appears to provide the full request as a JSON body:

func (c *FusionAuthClient) DeleteUsersByQueryWithContext(ctx context.Context, request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) {
	var resp UserDeleteResponse
	var errors Errors

	restClient := c.Start(&resp, &errors)
	err := restClient.WithUri("/api/user/bulk").
		WithJSONBody(request).                            // <--- json body
		WithMethod(http.MethodDelete).
		Do(ctx)
	if restClient.ErrorRef == nil {
		return &resp, nil, err
	}
	return &resp, &errors, err
}

And your API documentation states it should use query parameters: https://fusionauth.io/docs/apis/users#bulk-delete-users

DELETE /api/user/bulk?queryString={queryString}&hardDelete=true&dryRun=false&limit=10000

In go, when I construct the request, my queryString is "*@example.com" and I am not able to bulk delete users with that domain even though several exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions