API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console

POST /v1/hosting-plans

POST/v1/hosting-plans

Create a hosting plan

Data model

This operation works on the entity hosting_plan (hosting_plan). All 16 fields — type, validation, required status, relationships — are listed in the schema reference.

  • Required fields: name, diskQuotaGb, bandwidthQuotaGbMonth, maxEmailAccounts, maxDatabases, maxFtpUsers, maxSubdomains, phpVersions, defaultPhpVersion, phpMode, features, monthlyPriceCents
  • Server-managed: _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy — the platform assigns these fields; they are discarded in the request.

Request body

NameTypeDescription
namerequiredstring
descriptionstring
diskQuotaGbrequiredinteger
bandwidthQuotaGbMonthrequiredinteger
maxEmailAccountsrequiredinteger
maxDatabasesrequiredinteger
maxFtpUsersrequiredinteger
maxSubdomainsrequiredinteger
phpVersionsstring[]
defaultPhpVersionstring
phpModestring
priceCentsinteger
diskOveragePerGbCentsinteger
preferredServerTypestring
isActiveboolean

Example

curl -X POST https://api.codemeta-os.de/v1/hosting-plans \
  -H "X-Tenant-Id: $TENANT" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
  "name": "string",
  "description": "string",
  "diskQuotaGb": 0,
  "bandwidthQuotaGbMonth": 0,
  "maxEmailAccounts": 0,
  "maxDatabases": 0,
  "maxFtpUsers": 0,
  "maxSubdomains": 0,
  "phpVersions": [],
  "defaultPhpVersion": "string",
  "phpMode": "string",
  "priceCents": 0,
  "diskOveragePerGbCents": 0,
  "preferredServerType": "any",
  "isActive": true
}'
const result = await cm.hosting-plans.post({
  "name": "string",
  "description": "string",
  "diskQuotaGb": 0,
  "bandwidthQuotaGbMonth": 0,
  "maxEmailAccounts": 0,
  "maxDatabases": 0,
  "maxFtpUsers": 0,
  "maxSubdomains": 0,
  "phpVersions": [],
  "defaultPhpVersion": "string",
  "phpMode": "string",
  "priceCents": 0,
  "diskOveragePerGbCents": 0,
  "preferredServerType": "any",
  "isActive": true
});

Response codes

HTTP Meaning
201 Default Response

Search