Proxmox VE Access API

The Access API from Proxmox VE — 3 operation(s) for access.

OpenAPI Specification

proxmox-access-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Proxmox VE Access API
  description: 'REST-style management API for Proxmox Virtual Environment (PVE). All endpoints live

    under /api2/json on port 8006 of a PVE node. Authentication is via stateless API

    tokens (PVEAPIToken header) or ticket-based sessions issued by /access/ticket

    (cookie + CSRFPreventionToken header for write operations). Output format may be

    switched via the path (json, extjs, html, text). Tickets expire after 2 hours.

    '
  version: 1.0.0
  contact:
    name: Proxmox VE API
    url: https://pve.proxmox.com/wiki/Proxmox_VE_API
servers:
- url: https://{server}:8006/api2/json
  description: Proxmox VE node API
  variables:
    server:
      default: your.server
      description: Hostname or IP of the Proxmox VE node
security:
- apiTokenAuth: []
- ticketAuth: []
tags:
- name: Access
paths:
  /access/ticket:
    post:
      tags:
      - Access
      summary: Create authentication ticket
      description: 'Create a ticket (and CSRFPreventionToken) using username/password credentials.

        The returned ticket is used as the PVEAuthCookie for subsequent requests, and

        the CSRFPreventionToken header is required for write operations.

        '
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - username
              - password
              properties:
                username:
                  type: string
                  description: User name in the form `USER@REALM`.
                password:
                  type: string
                  format: password
                realm:
                  type: string
                otp:
                  type: string
      responses:
        '200':
          description: Ticket and CSRFPreventionToken
  /access/users:
    get:
      tags:
      - Access
      summary: List configured users
      responses:
        '200':
          description: User list
    post:
      tags:
      - Access
      summary: Create a new user
      responses:
        '200':
          description: User created
  /access/users/{userid}:
    parameters:
    - name: userid
      in: path
      required: true
      schema:
        type: string
      description: User identifier in `USER@REALM` form.
    delete:
      tags:
      - Access
      summary: Delete user
      responses:
        '200':
          description: User deleted
components:
  securitySchemes:
    apiTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Stateless API token. Send header

        `Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID`.

        No CSRFPreventionToken required.

        '
    ticketAuth:
      type: apiKey
      in: cookie
      name: PVEAuthCookie
      description: 'Ticket issued by POST /access/ticket. Carried as a cookie. Write

        operations also require the `CSRFPreventionToken` header returned with

        the ticket. Tickets expire after 2 hours.

        '