openapi: 3.0.0
info:
  title: VPSnet API
  description: |
    VPSnet API reference (v1).

    Authenticated endpoints use an API key in the `X-API-KEY` header.
    Public endpoints are available under `/public/*` without authentication.
    This specification is intentionally partial and may omit fields from responses.
  termsOfService: https://www.vpsnet.com/en/information/term-of-service
  contact:
    email: info@vpsnet.com
  version: 1.0.0
servers:
  - url: https://api.vpsnet.com
    description: Production
tags:
  - name: Public
    description: Public endpoints (no auth)
  - name: Services
    description: Services
  - name: Macro payments
    description: Macro payments
paths:
  /public/status:
    get:
      tags: [Public]
      summary: Service health check
      operationId: getPublicStatus
      responses:
        "200":
          description: OK
  /public/faq:
    get:
      tags: [Public]
      summary: Get public FAQ entries (localized)
      operationId: getPublicFaq
      responses:
        "200":
          description: OK
  /public/changelog:
    get:
      tags: [Public]
      summary: Get public changelog entries (localized)
      operationId: getPublicChangelog
      responses:
        "200":
          description: OK
  /public/prices/{type}/plans:
    get:
      tags: [Public]
      summary: Get pricing plans for a service type
      operationId: getPublicPlansPrices
      parameters:
        - name: type
          in: path
          required: true
          description: Service type
          schema:
            type: string
            enum: [vps, vds, ds]
      responses:
        "200":
          description: OK
  /public/i18n:
    get:
      tags: [Public]
      summary: Get website translations
      operationId: getPublicI18n
      parameters:
        - name: lng
          in: query
          required: false
          schema:
            type: string
          description: Language code(s), e.g. "en", "lt", or "en lt"
        - name: ns
          in: query
          required: false
          schema:
            type: string
          description: Namespace(s), e.g. "common landingHome"
      responses:
        "200":
          description: OK
  /public/contactForm:
    post:
      tags: [Public]
      summary: Submit a contact form message
      operationId: postPublicContactForm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [contactName, contactEmail, contactMessage, recaptcha]
              properties:
                contactName:
                  type: string
                contactEmail:
                  type: string
                  format: email
                contactMessage:
                  type: string
                recaptcha:
                  type: string
      responses:
        "200":
          description: OK
  /api/v1/macro/projects:
    get:
      tags: [Macro payments]
      summary: Get macro payments projects
      operationId: getMacroPaymentProjects
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        "401":
          $ref: "#/components/responses/UnauthorizedError"
      security:
        - apiKey: []
  /api/v1/services:
    get:
      tags: [Services]
      summary: Get services list
      operationId: getServices
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/service"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
      security:
        - apiKey: []
  /api/v1/services/{serviceId}:
    get:
      tags: [Services]
      summary: Get service
      operationId: getService
      parameters:
        - name: serviceId
          in: path
          required: true
          description: Service ID
          schema:
            type: integer
            format: int64
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/service"
        "401":
          $ref: "#/components/responses/UnauthorizedError"
        "404":
          description: Not found
      security:
        - apiKey: []
components:
  schemas:
    service:
      description: Service model (partial)
      type: object
      properties:
        id:
          description: Service ID
          type: integer
  responses:
    UnauthorizedError:
      description: Unauthorized
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-KEY
      in: header
