# Web Cloud › Web Hosting › My sites API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 35 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/web-hosting/my-sites.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/web-hosting/my-sites.json?format=openapi3

## Operations

- `GET /hosting/web/{serviceName}/attachedDomain` — List attached domains
- `GET /hosting/web/{serviceName}/website` — List websites
- `GET /hosting/web/{serviceName}/website/{id}/deployment` — List deployments
- `GET /webhosting/resource/{name}/website` — List websites
- `GET /hosting/web/{serviceName}/attachedDomain/{domain}` — Get an attached domain
- `GET /hosting/web/attachedDomain` — Find hostings by attached domain
- `GET /hosting/web/{serviceName}/attachedDomain/{domain}/digStatus` — Get attached domain DNS status
- `GET /hosting/web/{serviceName}/attachedDomain/{domain}/ssl` — Get the SSL certificate
- `GET /hosting/web/{serviceName}/attachedDomain/{domain}/ssl/report` — Get the SSL certificate report
- `GET /hosting/web/{serviceName}/token` — Get the domain ownership token
- `GET /hosting/web/{serviceName}/vcs/webhooks` — Get VCS webhook URLs
- `GET /hosting/web/vcs/supported` — List supported VCS platforms
- `GET /hosting/web/{serviceName}/website/{id}` — Get a website
- `GET /hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}` — Get a deployment
- `GET /hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}/logs` — Get deployment logs
- `GET /hosting/web/{serviceName}/websiteCreationCapabilities` — Get website creation capabilities
- `GET /webhosting/attachedDomain` — List attached domains
- `GET /webhosting/resource/{name}/attachedDomain` — List attached domains
- `GET /webhosting/resource/{name}/website/{websiteId}` — Get a website
- `GET /webhosting/resource/{name}/website/{websiteId}/domain` — List website domains
- `POST /hosting/web/{serviceName}/attachedDomain` — Attach a domain
- `POST /hosting/web/{serviceName}/attachedDomain/{domain}/ssl` — Create a free SSL certificate
- `POST /hosting/web/{serviceName}/attachedDomain/{domain}/ssl/regenerate` — Regenerate the SSL certificate
- `POST /hosting/web/{serviceName}/attachedDomain/{domain}/purgeCache` — Purge the attached domain cache
- `POST /hosting/web/{serviceName}/attachedDomain/{domain}/restart` — Restart the attached domain virtual host
- `POST /hosting/web/{serviceName}/website` — Create a website
- `POST /hosting/web/{serviceName}/website/{id}/deploy` — Deploy a website
- `POST /webhosting/resource/{name}/website` — Create a website
- `DELETE /hosting/web/{serviceName}/attachedDomain/{domain}` — Detach a domain
- `DELETE /hosting/web/{serviceName}/attachedDomain/{domain}/ssl` — Delete the SSL certificate
- `DELETE /hosting/web/{serviceName}/website/{id}` — Delete a website
- `PUT /hosting/web/{serviceName}/attachedDomain/{domain}` — Update an attached domain
- `PUT /hosting/web/{serviceName}/attachedDomain/{domain}/ssl` — Update the SSL certificate
- `PUT /hosting/web/{serviceName}/website/{id}` — Update a website
- `PUT /webhosting/resource/{name}/website/{websiteId}` — Update a website

## List attached domains

`GET /1.0/hosting/web/{serviceName}/attachedDomain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-attacheddomain

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/get`

Returns the domains and subdomains attached to the hosting. Filter them by domain or path.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | query | string |  | Filter the value of domain property (like) |
| `path` | query | string |  | Filter the value of path property (like) |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/attachedDomain")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/attachedDomain");

print_r($result);
?>
```

## List websites

`GET /1.0/hosting/web/{serviceName}/website`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-website

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/get`

Returns the IDs of the websites of the hosting. Filter them by path.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `path` | query | string |  | Filter the value of path property |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/website")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/website");

print_r($result);
?>
```

## List deployments

`GET /1.0/hosting/web/{serviceName}/website/{id}/deployment`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-website-id-deployment

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/deployment/get`

Returns the IDs of the deployments of the website.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}/deployment" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/website/{id}/deployment")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/website/{id}/deployment");

print_r($result);
?>
```

## List websites

`GET /v2/webhosting/resource/{name}/website`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-webhosting-resource-name-website

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:website/get`

