As you used the term endpoint in the subject of the question, I assume you are using (web) URI to define the location and identify of your (REST) resource.
Merging two methods into one based on the query parameters should not be the reason for your decisions. You should be defining your API based on your resources.
The methods that implement functionality for resources could be one or more.
That said, in my opinion, the behaviour of the two methods is not the same. Listing a resource based on identity, essentialy returns a single resource instance.
However multiple resource instances could be matched with the keyword and similarly multiple resource instances could be retreived after the creation date.
The client of the API does not care how the service implements the functionality. It can be a single method or multiple method defined on the same resource e.g. for a resource Customer
GET http://domain.com/customers?id=25 // get a customer with id 25
GET http://domain.com/customers?keyword=male // get a customer with keyword male
GET http://domain.com/customers?created_after=20191121 // get a customer created after
can either be implemented by service as
public Response getCustomerById(int id) { /* code */}
public Response getCustomersByKeyword(String keyword) {/* code */}
public Response getCustomersCreatedAfter(String creationDate) { /* code */}
or ...
public Response getCustomer(int id, String keyword, String creationDate) {
if (id > 0) {
// return get customer with id
}
if (keyword != null) {
// return get customer with keyword
}
if (creationDate != null) {
// return get customer after creation date
}
// or any possible combination
}
As the developer of the API you are free to chose. You need to decide what kind of granularity do you want to implement.