POST /1/keys
Creates a new API key with specific permissions and restrictions.
Servers
- https://{appId}.algolia.net
- https://{appId}-1.algolianet.com
- https://{appId}-2.algolianet.com
- https://{appId}-3.algolianet.com
- https://{appId}-dsn.algolia.net
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
maxQueriesPerIPPerHour |
Integer | No |
Maximum number of API requests allowed per IP address or user token per hour. If this limit is reached, the API returns an error with status code Default value: 0 |
indexes[] |
Array | No |
Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (
|
queryParameters |
String | No |
Query parameters to add when making API requests with this API key. To restrict this API key to specific IP addresses, add the Creating an API key fails if the request is made from an IP address outside the restricted range. |
description |
String | No |
Description of an API key to help you identify this API key. |
maxHitsPerQuery |
Integer | No |
Maximum number of results this API key can retrieve in one query. By default, there's no limit. Default value: 0 |
referers[] |
Array | No |
Allowed HTTP referrers for this API key. By default, all referrers are allowed.
You can use leading and trailing wildcard characters (
Like all HTTP headers, referrers can be spoofed. Don't rely on them to secure your data. For more information, see HTTP referrer restrictions. |
acl[] |
Array | Yes |
Permissions that determine the type of API requests this key can make. The required ACL is listed in each endpoint's reference. For more information, see access control list. |
validity |
Integer | No |
Duration (in seconds) after which the API key expires. By default, API keys don't expire. Default value: 0 |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.