Returns the websites of the hosting.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `name` | path | string | yes | Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.Website[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.WebsiteCurrentState | read-only | Current state of the website |
| `currentState.git` | webhosting.Git | read-only | Git details of the website |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.linkedDomains` | integer | read-only | Number of domain linked to a website |
| `currentState.module` | webhosting.ModuleStatus | read-only | module status of the website |
| `currentState.module.enabled` | boolean | read-only | module enabled status |
| `currentState.name` | string | read-only | Name of the website |
| `currentState.path` | string | read-only | Path of the website |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the website |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the website |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting Website readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | webhosting.WebsiteTargetSpec | read-only | Webhosting Website target specification |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Root folder of the website |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "git": {
        "status": "CREATED",
        "vcsBranch": "string",
        "vcsUrl": "string"
      },
      "linkedDomains": 0,
      "module": {
        "enabled": true
      },
      "name": "string",
      "path": "string"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "name": "string",
      "path": "string"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/website" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/webhosting/resource/{name}/website")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/webhosting/resource/{name}/website");

print_r($result);
?>
```

## Get an attached domain

`GET /1.0/hosting/web/{serviceName}/attachedDomain/{domain}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-attacheddomain-domain

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/get`

Returns the path, CDN, firewall, SSL, IP location and status of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.attachedDomain.PublicAttachedDomain | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `capabilities` | hosting.web.attachedDomain.Capabilities[] | read-only | Provides the capabilities related to your attachedDomain |
| `capabilities[].description` | string | read-only | Capability description |
| `capabilities[].href` | string | read-only | Capability href |
| `capabilities[].key` | string | read-only | Capability key |
| `capabilities[].method` | hosting.web.attachedDomain.CapabilityMethodEnum | read-only | Capability method — one of `DELETE`, `GET`, `POST`, `PUT` |
| `cdn` | hosting.web.attachedDomain.CdnEnum | read-only | whether or not attachedDomain is linked to the hosting cdn — one of `active`, `none` |
| `domain` | string | read-only | Domain linked (fqdn) |
| `firewall` | hosting.web.attachedDomain.FirewallEnum | read-only | Firewall state for this path — one of `active`, `none` |
| `ipLocation` | hosting.web.CountryEnum | read-only | IP location of the domain linked — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `isFlushable` | boolean | read-only | Whether your CDN can be flushed |
| `ownLog` | string | read-only | Domain for separate the logs |
| `path` | string | read-only | Attached domain path |
| `runtimeId` | integer | read-only | The runtime configuration ID used on this domain |
| `ssl` | boolean | read-only | Put domain in SSL certificate |
| `status` | hosting.web.attachedDomain.StatusEnum | read-only | Domain status — one of `created`, `creating`, `deleting`, `updating` |
| `taskId` | integer | read-only | The task ID working on this domain |
| `vcsStatus` | hosting.web.attachedDomain.VcsStatusEnum | read-only | The status of the VCS synchronization — one of `created`, `creating`, `deleting`, `deploying`, `disabled`, `error`, `initialError` |

```json
{
  "capabilities": [
    {
      "description": "string",
      "href": "string",
      "key": "string",
      "method": "DELETE"
    }
  ],
  "cdn": "active",
  "domain": "string",
  "firewall": "active",
  "ipLocation": "BE",
  "isFlushable": true,
  "ownLog": "string",
  "path": "string",
  "runtimeId": 0,
  "ssl": true,
  "status": "created",
  "taskId": 0,
  "vcsStatus": "created"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/attachedDomain/{domain}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/attachedDomain/{domain}");

print_r($result);
?>
```

## Find hostings by attached domain

`GET /1.0/hosting/web/attachedDomain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-attacheddomain

**Status:** Stable production version  
**IAM actions:** `account:apiovh:webHosting/attachedDomain/get`

Returns the service names of the hostings that have the given domain attached.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | query | string | yes | Domain used into web hosting attached domains |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/attachedDomain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/attachedDomain")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/attachedDomain");

print_r($result);
?>
```

## Get attached domain DNS status

`GET /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/digStatus`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-attacheddomain-domain-digstatus

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/digStatus/get`

Returns the DNS records of the attached domain, their status and the recommended IPs to point them to.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.attachedDomain.DigStatus | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | read-only | Attached domain |
| `recommendedIps` | hosting.web.attachedDomain.RecommendedIps | read-only | Recommended IPs for DNS records configuration |
| `recommendedIps.recommendedIpV4` | ipv4[] | read-only | Recommended IPV4 |
| `recommendedIps.recommendedIpV6` | ipv6[] | read-only | Recommended IPV6 |
| `records` | object | read-only |  |

```json
{
  "domain": "string",
  "recommendedIps": {
    "recommendedIpV4": [
      "192.0.2.0"
    ],
    "recommendedIpV6": [
      "2001:41d0:1:1994::1"
    ]
  },
  "records": {
    "key": {
      "dnsConfigured": true,
      "isOvhIp": true,
      "type": "A"
    }
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/digStatus" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/attachedDomain/{domain}/digStatus")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/attachedDomain/{domain}/digStatus");

print_r($result);
?>
```

## Get the SSL certificate

`GET /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-attacheddomain-domain-ssl

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/get`

Returns the provider, type and status of the SSL certificate of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SSL | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isReportable` | boolean | read-only | If the hostedssl is currently bound to a report |
| `provider` | hosting.web.hostedssl.ProviderEnum | read-only | Provider of the Hosted SSL — one of `COMODO`, `CUSTOM`, `LETSENCRYPT`, `SECTIGO` |
| `regenerable` | boolean | read-only | Regenerable flag |
| `status` | hosting.web.hostedssl.StatusEnum | read-only | Status of the Hosted SSL — one of `created`, `creating`, `deleting`, `importing`, `regenerating` |
| `taskId` | integer | read-only | The task ID working on this Hosted SSL |
| `type` | hosting.web.hostedssl.TypeEnum | read-only | Type of the Hosted SSL — one of `CUSTOM`, `DV`, `EV` |

```json
{
  "isReportable": true,
  "provider": "COMODO",
  "regenerable": true,
  "status": "created",
  "taskId": 0,
  "type": "CUSTOM"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl");

print_r($result);
?>
```

## Get the SSL certificate report

`GET /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/report`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-attacheddomain-domain-ssl-report

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/report/get`

Returns the status of each validation check run by the certification authority for the certificate of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.ssl.Report | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `certificateSigningRequestStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | "Certificate signing request" test status done by certification authority — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |
| `domainControlValidationStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | "Domain control validation" test status done by certification authority — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |
| `organizationValidationStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | Applicant's legal status obtained or verified directly with registration agency — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |
| `phoneCallApprovalStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | Approval verified through a phone call to the contract signer — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |
| `providerOrderId` | string | read-only | The order ID from given hostedssl provider |
| `termsAndConditionsAcceptanceStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | Terms and conditions agreements acceptance — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |
| `tradeNameVerificationStatus` | hosting.web.hostedssl.ReportStatusEnum | read-only | Trade name verified directly with registration agency or through a verified third party — one of `completed`, `in-progress`, `non-completed`, `non-required`, `not-applicable`, `not-provided` |

```json
{
  "certificateSigningRequestStatus": "completed",
  "domainControlValidationStatus": "completed",
  "organizationValidationStatus": "completed",
  "phoneCallApprovalStatus": "completed",
  "providerOrderId": "string",
  "termsAndConditionsAcceptanceStatus": "completed",
  "tradeNameVerificationStatus": "completed"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/report" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/report")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/report");

print_r($result);
?>
```

## Get the domain ownership token

`GET /1.0/hosting/web/{serviceName}/token`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-token

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:token/get`

Get the domain ownership token. Returns the token that proves the ownership of an external domain. Add it in a TXT record of the ovhcontrol subdomain in the DNS zone.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string | successful operation |

```json
"string"
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/token" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/token")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/token");

print_r($result);
?>
```

## Get VCS webhook URLs

`GET /1.0/hosting/web/{serviceName}/vcs/webhooks`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-vcs-webhooks

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:vcs/webhooks/get`

Returns the webhook URL to call on push events to deploy a website. Filter it by hosting path and VCS platform.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `path` | query | string | yes | Filter on hosting path |
| `serviceName` | path | string | yes | Service name |
| `vcs` | query | hosting.web.SupportedVcsEnum | yes | Filter on VCS platform — one of `github` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.VcsWebhooks | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `push` | string | read-only | Webhook URL for push events |

```json
{
  "push": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/vcs/webhooks" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/vcs/webhooks")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/vcs/webhooks");

print_r($result);
?>
```

## List supported VCS platforms

`GET /1.0/hosting/web/vcs/supported`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-vcs-supported

**Status:** Stable production version

Returns the VCS platforms a website can be deployed from.

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SupportedVcsEnum[] | successful operation |

```json
[
  "github"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/vcs/supported" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/vcs/supported")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/vcs/supported");

print_r($result);
?>
```

## Get a website

`GET /1.0/hosting/web/{serviceName}/website/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-website-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/get`

Returns the name, path, status, domains and repository of the website.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.Website | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domains` | hosting.web.website.Domain[] | read-only | Domains of the website |
| `domains[].cdn` | boolean | read-only | If the CDN is currently active |
| `domains[].fqdn` | string | read-only | FQDN of the website domain |
| `domains[].ssl` | boolean | read-only | If the SSL is currently active |
| `hostingDisplayName` | string | read-only | Display name of the hosting |
| `hostingServiceName` | string | read-only | Name of the hosting service |
| `id` | integer | read-only | Website numeric identifier |
| `name` | string | read-only | Customizable name of the website |
| `path` | string | read-only | Relative path on the hosting filesystem the website is deployed into |
| `status` | hosting.web.website.StatusEnum | read-only | Current status of the website — one of `created`, `creating`, `deleting`, `deploying`, `error`, `initialError` |
| `vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |

```json
{
  "domains": [
    {
      "cdn": true,
      "fqdn": "string",
      "ssl": true
    }
  ],
  "hostingDisplayName": "string",
  "hostingServiceName": "string",
  "id": 0,
  "name": "string",
  "path": "string",
  "status": "created",
  "vcsBranch": "string",
  "vcsUrl": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/website/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/website/{id}");

print_r($result);
?>
```

## Get a deployment

`GET /1.0/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-website-id-deployment-deploymentid

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/deployment/get`

Returns the status, source, branch and last commit of the deployment.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `deploymentId` | path | integer | yes | Deployment ID |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.website.Deployment | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | Date of the deployment |
| `id` | integer | read-only | Deployment numeric identifier |
| `reset` | boolean | read-only | Whether a reset was requested before deploying |
| `source` | string | read-only | Source which triggered the deployment |
| `status` | hosting.web.website.deployment.StatusEnum | read-only | Current status of the deployment — one of `doing`, `failed`, `successful` |
| `vcsBranch` | string | read-only | Which branch of the repository is deployed |
| `vcsCommitId` | string | read-only | Identifier of the last commit after deployment |
| `vcsCommitMessage` | string | read-only | Message of the last commit after deployment |
| `websiteId` | integer | read-only | Website numeric identifier |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "id": 0,
  "reset": true,
  "source": "string",
  "status": "doing",
  "vcsBranch": "string",
  "vcsCommitId": "string",
  "vcsCommitMessage": "string",
  "websiteId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}");

