Skip to content

Commit f8aea1e

Browse files
authored
Custom domain integration for partner integration APIs (#301)
* Custom domain integration for partner integration APIs * prettier fix * revert url change * verbose docs
1 parent 5771600 commit f8aea1e

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

static/api/extensions/v1/api.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,100 @@ paths:
225225
application/json:
226226
schema:
227227
$ref: "#/components/schemas/GenericError"
228+
/v1/providers/{provider_id}/orgs/{org_id}/buckets/{bucket_name}/domain:
229+
post:
230+
tags:
231+
- buckets
232+
summary: Attach a custom domain to bucket
233+
description: |
234+
Sets a custom domain for a bucket. If the domain is already set, it will be replaced.
235+
236+
:::note
237+
The custom domain must have a CNAME record that points to the bucket URL.
238+
:::
239+
240+
##### Example:
241+
If your bucket is `my-bucket` and you want to use `images.example.com`,
242+
create a CNAME record pointing `images.example.com` to `my-bucket.t3.storage.dev`.
243+
244+
After setting the custom domain, objects will be accessible via:
245+
- `https://images.example.com/object.jpg`
246+
- `https://my-bucket.t3.storage.dev/object.jpg` (original URL still works)
247+
248+
operationId: Tigris_SetCustomDomain
249+
parameters:
250+
- $ref: "#/components/parameters/provider_id"
251+
- $ref: "#/components/parameters/org_id"
252+
- $ref: "#/components/parameters/bucket_name"
253+
requestBody:
254+
content:
255+
application/json:
256+
schema:
257+
$ref: "#/components/schemas/SetCustomDomainRequest"
258+
required: true
259+
responses:
260+
"200":
261+
description: OK
262+
content:
263+
application/json:
264+
schema:
265+
$ref: "#/components/schemas/SetCustomDomainResponse"
266+
default:
267+
description: Unexpected error
268+
content:
269+
application/json:
270+
schema:
271+
$ref: "#/components/schemas/GenericError"
272+
delete:
273+
tags:
274+
- buckets
275+
summary: Remove custom domain from bucket
276+
description: |
277+
Removes the custom domain from a bucket. After removal, the bucket will only be accessible via its default Tigris URL.
278+
The CNAME DNS record can be safely deleted after the custom domain is removed.
279+
operationId: Tigris_DeleteCustomDomain
280+
parameters:
281+
- $ref: "#/components/parameters/provider_id"
282+
- $ref: "#/components/parameters/org_id"
283+
- $ref: "#/components/parameters/bucket_name"
284+
responses:
285+
"200":
286+
description: OK
287+
content:
288+
application/json:
289+
schema:
290+
$ref: "#/components/schemas/DeleteCustomDomainResponse"
291+
default:
292+
description: Unexpected error
293+
content:
294+
application/json:
295+
schema:
296+
$ref: "#/components/schemas/GenericError"
297+
get:
298+
tags:
299+
- buckets
300+
summary: Get custom domain settings for a bucket
301+
description: |
302+
Returns the currently configured custom domain for the bucket, or an empty
303+
object if no custom domain is set.
304+
operationId: Tigris_GetCustomDomain
305+
parameters:
306+
- $ref: "#/components/parameters/provider_id"
307+
- $ref: "#/components/parameters/org_id"
308+
- $ref: "#/components/parameters/bucket_name"
309+
responses:
310+
"200":
311+
description: OK
312+
content:
313+
application/json:
314+
schema:
315+
$ref: "#/components/schemas/GetCustomDomainResponse"
316+
default:
317+
description: Unexpected error
318+
content:
319+
application/json:
320+
schema:
321+
$ref: "#/components/schemas/GenericError"
228322

229323
/v1/providers/{provider_id}/orgs/{org_id}/key/rotate:
230324
post:
@@ -585,6 +679,36 @@ components:
585679
properties:
586680
data:
587681
$ref: "#/components/schemas/Invoice"
682+
BucketWebsiteSettings:
683+
type: object
684+
additionalProperties: false
685+
properties:
686+
domain_name:
687+
type: string
688+
example: "images.example.com"
689+
description: |
690+
Custom domain name for the bucket. Must be a valid fully-qualified domain name (FQDN) and
691+
have a CNAME record pointing to the bucket URL.
692+
SetCustomDomainRequest:
693+
type: object
694+
additionalProperties: false
695+
required:
696+
- website
697+
properties:
698+
website:
699+
$ref: "#/components/schemas/BucketWebsiteSettings"
700+
SetCustomDomainResponse:
701+
type: object
702+
DeleteCustomDomainResponse:
703+
type: object
704+
GetCustomDomainResponse:
705+
type: object
706+
additionalProperties: false
707+
required:
708+
- website
709+
properties:
710+
website:
711+
$ref: "#/components/schemas/BucketWebsiteSettings"
588712
Invoice:
589713
type: object
590714
properties:
@@ -740,6 +864,8 @@ components:
740864
object_acl_enabled:
741865
type: boolean
742866
description: If set to true, per object ACL is enabled
867+
website:
868+
$ref: "#/components/schemas/BucketWebsiteSettings"
743869
GetUsageResponse:
744870
type: object
745871
properties:

0 commit comments

Comments
 (0)