Sep 20, 2024
Update an API key
Replaces the permissions of an existing API key.
Any unspecified attribute resets that attribute to its default value.
Usage A
Requires
Admin API key
Copy
1
2
3
4
5
6
7
8
9
import com.algolia.api.SearchClient;
import com.algolia.model.search.*;
SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
client.updateApiKey(
"ALGOLIA_API_KEY",
new ApiKey().setAcl(Arrays.asList(Acl.SEARCH, Acl.ADD_OBJECT)).setValidity(300).setMaxQueriesPerIPPerHour(100).setMaxHitsPerQuery(20)
);
Did you find this page helpful?