Coolify Hetzner API

Hetzner

OpenAPI Specification

coolify-hetzner-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Coolify Applications Hetzner API
  version: '0.1'
  description: Applications
servers:
- url: https://app.coolify.io/api/v1
  description: Coolify Cloud API. Change the host to your own instance if you are self-hosting.
tags:
- name: Hetzner
  description: Hetzner
paths:
  /hetzner/locations:
    get:
      tags:
      - Hetzner
      summary: Get Hetzner Locations
      description: Get all available Hetzner datacenter locations.
      operationId: get-hetzner-locations
      parameters:
      - name: cloud_provider_token_uuid
        in: query
        description: Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
        required: false
        schema:
          type: string
      - name: cloud_provider_token_id
        in: query
        description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'
        required: false
        deprecated: true
        schema:
          type: string
      responses:
        '200':
          description: List of Hetzner locations.
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
                    description:
                      type: string
                    country:
                      type: string
                    city:
                      type: string
                    latitude:
                      type: number
                    longitude:
                      type: number
                  type: object
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
      - bearerAuth: []
  /hetzner/server-types:
    get:
      tags:
      - Hetzner
      summary: Get Hetzner Server Types
      description: Get all available Hetzner server types (instance sizes).
      operationId: get-hetzner-server-types
      parameters:
      - name: cloud_provider_token_uuid
        in: query
        description: Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
        required: false
        schema:
          type: string
      - name: cloud_provider_token_id
        in: query
        description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'
        required: false
        deprecated: true
        schema:
          type: string
      responses:
        '200':
          description: List of Hetzner server types.
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
                    description:
                      type: string
                    cores:
                      type: integer
                    memory:
                      type: number
                    disk:
                      type: integer
                    prices:
                      type: array
                      items:
                        type: object
                        properties:
                          location:
                            type: string
                            description: Datacenter location name
                          price_hourly:
                            type: object
                            properties:
                              net:
                                type: string
                              gross:
                                type: string
                          price_monthly:
                            type: object
                            properties:
                              net:
                                type: string
                              gross:
                                type: string
                  type: object
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
      - bearerAuth: []
  /hetzner/images:
    get:
      tags:
      - Hetzner
      summary: Get Hetzner Images
      description: Get all available Hetzner system images (operating systems).
      operationId: get-hetzner-images
      parameters:
      - name: cloud_provider_token_uuid
        in: query
        description: Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
        required: false
        schema:
          type: string
      - name: cloud_provider_token_id
        in: query
        description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'
        required: false
        deprecated: true
        schema:
          type: string
      responses:
        '200':
          description: List of Hetzner images.
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
                    description:
                      type: string
                    type:
                      type: string
                    os_flavor:
                      type: string
                    os_version:
                      type: string
                    architecture:
                      type: string
                  type: object
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
      - bearerAuth: []
  /hetzner/ssh-keys:
    get:
      tags:
      - Hetzner
      summary: Get Hetzner SSH Keys
      description: Get all SSH keys stored in the Hetzner account.
      operationId: get-hetzner-ssh-keys
      parameters:
      - name: cloud_provider_token_uuid
        in: query
        description: Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
        required: false
        schema:
          type: string
      - name: cloud_provider_token_id
        in: query
        description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'
        required: false
        deprecated: true
        schema:
          type: string
      responses:
        '200':
          description: List of Hetzner SSH keys.
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
                    fingerprint:
                      type: string
                    public_key:
                      type: string
                  type: object
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
      - bearerAuth: []
  /servers/hetzner:
    post:
      tags:
      - Hetzner
      summary: Create Hetzner Server
      description: Create a new server on Hetzner and register it in Coolify.
      operationId: create-hetzner-server
      requestBody:
        description: Hetzner server creation parameters
        required: true
        content:
          application/json:
            schema:
              required:
              - location
              - server_type
              - image
              - private_key_uuid
              properties:
                cloud_provider_token_uuid:
                  type: string
                  example: abc123
                  description: Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
                cloud_provider_token_id:
                  type: string
                  example: abc123
                  description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'
                  deprecated: true
                location:
                  type: string
                  example: nbg1
                  description: Hetzner location name
                server_type:
                  type: string
                  example: cx11
                  description: Hetzner server type name
                image:
                  type: integer
                  example: 15512617
                  description: Hetzner image ID
                name:
                  type: string
                  example: my-server
                  description: Server name (auto-generated if not provided)
                private_key_uuid:
                  type: string
                  example: xyz789
                  description: Private key UUID
                enable_ipv4:
                  type: boolean
                  example: true
                  description: 'Enable IPv4 (default: true)'
                enable_ipv6:
                  type: boolean
                  example: true
                  description: 'Enable IPv6 (default: true)'
                hetzner_ssh_key_ids:
                  type: array
                  items:
                    type: integer
                  description: Additional Hetzner SSH key IDs
                cloud_init_script:
                  type: string
                  description: Cloud-init YAML script (optional)
                instant_validate:
                  type: boolean
                  example: false
                  description: Validate server immediately after creation
              type: object
      responses:
        '201':
          description: Hetzner server created.
          content:
            application/json:
              schema:
                properties:
                  uuid:
                    type: string
                    example: og888os
                    description: The UUID of the server.
                  hetzner_server_id:
                    type: integer
                    description: The Hetzner server ID.
                  ip:
                    type: string
                    description: The server IP address.
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
      security:
      - bearerAuth: []
components:
  responses:
    '400':
      description: Invalid token.
      content:
        application/json:
          schema:
            properties:
              message:
                type: string
                example: Invalid token.
            type: object
    '429':
      description: Rate limit exceeded.
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying.
          schema:
            type: integer
            example: 60
      content:
        application/json:
          schema:
            properties:
              message:
                type: string
                example: Rate limit exceeded. Please try again later.
            type: object
    '404':
      description: Resource not found.
      content:
        application/json:
          schema:
            properties:
              message:
                type: string
                example: Resource not found.
            type: object
    '401':
      description: Unauthenticated.
      content:
        application/json:
          schema:
            properties:
              message:
                type: string
                example: Unauthenticated.
            type: object
    '422':
      description: Validation error.
      content:
        application/json:
          schema:
            properties:
              message:
                type: string
                example: Validation error.
              errors:
                type: object
                example:
                  name:
                  - The name field is required.
                  api_url:
                  - The api url field is required.
                  - The api url format is invalid.
                additionalProperties:
                  type: array
                  items:
                    type: string
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: Go to `Keys & Tokens` / `API tokens` and create a new token. Use the token as the bearer token.
      scheme: bearer