print_r($result);
?>
```

## Get deployment logs

`GET /1.0/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}/logs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-website-id-deployment-deploymentid-logs

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/deployment/logs/get`

Returns the dated log messages of the deployment.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `deploymentId` | path | integer | yes | Deployment ID |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.website.deployment.LogsMessage[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | Date of the message |
| `message` | string | read-only | Content of the message |

```json
[
  {
    "date": "2024-01-01T12:00:00Z",
    "message": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}/logs" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}/logs")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/website/{id}/deployment/{deploymentId}/logs");

print_r($result);
?>
```

## Get website creation capabilities

`GET /1.0/hosting/web/{serviceName}/websiteCreationCapabilities`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-hosting-web-servicename-websitecreationcapabilities

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:websiteCreationCapabilities/get`

Returns the number of existing websites and the number allowed by the offer, then the same for the websites deployed from a Git repository, -1 meaning unlimited.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.WebsiteCreationCapabilities | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowedVcsWebsites` | integer | read-only | Number of websites deployed from a Git repository allowed by your hosting offer, -1 meaning unlimited |
| `allowedWebsites` | integer | read-only | Number of websites allowed by your hosting offer, Git-deployed or not, -1 meaning unlimited |
| `existingVcsWebsites` | integer | read-only | Number of existing websites deployed from a Git repository on your hosting |
| `existingWebsites` | integer | read-only | Number of existing websites on your hosting, Git-deployed or not |

```json
{
  "allowedVcsWebsites": 0,
  "allowedWebsites": 0,
  "existingVcsWebsites": 0,
  "existingWebsites": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/websiteCreationCapabilities" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/hosting/web/{serviceName}/websiteCreationCapabilities")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/hosting/web/{serviceName}/websiteCreationCapabilities");

print_r($result);
?>
```

## List attached domains

`GET /v2/webhosting/attachedDomain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-webhosting-attacheddomain

**Status:** Beta version  
**IAM actions:** `account:apiovh:webHosting/attachedDomain/get`

Returns the domains attached to all the web hostings of the account. Filter them by name with the domain parameter.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `domain` | query | string |  | Optional query param to only filter domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.AttachedDomain[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.AttachedDomainCurrentState | read-only | Current state of the attached domain |
| `currentState.cdn` | webhosting.CdnStatus | read-only | CDN related to the attached domain |
| `currentState.cdn.status` | webhosting.CdnStatusEnum | yes | CDN status — one of `ACTIVE`, `NONE` |
| `currentState.firewall` | webhosting.FirewallStatus | read-only | Firewall of the attached domain |
| `currentState.firewall.status` | webhosting.FirewallStatusEnum | yes | Firewall status — one of `ACTIVE`, `NONE` |
| `currentState.fqdn` | string | read-only | FQDN of the attached domain |
| `currentState.git` | webhosting.Git | read-only | Git details of the attached domain |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.hosting` | webhosting.AttachedDomainHosting | read-only | Hosting details of the attached domain |
| `currentState.hosting.boostOffer` | string | read-only | Boost offer of the hosting related to the attached domain |
| `currentState.hosting.displayName` | string | read-only | Display name of the hosting related to the attached domain |
| `currentState.hosting.offer` | string | read-only | Offer of the hosting related to the attached domain |
| `currentState.hosting.serviceName` | string | read-only | Service name of the hosting related to the attached domain |
| `currentState.isDefault` | boolean | read-only | Default attached domain can't be updated and can't support SSL |
| `currentState.ownLog` | string | read-only | Domain to separate the logs from the others attached domains |
| `currentState.path` | string | read-only | Path of the attached domain |
| `currentState.ssl` | webhosting.AttachedDomainSsl | read-only | SSL details |
| `currentState.ssl.status` | webhosting.SslStatusEnum | read-only | SSL status — one of `ACTIVE`, `NONE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the attached domain |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the attached domain |
| `ipLocation` | webhosting.IpLocationCountryEnum | read-only | IP Location for the attached domain — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting attached domain readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "cdn": {
        "status": "ACTIVE"
      },
      "firewall": {
        "status": "ACTIVE"
      },
      "fqdn": "string",
      "git": {
        "status": "CREATED",
        "vcsBranch": "string",
        "vcsUrl": "string"
      },
      "hosting": {
        "boostOffer": "string",
        "displayName": "string",
        "offer": "string",
        "serviceName": "string"
      },
      "isDefault": true,
      "ownLog": "string",
      "path": "string",
      "ssl": {
        "status": "ACTIVE"
      }
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "ipLocation": "BE",
    "resourceStatus": "CREATING"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/webhosting/attachedDomain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/webhosting/attachedDomain")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/webhosting/attachedDomain");

