{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.30.0",
  "summary": "Manage Gyro cloud servers, SSH keys and billing programmatically.",
  "x-summary-tr": "Gyro bulut sunucularınızı, SSH anahtarlarınızı ve faturalarınızı programla yönetin.",
  "contact": {
   "name": "Gyro Hosting",
   "url": "https://www.gyrohosting.com"
  },
  "license": {
   "name": "Proprietary",
   "identifier": "LicenseRef-Gyro-API-Terms"
  }
 },
 "servers": [
  {
   "url": "https://www.gyrohosting.com/api/v1/client",
   "description": "Production"
  }
 ],
 "paths": {
  "/cloud/services/{id}/project": {
   "put": {
    "tags": [
     "Projects"
    ],
    "operationId": "setServiceProject",
    "summary": "Set the project of a service",
    "x-summary-tr": "Hizmetin projesini ayarla",
    "x-scope": "services_write",
    "description": "`project_id` 0 = default project. Answers the service (with `project`). Sub-account keys need the `project:move` action.",
    "x-description-tr": "`project_id` 0 = varsayılan proje. Hizmeti (`project` ile) döner. Alt hesap anahtarı `project:move` eylemi ister.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "project_id"
        ],
        "properties": {
         "project_id": {
          "type": "integer",
          "minimum": 0
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Service",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Service"
          }
         }
        }
       }
      }
     },
     "422": {
      "description": "project_id_required / invalid_project_id"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "x-cli": {
     "command": "service project set"
    }
   },
   "parameters": [
    {
     "name": "id",
     "in": "path",
     "required": true,
     "schema": {
      "type": "integer"
     },
     "description": "Service id"
    }
   ]
  }
 },
 "components": {
  "responses": {
   "RateLimited": {
    "description": "Too many requests (`rate_limited`); see the `Retry-After` and `X-RateLimit-*` headers",
    "headers": {
     "Retry-After": {
      "description": "Seconds to wait",
      "schema": {
       "type": "integer"
      }
     }
    },
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "NotFound": {
    "description": "Not found — also returned for objects owned by someone else",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Forbidden": {
    "description": "Key lacks the scope, IP not allowed, or feature disabled",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Unauthorized": {
    "description": "Missing, invalid or revoked key",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string",
        "example": "server_not_found"
       },
       "message": {
        "type": "string"
       },
       "details": {
        "type": "object",
        "additionalProperties": true,
        "description": "Extra data. Limit refusals add the LimitHint fields (`limit_exceeded: true`, `limit_key`, `limit`, `current`, `how_to_increase`, `support_ticket`, `hint`): account limits are raised with a support ticket. Validation errors (length, format) never carry the limit hint.",
        "x-description-tr": "Ek veri. Sınır retlerinde LimitHint alanları gelir: hesap sınırları destek talebiyle artırılır. Doğrulama hataları (uzunluk, biçim) sınır ipucu taşımaz."
       }
      }
     }
    }
   },
   "Service": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "type": {
      "type": "string",
      "example": "server"
     },
     "product_line": {
      "type": "string",
      "example": "mail"
     },
     "module": {
      "type": [
       "string",
       "null"
      ],
      "description": "Omitted for white-label resellers"
     },
     "name": {
      "type": "string"
     },
     "status": {
      "type": "string"
     },
     "product_id": {
      "type": "integer"
     },
     "host": {
      "type": [
       "string",
       "null"
      ]
     },
     "ip": {
      "type": [
       "string",
       "null"
      ]
     },
     "cycle": {
      "type": "string"
     },
     "price": {
      "$ref": "#/components/schemas/Money"
     },
     "auto_renew": {
      "type": "boolean"
     },
     "due_date": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "customer_id": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Reseller end-customer the service is assigned to"
     },
     "nickname": {
      "type": [
       "string",
       "null"
      ],
      "description": "Customer-defined nickname (see `/cloud/services/{id}/label`); null when not set"
     },
     "tags": {
      "type": "array",
      "description": "Customer-defined colour tags (see `/cloud/services/{id}/label`); empty when not set",
      "items": {
       "$ref": "#/components/schemas/ServiceLabelTag"
      }
     },
     "project": {
      "$ref": "#/components/schemas/ProjectRef"
     }
    }
   },
   "ProjectRef": {
    "type": [
     "object",
     "null"
    ],
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     }
    },
    "description": "Project of the service (id 0 = default project); null when projects are not available"
   },
   "ServiceLabelTag": {
    "type": "object",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 24,
      "description": "Letter or digit first; then letters, digits, space and . _ - / + # &",
      "example": "production"
     },
     "color": {
      "type": "string",
      "enum": [
       "gray",
       "blue",
       "green",
       "red",
       "orange",
       "yellow",
       "purple",
       "pink",
       "teal",
       "indigo"
      ],
      "example": "green"
     }
    }
   },
   "Money": {
    "type": "object",
    "properties": {
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "example": "TRY"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}