# Website

Website Configuration of a Bucket

## GetBucketWebsite

> \<p>Returns the website configuration for a bucket. \</p> \<p>This GET operation requires the \`GetBucketWebsite\` permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the \`GetBucketWebsite\` permission.\</p>

```json
{"openapi":"3.0.3","info":{"title":"IONOS Object Storage API for contract-owned buckets","version":"2.0.3"},"tags":[{"name":"Website","description":"Website Configuration of a Bucket"}],"servers":[{"url":"https://s3.eu-central-3.ionoscloud.com","description":"The endpoint for the `eu-central-3` region (Berlin, Germany)"},{"url":"https://s3.us-central-1.ionoscloud.com","description":"The endpoint for the `us-central-1` region (Lenexa, USA)"}],"security":[{"hmac":[]}],"components":{"securitySchemes":{"hmac":{"type":"apiKey","name":"Authorization","in":"header","description":"IONOS Object Storage API requests are authenticated using the AWS signature. \nThe IONOS Object Storage API authenticates users using a customized HTTP scheme based on a [keyed-HMAC](https://en.wikipedia.org/wiki/HMAC) (Hash Message Authentication Code).\nThe process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.\n\n<img src=\"/docs/s3/hmac-postman.png\" width=\"800px\" />\n\nIn the **Authorization** tab for a request, select **AWS Signature** from the **Type** dropdown list.\nSpecify where Postman should append your authorization data using the **Add authorization data to** drop-down menu.\n\n* If you select **Request Headers**, Postman populates the **Headers** tab with Authorization and `X-Amz-` prefixed fields.\n\n* If you select **Request URL**, Postman populates the **Params** tab with authentication details prefixed with `X-Amz-`.\n\n\n**Note:** The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.\n\n* For **Access Key**, enter your `access key` directly in the fields or through variables for added security.\n\n* For **Secret Key**, enter your `secret key` directly in the fields or through variables for added security.\n\nAdvanced fields are optional, but Postman will attempt to generate them automatically if necessary.\n* For **AWS Region**, enter one of the [regions](#section/Endpoints) (`eu-central-3`) where your bucket is hosted.\n\n* For **Service Name**, enter `s3`. The name of the service that receives the requests.\n\n* For **Session Token**, **leave the field blank**. This is only required when temporary security credentials are used.\n"}},"schemas":{"GetBucketWebsiteOutput":{"type":"object","properties":{"RedirectAllRequestsTo":{"$ref":"#/components/schemas/RedirectAllRequestsTo"},"IndexDocument":{"$ref":"#/components/schemas/IndexDocument"},"ErrorDocument":{"$ref":"#/components/schemas/ErrorDocument"},"RoutingRules":{"$ref":"#/components/schemas/RoutingRules"}}},"RedirectAllRequestsTo":{"description":"Specifies the redirect behavior of all requests to a website endpoint of an IONOS Object Storage bucket.","type":"object","required":["HostName"],"properties":{"HostName":{"description":"Name of the host where requests are redirected.","type":"string"},"Protocol":{"description":"Protocol to use when redirecting requests. The default is the protocol that is used in the original request.","type":"string","enum":["http","https"]}}},"IndexDocument":{"type":"object","required":["Suffix"],"properties":{"Suffix":{"description":"A suffix that is appended to a request that is for a\ndirectory on the website endpoint (for example, if the suffix is\nindex.html and you make a request to `samplebucket/images/` the\ndata that is returned will be for the object with the key name\n`images/index.html`) The suffix must not be empty and must not\ninclude a slash character.\nReplacement must be made for object keys containing special\ncharacters (such as carriage returns) when using XML requests.\n","type":"string"}},"description":"Container for the `Suffix` element."},"ErrorDocument":{"description":"The object key name to use when a 4XX class error occurs. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.","type":"object","required":["Key"],"properties":{"Key":{"$ref":"#/components/schemas/ObjectKey"}}},"ObjectKey":{"description":"The object key.","type":"string","minLength":1,"maxLength":1024},"RoutingRules":{"type":"array","items":{"$ref":"#/components/schemas/RoutingRule"}},"RoutingRule":{"description":"Specifies the redirect behavior and when a redirect is applied.","type":"object","required":["Redirect"],"properties":{"Condition":{"description":"A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the `/docs` folder, redirect to the `/documents` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.","type":"object","properties":{"HttpErrorCodeReturnedEquals":{"$ref":"#/components/schemas/HttpErrorCodeReturnedEquals"},"KeyPrefixEquals":{"$ref":"#/components/schemas/KeyPrefixEquals"}}},"Redirect":{"$ref":"#/components/schemas/Redirect"}},"xml":{"name":"RoutingRule"}},"HttpErrorCodeReturnedEquals":{"description":"The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element `Condition` is specified and sibling `KeyPrefixEquals` is not specified. If both are specified, then both must be true for the redirect to be applied.","type":"string"},"KeyPrefixEquals":{"description":"<p>The object key name prefix when the redirect is applied. For example, to redirect requests for `ExamplePage.html`, the key prefix will be `ExamplePage.html`. To redirect request for all pages with the prefix `docs/`, the key prefix will be `/docs`, which identifies all objects in the `docs/` folder. Required when the parent element `Condition` is specified and sibling `HttpErrorCodeReturnedEquals` is not specified. If both conditions are specified, both must be true for the redirect to be applied.</p> <important> <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.</p> </important>","type":"string"},"Redirect":{"description":"Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.","type":"object","properties":{"HostName":{"description":"The host name to use in the redirect request.","type":"string"},"HttpRedirectCode":{"description":"The HTTP redirect code to use on the response. Not required if one of the siblings is present.","type":"string"},"Protocol":{"description":"Protocol to use when redirecting requests. The default is the protocol that is used in the original request.","type":"string","enum":["http","https"]},"ReplaceKeyPrefixWith":{"description":"<p>The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix `docs/` (objects in the `docs/` folder) to `documents/`, you can set a condition block with `KeyPrefixEquals` set to `docs/` and in the Redirect set `ReplaceKeyPrefixWith` to `/documents`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyWith` is not provided.</p> <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. </p>","type":"string"},"ReplaceKeyWith":{"description":"The specific object key to use in the redirect request. For example, redirect request to `error.html`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyPrefixWith` is not provided.\nReplacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.","type":"string"}}},"BucketName":{"description":"The bucket name.","type":"string","minLength":3,"maxLength":63,"xml":{"name":"Name"}}}},"paths":{"/{Bucket}?website":{"get":{"tags":["Website"],"summary":"GetBucketWebsite","operationId":"GetBucketWebsite","description":"<p>Returns the website configuration for a bucket. </p> <p>This GET operation requires the `GetBucketWebsite` permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the `GetBucketWebsite` permission.</p>","responses":{"200":{"description":"Successful operation","headers":{},"content":{"application/xml":{"schema":{"$ref":"#/components/schemas/GetBucketWebsiteOutput"}}}}},"parameters":[{"name":"Bucket","in":"path","required":true,"schema":{"$ref":"#/components/schemas/BucketName"}},{"name":"website","in":"query","required":true,"schema":{"type":"boolean","enum":[true]},"allowEmptyValue":true}]}}}}
```

## PutBucketWebsite

> \<p>Sets the configuration of the website that is specified in the \`website\` subresource. To configure a bucket as a website, you can add this subresource on the bucket with website configuration information such as the file name of the index document and any redirect rules. \</p>                  \<p>This PUT operation requires the \`PutBucketWebsite\` permission. By default, only the bucket owner can configure the website attached to a bucket; however, bucket owners can allow other users to set the website configuration by writing a bucket policy that grants them the \`PutBucketWebsite\` permission.\</p> \<p>To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the following elements. Because all requests are sent to another website, you don't need to provide index document name for the bucket.\</p> \<ul> \<li> \<p> \`WebsiteConfiguration\` \</p> \</li> \<li> \<p> \`RedirectAllRequestsTo\` \</p> \</li> \<li> \<p> \`HostName\` \</p> \</li> \<li> \<p> \`Protocol\` \</p> \</li> \</ul> \<p>If you want granular control over redirects, you can use the following elements to add routing rules that describe conditions for redirecting requests and information about the redirect destination. In this case, the website configuration must provide an index document for the bucket, because some requests might not be redirected. \</p> \<ul> \<li> \<p> \`WebsiteConfiguration\` \</p> \</li> \<li> \<p> \`IndexDocument\` \</p> \</li> \<li> \<p> \`Suffix\` \</p> \</li> \<li> \<p> \`ErrorDocument\` \</p> \</li> \<li> \<p> \`Key\` \</p> \</li> \<li> \<p> \`RoutingRules\` \</p> \</li> \<li> \<p> \`RoutingRule\` \</p> \</li> \<li> \<p> \`Condition\` \</p> \</li> \<li> \<p> \`HttpErrorCodeReturnedEquals\` \</p> \</li> \<li> \<p> \`KeyPrefixEquals\` \</p> \</li> \<li> \<p> \`Redirect\` \</p> \</li> \<li> \<p> \`Protocol\` \</p> \</li> \<li> \<p> \`HostName\` \</p> \</li> \<li> \<p> \`ReplaceKeyPrefixWith\` \</p> \</li> \<li> \<p> \`ReplaceKeyWith\` \</p> \</li> \<li> \<p> \`HttpRedirectCode\` \</p> \</li> \</ul>

```json
{"openapi":"3.0.3","info":{"title":"IONOS Object Storage API for contract-owned buckets","version":"2.0.3"},"tags":[{"name":"Website","description":"Website Configuration of a Bucket"}],"servers":[{"url":"https://s3.eu-central-3.ionoscloud.com","description":"The endpoint for the `eu-central-3` region (Berlin, Germany)"},{"url":"https://s3.us-central-1.ionoscloud.com","description":"The endpoint for the `us-central-1` region (Lenexa, USA)"}],"security":[{"hmac":[]}],"components":{"securitySchemes":{"hmac":{"type":"apiKey","name":"Authorization","in":"header","description":"IONOS Object Storage API requests are authenticated using the AWS signature. \nThe IONOS Object Storage API authenticates users using a customized HTTP scheme based on a [keyed-HMAC](https://en.wikipedia.org/wiki/HMAC) (Hash Message Authentication Code).\nThe process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.\n\n<img src=\"/docs/s3/hmac-postman.png\" width=\"800px\" />\n\nIn the **Authorization** tab for a request, select **AWS Signature** from the **Type** dropdown list.\nSpecify where Postman should append your authorization data using the **Add authorization data to** drop-down menu.\n\n* If you select **Request Headers**, Postman populates the **Headers** tab with Authorization and `X-Amz-` prefixed fields.\n\n* If you select **Request URL**, Postman populates the **Params** tab with authentication details prefixed with `X-Amz-`.\n\n\n**Note:** The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.\n\n* For **Access Key**, enter your `access key` directly in the fields or through variables for added security.\n\n* For **Secret Key**, enter your `secret key` directly in the fields or through variables for added security.\n\nAdvanced fields are optional, but Postman will attempt to generate them automatically if necessary.\n* For **AWS Region**, enter one of the [regions](#section/Endpoints) (`eu-central-3`) where your bucket is hosted.\n\n* For **Service Name**, enter `s3`. The name of the service that receives the requests.\n\n* For **Session Token**, **leave the field blank**. This is only required when temporary security credentials are used.\n"}},"schemas":{"BucketName":{"description":"The bucket name.","type":"string","minLength":3,"maxLength":63,"xml":{"name":"Name"}},"Content-MD5":{"type":"string","description":"The base64 encoded MD5 digest of the message (without the headers) according to\n[RFC 1864](http://www.ietf.org/rfc/rfc1864.txt).\n"},"ErrorDocument":{"description":"The object key name to use when a 4XX class error occurs. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.","type":"object","required":["Key"],"properties":{"Key":{"$ref":"#/components/schemas/ObjectKey"}}},"ObjectKey":{"description":"The object key.","type":"string","minLength":1,"maxLength":1024},"IndexDocument":{"type":"object","required":["Suffix"],"properties":{"Suffix":{"description":"A suffix that is appended to a request that is for a\ndirectory on the website endpoint (for example, if the suffix is\nindex.html and you make a request to `samplebucket/images/` the\ndata that is returned will be for the object with the key name\n`images/index.html`) The suffix must not be empty and must not\ninclude a slash character.\nReplacement must be made for object keys containing special\ncharacters (such as carriage returns) when using XML requests.\n","type":"string"}},"description":"Container for the `Suffix` element."},"RedirectAllRequestsTo":{"description":"Specifies the redirect behavior of all requests to a website endpoint of an IONOS Object Storage bucket.","type":"object","required":["HostName"],"properties":{"HostName":{"description":"Name of the host where requests are redirected.","type":"string"},"Protocol":{"description":"Protocol to use when redirecting requests. The default is the protocol that is used in the original request.","type":"string","enum":["http","https"]}}},"RoutingRules":{"type":"array","items":{"$ref":"#/components/schemas/RoutingRule"}},"RoutingRule":{"description":"Specifies the redirect behavior and when a redirect is applied.","type":"object","required":["Redirect"],"properties":{"Condition":{"description":"A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the `/docs` folder, redirect to the `/documents` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.","type":"object","properties":{"HttpErrorCodeReturnedEquals":{"$ref":"#/components/schemas/HttpErrorCodeReturnedEquals"},"KeyPrefixEquals":{"$ref":"#/components/schemas/KeyPrefixEquals"}}},"Redirect":{"$ref":"#/components/schemas/Redirect"}},"xml":{"name":"RoutingRule"}},"HttpErrorCodeReturnedEquals":{"description":"The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element `Condition` is specified and sibling `KeyPrefixEquals` is not specified. If both are specified, then both must be true for the redirect to be applied.","type":"string"},"KeyPrefixEquals":{"description":"<p>The object key name prefix when the redirect is applied. For example, to redirect requests for `ExamplePage.html`, the key prefix will be `ExamplePage.html`. To redirect request for all pages with the prefix `docs/`, the key prefix will be `/docs`, which identifies all objects in the `docs/` folder. Required when the parent element `Condition` is specified and sibling `HttpErrorCodeReturnedEquals` is not specified. If both conditions are specified, both must be true for the redirect to be applied.</p> <important> <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.</p> </important>","type":"string"},"Redirect":{"description":"Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.","type":"object","properties":{"HostName":{"description":"The host name to use in the redirect request.","type":"string"},"HttpRedirectCode":{"description":"The HTTP redirect code to use on the response. Not required if one of the siblings is present.","type":"string"},"Protocol":{"description":"Protocol to use when redirecting requests. The default is the protocol that is used in the original request.","type":"string","enum":["http","https"]},"ReplaceKeyPrefixWith":{"description":"<p>The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix `docs/` (objects in the `docs/` folder) to `documents/`, you can set a condition block with `KeyPrefixEquals` set to `docs/` and in the Redirect set `ReplaceKeyPrefixWith` to `/documents`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyWith` is not provided.</p> <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. </p>","type":"string"},"ReplaceKeyWith":{"description":"The specific object key to use in the redirect request. For example, redirect request to `error.html`. Not required if one of the siblings is present. Can be present only if `ReplaceKeyPrefixWith` is not provided.\nReplacement must be made for object keys containing special characters (such as carriage returns) when using XML requests.","type":"string"}}}}},"paths":{"/{Bucket}?website":{"put":{"tags":["Website"],"summary":"PutBucketWebsite","operationId":"PutBucketWebsite","description":"<p>Sets the configuration of the website that is specified in the `website` subresource. To configure a bucket as a website, you can add this subresource on the bucket with website configuration information such as the file name of the index document and any redirect rules. </p>                  <p>This PUT operation requires the `PutBucketWebsite` permission. By default, only the bucket owner can configure the website attached to a bucket; however, bucket owners can allow other users to set the website configuration by writing a bucket policy that grants them the `PutBucketWebsite` permission.</p> <p>To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the following elements. Because all requests are sent to another website, you don't need to provide index document name for the bucket.</p> <ul> <li> <p> `WebsiteConfiguration` </p> </li> <li> <p> `RedirectAllRequestsTo` </p> </li> <li> <p> `HostName` </p> </li> <li> <p> `Protocol` </p> </li> </ul> <p>If you want granular control over redirects, you can use the following elements to add routing rules that describe conditions for redirecting requests and information about the redirect destination. In this case, the website configuration must provide an index document for the bucket, because some requests might not be redirected. </p> <ul> <li> <p> `WebsiteConfiguration` </p> </li> <li> <p> `IndexDocument` </p> </li> <li> <p> `Suffix` </p> </li> <li> <p> `ErrorDocument` </p> </li> <li> <p> `Key` </p> </li> <li> <p> `RoutingRules` </p> </li> <li> <p> `RoutingRule` </p> </li> <li> <p> `Condition` </p> </li> <li> <p> `HttpErrorCodeReturnedEquals` </p> </li> <li> <p> `KeyPrefixEquals` </p> </li> <li> <p> `Redirect` </p> </li> <li> <p> `Protocol` </p> </li> <li> <p> `HostName` </p> </li> <li> <p> `ReplaceKeyPrefixWith` </p> </li> <li> <p> `ReplaceKeyWith` </p> </li> <li> <p> `HttpRedirectCode` </p> </li> </ul>","responses":{"200":{"description":"Success","headers":{}}},"parameters":[{"name":"Bucket","in":"path","required":true,"schema":{"$ref":"#/components/schemas/BucketName"}},{"name":"Content-MD5","in":"header","required":false,"schema":{"$ref":"#/components/schemas/Content-MD5"}},{"name":"website","in":"query","required":true,"schema":{"type":"boolean","enum":[true]},"allowEmptyValue":true}],"requestBody":{"required":true,"content":{"application/xml":{"schema":{"type":"object","required":["WebsiteConfiguration"],"properties":{"WebsiteConfiguration":{"description":"Specifies website configuration parameters for an IONOS Object Storage bucket.","type":"object","properties":{"ErrorDocument":{"$ref":"#/components/schemas/ErrorDocument"},"IndexDocument":{"$ref":"#/components/schemas/IndexDocument"},"RedirectAllRequestsTo":{"allOf":[{"$ref":"#/components/schemas/RedirectAllRequestsTo"},{"description":"<p>The redirect behavior for every request to this bucket's website endpoint.</p> <important> <p>If you specify this property, you can't specify any other property.</p> </important>"}]},"RoutingRules":{"allOf":[{"$ref":"#/components/schemas/RoutingRules"},{"description":"Rules that define when a redirect is applied and the redirect behavior."}]}}}}}}}}}}}}
```

## DeleteBucketWebsite

> \<p>This operation removes the website configuration for a bucket. IONOS Object Storage returns a \`200 OK\` response upon successfully deleting a website configuration on the specified bucket. You will get a \`200 OK\` response if the website configuration you are trying to delete does not exist on the bucket. IONOS Object Storage returns a \`404\` response if the bucket specified in the request does not exist.\</p> \<p>This DELETE operation requires the \`DeleteBucketWebsite\` permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the \`DeleteBucketWebsite\` permission.\</p>

```json
{"openapi":"3.0.3","info":{"title":"IONOS Object Storage API for contract-owned buckets","version":"2.0.3"},"tags":[{"name":"Website","description":"Website Configuration of a Bucket"}],"servers":[{"url":"https://s3.eu-central-3.ionoscloud.com","description":"The endpoint for the `eu-central-3` region (Berlin, Germany)"},{"url":"https://s3.us-central-1.ionoscloud.com","description":"The endpoint for the `us-central-1` region (Lenexa, USA)"}],"security":[{"hmac":[]}],"components":{"securitySchemes":{"hmac":{"type":"apiKey","name":"Authorization","in":"header","description":"IONOS Object Storage API requests are authenticated using the AWS signature. \nThe IONOS Object Storage API authenticates users using a customized HTTP scheme based on a [keyed-HMAC](https://en.wikipedia.org/wiki/HMAC) (Hash Message Authentication Code).\nThe process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.\n\n<img src=\"/docs/s3/hmac-postman.png\" width=\"800px\" />\n\nIn the **Authorization** tab for a request, select **AWS Signature** from the **Type** dropdown list.\nSpecify where Postman should append your authorization data using the **Add authorization data to** drop-down menu.\n\n* If you select **Request Headers**, Postman populates the **Headers** tab with Authorization and `X-Amz-` prefixed fields.\n\n* If you select **Request URL**, Postman populates the **Params** tab with authentication details prefixed with `X-Amz-`.\n\n\n**Note:** The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.\n\n* For **Access Key**, enter your `access key` directly in the fields or through variables for added security.\n\n* For **Secret Key**, enter your `secret key` directly in the fields or through variables for added security.\n\nAdvanced fields are optional, but Postman will attempt to generate them automatically if necessary.\n* For **AWS Region**, enter one of the [regions](#section/Endpoints) (`eu-central-3`) where your bucket is hosted.\n\n* For **Service Name**, enter `s3`. The name of the service that receives the requests.\n\n* For **Session Token**, **leave the field blank**. This is only required when temporary security credentials are used.\n"}},"schemas":{"BucketName":{"description":"The bucket name.","type":"string","minLength":3,"maxLength":63,"xml":{"name":"Name"}}}},"paths":{"/{Bucket}?website":{"delete":{"tags":["Website"],"summary":"DeleteBucketWebsite","operationId":"DeleteBucketWebsite","description":"<p>This operation removes the website configuration for a bucket. IONOS Object Storage returns a `200 OK` response upon successfully deleting a website configuration on the specified bucket. You will get a `200 OK` response if the website configuration you are trying to delete does not exist on the bucket. IONOS Object Storage returns a `404` response if the bucket specified in the request does not exist.</p> <p>This DELETE operation requires the `DeleteBucketWebsite` permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the `DeleteBucketWebsite` permission.</p>","responses":{"204":{"description":"Success","headers":{}}},"parameters":[{"name":"Bucket","in":"path","required":true,"schema":{"$ref":"#/components/schemas/BucketName"}},{"name":"website","in":"query","required":true,"schema":{"type":"boolean","enum":[true]},"allowEmptyValue":true}]}}}}
```