print_r($result);
?>
```

## List attached domains

`GET /v2/webhosting/resource/{name}/attachedDomain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-webhosting-resource-name-attacheddomain

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:attachedDomain/get`

Returns the domains attached to the hosting, with their path and their SSL, CDN, firewall and Git settings.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `name` | path | string | yes | Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.AttachedDomain[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.AttachedDomainCurrentState | read-only | Current state of the attached domain |
| `currentState.cdn` | webhosting.CdnStatus | read-only | CDN related to the attached domain |
| `currentState.cdn.status` | webhosting.CdnStatusEnum | yes | CDN status — one of `ACTIVE`, `NONE` |
| `currentState.firewall` | webhosting.FirewallStatus | read-only | Firewall of the attached domain |
| `currentState.firewall.status` | webhosting.FirewallStatusEnum | yes | Firewall status — one of `ACTIVE`, `NONE` |
| `currentState.fqdn` | string | read-only | FQDN of the attached domain |
| `currentState.git` | webhosting.Git | read-only | Git details of the attached domain |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.hosting` | webhosting.AttachedDomainHosting | read-only | Hosting details of the attached domain |
| `currentState.hosting.boostOffer` | string | read-only | Boost offer of the hosting related to the attached domain |
| `currentState.hosting.displayName` | string | read-only | Display name of the hosting related to the attached domain |
| `currentState.hosting.offer` | string | read-only | Offer of the hosting related to the attached domain |
| `currentState.hosting.serviceName` | string | read-only | Service name of the hosting related to the attached domain |
| `currentState.isDefault` | boolean | read-only | Default attached domain can't be updated and can't support SSL |
| `currentState.ownLog` | string | read-only | Domain to separate the logs from the others attached domains |
| `currentState.path` | string | read-only | Path of the attached domain |
| `currentState.ssl` | webhosting.AttachedDomainSsl | read-only | SSL details |
| `currentState.ssl.status` | webhosting.SslStatusEnum | read-only | SSL status — one of `ACTIVE`, `NONE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the attached domain |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the attached domain |
| `ipLocation` | webhosting.IpLocationCountryEnum | read-only | IP Location for the attached domain — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting attached domain readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "cdn": {
        "status": "ACTIVE"
      },
      "firewall": {
        "status": "ACTIVE"
      },
      "fqdn": "string",
      "git": {
        "status": "CREATED",
        "vcsBranch": "string",
        "vcsUrl": "string"
      },
      "hosting": {
        "boostOffer": "string",
        "displayName": "string",
        "offer": "string",
        "serviceName": "string"
      },
      "isDefault": true,
      "ownLog": "string",
      "path": "string",
      "ssl": {
        "status": "ACTIVE"
      }
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "ipLocation": "BE",
    "resourceStatus": "CREATING"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/attachedDomain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/webhosting/resource/{name}/attachedDomain")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/webhosting/resource/{name}/attachedDomain");

print_r($result);
?>
```

## Get a website

`GET /v2/webhosting/resource/{name}/website/{websiteId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-webhosting-resource-name-website-websiteid

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:website/get`

