OpenApiTypesense.Keys (OpenApiTypesense v1.0.4)
View SourceProvides API endpoints related to keys
Summary
Functions
Create an API Key
Delete an API key given its ID.
Retrieve (metadata about) a key
Retrieve (metadata about) all keys.
Functions
@spec create_key(body :: OpenApiTypesense.ApiKeySchema.t(), opts :: keyword()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Create an API Key
Create an API Key with fine-grain access control. You can restrict access on both a per-collection and per-action level. The generated key is returned only during creation. You want to store this key carefully in a secure place.
@spec delete_key(key_id :: integer(), opts :: keyword()) :: {:ok, OpenApiTypesense.ApiKeyDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Delete an API key given its ID.
@spec get_key(key_id :: integer(), opts :: keyword()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Retrieve (metadata about) a key
Retrieve (metadata about) a key. Only the key prefix is returned when you retrieve a key. Due to security reasons, only the create endpoint returns the full API key.
@spec get_keys(opts :: keyword()) :: {:ok, OpenApiTypesense.ApiKeysResponse.t()} | :error
Retrieve (metadata about) all keys.