{
 "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}/label": {
   "put": {
    "tags": [
     "Services (all products)"
    ],
    "operationId": "updateServiceLabel",
    "summary": "Set the nickname and/or tags of a service",
    "x-summary-tr": "Hizmetin takma adını ve/veya etiketlerini ayarla",
    "description": "Send `nickname`, `tags` or both; a field that is not sent stays unchanged. `nickname` \"\" or null clears it; `tags` replaces all tags and `[]` clears them. A tag is `\"name\"` or `{\"name\", \"color\"}`; an unknown or missing colour gets a stable default. Duplicate names (case-insensitive) are merged. Limit: 30 label writes per minute per key (429 `rate_limited`). Sub-account keys need the `label:edit` action. Errors: 422 `nothing_to_update`, `invalid_nickname`, `invalid_tags`; 404 `service_not_found` (also for services of other accounts) or `feature_unavailable`.",
    "x-description-tr": "`nickname`, `tags` ya da ikisini gönderin; gönderilmeyen alan değişmez. `nickname` \"\" veya null temizler; `tags` tüm etiketlerin yerine geçer, `[]` temizler. Etiket `\"ad\"` ya da `{\"name\", \"color\"}`; bilinmeyen/eksik renk için sabit varsayılan atanır. Aynı adlı (büyük/küçük harf duyarsız) etiketler birleştirilir. Sınır: anahtar başına dakikada 30 etiket yazması (429 `rate_limited`). Alt hesap anahtarı `label:edit` eylemi ister. Hatalar: 422 `nothing_to_update`, `invalid_nickname`, `invalid_tags`; 404 `service_not_found` (başka hesabın hizmeti dahil) veya `feature_unavailable`.",
    "x-scope": "services_write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ServiceLabelUpdate"
       },
       "example": {
        "nickname": "Accounting server",
        "tags": [
         {
          "name": "production",
          "color": "green"
         },
         "customer-A"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Saved label",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceLabel"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   },
   "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"
      }
     }
    }
   },
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "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."
       }
      }
     }
    }
   },
   "ServiceLabel": {
    "type": "object",
    "properties": {
     "service_id": {
      "type": "integer"
     },
     "nickname": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 60,
      "description": "Shown next to the product name in the client area"
     },
     "tags": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/ServiceLabelTag"
      }
     },
     "updated_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "colors": {
      "type": "array",
      "description": "Allowed colour keys (palette)",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "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"
     }
    }
   },
   "ServiceLabelUpdate": {
    "type": "object",
    "minProperties": 1,
    "properties": {
     "nickname": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 60,
      "description": "\"\" or null clears the nickname. No control characters.",
      "x-description-tr": "\"\" veya null takma adı temizler. Kontrol karakteri içeremez."
     },
     "tags": {
      "type": [
       "array",
       "null"
      ],
      "maxItems": 10,
      "description": "Replaces all tags; [] or null clears them. Item: a tag name, or {\"name\", \"color\"} (CLI: use --data for colours).",
      "x-description-tr": "Tüm etiketlerin yerine geçer; [] veya null temizler. Öğe: etiket adı ya da {\"name\", \"color\"} (CLI: renk için --data kullanın).",
      "items": {
       "oneOf": [
        {
         "type": "string",
         "minLength": 1,
         "maxLength": 24
        },
        {
         "$ref": "#/components/schemas/ServiceLabelTag"
        }
       ]
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}