Returns the website name, root folder, number of linked domains and its Git and module status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Name |
| `websiteId` | path | string (uuid) | yes | Website ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.Website | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.WebsiteCurrentState | read-only | Current state of the website |
| `currentState.git` | webhosting.Git | read-only | Git details of the website |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.linkedDomains` | integer | read-only | Number of domain linked to a website |
| `currentState.module` | webhosting.ModuleStatus | read-only | module status of the website |
| `currentState.module.enabled` | boolean | read-only | module enabled status |
| `currentState.name` | string | read-only | Name of the website |
| `currentState.path` | string | read-only | Path of the website |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the website |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the website |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting Website readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | webhosting.WebsiteTargetSpec | read-only | Webhosting Website target specification |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Root folder of the website |

```json
{
  "checksum": "string",
  "currentState": {
    "git": {
      "status": "CREATED",
      "vcsBranch": "string",
      "vcsUrl": "string"
    },
    "linkedDomains": 0,
    "module": {
      "enabled": true
    },
    "name": "string",
    "path": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string",
    "path": "string"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/website/{websiteId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/webhosting/resource/{name}/website/{websiteId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/webhosting/resource/{name}/website/{websiteId}");

print_r($result);
?>
```

## List website domains

`GET /v2/webhosting/resource/{name}/website/{websiteId}/domain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#get-webhosting-resource-name-website-websiteid-domain

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:website/domain/get`

Returns the domains linked to the website, with their path, CDN and firewall status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `name` | path | string | yes | Name |
| `websiteId` | path | string (uuid) | yes | Website ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.Domain[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.DomainCurrentState | read-only | Current state of the domain |
| `currentState.cdn` | webhosting.CdnStatus | read-only | CDN status for domain |
| `currentState.cdn.status` | webhosting.CdnStatusEnum | yes | CDN status — one of `ACTIVE`, `NONE` |
| `currentState.firewall` | webhosting.FirewallStatus | read-only | Firewall status for domain |
| `currentState.firewall.status` | webhosting.FirewallStatusEnum | yes | Firewall status — one of `ACTIVE`, `NONE` |
| `currentState.fqdn` | string | read-only | FQDN of the domain |
| `currentState.path` | string | read-only | Target specification of the domain path |
| `currentState.ssl` | webhosting.AttachedDomainSsl | read-only | SSL details |
| `currentState.ssl.status` | webhosting.SslStatusEnum | read-only | SSL status — one of `ACTIVE`, `NONE` |
| `currentState.websiteId` | string | read-only | Unique identifier of the website the domain belongs to |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the website's domain |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the domain |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting Domain readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "cdn": {
        "status": "ACTIVE"
      },
      "firewall": {
        "status": "ACTIVE"
      },
      "fqdn": "string",
      "path": "string",
      "ssl": {
        "status": "ACTIVE"
      },
      "websiteId": "string"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "string",
    "resourceStatus": "CREATING"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/website/{websiteId}/domain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/webhosting/resource/{name}/website/{websiteId}/domain")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/webhosting/resource/{name}/website/{websiteId}/domain");

print_r($result);
?>
```

## Attach a domain

`POST /1.0/hosting/web/{serviceName}/attachedDomain`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-attacheddomain

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/create`

Attaches a domain to a folder of the hosting, with its CDN, firewall, SSL and IP location settings, and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.AttachedDomain`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bypassDNSConfiguration` | boolean |  | If set to true, DNS zone will not be updated by the operation |
| `cdn` | hosting.web.attachedDomain.CdnEnum |  | Whether the attached domain is linked to the hosting CDN — one of `active`, `none` |
| `domain` | string |  | Domain to link |
| `firewall` | hosting.web.attachedDomain.FirewallEnum |  | Whether the firewall is active for this domain — one of `active`, `none` |
| `ipLocation` | hosting.web.CountryEnum |  | Change attached domain's DNS to the IP of the country — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `ownLog` | string |  | Domain to separate the logs on |
| `path` | string |  | Path of the attached domain |
| `runtimeId` | integer |  | The runtime configuration ID used on this domain |
| `ssl` | boolean |  | Whether to put the attached domain in the SSL certificate |

```json
{
  "bypassDNSConfiguration": true,
  "cdn": "active",
  "domain": "string",
  "firewall": "active",
  "ipLocation": "BE",
  "ownLog": "string",
  "path": "string",
  "runtimeId": 0,
  "ssl": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.PublicTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Done date |
| `function` | hosting.web.task.FunctionEnum | read-only | Task function — one of `abuse/close`, `abuse/create`, `abuse/create/web`, `abuse/delete/web`, `abuse/update`, `abuse/update/web`, `agora/AnycastUpdateReference`, `agora/DnsAddonUpdateReference`, `agora/DnsUpdateReference`, `agora/updateReference`, `attachedDomain/create`, `attachedDomain/delete`, … |
| `id` | integer | read-only | Task's id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `objectId` | string | read-only | Task object id |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Start date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "abuse/close",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.AttachedDomain
result = client.post("/hosting/web/{serviceName}/attachedDomain",
	bypassDNSConfiguration = None, # If set to true, DNS zone will not be updated by the operation (type: boolean, nullable)
	cdn = None, # Whether the attached domain is linked to the hosting CDN (type: hosting.web.attachedDomain.CdnEnum, nullable)
	domain = None, # Domain to link (type: string, nullable)
	firewall = None, # Whether the firewall is active for this domain (type: hosting.web.attachedDomain.FirewallEnum, nullable)
	ipLocation = None, # Change attached domain's DNS to the IP of the country (type: hosting.web.CountryEnum, nullable)
	ownLog = None, # Domain to separate the logs on (type: string, nullable)
	path = None, # Path of the attached domain (type: string, nullable)
	runtimeId = None, # The runtime configuration ID used on this domain (type: integer, nullable)
	ssl = None, # Whether to put the attached domain in the SSL certificate (type: boolean, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.AttachedDomain
$result = $ovh->post("/hosting/web/{serviceName}/attachedDomain", array(
	bypassDNSConfiguration => null, // If set to true, DNS zone will not be updated by the operation (type: boolean, nullable)
	cdn => null, // Whether the attached domain is linked to the hosting CDN (type: hosting.web.attachedDomain.CdnEnum, nullable)
	domain => null, // Domain to link (type: string, nullable)
	firewall => null, // Whether the firewall is active for this domain (type: hosting.web.attachedDomain.FirewallEnum, nullable)
	ipLocation => null, // Change attached domain's DNS to the IP of the country (type: hosting.web.CountryEnum, nullable)
	ownLog => null, // Domain to separate the logs on (type: string, nullable)
	path => null, // Path of the attached domain (type: string, nullable)
	runtimeId => null, // The runtime configuration ID used on this domain (type: integer, nullable)
	ssl => null, // Whether to put the attached domain in the SSL certificate (type: boolean, nullable)
));

print_r($result);
?>
```

## Create a free SSL certificate

`POST /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-attacheddomain-domain-ssl

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/create`

Creates the free Let's Encrypt SSL certificate of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SSL | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isReportable` | boolean | read-only | If the hostedssl is currently bound to a report |
| `provider` | hosting.web.hostedssl.ProviderEnum | read-only | Provider of the Hosted SSL — one of `COMODO`, `CUSTOM`, `LETSENCRYPT`, `SECTIGO` |
| `regenerable` | boolean | read-only | Regenerable flag |
| `status` | hosting.web.hostedssl.StatusEnum | read-only | Status of the Hosted SSL — one of `created`, `creating`, `deleting`, `importing`, `regenerating` |
| `taskId` | integer | read-only | The task ID working on this Hosted SSL |
| `type` | hosting.web.hostedssl.TypeEnum | read-only | Type of the Hosted SSL — one of `CUSTOM`, `DV`, `EV` |

```json
{
  "isReportable": true,
  "provider": "COMODO",
  "regenerable": true,
  "status": "created",
  "taskId": 0,
  "type": "CUSTOM"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl");

print_r($result);
?>
```

## Regenerate the SSL certificate

`POST /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/regenerate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-attacheddomain-domain-ssl-regenerate

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/regenerate`

Regenerates the SSL certificate of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SSL | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isReportable` | boolean | read-only | If the hostedssl is currently bound to a report |
| `provider` | hosting.web.hostedssl.ProviderEnum | read-only | Provider of the Hosted SSL — one of `COMODO`, `CUSTOM`, `LETSENCRYPT`, `SECTIGO` |
| `regenerable` | boolean | read-only | Regenerable flag |
| `status` | hosting.web.hostedssl.StatusEnum | read-only | Status of the Hosted SSL — one of `created`, `creating`, `deleting`, `importing`, `regenerating` |
| `taskId` | integer | read-only | The task ID working on this Hosted SSL |
| `type` | hosting.web.hostedssl.TypeEnum | read-only | Type of the Hosted SSL — one of `CUSTOM`, `DV`, `EV` |

```json
{
  "isReportable": true,
  "provider": "COMODO",
  "regenerable": true,
  "status": "created",
  "taskId": 0,
  "type": "CUSTOM"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/regenerate" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/regenerate")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl/regenerate");

print_r($result);
?>
```

## Purge the attached domain cache

`POST /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/purgeCache`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-attacheddomain-domain-purgecache

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/purgeCache`

Purge the attached domain cache. Purges the CDN cache of the attached domain and returns the task. Available when isFlushable is true on the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain linked (fqdn) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/purgeCache" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/hosting/web/{serviceName}/attachedDomain/{domain}/purgeCache")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/hosting/web/{serviceName}/attachedDomain/{domain}/purgeCache");

print_r($result);
?>
```

## Restart the attached domain virtual host

`POST /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/restart`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-attacheddomain-domain-restart

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/restart`

Restart the attached domain virtual host. Restarts the virtual host serving the attached domain and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain linked (fqdn) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/restart" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/hosting/web/{serviceName}/attachedDomain/{domain}/restart")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/hosting/web/{serviceName}/attachedDomain/{domain}/restart");

print_r($result);
?>
```

## Create a website

`POST /1.0/hosting/web/{serviceName}/website`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-website

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/create`

Creates a website in a folder of the hosting, deployed from a repository branch, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.website.CreationRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `path` | string | yes | Relative path on the hosting filesystem the website will be deployed into |
| `vcsBranch` | string | yes | Branch of the repository containing the website source code to deploy |
| `vcsUrl` | string | yes | Clone URL of the repository containing the website source code to deploy |

```json
{
  "path": "string",
  "vcsBranch": "string",
  "vcsUrl": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.PublicTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Done date |
| `function` | hosting.web.task.FunctionEnum | read-only | Task function — one of `abuse/close`, `abuse/create`, `abuse/create/web`, `abuse/delete/web`, `abuse/update`, `abuse/update/web`, `agora/AnycastUpdateReference`, `agora/DnsAddonUpdateReference`, `agora/DnsUpdateReference`, `agora/updateReference`, `attachedDomain/create`, `attachedDomain/delete`, … |
| `id` | integer | read-only | Task's id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `objectId` | string | read-only | Task object id |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Start date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "abuse/close",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.website.CreationRequest
result = client.post("/hosting/web/{serviceName}/website",
	path = None, # Relative path on the hosting filesystem the website will be deployed into (type: string)
	vcsBranch = None, # Branch of the repository containing the website source code to deploy (type: string)
	vcsUrl = None, # Clone URL of the repository containing the website source code to deploy (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.website.CreationRequest
$result = $ovh->post("/hosting/web/{serviceName}/website", array(
	path => null, // Relative path on the hosting filesystem the website will be deployed into (type: string)
	vcsBranch => null, // Branch of the repository containing the website source code to deploy (type: string)
	vcsUrl => null, // Clone URL of the repository containing the website source code to deploy (type: string)
));

print_r($result);
?>
```

## Deploy a website

`POST /1.0/hosting/web/{serviceName}/website/{id}/deploy`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-hosting-web-servicename-website-id-deploy

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/deploy`

Deploys the website from its repository branch and returns the task. Set reset to true to reset the website files before deploying.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.website.DeploymentRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `reset` | boolean |  | Whether a reset was requested before deploying |

```json
{
  "reset": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.PublicTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Done date |
| `function` | hosting.web.task.FunctionEnum | read-only | Task function — one of `abuse/close`, `abuse/create`, `abuse/create/web`, `abuse/delete/web`, `abuse/update`, `abuse/update/web`, `agora/AnycastUpdateReference`, `agora/DnsAddonUpdateReference`, `agora/DnsUpdateReference`, `agora/updateReference`, `attachedDomain/create`, `attachedDomain/delete`, … |
| `id` | integer | read-only | Task's id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `objectId` | string | read-only | Task object id |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Start date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "abuse/close",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}/deploy" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.website.DeploymentRequest
result = client.post("/hosting/web/{serviceName}/website/{id}/deploy",
	reset = None, # Whether a reset was requested before deploying (type: boolean)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.website.DeploymentRequest
$result = $ovh->post("/hosting/web/{serviceName}/website/{id}/deploy", array(
	reset => null, // Whether a reset was requested before deploying (type: boolean)
));

print_r($result);
?>
```

## Create a website

`POST /v2/webhosting/resource/{name}/website`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#post-webhosting-resource-name-website

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:website/create`

Creates a website on a domain, with its root folder, and can install a WordPress, Joomla, Drupal or PrestaShop module. Creation is asynchronous: follow resourceStatus until READY. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Name |

### Request body (required)

Type: `webhosting.WebsitePostPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | webhosting.WebsitePostTargetSpec | yes | Target specification of the website |
| `targetSpec.adminConfiguration` | webhosting.ModuleAdminConfiguration |  | Configuration of the admin account for module installation |
| `targetSpec.adminConfiguration.adminLogin` | string | yes | Administrator username for accessing the module backend |
| `targetSpec.adminConfiguration.adminPassword` | string | yes | Password for the module administrator account |
| `targetSpec.adminConfiguration.domain` | string | yes | Domain name on which the module will be installed |
| `targetSpec.adminConfiguration.installPath` | string |  | Directory path where the module will be installed inside the hosting |
| `targetSpec.adminConfiguration.language` | webhosting.ModuleLanguageEnum | yes | Language selected for module installation — one of `cz`, `de`, `en`, `es`, `fi`, `fr`, `it`, `lt`, `nl`, `pl`, `pt` |
| `targetSpec.bypassDNSConfiguration` | boolean |  | If set to true, DNS zone will not be updated by the operation |
| `targetSpec.cdn` | webhosting.CdnStatus |  | CDN related to the domain |
| `targetSpec.cdn.status` | webhosting.CdnStatusEnum | yes | CDN status — one of `ACTIVE`, `NONE` |
| `targetSpec.databaseConfiguration` | webhosting.DatabaseConfiguration |  | Configuration of the database for module installation |
| `targetSpec.databaseConfiguration.databaseName` | string | yes | Name of the database to use during the module installation |
| `targetSpec.databaseConfiguration.password` | string | yes | Database password used for authentication |
| `targetSpec.databaseConfiguration.port` | integer | yes | Port used to connect to the database server |
| `targetSpec.databaseConfiguration.server` | string | yes | Hostname or address of the database server, for example mydb.mysql.db |
| `targetSpec.databaseConfiguration.user` | string | yes | Database username used for authentication |
| `targetSpec.firewall` | webhosting.FirewallStatus |  | Firewall of the domain |
| `targetSpec.firewall.status` | webhosting.FirewallStatusEnum | yes | Firewall status — one of `ACTIVE`, `NONE` |
| `targetSpec.fqdn` | string | yes | FQDN of the domain |
| `targetSpec.ipLocation` | webhosting.IpLocationCountryEnum |  | Change domain's DNS to the IP of the country — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `targetSpec.module` | webhosting.Module |  | Type of module to install on the domain |
| `targetSpec.module.name` | webhosting.ModuleNameEnum | yes | Module name — one of `DRUPAL`, `JOOMLA`, `PRESTASHOP`, `WORDPRESS` |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Path of the domain |

```json
{
  "targetSpec": {
    "adminConfiguration": {
      "adminLogin": "string",
      "adminPassword": "string",
      "domain": "string",
      "installPath": "string",
      "language": "cz"
    },
    "bypassDNSConfiguration": true,
    "cdn": {
      "status": "ACTIVE"
    },
    "databaseConfiguration": {
      "databaseName": "string",
      "password": "string",
      "port": 0,
      "server": "string",
      "user": "string"
    },
    "firewall": {
      "status": "ACTIVE"
    },
    "fqdn": "string",
    "ipLocation": "BE",
    "module": {
      "name": "DRUPAL"
    },
    "name": "string",
    "path": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.Website | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.WebsiteCurrentState | read-only | Current state of the website |
| `currentState.git` | webhosting.Git | read-only | Git details of the website |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.linkedDomains` | integer | read-only | Number of domain linked to a website |
| `currentState.module` | webhosting.ModuleStatus | read-only | module status of the website |
| `currentState.module.enabled` | boolean | read-only | module enabled status |
| `currentState.name` | string | read-only | Name of the website |
| `currentState.path` | string | read-only | Path of the website |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the website |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the website |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting Website readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | webhosting.WebsiteTargetSpec | read-only | Webhosting Website target specification |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Root folder of the website |

```json
{
  "checksum": "string",
  "currentState": {
    "git": {
      "status": "CREATED",
      "vcsBranch": "string",
      "vcsUrl": "string"
    },
    "linkedDomains": 0,
    "module": {
      "enabled": true
    },
    "name": "string",
    "path": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string",
    "path": "string"
  }
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/website" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: webhosting.WebsitePostPayload
result = client.post("/v2/webhosting/resource/{name}/website",
	targetSpec = None, # Target specification of the website (type: webhosting.WebsitePostTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: webhosting.WebsitePostPayload
$result = $ovh->post("/v2/webhosting/resource/{name}/website", array(
	targetSpec => null, // Target specification of the website (type: webhosting.WebsitePostTargetSpec)
));

print_r($result);
?>
```

## Detach a domain

`DELETE /1.0/hosting/web/{serviceName}/attachedDomain/{domain}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#delete-hosting-web-servicename-attacheddomain-domain

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/delete`

Detaches the domain from the hosting and returns the task. Set bypassDNSConfiguration to true to leave the DNS zone unchanged.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bypassDNSConfiguration` | query | boolean |  | If set to true, DNS zone will not be updated by the operation |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.PublicTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Done date |
| `function` | hosting.web.task.FunctionEnum | read-only | Task function — one of `abuse/close`, `abuse/create`, `abuse/create/web`, `abuse/delete/web`, `abuse/update`, `abuse/update/web`, `agora/AnycastUpdateReference`, `agora/DnsAddonUpdateReference`, `agora/DnsUpdateReference`, `agora/updateReference`, `attachedDomain/create`, `attachedDomain/delete`, … |
| `id` | integer | read-only | Task's id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `objectId` | string | read-only | Task object id |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Start date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "abuse/close",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/hosting/web/{serviceName}/attachedDomain/{domain}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/hosting/web/{serviceName}/attachedDomain/{domain}");

print_r($result);
?>
```

## Delete the SSL certificate

`DELETE /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#delete-hosting-web-servicename-attacheddomain-domain-ssl

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/delete`

Deletes the SSL certificate of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SSL | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isReportable` | boolean | read-only | If the hostedssl is currently bound to a report |
| `provider` | hosting.web.hostedssl.ProviderEnum | read-only | Provider of the Hosted SSL — one of `COMODO`, `CUSTOM`, `LETSENCRYPT`, `SECTIGO` |
| `regenerable` | boolean | read-only | Regenerable flag |
| `status` | hosting.web.hostedssl.StatusEnum | read-only | Status of the Hosted SSL — one of `created`, `creating`, `deleting`, `importing`, `regenerating` |
| `taskId` | integer | read-only | The task ID working on this Hosted SSL |
| `type` | hosting.web.hostedssl.TypeEnum | read-only | Type of the Hosted SSL — one of `CUSTOM`, `DV`, `EV` |

```json
{
  "isReportable": true,
  "provider": "COMODO",
  "regenerable": true,
  "status": "created",
  "taskId": 0,
  "type": "CUSTOM"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl");

print_r($result);
?>
```

## Delete a website

`DELETE /1.0/hosting/web/{serviceName}/website/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#delete-hosting-web-servicename-website-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/delete`

Deletes the website and returns the task. Set deleteFiles to true to also empty the website folder.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `deleteFiles` | query | boolean | yes | Whether the website path should be emptied or not |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.PublicTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Done date |
| `function` | hosting.web.task.FunctionEnum | read-only | Task function — one of `abuse/close`, `abuse/create`, `abuse/create/web`, `abuse/delete/web`, `abuse/update`, `abuse/update/web`, `agora/AnycastUpdateReference`, `agora/DnsAddonUpdateReference`, `agora/DnsUpdateReference`, `agora/updateReference`, `attachedDomain/create`, `attachedDomain/delete`, … |
| `id` | integer | read-only | Task's id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `objectId` | string | read-only | Task object id |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Start date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "abuse/close",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/hosting/web/{serviceName}/website/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/hosting/web/{serviceName}/website/{id}");

print_r($result);
?>
```

## Update an attached domain

`PUT /1.0/hosting/web/{serviceName}/attachedDomain/{domain}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#put-hosting-web-servicename-attacheddomain-domain

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:attachedDomain/edit`

Updates the path, CDN, firewall, SSL, IP location or log domain of the attached domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.AttachedDomain`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bypassDNSConfiguration` | boolean |  | If set to true, DNS zone will not be updated by the operation |
| `cdn` | hosting.web.attachedDomain.CdnEnum |  | Whether the attached domain is linked to the hosting CDN — one of `active`, `none` |
| `domain` | string |  | Domain to link |
| `firewall` | hosting.web.attachedDomain.FirewallEnum |  | Whether the firewall is active for this domain — one of `active`, `none` |
| `ipLocation` | hosting.web.CountryEnum |  | Change attached domain's DNS to the IP of the country — one of `BE`, `CA`, `CZ`, `DE`, `ES`, `FI`, `FR`, `IE`, `IT`, `LT`, `NL`, `PL`, … |
| `ownLog` | string |  | Domain to separate the logs on |
| `path` | string |  | Path of the attached domain |
| `runtimeId` | integer |  | The runtime configuration ID used on this domain |
| `ssl` | boolean |  | Whether to put the attached domain in the SSL certificate |

```json
{
  "bypassDNSConfiguration": true,
  "cdn": "active",
  "domain": "string",
  "firewall": "active",
  "ipLocation": "BE",
  "ownLog": "string",
  "path": "string",
  "runtimeId": 0,
  "ssl": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.AttachedDomain
result = client.put("/hosting/web/{serviceName}/attachedDomain/{domain}",
	bypassDNSConfiguration = None, # If set to true, DNS zone will not be updated by the operation (type: boolean, nullable)
	cdn = None, # Whether the attached domain is linked to the hosting CDN (type: hosting.web.attachedDomain.CdnEnum, nullable)
	domain = None, # Domain to link (type: string, nullable)
	firewall = None, # Whether the firewall is active for this domain (type: hosting.web.attachedDomain.FirewallEnum, nullable)
	ipLocation = None, # Change attached domain's DNS to the IP of the country (type: hosting.web.CountryEnum, nullable)
	ownLog = None, # Domain to separate the logs on (type: string, nullable)
	path = None, # Path of the attached domain (type: string, nullable)
	runtimeId = None, # The runtime configuration ID used on this domain (type: integer, nullable)
	ssl = None, # Whether to put the attached domain in the SSL certificate (type: boolean, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.AttachedDomain
$result = $ovh->put("/hosting/web/{serviceName}/attachedDomain/{domain}", array(
	bypassDNSConfiguration => null, // If set to true, DNS zone will not be updated by the operation (type: boolean, nullable)
	cdn => null, // Whether the attached domain is linked to the hosting CDN (type: hosting.web.attachedDomain.CdnEnum, nullable)
	domain => null, // Domain to link (type: string, nullable)
	firewall => null, // Whether the firewall is active for this domain (type: hosting.web.attachedDomain.FirewallEnum, nullable)
	ipLocation => null, // Change attached domain's DNS to the IP of the country (type: hosting.web.CountryEnum, nullable)
	ownLog => null, // Domain to separate the logs on (type: string, nullable)
	path => null, // Path of the attached domain (type: string, nullable)
	runtimeId => null, // The runtime configuration ID used on this domain (type: integer, nullable)
	ssl => null, // Whether to put the attached domain in the SSL certificate (type: boolean, nullable)
));

print_r($result);
?>
```

## Update the SSL certificate

`PUT /1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#put-hosting-web-servicename-attacheddomain-domain-ssl

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:ssl/edit`

Updates the SSL certificate of the attached domain. Set regenerate to true to regenerate it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Domain |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.SSLUpdateInput`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `regenerate` | boolean |  | true to regenerate the certificate |

```json
{
  "regenerate": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.SSL | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isReportable` | boolean | read-only | If the hostedssl is currently bound to a report |
| `provider` | hosting.web.hostedssl.ProviderEnum | read-only | Provider of the Hosted SSL — one of `COMODO`, `CUSTOM`, `LETSENCRYPT`, `SECTIGO` |
| `regenerable` | boolean | read-only | Regenerable flag |
| `status` | hosting.web.hostedssl.StatusEnum | read-only | Status of the Hosted SSL — one of `created`, `creating`, `deleting`, `importing`, `regenerating` |
| `taskId` | integer | read-only | The task ID working on this Hosted SSL |
| `type` | hosting.web.hostedssl.TypeEnum | read-only | Type of the Hosted SSL — one of `CUSTOM`, `DV`, `EV` |

```json
{
  "isReportable": true,
  "provider": "COMODO",
  "regenerable": true,
  "status": "created",
  "taskId": 0,
  "type": "CUSTOM"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/attachedDomain/{domain}/ssl" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.SSLUpdateInput
result = client.put("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl",
	regenerate = None, # true to regenerate the certificate (type: boolean)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.SSLUpdateInput
$result = $ovh->put("/hosting/web/{serviceName}/attachedDomain/{domain}/ssl", array(
	regenerate => null, // true to regenerate the certificate (type: boolean)
));

print_r($result);
?>
```

## Update a website

`PUT /1.0/hosting/web/{serviceName}/website/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#put-hosting-web-servicename-website-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:website/edit`

Updates the repository branch deployed on the website.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `hosting.web.website.Update`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `vcsBranch` | string |  | Branch of the repository containing the website source code to deploy |

```json
{
  "vcsBranch": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.Website | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domains` | hosting.web.website.Domain[] | read-only | Domains of the website |
| `domains[].cdn` | boolean | read-only | If the CDN is currently active |
| `domains[].fqdn` | string | read-only | FQDN of the website domain |
| `domains[].ssl` | boolean | read-only | If the SSL is currently active |
| `hostingDisplayName` | string | read-only | Display name of the hosting |
| `hostingServiceName` | string | read-only | Name of the hosting service |
| `id` | integer | read-only | Website numeric identifier |
| `name` | string | read-only | Customizable name of the website |
| `path` | string | read-only | Relative path on the hosting filesystem the website is deployed into |
| `status` | hosting.web.website.StatusEnum | read-only | Current status of the website — one of `created`, `creating`, `deleting`, `deploying`, `error`, `initialError` |
| `vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |

```json
{
  "domains": [
    {
      "cdn": true,
      "fqdn": "string",
      "ssl": true
    }
  ],
  "hostingDisplayName": "string",
  "hostingServiceName": "string",
  "id": 0,
  "name": "string",
  "path": "string",
  "status": "created",
  "vcsBranch": "string",
  "vcsUrl": "string"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/website/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: hosting.web.website.Update
result = client.put("/hosting/web/{serviceName}/website/{id}",
	vcsBranch = None, # Branch of the repository containing the website source code to deploy (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: hosting.web.website.Update
$result = $ovh->put("/hosting/web/{serviceName}/website/{id}", array(
	vcsBranch => null, // Branch of the repository containing the website source code to deploy (type: string, nullable)
));

print_r($result);
?>
```

## Update a website

`PUT /v2/webhosting/resource/{name}/website/{websiteId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/my-sites/#put-webhosting-resource-name-website-websiteid

**Status:** Beta version  
**IAM actions:** `webHosting:apiovh:website/edit`

Updates the name and root folder of the website.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Name |
| `websiteId` | path | string (uuid) | yes | Website ID |

### Request body (required)

Type: `webhosting.WebsitePutPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | webhosting.WebsiteTargetSpec | yes | Target specification of the resource |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Root folder of the website |

```json
{
  "targetSpec": {
    "name": "string",
    "path": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | webhosting.Website | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `currentState` | webhosting.WebsiteCurrentState | read-only | Current state of the website |
| `currentState.git` | webhosting.Git | read-only | Git details of the website |
| `currentState.git.status` | webhosting.GitStatusEnum | read-only | Git status — one of `CREATED`, `CREATING`, `DELETING`, `DEPLOYING`, `DISABLED`, `ERROR`, `INITIAL_ERROR` |
| `currentState.git.vcsBranch` | string | read-only | Branch of the repository containing the website source code to deploy |
| `currentState.git.vcsUrl` | string | read-only | URL of the repository containing the website source code to deploy |
| `currentState.linkedDomains` | integer | read-only | Number of domain linked to a website |
| `currentState.module` | webhosting.ModuleStatus | read-only | module status of the website |
| `currentState.module.enabled` | boolean | read-only | module enabled status |
| `currentState.name` | string | read-only | Name of the website |
| `currentState.path` | string | read-only | Path of the website |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the website |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the website |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Webhosting Website readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | webhosting.WebsiteTargetSpec | read-only | Webhosting Website target specification |
| `targetSpec.name` | string | yes | Target specification of the website name |
| `targetSpec.path` | string |  | Root folder of the website |

```json
{
  "checksum": "string",
  "currentState": {
    "git": {
      "status": "CREATED",
      "vcsBranch": "string",
      "vcsUrl": "string"
    },
    "linkedDomains": 0,
    "module": {
      "enabled": true
    },
    "name": "string",
    "path": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "name": "string",
    "path": "string"
  }
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/webhosting/resource/{name}/website/{websiteId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: webhosting.WebsitePutPayload
result = client.put("/v2/webhosting/resource/{name}/website/{websiteId}",
	targetSpec = None, # Target specification of the resource (type: webhosting.WebsiteTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: webhosting.WebsitePutPayload
$result = $ovh->put("/v2/webhosting/resource/{name}/website/{websiteId}", array(
	targetSpec => null, // Target specification of the resource (type: webhosting.WebsiteTargetSpec)
));

print_r($result);
?>
```
