HashiCorp Vault Token API

Token auth method for token lifecycle management

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Identity & Access Management BC-620.20

Operations 12

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /auth/token/create Create a new Vault token · HashiCorp Vault Create token #
Ask an LLM
“How do I issue a new Vault token with a custom TTL?”
“Can I create a token that is renewable and has a limited number of uses?”
Tell an agent
Create a new token with TTL {ttl}.
Create a token renewable for {ttl} with {num_uses} uses.
POST /auth/token/create-orphan Create an orphan token · HashiCorp Vault Create orphan token #
Ask an LLM
“How do I create a token with no parent token?”
“Does creating an orphan token require a root token?”
Tell an agent
Create an orphan token with TTL {ttl}.
Create an orphan token for role {role_name}.
POST /auth/token/create/{role_name} Create a token from a named role · HashiCorp Vault Create token with role #
Ask an LLM
“How do I issue a token based on a specific token role?”
“Can I create a token from a role with a custom display name?”
Tell an agent
Create a token from role {role_name}.
Issue a token from role {role_name} named {display_name}.
POST /auth/token/lookup Look up a token's details · HashiCorp Vault Lookup token #
Ask an LLM
“What policies and TTL does a given token have?”
“Can I inspect a token by its ID?”
Tell an agent
Look up token {token}.
Show the details of token {token}.
GET /auth/token/lookup-self Look up my own token · HashiCorp Vault Lookup self token #
Ask an LLM
“Which token did I use to make this request?”
“What policies are attached to my current token?”
Tell an agent
Look up my own token.
Show the token I am using.
POST /auth/token/renew Renew a token's lease · HashiCorp Vault Renew token #
Ask an LLM
“How do I extend the lease on a token I am not using?”
“Can I renew a token for a specific increment?”
Tell an agent
Renew token {token} for {increment}.
Extend the lease on token {token}.
POST /auth/token/renew-self Renew my own token's lease · HashiCorp Vault Renew self token #
Ask an LLM
“How do I renew the token I am currently using?”
“Can I extend the lease on my own token by a set amount?”
Tell an agent
Renew my own token for {increment}.
Extend the lease on the token I am using.
POST /auth/token/revoke Revoke a token and its children · HashiCorp Vault Revoke token #
Ask an LLM
“How do I revoke a token and all of its child tokens?”
“Can I invalidate a leaked token by ID?”
Tell an agent destructive · confirm first
Revoke token {token} and all its children.
Invalidate token {token}.
POST /auth/token/revoke-self Revoke my own token · HashiCorp Vault Revoke self token #
Ask an LLM
“How do I revoke the token I am currently using?”
“Can I invalidate my own token?”
Tell an agent destructive · confirm first
Revoke my own token.
Invalidate the token I am using.
GET /auth/token/roles/{role_name} Read a token role's configuration · HashiCorp Vault Read token role #
Ask an LLM
“What policies and TTL does a token role allow?”
“Can I see the configuration of a named token role?”
Tell an agent
Read token role {role_name}.
Show the configuration of token role {role_name}.
POST /auth/token/roles/{role_name} Create or update a token role · HashiCorp Vault Create or update token role #
Ask an LLM
“How do I create a token role that only allows certain policies?”
“Can I make a token role's tokens renewable with a period?”
Tell an agent
Create token role {role_name} allowing policies {allowed_policies}.
Set token role {role_name} to have a period of {token_period}.
DELETE /auth/token/roles/{role_name} Delete a token role · HashiCorp Vault Delete token role #
Ask an LLM
“How do I remove a token role I no longer use?”
“Can I delete a token role by name?”
Tell an agent destructive · confirm first
Delete token role {role_name}.
Remove the token role {role_name}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hvault:hvault-token-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hvault-token-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: HashiCorp Vault Vault Auth Methods Token API
  description: APIs for authentication methods in HashiCorp Vault including Token, AppRole, Kubernetes, LDAP, JWT/OIDC, GitHub, Userpass, and AWS auth methods. These endpoints handle user and machine authentication to obtain Vault tokens.
  version: '1.0'
  contact:
    name: HashiCorp Support
    email: support@hashicorp.com
    url: https://support.hashicorp.com/
  license:
    name: Business Source License 1.1
    url: https://github.com/hashicorp/vault/blob/main/LICENSE
