### Install Python Libraries and Setup .env Source: https://developer.mittwald.de/docs/v2/platform/aihosting/examples/python Installs the required Python libraries (`python-dotenv`, `openai`, `langchain-openai`) using pip and sets up the `OPENAI_API_KEY` in a `.env` file for authentication with mittwald's AI hosting. ```shell pip install python-dotenv openai langchain-openai echo 'OPENAI_API_KEY="sk-…"' > .env ``` -------------------------------- ### Node.js Container Start Commands Source: https://developer.mittwald.de/docs/v2/guides/apps/nodejs-container-migration Provides example commands for starting a Node.js application within a container. These commands vary depending on whether `yarn install` has already been executed. The snippets demonstrate changing the directory to `/app` and then executing `yarn start`, with one option including `yarn install`. ```bash # If code was duplicated (and yarn install was already executed): sh -c "cd /app && yarn start" ``` ```bash # If code was redeployed (and yarn install has not been executed yet): sh -c "cd /app && yarn install && yarn start" ``` -------------------------------- ### Get System Software (JavaScript SDK) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-installed-systemsoftware-for-appinstallation Demonstrates how to use the Mittwald API v2 JavaScript SDK to get installed system software for an app installation. This code snippet shows client initialization, making the API call, and asserting the response status. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.getInstalledSystemsoftwareForAppinstallation({ "appInstallationId": "string", "queryParameters": { "tagFilter": "string" } }); assertStatus(response, 200); ``` -------------------------------- ### Get System Software (PHP SDK) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-installed-systemsoftware-for-appinstallation Illustrates fetching installed system software for an app installation using the Mittwald API v2 PHP SDK. The example shows how to create a request object, set parameters like app installation ID and tag filter, and handle the API response. ```php use \Mittwald\ApiClient\Generated\V2\Clients\App\GetInstalledSystemsoftwareForAppinstallation\GetInstalledSystemsoftwareForAppinstallationRequest; $client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN')); $request = (new GetInstalledSystemsoftwareForAppinstallationRequest( appInstallationId: "string" )) ->withTagFilter("string"); $response = $client->app()->getInstalledSystemsoftwareForAppinstallation($request); var_dump($response->getBody(); ``` -------------------------------- ### Get App Installation using JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-appinstallation This example demonstrates how to fetch an app installation using the Mittwald API v2 JavaScript SDK. It initializes the client with an API token and calls the `getAppinstallation` method with the `appInstallationId`. The `assertStatus` function is used to verify that the response has a status code of 200. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.getAppinstallation({ "appInstallationId": "string" }); assertStatus(response, 200); ``` -------------------------------- ### GET /v2/app-installations/{appInstallationId}/ Source: https://developer.mittwald.de/docs/v2/api/howtos/create-php Retrieve the status and details of a specific application installation. ```APIDOC ## GET /v2/app-installations/{appInstallationId}/ ### Description Retrieves the current status and details of a previously installed application or worker. This is useful for monitoring the installation progress and finding the `installationPath`. ### Method GET ### Endpoint /v2/app-installations/{appInstallationId}/ ### Parameters #### Path Parameters - **appInstallationId** (string) - Required - The ID of the application installation to retrieve. #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier for the application installation. - **status** (string) - The current status of the installation (e.g., "running", "failed", "installed"). - **installationPath** (string) - The directory within the project's file system where the application is installed. - ... (other installation details) #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "status": "installed", "installationPath": "/var/www/html/your-php-app" } ``` ``` -------------------------------- ### mw app get [INSTALLATION-ID] Source: https://developer.mittwald.de/docs/v2/cli/reference/app Get details about an app installation. You can specify an installation ID or rely on the default set in the context. The output format can be text or JSON. ```APIDOC ## `mw app get [INSTALLATION-ID]` ### Description Get details about an app installation. ### Method GET ### Endpoint `/websites/developer_mittwald_de_v2/apps/{INSTALLATION-ID}` ### Parameters #### Path Parameters - **INSTALLATION-ID** (string) - Optional - ID or short ID of an app installation. If omitted, the default app installation from the context is used. #### Query Parameters - **output** (string) - Optional - The output format to use. Options: `txt` (human-readable text), `json` (machine-readable JSON). Default is `txt`. #### Request Body None ### Request Example ```json { "INSTALLATION-ID": "app-67890", "output": "json" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the app installation. - **name** (string) - The name of the app installation. - **status** (string) - The current status of the app installation (e.g., 'running', 'stopped'). - **createdAt** (string) - The timestamp when the app installation was created. - **updatedAt** (string) - The timestamp when the app installation was last updated. #### Response Example ```json { "id": "app-67890", "name": "my-production-app", "status": "running", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T11:30:00Z" } ``` ``` -------------------------------- ### GET /v2/apps/ Source: https://developer.mittwald.de/docs/v2/api/howtos/create-php Retrieve a list of available applications and their IDs. ```APIDOC ## GET /v2/apps/ ### Description Retrieves a list of all available applications on the platform. This is useful for finding the specific `appId` for applications like 'PHP' or 'PHP Worker'. ### Method GET ### Endpoint /v2/apps/ ### Parameters None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier for the application. - **name** (string) - The name of the application (e.g., "PHP", "PHP Worker"). - ... (other application details) #### Response Example ```json { "id": "34220303-cb87-4592-8a95-2eb20a97b2ac", "name": "PHP", "description": "Generic custom PHP application" } ``` ``` -------------------------------- ### Get System Software (cURL) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-installed-systemsoftware-for-appinstallation Example of how to retrieve installed system software for an app installation using cURL. It requires an API token for authentication and allows filtering by tag. ```bash $ curl \ --fail \ --location \ -H "Authorization: Bearer $MITTWALD_API_TOKEN" \ https://api.mittwald.de/v2/app-installations/string/systemSoftware?tagFilter=string ``` -------------------------------- ### List Recommended App Versions with PHP SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-list-appversions Demonstrates how to fetch recommended application versions using the PHP SDK. This example shows how to instantiate the client, create a request object with the app ID and recommended flag, and execute the request. ```php use \Mittwald\ApiClient\Generated\V2\Clients\App\ListAppversions\ListAppversionsRequest; $client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN')); $request = (new ListAppversionsRequest( appId: "f0f86186-0a5a-45b2-aa33-502777496347" )) ->withRecommended(true); $response = $client->app()->listAppversions($request); var_dump($response->getBody(); ``` -------------------------------- ### Example JSON Response for App Installation Status Source: https://developer.mittwald.de/docs/v2/reference/app/app-retrieve-status This is an example of a successful JSON response (200 OK) when retrieving the runtime status of an app installation. It includes the `lastExitCode`, `logFileLocation`, current `state` (e.g., 'running'), and `uptimeSeconds`. ```json { "lastExitCode": 123, "logFileLocation": "string", "state": "running", "uptimeSeconds": 123 } ``` -------------------------------- ### Request App Installation using JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-request-appinstallation This JavaScript example demonstrates how to request an app installation using the Mittwald API client. It initializes the client with an API token and calls the `requestAppinstallation` method with project ID and app installation data. The `assertStatus` function is used to verify a successful 201 Created response. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.requestAppinstallation({ "projectId": "string", "data": { "appVersionId": "f0f86186-0a5a-45b2-aa33-502777496347", "description": "string", "installationPath": "string", "updatePolicy": "none", "userInputs": [ { "name": "string", "value": "string" } ] } }); assertStatus(response, 201); ``` -------------------------------- ### Install Matomo Application Source: https://developer.mittwald.de/docs/v2/cli/reference/app This command creates a new Matomo installation. It supports specifying the Matomo version, project ID, and administrator credentials. Optional flags allow for quiet output, waiting for readiness, and configuring the host and site title. ```bash mw app install matomo --version [--token ] [-p ] [-q] [--host ] [--admin-user ] [--admin-email ] [--admin-pass ] [--site-title ] [-w] [--wait-timeout ] ``` -------------------------------- ### Get Missing Dependencies for App Installation (JavaScript SDK) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-missing-dependencies-for-appinstallation This JavaScript example uses the Mittwald API client to fetch missing dependencies for an app installation. It authenticates using an API token and specifies the target app version ID. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.getMissingDependenciesForAppinstallation({ "appInstallationId": "string", "queryParameters": { "targetAppVersionID": "f0f86186-0a5a-45b2-aa33-502777496347" } }); assertStatus(response, 200); ``` -------------------------------- ### List App Installations with PHP SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-list-appinstallations-for-user This example demonstrates how to list app installations using the Mittwald PHP SDK. It initializes a client with an API token and constructs a `ListAppinstallationsForUserRequest` object to specify filtering criteria like app IDs, search term, limit, and page. The response body is then outputted. ```php use \Mittwald\ApiClient\Generated\V2\Clients\App\ListAppinstallationsForUser\ListAppinstallationsForUserRequest; $client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN')); $request = (new ListAppinstallationsForUserRequest()) ->withAppIds(["f0f86186-0a5a-45b2-aa33-502777496347"]) ->withSearchTerm("string") ->withLimit(50) ->withPage(1); $response = $client->app()->listAppinstallationsForUser($request); var_dump($response->getBody(); ``` -------------------------------- ### Get Missing Dependencies for App Installation (PHP SDK) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-missing-dependencies-for-appinstallation This PHP example demonstrates how to retrieve missing dependencies for an app installation using the Mittwald API client. It requires an API token for authentication and allows specifying the target app version ID. ```php use \Mittwald\ApiClient\Generated\V2\Clients\App\GetMissingDependenciesForAppinstallation\GetMissingDependenciesForAppinstallationRequest; $client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN')); $request = (new GetMissingDependenciesForAppinstallationRequest( appInstallationId: "string" )) ->withTargetAppVersionID("f0f86186-0a5a-45b2-aa33-502777496347"); $response = $client->app()->getMissingDependenciesForAppinstallation($request); var_dump($response->getBody(); ``` -------------------------------- ### Project Hosting Resource Example (JSON) Source: https://developer.mittwald.de/docs/v2/reference/project/project-list-projects An example JSON object representing a project hosting resource. This demonstrates the structure and data types for fields such as backup storage, creation date, customer metadata, enabled status, and supported features. ```json [ { "backupStorageUsageInBytes": 123, "backupStorageUsageInBytesSetAt": "2025-10-24T11:48:08.784Z", "createdAt": "2025-10-24T11:48:08.784Z", "customerId": "string", "customerMeta": { "id": "string" }, "description": "string", "disableReason": "maliciousCode", "disabledAt": "2025-10-24T11:48:08.784Z", "enabled": true, "id": "string", "imageRefId": "string", "projectHostingId": "f0f86186-0a5a-45b2-aa33-502777496347", "serverId": "string", "shortId": "string", "status": "pending", "statusSetAt": "2025-10-24T11:48:08.784Z", "supportedFeatures": [ "redis" ], "webStorageUsageInBytes": 123, "webStorageUsageInBytesSetAt": "2025-10-24T11:48:08.784Z" } ] ``` -------------------------------- ### Trigger App Action using cURL Source: https://developer.mittwald.de/docs/v2/reference/app/app-execute-action This example demonstrates how to trigger a runtime action for an app installation using a cURL command. It requires the app installation ID and the desired action (start, stop, or restart), along with an API token for authentication. ```bash $ curl \ --fail \ --location \ -X POST \ -H "Authorization: Bearer $MITTWALD_API_TOKEN" \ https://api.mittwald.de/v2/app-installations/string/actions/start ``` -------------------------------- ### Install TYPO3 App using mw CLI Source: https://developer.mittwald.de/docs/v2/reference/app/app-request-appinstallation This example demonstrates installing the TYPO3 app using the Mittwald command-line interface (mw CLI). It shows two commands: first, creating a PHP app, and second, installing TYPO3 with specific version, installation mode, and administrative details. This approach is useful for automated deployments or scripting. ```bash $ mw app create php \ --project-id $PROJECT_ID \ --site-title "My TYPO3 site" $ mw app install typo3 \ --version 12.4.16 \ --install-mode composer \ --project-id $PROJECT_ID \ --admin-email admin@typo3.example \ --admin-pass securepassword \ --admin-user admin \ --site-title "My TYPO3 site" ``` -------------------------------- ### Retrieve App Installation Status with JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-retrieve-status This example shows how to retrieve the runtime status of an app installation using the Mittwald API JavaScript SDK. It initializes the client with an API token and calls the `retrieveStatus` method with the app installation ID. It also includes assertion for a successful HTTP status. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.retrieveStatus({ "appInstallationId": "string" }); assertStatus(response, 200); ``` -------------------------------- ### Get Ingress Details using JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/domain/ingress-get-ingress This example demonstrates how to fetch ingress details using the Mittwald API v2 JavaScript SDK. It initializes the client with an API token, makes a request to get the ingress by its ID, and asserts that the response status is 200 OK. Ensure the '@mittwald/api-client' and '@mittwald/api-client-commons' packages are installed. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.domain.ingressGetIngress({ "ingressId": "f0f86186-0a5a-45b2-aa33-502777496347" }); assertStatus(response, 200); ``` -------------------------------- ### Install Go API Client Source: https://developer.mittwald.de/docs/v2/api/sdks/go Installs the Mittwald API client library for Go using the `go get` command. This is the primary step to integrate the client into your Go project. ```bash go get github.com/mittwald/api-client-go ``` -------------------------------- ### GET /v2/apps/{appId}/versions/ Source: https://developer.mittwald.de/docs/v2/api/howtos/create-php Retrieve a list of available versions for a specific application. ```APIDOC ## GET /v2/apps/{appId}/versions/ ### Description Retrieves a list of all available versions for a given application ID (`appId`). You can filter these versions to find the recommended one for installation. ### Method GET ### Endpoint /v2/apps/{appId}/versions/ ### Parameters #### Path Parameters - **appId** (string) - Required - The ID of the application for which to retrieve versions. #### Query Parameters - **recommended** (boolean) - Optional - Filter to retrieve only the recommended version. ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier for the application version. - **recommended** (boolean) - Indicates if this version is recommended for installation. - ... (other version details) #### Response Example ```json { "id": "ff45ad04-8589-46d7-a645-0566be3eaeec", "recommended": true, "version": "1.0.0" } ``` ``` -------------------------------- ### Cronjob Execution JSON Response Example Source: https://developer.mittwald.de/docs/v2/reference/cronjob/cronjob-get-execution This is an example of a successful JSON response (HTTP 200 OK) when retrieving a cronjob execution. It includes details such as the cronjob ID, duration, start and end times, status, and whether it was successful. ```json { "abortedBy": { "id": "f0f86186-0a5a-45b2-aa33-502777496347" }, "cronjobId": "string", "durationInMilliseconds": 12374, "end": "2025-10-24T11:45:48.041Z", "id": "cron-bd26li-28027320", "logPath": "/var/log/cronjobs/cron-bd26li-28027320.log", "start": "2025-10-24T11:45:48.041Z", "status": "Complete", "successful": true, "triggeredBy": { "id": "f0f86186-0a5a-45b2-aa33-502777496347" } } ``` -------------------------------- ### Python OpenAI Client for AI Hosting Source: https://developer.mittwald.de/docs/v2/platform/aihosting/examples/python Demonstrates how to use the `openai` Python library to interact with mittwald's AI hosting. It loads the API key from the environment, initializes the `OpenAI` client with a custom base URL, and makes a chat completion request. ```python from openai import OpenAI from dotenv import load_dotenv # Load .env file load_dotenv() # Initialize client with custom host and key from environment client = OpenAI( base_url="https://llm.aihosting.mittwald.de/v1" ) # Make a simple call response = client.chat.completions.create( model="Mistral-Small-3.2-24B-Instruct", temperature = 0.15, messages=[ {"role": "user", "content": "Moin and hello!"} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Get LeadFyndr Profile Request API - JavaScript SDK Example Source: https://developer.mittwald.de/docs/v2/reference/leadfyndr/leadfyndr-get-lead-fyndr-profile-request This code example shows how to use the Mittwald API client for JavaScript to fetch a LeadFyndr profile request. It initializes the client with an API token, constructs the request object with the customer ID, and asserts that the response status is 200 OK. Ensure the '@mittwald/api-client' and '@mittwald/api-client-commons' packages are installed. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.leadFyndr.getLeadFyndrProfileRequest({ "customerId": "string" }); assertStatus(response, 200); ``` -------------------------------- ### GET /app-installations/{appInstallationId}/systemSoftware/ Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-installed-systemsoftware-for-appinstallation Retrieves a list of installed system software for a specific app installation. You can filter the results by tags. ```APIDOC ## GET /app-installations/{appInstallationId}/systemSoftware/ ### Description Retrieves a list of installed system software for a specific app installation. You can filter the results by tags. ### Method GET ### Endpoint /app-installations/{appInstallationId}/systemSoftware/ ### Parameters #### Path Parameters - **appInstallationId** (string) - Required - The ID of the app installation. #### Query Parameters - **tagFilter** (string) - Optional - Filters the results to include only system software with the specified tag. ### Request Example ```bash curl \ --fail \ --location \ -H "Authorization: Bearer $MITTWALD_API_TOKEN" \ https://api.mittwald.de/v2/app-installations/string/systemSoftware?tagFilter=string ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the system software. - **meta** (object) - Additional metadata for the system software. - **name** (string) - The name of the system software. - **tags** (array of string) - A list of tags associated with the system software. #### Response Example ```json [ { "id": "string", "meta": { "string": "string" }, "name": "string", "tags": [ "string" ] } ] ``` ``` -------------------------------- ### POST /v2/orders/ Source: https://developer.mittwald.de/docs/v2/api/howtos/create-project Orders a new standalone project (proSpace plan). Requires customer ID, description, disk space, and machine type. ```APIDOC ## POST /v2/orders/ ### Description Orders a new stand-alone project using the proSpace plan. This requires authorization for chargeable actions within an organization. ### Method POST ### Endpoint `/v2/orders/` ### Parameters #### Request Body - **orderType** (string) - Required - Must be set to `"projectHosting"` to indicate the creation of a new project. - **orderData** (object) - Required - An object describing the order details. - **customerId** (string) - Required - The ID of the organization that will pay for the project. - **description** (string) - Required - A human-readable description of the project. - **diskspaceInGiB** (number) - Required - The storage space to be booked for the project. Must be at least 20 GiB and a multiple of 20. - **spec** (object) - Required - Defines the project's resources (CPU, RAM). - **machineType** (string) - Required - The type of machine resources to allocate. Possible values can be obtained via the `GET /v2/articles/` endpoint. ### Request Example ```json { "orderType": "projectHosting", "orderData": { "customerId": "org_abcdef12", "description": "My new standalone project", "diskspaceInGiB": 40, "spec": { "machineType": "cpu-4cores-8gb-ram" } } } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the newly created order. #### Response Example ```json { "id": "order_7890abcd" } ``` ``` -------------------------------- ### List System Softwares using JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-list-systemsoftwares This JavaScript code example shows how to use the Mittwald API client to list system softwares. It initializes the client with an API token and makes a request with specified query parameters for limit and page. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.listSystemsoftwares({ "queryParameters": { "limit": 50, "page": 1 } }); assertStatus(response, 200); ``` -------------------------------- ### Create Static Site Installation Source: https://developer.mittwald.de/docs/v2/cli/reference/app Creates a new custom static site installation. You can specify the document root, site title, and project ID. ```APIDOC ## `mw app create static` ### Description Creates new custom static site installation. ### Method POST ### Endpoint `/websites/developer_mittwald_de_v2/apps/create/static` ### Parameters #### Query Parameters - **document-root** (string) - Required - The document root from which your custom static site will be served (relative to the installation path). - **site-title** (string) - Optional - Site title for your custom static site installation. - **project-id** (string) - Optional - ID or short ID of a project. - **wait** (boolean) - Optional - Wait for the resource to be ready. - **wait-timeout** (string) - Optional - The duration to wait for the resource to be ready (default: 600s). - **quiet** (boolean) - Optional - Suppress process output and only display a machine-readable summary. - **token** (string) - Optional - API token to use for authentication. ### Request Example ```json { "document_root": "/var/www/html", "site_title": "My Static Site", "project_id": "proj_12345", "wait": true, "wait_timeout": "120s", "quiet": false, "token": "your_api_token" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the created static site installation. - **status** (string) - The status of the installation. #### Response Example ```json { "id": "static_site_abcde", "status": "created" } ``` ``` -------------------------------- ### List Servers via JavaScript SDK Source: https://developer.mittwald.de/docs/v2/reference/project/project-list-servers This example demonstrates listing servers using the Mittwald JavaScript SDK. It initializes a client with an API token and makes a request to list servers with specified query parameters. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.project.listServers({ "queryParameters": { "customerId": "string", "searchTerm": "string", "limit": 50, "page": 1, "sort": "createdAt", "order": "asc" } }); assertStatus(response, 200); ``` -------------------------------- ### POST /v2/servers/{serverId}/projects/ Source: https://developer.mittwald.de/docs/v2/api/howtos/create-project Creates a new project on an existing server. Requires the server ID and a project description. ```APIDOC ## POST /v2/servers/{serverId}/projects/ ### Description Creates a new project on an existing server. You will require the server's ID, which can be obtained using the `GET /v2/servers/` endpoint. ### Method POST ### Endpoint `/v2/servers/{serverId}/projects/` ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server on which to create the project. #### Request Body - **description** (string) - Required - A human-readable description of the project. ### Request Example ```json { "description": "My new website project" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the newly created project. #### Response Example ```json { "id": "proj_12345abc" } ``` ``` -------------------------------- ### Project Membership JSON Response Example Source: https://developer.mittwald.de/docs/v2/reference/project/project-get-self-membership-for-project An example of the JSON response when successfully retrieving a user's project membership. It includes details like avatar reference, email, expiration time, names, IDs, inheritance status, invite ID, membership start date, MFA status, project ID, and role. ```json { "avatarRef": "f0f86186-0a5a-45b2-aa33-502777496347", "email": "email@mittwald.example", "expiresAt": "2025-10-24T11:48:09.405Z", "firstName": "string", "id": "f0f86186-0a5a-45b2-aa33-502777496347", "inherited": true, "inviteId": "f0f86186-0a5a-45b2-aa33-502777496347", "lastName": "string", "memberSince": "2025-10-24T11:48:09.405Z", "mfa": true, "projectId": "f0f86186-0a5a-45b2-aa33-502777496347", "role": "notset", "userId": "f0f86186-0a5a-45b2-aa33-502777496347" } ``` -------------------------------- ### Get Unread Notification Counts - cURL Example Source: https://developer.mittwald.de/docs/v2/reference/notification/notifications-count-unread-notifications Example of how to fetch unread notification counts using cURL. This command sends a GET request to the API endpoint with an authorization header. ```shell $ curl \ --fail \ --location \ -H "Authorization: Bearer $MITTWALD_API_TOKEN" \ https://api.mittwald.de/v2/notification-unread-counts ``` -------------------------------- ### Python Langchain Client for AI Hosting Source: https://developer.mittwald.de/docs/v2/platform/aihosting/examples/python Shows how to use the `langchain-openai` library to connect to mittwald's AI hosting. It loads environment variables, initializes `ChatOpenAI` with the custom base URL, and sends a message to the model. ```python from dotenv import load_dotenv from langchain_openai import ChatOpenAI from langchain_core.messages import HumanMessage # Load .env file load_dotenv() # Initialize client with custom host and key from environment chat = ChatOpenAI( model="Mistral-Small-3.2-24B-Instruct", base_url="https://llm.aihosting.mittwald.de/v1", temperature = 0.15 ) # Get response response = chat.invoke([ HumanMessage(content="Moin and hello!") ]) print(response.content) ``` -------------------------------- ### GET /app-installations/{appInstallationId}/status/ Source: https://developer.mittwald.de/docs/v2/reference/app/app-retrieve-status Fetches the current runtime status for a specific app installation using its ID. ```APIDOC ## GET /app-installations/{appInstallationId}/status/ ### Description Retrieves the runtime status of an app installation. ### Method GET ### Endpoint /app-installations/{appInstallationId}/status/ ### Parameters #### Path Parameters - **appInstallationId** (string) - Required - The ID of the app installation. ### Request Example ``` { "appInstallationId": "string" } ``` ### Response #### Success Response (200) - **lastExitCode** (integer) - The last exit code of the application. - **logFileLocation** (string) - The location of the log file. - **state** (string) - The current state of the app installation (one of: running, stopped, exited). - **uptimeSeconds** (number) - The uptime of the application in seconds (double). #### Response Example ```json { "lastExitCode": 123, "logFileLocation": "string", "state": "running", "uptimeSeconds": 123.45 } ``` ``` -------------------------------- ### Project API JSON Response Example Source: https://developer.mittwald.de/docs/v2/reference/project/project-get-project This is an example of a successful JSON response (200 OK) from the Project API. It includes details about backup storage, cluster information, creation timestamps, customer ID, deletion status, description, enabled status, IDs, server information, spec details, statistics, status, and supported features. ```json { "backupStorageUsageInBytes": 123, "backupStorageUsageInBytesSetAt": "2025-10-24T11:48:03.678Z", "clusterDomain": "project.host", "clusterId": "espelkamp", "createdAt": "2025-10-24T11:48:03.678Z", "customerId": "f282f1a8-2b15-4b08-9850-6788e3b20136", "deletionRequested": true, "description": "My first Project!", "directories": { "Home": "/home/p-4e7tz3" }, "disableReason": "maliciousCode", "disabledAt": "2025-10-24T11:48:03.678Z", "enabled": true, "id": "f0f86186-0a5a-45b2-aa33-502777496347", "imageRefId": "f0f86186-0a5a-45b2-aa33-502777496347", "projectHostingId": "f0f86186-0a5a-45b2-aa33-502777496347", "serverId": "f0f86186-0a5a-45b2-aa33-502777496347", "serverShortId": "string", "shortId": "s-4e7tz3", "spec": { "storage": "string", "visitors": 123 }, "statisticsBaseDomain": "pe-prod.staging.mcloud.services", "status": "pending", "statusSetAt": "2025-10-24T11:48:03.678Z", "supportedFeatures": [ "redis" ], "webStorageUsageInBytes": 123, "webStorageUsageInBytesSetAt": "2025-10-24T11:48:03.678Z" } ``` -------------------------------- ### Get Customer Membership - JavaScript SDK Example Source: https://developer.mittwald.de/docs/v2/reference/customer/customer-get-customer-membership This JavaScript code snippet shows how to fetch a customer membership using the Mittwald API client. It initializes the client with an API token, calls the getCustomerMembership method with the required customerMembershipId, and asserts that the response status is 200 OK. Ensure the @mittwald/api-client and @mittwald/api-client-commons packages are installed. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.customer.getCustomerMembership({ "customerMembershipId": "string" }); assertStatus(response, 200); ``` -------------------------------- ### Link MySQL Database to App Installation (JavaScript SDK) Source: https://developer.mittwald.de/docs/v2/reference/app/app-link-database This JavaScript example shows how to link a MySQL database to an app installation using the Mittwald API v2 client. It utilizes the `linkDatabase` method and asserts a 204 No Content response. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.app.linkDatabase({ "appInstallationId": "string", "data": { "databaseId": "f0f86186-0a5a-45b2-aa33-502777496347", "databaseUserIds": { "string": "string" }, "purpose": "primary" } }); assertStatus(response, 204); ``` -------------------------------- ### Get Unread Notification Counts - JavaScript SDK Example Source: https://developer.mittwald.de/docs/v2/reference/notification/notifications-count-unread-notifications Example demonstrating how to use the Mittwald API JavaScript SDK to get unread notification counts. It initializes the client with a token and calls the appropriate method. ```javascript import { MittwaldAPIV2Client } from "@mittwald/api-client"; import { assertStatus } from "@mittwald/api-client-commons"; const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN); const response = await client.notification.notificationsCountUnreadNotifications({}); assertStatus(response, 200); ``` -------------------------------- ### AppInstallation JSON Example Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-appinstallation This JSON object represents a typical AppInstallation, detailing its configuration, linked resources, and current status. It's used for creating or updating application installations. ```json { "appId": "f0f86186-0a5a-45b2-aa33-502777496347", "appVersion": { "current": "string", "desired": "string" }, "createdAt": "2024-09-20T22:57:32.000Z", "customDocumentRoot": "string", "deletionRequested": true, "description": "string", "disabled": true, "id": "f0f86186-0a5a-45b2-aa33-502777496347", "installationPath": "string", "linkedDatabases": [ { "databaseId": "f0f86186-0a5a-45b2-aa33-502777496347", "databaseUserIds": { "string": "string" }, "kind": "mysql", "purpose": "primary" } ], "lockedBy": { "string": "unspecified" }, "phase": "ready", "projectId": "f0f86186-0a5a-45b2-aa33-502777496347", "screenshotId": "f0f86186-0a5a-45b2-aa33-502777496347", "screenshotRef": "string", "shortId": "a-XXXXXX", "systemSoftware": [ { "systemSoftwareId": "f0f86186-0a5a-45b2-aa33-502777496347", "systemSoftwareVersion": { "current": "string", "desired": "string" }, "updatePolicy": "none" } ], "updatePolicy": "none", "userInputs": [ { "name": "string", "value": "string" } ] } ``` -------------------------------- ### Request App Installation using PHP SDK Source: https://developer.mittwald.de/docs/v2/reference/app/app-request-appinstallation This PHP snippet illustrates requesting an app installation with the Mittwald API client. It shows how to instantiate the client with a token and create a `RequestAppinstallationRequest` object containing the project ID and request body. Note that the `RequestAppinstallationRequestBody` requires specific property values to be set. ```php use \Mittwald\ApiClient\Generated\V2\Clients\App\RequestAppinstallation\RequestAppinstallationRequest; use \Mittwald\ApiClient\Generated\V2\Clients\App\RequestAppinstallation\RequestAppinstallationRequestBody; $client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN')); // TODO: Please consult the properties and constructor signature of // RequestAppinstallationRequestBody to learn how to construct a valid instance $body = new RequestAppinstallationRequestBody(/* TODO: ... */); $request = (new RequestAppinstallationRequest( projectId: "string", body: $body )); $response = $client->app()->requestAppinstallation($request); var_dump($response->getBody(); ``` -------------------------------- ### App Installation Details (GET /websites/developer_mittwald_de_v2) Source: https://developer.mittwald.de/docs/v2/reference/app/app-get-appinstallation Retrieves detailed information about a specific app installation. ```APIDOC ## GET /websites/developer_mittwald_de_v2 ### Description Retrieves detailed information about a specific app installation, including its ID, version, linked databases, system software, and deployment phase. ### Method GET ### Endpoint /websites/developer_mittwald_de_v2 ### Parameters #### Query Parameters - **id** (string) - Required - The unique identifier of the app installation. ### Response #### Success Response (200 OK) - **appId** (string) - The unique identifier of the application. - **appVersion** (object) - Details about the current and desired application version. - **current** (string) - The current version of the application. - **desired** (string) - The desired version of the application. - **createdAt** (string) - The date and time when the app installation was created. - **customDocumentRoot** (string) - The custom document root for the app. - **deletionRequested** (boolean) - Indicates if deletion has been requested for the app installation. - **description** (string) - A description of the app installation. - **disabled** (boolean) - Indicates if the app installation is disabled. - **id** (string) - The unique identifier of the app installation. - **installationPath** (string) - The path where the application is installed. - **linkedDatabases** (array of object) - A list of databases linked to the app installation. - **databaseId** (string) - The unique identifier of the linked database. - **databaseUserIds** (object) - User IDs associated with the linked database. - **kind** (string) - The type of the database (e.g., mysql, redis). - **purpose** (string) - The purpose of the linked database (e.g., primary, cache, custom). - **lockedBy** (object) - Information about why the app installation is locked. - **phase** (string) - The current phase of the app installation lifecycle (e.g., pending, installing, ready). - **projectId** (string) - The unique identifier of the project the app installation belongs to. - **screenshotId** (string) - The ID of the associated screenshot. - **screenshotRef** (string) - A reference to the screenshot. - **shortId** (string) - A short, human-readable identifier for the app installation. - **systemSoftware** (array of object) - Details about the system software installed. - **systemSoftwareId** (string) - The unique identifier of the system software. - **systemSoftwareVersion** (object) - Details about the current and desired system software version. - **current** (string) - The current version of the system software. - **desired** (string) - The desired version of the system software. - **updatePolicy** (string) - The update policy for the system software (e.g., none, inheritedFromApp). - **updatePolicy** (string) - The overall update policy for the app installation (e.g., none, patchLevel, all). - **userInputs** (array of object) - User-provided input values for the app installation. - **name** (string) - The name of the input field. - **value** (string) - The value provided for the input field. #### Response Example ```json { "appId": "f0f86186-0a5a-45b2-aa33-502777496347", "appVersion": { "current": "string", "desired": "string" }, "createdAt": "2024-09-20T22:57:32.000Z", "customDocumentRoot": "string", "deletionRequested": true, "description": "string", "disabled": true, "id": "f0f86186-0a5a-45b2-aa33-502777496347", "installationPath": "string", "linkedDatabases": [ { "databaseId": "f0f86186-0a5a-45b2-aa33-502777496347", "databaseUserIds": { "string": "string" }, "kind": "mysql", "purpose": "primary" } ], "lockedBy": { "string": "unspecified" }, "phase": "ready", "projectId": "f0f86186-0a5a-45b2-aa33-502777496347", "screenshotId": "f0f86186-0a5a-45b2-aa33-502777496347", "screenshotRef": "string", "shortId": "a-XXXXXX", "systemSoftware": [ { "systemSoftwareId": "f0f86186-0a5a-45b2-aa33-502777496347", "systemSoftwareVersion": { "current": "string", "desired": "string" }, "updatePolicy": "none" } ], "updatePolicy": "none", "userInputs": [ { "name": "string", "value": "string" } ] } ``` ```