> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/enclaive-multi-cloud-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/enclaive-multi-cloud-platform/developers/api/client-api/manage/application.md).

# Application

The "Application" section allows the management of application resources, providing endpoints for creating, deleting, updating, and retrieving application details. It also includes a "DNS" subsection for verifying correct DNS configuration during application creation.

Applications can only be created with the Kraud.Cloud provider. Only Next Cloud can be created at this time.

## Create app

<mark style="color:green;">`POST`</mark> `{{BASE_URL}}/api/apps`

Application Creation. Currently, only Next Cloud can be created.

#### Path Parameters

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| team<mark style="color:red;">\*</mark>    | String | Team ID     |
| project<mark style="color:red;">\*</mark> | String | Project ID  |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

#### Request Body

| Name                                  | Type   | Description |
| ------------------------------------- | ------ | ----------- |
| app<mark style="color:red;">\*</mark> | Object |             |

{% tabs %}
{% tab title="201: Created " %}

```json
{
    "region": {
        "datacenter": {
            "name": "berlin",
            "displayName": "Berlin"
        },
        "physicalLocation": "Germany"
    },
    "image": {
        "version": {
            "name": "nextcloud_latest",
            "displayName": "latest"
        },
        "distribution": "Nextcloud"
    },
    "status": 0,
    "urlAddress": "",
    "attestationId": "",
    "_id": "6548c71a984ffc044f8ebc41",
    "name": "kraud-cloud-nextcloud-berlin-01",
    "provider": "6548a383e2442d14b6bf968d",
    "size": "6548a383e2442d14b6bf973e",
    "price": "6548a383e2442d14b6bf96fc",
    "project": "6548a41f38406c14db33b62c",
    "team": "6548a41f38406c14db33b61e",
    "createdAt": "2023-11-06T10:59:38.121Z",
    "updatedAt": "2023-11-06T10:59:38.121Z"
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Request payload</summary>

```json
{
    "team": "6548a41f38406c14db33b61e",
    "project": "6548a41f38406c14db33b62c",
    "name": "kraud-cloud-nextcloud-berlin-01",
    "provider": "6548a383e2442d14b6bf968d",
    "cloudProvider": "6548a383e2442d14b6bf9685",
    "region": {
        "physicalLocation": "Germany",
        "datacenter": {
            "name": "berlin",
            "displayName": "Berlin"
        }
    },
    "image": {
        "distribution": "Nextcloud",
        "version": {
            "name": "nextcloud_latest",
            "displayName": "latest"
        }
    },
    "type": "nextCloud",
    "size": "6548a383e2442d14b6bf973e",
    "price": "6548a383e2442d14b6bf96fc",
    "domainName": "m4rgdmtr.1d.pt",
}
```

</details>

***

## Get apps

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/api/teams/{team}/projects/{project}/apps`

Get all active applications for a specific project.

#### Path Parameters

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| team<mark style="color:red;">\*</mark>    | String | Team ID     |
| project<mark style="color:red;">\*</mark> | String | Project ID  |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "_id": "6548d4f261cabb0308b984ee",
        "region": {
            "datacenter": {
                "name": "berlin",
                "displayName": "Berlin"
            },
            "physicalLocation": "Germany"
        },
        "image": {
            "version": {
                "name": "nextcloud_latest",
                "displayName": "latest"
            },
            "distribution": "Nextcloud"
        },
        "status": 0,
        "urlAddress": "",
        "attestationId": "",
        "name": "kraud-cloud-nextcloud-berlin-01",
        "provider": {
            "_id": "6548a383e2442d14b6bf968d",
            "type": "app",
            "isDisabled": false,
            "cloudProvider": {
                "_id": "6548a383e2442d14b6bf9685",
                "name": "Kraud.Cloud",
                "isDisabled": false
            }
        },
        "size": {
            "_id": "6548a383e2442d14b6bf973e",
            "provider": "6548a383e2442d14b6bf968d",
            "location": "berlin",
            "name": "Standart_berlin_1_1_500",
            "vCPUs": 1,
            "memoryGB": 1,
            "spaceGB": 500,
            "group": 0
        },
        "price": {
            "_id": "6548a383e2442d14b6bf96fc",
            "provider": "6548a383e2442d14b6bf968d",
            "locationName": "berlin",
            "sizeName": "Standart_berlin_1_1_500",
            "imageName": "Nextcloud",
            "pricePerHour": 0.0694,
            "pricePerMonth": 50,
            "currencyCode": "EUR",
            "createdAt": "2023-11-06T08:27:47.132Z",
            "updatedAt": "2023-11-06T08:27:47.132Z"
        },
        "owner": "6548a41138406c14db33b606",
        "project": "6548a41f38406c14db33b62c",
        "team": "6548a41f38406c14db33b61e",
        "createdAt": "2023-11-06T11:58:42.399Z",
        "updatedAt": "2023-11-06T11:58:42.399Z",
        "attestation": null
    }
]
```

{% endtab %}
{% endtabs %}

## Get app by ID

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/api/apps/{id}`

