R2
Custom Domains
Custom Domains endpoint reference.
List
List custom domains for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->customDomains()->list('ACCOUNT_ID', 'BUCKET_NAME', 'JURISDICTION');
Create
Add a custom domain to a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
values | array | Yes | Values to set, e.g. `domain`, `zoneId`, `enabled`. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->customDomains()->create('ACCOUNT_ID', 'BUCKET_NAME', [], 'JURISDICTION');
Get
Get an existing custom domain for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
domain | string | Yes | Custom domain name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->customDomains()->get('ACCOUNT_ID', 'BUCKET_NAME', 'DOMAIN', 'JURISDICTION');
Update
Update an existing custom domain for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
domain | string | Yes | Custom domain name. | |
values | array | Yes | Values to set, e.g. `enabled`, `minTLS`, `ciphers`. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->customDomains()->update('ACCOUNT_ID', 'BUCKET_NAME', 'DOMAIN', [], 'JURISDICTION');
Delete
Remove a custom domain from a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
domain | string | Yes | Custom domain name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->customDomains()->delete('ACCOUNT_ID', 'BUCKET_NAME', 'DOMAIN', 'JURISDICTION');

