HashiCorp Nomad Variables API

Endpoints for managing Nomad variables, which store encrypted key-value data.

Operations 4

GET /vars List variables #
GET /var/{variablePath} Read a variable #
PUT /var/{variablePath} Create or update a variable #
DELETE /var/{variablePath} Delete a variable #

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/nomad-variables-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

nomad-variables-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: HashiCorp Nomad HTTP ACL Variables API
  description: The HashiCorp Nomad HTTP API provides programmatic access to all Nomad functionality including job scheduling, allocation management, node operations, deployments, services, evaluations, namespaces, ACL policies, and cluster status. All API routes are prefixed with /v1/ and the default port is 4646. The API is RESTful, responds to standard HTTP verbs, and supports ACL token authentication via the X-Nomad-Token header or Bearer scheme.
  version: 1.9.0
  contact:
    name: HashiCorp Support
    url: https://support.hashicorp.com
  termsOfService: https://www.hashicorp.com/terms-of-service
  license:
    name: Business Source License 1.1
    url: https://github.com/hashicorp/nomad/blob/main/LICENSE
servers:
- url: http://localhost:4646/v1
  description: Local Nomad Agent
security:
- nomadToken: []
- bearerAuth: []
tags:
- name: Variables
  description: Endpoints for managing Nomad variables, which store encrypted key-value data.
paths:
  /vars:
    get:
      operationId: listVariables
      summary: List variables
      description: Lists all Nomad variables. Variables are encrypted key-value pairs stored in Nomad.
      tags:
      - Variables
      parameters:
      - $ref: '#/components/parameters/PrefixParam'
      - $ref: '#/components/parameters/NamespaceParam'
      - $ref: '#/components/parameters/NextTokenParam'
      - $ref: '#/components/parameters/PerPageParam'
      responses:
        '200':
          description: A list of variable metadata
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableMetadata'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
  /var/{variablePath}:
    get:
      operationId: readVariable
      summary: Read a variable
      description: Returns the full variable including its items at the specified path.
      tags:
      - Variables
      parameters:
      - name: variablePath
        in: path
        required: true
        description: The path of the variable.
        schema:
          type: string
      - $ref: '#/components/parameters/NamespaceParam'
      responses:
        '200':
          description: Variable details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
    put:
      operationId: upsertVariable
      summary: Create or update a variable
      description: Creates a new variable or updates an existing one at the specified path.
      tags:
      - Variables
      parameters:
      - name: variablePath
        in: path
        required: true
        description: The path of the variable.
        schema:
          type: string
      - $ref: '#/components/parameters/NamespaceParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Variable'
      responses:
        '200':
          description: Variable created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
    delete:
      operationId: deleteVariable
      summary: Delete a variable
      description: Deletes the variable at the specified path.
      tags:
      - Variables
      parameters:
      - name: variablePath
        in: path
        required: true
        description: The path of the variable.
        schema:
          type: string
      - $ref: '#/components/parameters/NamespaceParam'
      responses:
        '200':
          description: Variable deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    Unauthorized:
      description: Unauthorized - missing or invalid ACL token
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
  parameters:
    PrefixParam:
      name: prefix
      in: query
      description: Specifies a string to filter results based on an ID prefix.
      schema:
        type: string
    NamespaceParam:
      name: namespace
      in: query
      description: The target namespace. Defaults to the default namespace.
      schema:
        type: string
    PerPageParam:
      name: per_page
      in: query
      description: Maximum number of results to return per page.
      schema:
        type: integer
    NextTokenParam:
      name: next_token
      in: query
      description: Indicates where to start paging for queries that support pagination.
      schema:
        type: string
  schemas:
    VariableMetadata:
      type: object
      description: Metadata about a Nomad variable without the item values.
      properties:
        Namespace:
          type: string
        Path:
          type: string
        CreateIndex:
          type: integer
        ModifyIndex:
          type: integer
        CreateTime:
          type: integer
          format: int64
        ModifyTime:
          type: integer
          format: int64
    Variable:
      type: object
      description: A Nomad variable containing encrypted key-value data.
      properties:
        Namespace:
          type: string
          description: The namespace the variable belongs to.
        Path:
          type: string
          description: The path of the variable.
        Items:
          type: object
          additionalProperties:
            type: string
          description: The key-value items stored in the variable.
        CreateIndex:
          type: integer
        ModifyIndex:
          type: integer
        CreateTime:
          type: integer
          format: int64
        ModifyTime:
          type: integer
          format: int64
  securitySchemes:
    nomadToken:
      type: apiKey
      name: X-Nomad-Token
      in: header
      description: ACL token passed via the X-Nomad-Token request header.
    bearerAuth:
      type: http
      scheme: bearer
      description: ACL token passed via the Authorization header with Bearer scheme.
externalDocs:
  description: Nomad HTTP API Documentation
  url: https://developer.hashicorp.com/nomad/api-docs