Get a specific application by unique id.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | App ID      |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "_id": "6548d4f261cabb0308b984ee",
    "region": {
        "datacenter": {
            "name": "berlin",
            "displayName": "Berlin"
        },
        "physicalLocation": "Germany"
    },
    "image": {
        "version": {
            "name": "nextcloud_latest",
            "displayName": "latest"
        },
        "distribution": "Nextcloud"
    },
    "status": 2,
    "urlAddress": "",
    "attestationId": "f7c3d3a8-8593-4516-8b77-0a72e6cce330",
    "name": "kraud-cloud-nextcloud-berlin-01",
    "provider": {
        "_id": "6548a383e2442d14b6bf968d",
        "type": "app",
        "isDisabled": false,
        "cloudProvider": {
            "_id": "6548a383e2442d14b6bf9685",
            "name": "Kraud.Cloud",
            "isDisabled": false
        }
    },
    "size": {
        "_id": "6548a383e2442d14b6bf973e",
        "provider": "6548a383e2442d14b6bf968d",
        "location": "berlin",
        "name": "Standart_berlin_1_1_500",
        "vCPUs": 1,
        "memoryGB": 1,
        "spaceGB": 500,
        "group": 0
    },
    "price": {
        "_id": "6548a383e2442d14b6bf96fc",
        "provider": "6548a383e2442d14b6bf968d",
        "locationName": "berlin",
        "sizeName": "Standart_berlin_1_1_500",
        "imageName": "Nextcloud",
        "pricePerHour": 0.0694,
        "pricePerMonth": 50,
        "currencyCode": "EUR",
        "createdAt": "2023-11-06T08:27:47.132Z",
        "updatedAt": "2023-11-06T08:27:47.132Z"
    },
    "owner": "6548a41138406c14db33b606",
    "project": {
        "_id": "6548a41f38406c14db33b62c",
        "name": "first-project",
        "description": "Update your project information under Settings",
        "environment": "Development",
        "purpose": "Just trying out Enclaive",
        "isDefault": false,
        "icon": 1,
        "owner": "6548a41138406c14db33b606",
        "team": "6548a41f38406c14db33b61e",
        "createdAt": "2023-11-06T08:30:23.552Z",
        "updatedAt": "2023-11-06T08:30:23.552Z"
    },
    "team": {
        "_id": "6548a41f38406c14db33b61e",
        "name": "My Team",
        "email": "john.doe@mail.com",
        "members": [
            {
                "user": "6548a41138406c14db33b606",
                "role": 0
            }
        ],
        "createdAt": "2023-11-06T08:30:23.529Z",
        "updatedAt": "2023-11-06T12:56:06.337Z",
        "billingSettings": "6548e2660919dc0442dc2ec7"
    },
    "createdAt": "2023-11-06T11:58:42.399Z",
    "updatedAt": "2023-11-06T12:04:48.200Z",
    "deletedAt": "2023-11-06T12:04:48.199Z"
}
```

{% endtab %}
{% endtabs %}

## Delete app by ID

<mark style="color:red;">`DELETE`</mark> `{{BASE_URL}}/api/apps/{id}`

Delete a specific application by unique id.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | App ID      |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

{% tabs %}
{% tab title="200: OK " %}

```json
{"message":"App deleted","appId":"6548d4f261cabb0308b984ee"}
```

{% endtab %}
{% endtabs %}
