All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| create_api_key | POST /v1/api-keys | Create key |
| delete_api_key | DELETE /v1/api-keys/{keyId} | Delete key |
| list_api_keys | GET /v1/api-keys | List keys |
| verify_credential | GET /v1/auth/verify | Verify credential |
create_api_key(create_api_key_request)
Create key
Creates a new API key with an optional expiry. The full key value is only returned once in the response.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::APIKeysApi.new
create_api_key_request = Zernio::CreateApiKeyRequest.new({name: 'name_example'}) # CreateApiKeyRequest |
begin
# Create key
result = api_instance.create_api_key(create_api_key_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->create_api_key: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_api_key_with_http_info(create_api_key_request)
begin
# Create key
data, status_code, headers = api_instance.create_api_key_with_http_info(create_api_key_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateApiKey201Response>
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->create_api_key_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| create_api_key_request | CreateApiKeyRequest |
- Content-Type: application/json
- Accept: application/json
delete_api_key(key_id)
Delete key
Permanently revokes and deletes an API key.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::APIKeysApi.new
key_id = 'key_id_example' # String |
begin
# Delete key
result = api_instance.delete_api_key(key_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->delete_api_key: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_api_key_with_http_info(key_id)
begin
# Delete key
data, status_code, headers = api_instance.delete_api_key_with_http_info(key_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <DeleteAccountGroup200Response>
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->delete_api_key_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| key_id | String |
- Content-Type: Not defined
- Accept: application/json
list_api_keys
List keys
Returns all API keys for the authenticated user. Keys are returned with a preview only, not the full key value.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::APIKeysApi.new
begin
# List keys
result = api_instance.list_api_keys
p result
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->list_api_keys: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_api_keys_with_http_info
begin
# List keys
data, status_code, headers = api_instance.list_api_keys_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <ListApiKeys200Response>
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->list_api_keys_with_http_info: #{e}"
endThis endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
verify_credential
Verify credential
Checks whether the bearer credential on this request is valid, without reading any data. Accepts an API key or an OAuth access token. Intended for clients that must validate a credential before use (for example an MCP server verifying an incoming token) so they do not have to call a data endpoint to do it.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::APIKeysApi.new
begin
# Verify credential
result = api_instance.verify_credential
p result
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->verify_credential: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> verify_credential_with_http_info
begin
# Verify credential
data, status_code, headers = api_instance.verify_credential_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <VerifyCredential200Response>
rescue Zernio::ApiError => e
puts "Error when calling APIKeysApi->verify_credential_with_http_info: #{e}"
endThis endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json