servers:
- url: https://vault.example.com/v1
  description: Vault Server
security:
- vaultToken: []
tags:
- name: Token
  description: Token auth method for token lifecycle management
paths:
  /auth/token/create:
    post:
      operationId: createToken
      summary: HashiCorp Vault Create token
      description: Creates a new token. Certain options are only available when called by a root token. If used via the /auth/token/create/orphan endpoint, a root or sudo token is not required.
      tags:
      - Token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
      responses:
        '200':
          description: Token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Invalid request
        '403':
          description: Permission denied
  /auth/token/create-orphan:
    post:
      operationId: createOrphanToken
      summary: HashiCorp Vault Create orphan token
      description: Creates a new orphan token that has no parent. Requires a root token or sudo capability.
      tags:
      - Token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
      responses:
        '200':
          description: Orphan token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '403':
          description: Permission denied
  /auth/token/create/{role_name}:
    post:
      operationId: createTokenWithRole
      summary: HashiCorp Vault Create token with role
      description: Creates a new token based on a named token role.
      tags:
      - Token
      parameters:
      - name: role_name
        in: path
        required: true
        description: Name of the token role
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
      responses:
        '200':
          description: Token created with role
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Invalid request
        '403':
          description: Permission denied
  /auth/token/lookup:
    post:
      operationId: lookupToken
      summary: HashiCorp Vault Lookup token
      description: Returns information about the specified token.
      tags:
      - Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - token
              properties:
                token:
                  type: string
                  description: Token to look up
      responses:
        '200':
          description: Token information returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenLookupResponse'
        '403':
          description: Permission denied or bad token
  /auth/token/lookup-self:
    get:
      operationId: lookupSelfToken
      summary: HashiCorp Vault Lookup self token
      description: Returns information about the token used to make this request.
      tags:
      - Token
      responses:
        '200':
          description: Self token information returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenLookupResponse'
        '403':
          description: Permission denied
  /auth/token/renew:
    post:
      operationId: renewToken
      summary: HashiCorp Vault Renew token
      description: Renews a lease associated with the specified token.
      tags:
      - Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - token
              properties:
                token:
                  type: string
                  description: Token to renew
                increment:
                  type: string
                  description: Requested renewal increment (e.g., 1h)
      responses:
        '200':
          description: Token renewed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Token not renewable
        '403':
          description: Permission denied
  /auth/token/renew-self:
    post:
      operationId: renewSelfToken
      summary: HashiCorp Vault Renew self token
      description: Renews the lease on the token used to make this request.
      tags:
      - Token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                increment:
                  type: string
                  description: Requested renewal increment (e.g., 1h)
      responses:
        '200':
          description: Token renewed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Token not renewable
  /auth/token/revoke:
    post:
      operationId: revokeToken
      summary: HashiCorp Vault Revoke token
      description: Revokes the specified token and all child tokens.
      tags:
      - Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - token
              properties:
                token:
                  type: string
                  description: Token to revoke
      responses:
        '204':
          description: Token revoked
        '403':
          description: Permission denied
  /auth/token/revoke-self:
    post:
      operationId: revokeSelfToken
      summary: HashiCorp Vault Revoke self token
      description: Revokes the token used to make this request.
      tags:
      - Token
      responses:
        '204':
          description: Token revoked
  /auth/token/roles/{role_name}:
    get:
      operationId: readTokenRole
      summary: HashiCorp Vault Read token role
      description: Reads the configuration of the named token role.
      tags:
      - Token
      parameters:
      - $ref: '#/components/parameters/roleName'
      responses:
        '200':
          description: Token role configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenRole'
        '404':
          description: Role not found
    post:
      operationId: createOrUpdateTokenRole
      summary: HashiCorp Vault Create or update token role
      description: Creates or updates the named token role.
      tags:
      - Token
      parameters:
      - $ref: '#/components/parameters/roleName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenRole'
      responses:
        '204':
          description: Token role created or updated
        '400':
          description: Invalid request
    delete:
      operationId: deleteTokenRole
      summary: HashiCorp Vault Delete token role
      description: Deletes the named token role.
      tags:
      - Token
      parameters:
      - $ref: '#/components/parameters/roleName'
      responses:
        '204':
          description: Token role deleted
