---
updatedAt: 2026-10-06T17:37:25.000Z
agentTools:
  projectIndex: https://docs.akeyless.io/llms.txt
---

# /auth-method-create-k8s

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "support@akeyless.io",
      "name": "Akeyless",
      "url": "http://akeyless.io"
    },
    "description": "The purpose of this application is to provide access to Akeyless API.",
    "title": "Identity & access",
    "version": "3.0"
  },
  "paths": {
    "/auth-method-create-k8s": {
      "post": {
        "operationId": "authMethodCreateK8s",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authMethodCreateK8s"
              }
            }
          },
          "required": true,
          "x-go-name": "Body"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/authMethodCreateK8sResponse"
          },
          "default": {
            "$ref": "#/components/responses/errorResponse"
          }
        },
        "tags": [
          "Authentication"
        ],
        "x-docs-category": "Identity & access",
        "x-docs-group": "Authentication"
      }
    }
  },
  "tags": [
    {
      "name": "Authentication"
    }
  ],
  "x-readme": {
    "apply-tag-changes": true
  },
  "servers": [
    {
      "url": "https://api.akeyless.io"
    }
  ],
  "components": {
    "responses": {
      "authMethodCreateK8sResponse": {
        "description": "authMethodCreateK8sResponse wraps response body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/authMethodCreateOutput"
            }
          }
        }
      },
      "errorResponse": {
        "description": "errorResponse wraps any error to return it as a JSON object with one \"error\"\nfield.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JSONError"
            }
          }
        }
      }
    },
    "schemas": {
      "JSONError": {
        "properties": {
          "error": {
            "type": "string",
            "x-go-name": "Err"
          }
        },
        "title": "JSONError wraps an error with JSON object.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/client"
      },
      "authMethodCreateK8s": {
        "description": "authMethodCreateK8s is a command that creates a new auth method that will\nbe able to authenticate using K8S.",
        "properties": {
          "access-expires": {
            "default": 0,
            "description": "Access expiration date in Unix timestamp (select 0 for access without\nexpiry date)",
            "format": "int64",
            "type": "integer",
            "x-go-name": "AccessExpires"
          },
          "allowed-client-type": {
            "description": "limit the auth method usage for specific client types [cli,ui,gateway-admin,sdk,mobile,extension]",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "AllowedClientTypes"
          },
          "audience": {
            "description": "The audience in the Kubernetes JWT that the access is restricted to",
            "type": "string",
            "x-go-name": "Audience"
          },
          "audit-logs-claims": {
            "description": "Subclaims to include in audit logs, e.g \"--audit-logs-claims email --audit-logs-claims username\"",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "AuditLogsClaims"
          },
          "bound-ips": {
            "description": "A CIDR whitelist with the IPs that the access is restricted to",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "CIDRWhitelist"
          },
          "bound-namespaces": {
            "description": "A list of namespaces that the access is restricted to",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "BoundNamespaces"
          },
          "bound-pod-names": {
            "description": "A list of pod names that the access is restricted to",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "BoundPodNames"
          },
          "bound-sa-names": {
            "description": "A list of service account names that the access is restricted to",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "BoundServiceAccountNames"
          },
          "delete_protection": {
            "description": "Protection from accidental deletion of this object [true/false]",
            "type": "string",
            "x-go-name": "ObjectProtected"
          },
          "description": {
            "description": "Auth Method description",
            "type": "string",
            "x-go-name": "Description"
          },
          "expiration-event-in": {
            "description": "How many days before the expiration of the auth method would you like to be notified.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "ExpirationEventsInDays"
          },
          "force-sub-claims": {
            "description": "if true: enforce role-association must include sub claims",
            "type": "boolean",
            "x-go-name": "ForceSubClaims"
          },
          "gen-key": {
            "default": "true",
            "description": "Automatically generate key-pair for K8S configuration. If set to false, a public key needs to be provided [true/false]",
            "type": "string",
            "x-go-name": "GenerateKeyPair"
          },
          "gw-bound-ips": {
            "description": "A CIDR whitelist with the GW IPs that the access is restricted to",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "GWCIDRWhitelist"
          },
          "json": {
            "default": false,
            "description": "Set output format to JSON",
            "type": "boolean",
            "x-go-name": "Json"
          },
          "jwt-ttl": {
            "default": 0,
            "description": "Jwt TTL",
            "format": "int64",
            "type": "integer",
            "x-go-name": "JwtTtl"
          },
          "name": {
            "description": "Auth Method name",
            "type": "string",
            "x-go-name": "AuthMethodName"
          },
          "product-type": {
            "description": "Choose the relevant product type for the auth method [sm, sra, pm, dp, ca, ara]",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "ProductTypes"
          },
          "public-key": {
            "description": "Base64-encoded or PEM formatted public key data for K8S authentication method is required [RSA2048]",
            "type": "string",
            "x-go-name": "PublicKey"
          },
          "token": {
            "description": "Authentication token (see `/auth` and `/configure`)",
            "type": "string",
            "x-go-name": "Profile"
          },
          "uid-token": {
            "description": "The universal identity token, Required only for universal_identity authentication",
            "type": "string",
            "x-go-name": "UIDToken"
          }
        },
        "required": [
          "name"
        ],
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/client/commands"
      },
      "authMethodCreateOutput": {
        "properties": {
          "access_id": {
            "type": "string",
            "x-go-name": "AccessID"
          },
          "access_key": {
            "type": "string",
            "x-go-name": "AccessKey"
          },
          "name": {
            "type": "string",
            "x-go-name": "Name"
          },
          "prv_key": {
            "type": "string",
            "x-go-name": "PrivateKey"
          },
          "scim_base_url": {
            "description": "SCIM Base URL the IdP calls, set when SCIM flags were given",
            "type": "string",
            "x-go-name": "ScimBaseUrl"
          }
        },
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/client/commands"
      }
    }
  }
}
```