--- title: API Key overview: A template that represents a single API key. location: https://istio.io/docs/reference/config/template/apikey.html layout: protoc-gen-docs number_of_entries: 2 ---

The apikey template represents a single API key, which is used for authorization checks.

Template

The apikey template represents a single API key, used to authorize API calls.

Sample config:

apiVersion: "config.istio.io/v1alpha2"
kind: apikey
metadata:
  name: validate-apikey
  namespace: istio-system
spec:
  api: api.service | ""
  api_version: api.version | ""
  api_operation: api.operation | ""
  api_key: api.key | ""
  timestamp: request.time
Field Type Description
api string

The API being called (api.service).

apiVersion string

The version of the API (api.version).

apiOperation string

The API operation is being called.

apiKey string

API key used in API call.

timestamp istio.mixer.adapter.model.v1beta1.TimeStamp

Timestamp of API call.

istio.mixer.adapter.model.v1beta1.TimeStamp

TimeStamp is used inside templates for fields that are of ValueType “TIMESTAMP”