components:
  parameters:
    roleName:
      name: role_name
      in: path
      required: true
      description: Name of the role
      schema:
        type: string
  schemas:
    CreateTokenRequest:
      type: object
      properties:
        id:
          type: string
          description: Custom token ID (root only)
        role_name:
          type: string
          description: Name of the token role
        policies:
          type: array
          items:
            type: string
          description: Policies to attach to the token
        meta:
          type: object
          additionalProperties:
            type: string
          description: Metadata to associate with the token
        no_parent:
          type: boolean
          description: Create an orphan token
        no_default_policy:
          type: boolean
          description: Do not attach the default policy
        renewable:
          type: boolean
          description: Whether the token is renewable
        ttl:
          type: string
          description: Token TTL (e.g., 1h)
        explicit_max_ttl:
          type: string
          description: Explicit maximum TTL
        display_name:
          type: string
          description: Display name for the token
        num_uses:
          type: integer
          description: Maximum number of uses (0 for unlimited)
        period:
          type: string
          description: Renewal period
        entity_alias:
          type: string
          description: Entity alias name
        type:
          type: string
          enum:
          - service
          - batch
          description: Type of token to create
    TokenLookupResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            accessor:
              type: string
              description: Token accessor
            creation_time:
              type: integer
              description: Token creation time as Unix epoch
            creation_ttl:
              type: integer
              description: Original TTL in seconds
            display_name:
              type: string
              description: Display name
            entity_id:
              type: string
              description: Identity entity ID
            expire_time:
              type: string
              format: date-time
              description: Token expiration time
            explicit_max_ttl:
              type: integer
              description: Explicit max TTL in seconds
            id:
              type: string
              description: Token ID
            issue_time:
              type: string
              format: date-time
              description: Token issue time
            meta:
              type: object
              additionalProperties:
                type: string
              description: Token metadata
            num_uses:
              type: integer
              description: Remaining number of uses
            orphan:
              type: boolean
              description: Whether the token is an orphan
            path:
              type: string
              description: Auth path that created this token
            policies:
              type: array
              items:
                type: string
              description: Policies attached to the token
            renewable:
              type: boolean
              description: Whether the token is renewable
            ttl:
              type: integer
              description: Remaining TTL in seconds
            type:
              type: string
              description: Token type (service, batch)
    TokenRole:
      type: object
      properties:
        allowed_entity_aliases:
          type: array
          items:
            type: string
          description: Allowed entity aliases
        allowed_policies:
          type: array
          items:
            type: string
          description: Policies allowed for tokens created with this role
        disallowed_policies:
          type: array
          items:
            type: string
          description: Policies disallowed for tokens
        orphan:
          type: boolean
          description: Whether tokens are created as orphans
        path_suffix:
          type: string
          description: Path suffix for audit logging
        renewable:
          type: boolean
          description: Whether tokens are renewable
        explicit_max_ttl:
          type: string
          description: Explicit max TTL
        token_period:
          type: string
          description: Token period
        token_type:
          type: string
          enum:
          - default
          - service
          - batch
          description: Token type
    AuthResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique request identifier
        lease_id:
          type: string
          description: Lease identifier (empty for auth responses)
        renewable:
          type: boolean
          description: Whether the token is renewable
        lease_duration:
          type: integer
          description: Token TTL in seconds
        auth:
          type: object
          properties:
            client_token:
              type: string
              description: The Vault authentication token
            accessor:
              type: string
              description: Token accessor
            policies:
              type: array
              items:
                type: string
              description: Policies attached to the token
            token_policies:
              type: array
              items:
                type: string
              description: Token-specific policies
            identity_policies:
              type: array
              items:
                type: string
              description: Identity-derived policies
            metadata:
              type: object
              additionalProperties:
                type: string
              description: Metadata associated with the token
            lease_duration:
              type: integer
              description: Token TTL in seconds
            renewable:
              type: boolean
              description: Whether the token is renewable
            entity_id:
              type: string
              description: Identity entity ID
            token_type:
              type: string
              description: Type of token (service, batch)
            orphan:
              type: boolean
              description: Whether the token is an orphan
  securitySchemes:
    vaultToken:
      type: apiKey
      in: header
      name: X-Vault-Token
      description: Vault authentication token
externalDocs:
  description: Vault Auth Methods API Documentation
  url: https://developer.hashicorp.com/vault/api-docs/auth