StaticSite
A static site hosted by Composal: list, create, read, change or remove one.
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/api/v1/organizations/{organization_id}/static_sites |
create |
Static site created |
POST |
/api/v1/static_sites/{id}/provision |
create |
Provisioned static site |
GET |
/api/v1/organizations/{organization_id}/static_sites |
list |
Static sites in the organization |
GET |
/api/v1/static_sites/{id} |
load |
Success |
PATCH |
/api/v1/static_sites/{id} |
patch |
Success |
DELETE |
/api/v1/static_sites/{id} |
remove |
Success |
PUT |
/api/v1/static_sites/{id} |
update |
Success |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
static_sites, err := client.StaticSite(nil).List(map[string]any{"organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(static_sites)
static_site, err := client.StaticSite(nil).Load(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(static_site)
created, err := client.StaticSite(nil).Create(map[string]any{"organization_id": "example", "name": "example", "slug": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
updated, err := client.StaticSite(nil).Update(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
patched, err := client.StaticSite(nil).Patch(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(patched)
removed, err := client.StaticSite(nil).Remove(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local static_sites, err = client:StaticSite():list({ organization_id = "example" })
local static_site, err = client:StaticSite():load({ id = "example_id" })
local created, err = client:StaticSite():create({ organization_id = "example", name = "example", slug = "example" })
local updated, err = client:StaticSite():update({ id = "example_id" })
local patched, err = client:StaticSite():patch({ id = "example_id" })
local removed, err = client:StaticSite():remove({ id = "example_id" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$static_sites = $client->StaticSite()->list(["organization_id" => "example"]);
$static_site = $client->StaticSite()->load(["id" => "example_id"]);
$created = $client->StaticSite()->create(["organization_id" => "example", "name" => "example", "slug" => "example"]);
$updated = $client->StaticSite()->update(["id" => "example_id"]);
$patched = $client->StaticSite()->patch(["id" => "example_id"]);
$client->StaticSite()->remove(["id" => "example_id"]);
Python
Construct client as shown in the Python setup, then call the operations:
static_sites = client.StaticSite().list({"organization_id": "example"})
static_site = client.StaticSite().load({"id": "example_id"})
created = client.StaticSite().create({ "organization_id": "example", "name": "example", "slug": "example" })
updated = client.StaticSite().update({"id": "example_id"})
patched = client.StaticSite().patch({"id": "example_id"})
client.StaticSite().remove({"id": "example_id"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
static_sites = client.StaticSite.list({ "organization_id" => "example" })
static_site = client.StaticSite.load({ "id" => "example_id" })
created = client.StaticSite.create({ "organization_id" => "example", "name" => "example", "slug" => "example" })
updated = client.StaticSite.update({ "id" => "example_id" })
patched = client.StaticSite.patch({ "id" => "example_id" })
client.StaticSite.remove({ "id" => "example_id" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const static_sites = await client.StaticSite().list({ organization_id: "example" })
const static_site = await client.StaticSite().load({ id: "example_id" })
const created = await client.StaticSite().create({ organization_id: "example", name: "example", slug: "example" })
const updated = await client.StaticSite().update({ id: "example_id" })
const patched = await client.StaticSite().patch({ id: "example_id" })
await client.StaticSite().remove({ id: "example_id" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
active_deployment_id |
one,string,null |
Yes | Active Deployment Id |
cdn_hostname |
string |
Yes | Cdn Hostname |
cdn_url |
string |
Yes | Cdn Url |
cname_target |
string |
Yes | Cname Target |
created_at |
string |
Yes | Created At |
default_url |
string |
Yes | Default Url |
description |
one,string,null |
Yes | Description |
error_document |
one,string,null |
Yes | Error Document |
failure_message |
one,string,null |
Yes | Failure Message |
hosted_app_id |
one,string,null |
Yes | Hosted App Id |
id |
string |
Yes | Id |
index_document |
string |
Yes | Index Document |
name |
string |
Yes | Name |
organization_id |
string |
Yes | Organization Id |
provisioned |
boolean |
Yes | Provisioned |
provisioned_at |
one,string,null |
Yes | Provisioned At |
region |
one,string,null |
Yes | Region |
replication_regions |
array |
Yes | Replication Regions |
repository_id |
one,string,null |
Yes | Repository Id |
slug |
string |
Yes | Slug |
status |
string |
Yes | Status |
updated_at |
string |
Yes | Updated At |
create
POST /api/v1/organizations/{organization_id}/static_sites
Operation ID: post_api_v1_organizations_organization_id_static_sites.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
description |
string |
No | |
error_document |
string |
No | |
hosted_app_id |
string |
No | |
index_document |
string |
No | |
name |
string |
Yes | |
region |
string |
No | |
replication_regions |
array of string |
No | |
repository_id |
string |
No | |
slug |
string |
Yes |
Responses
200: Static site created
application/json
| Property | Type | Required | Description |
|---|---|---|---|
static_site |
object |
Yes | |
static_site.active_deployment_id |
string |
Yes | |
static_site.cdn_hostname |
string |
Yes | |
static_site.cdn_url |
string (uri) |
Yes | |
static_site.cname_target |
string |
Yes | |
static_site.created_at |
string (date-time) |
Yes | |
static_site.default_url |
string (uri) |
Yes | |
static_site.description |
string |
Yes | |
static_site.error_document |
string |
Yes | |
static_site.failure_message |
string |
Yes | |
static_site.hosted_app_id |
string |
Yes | |
static_site.id |
string |
Yes | |
static_site.index_document |
string |
Yes | |
static_site.name |
string |
Yes | |
static_site.organization_id |
string |
Yes | |
static_site.provisioned |
boolean |
Yes | |
static_site.provisioned_at |
string (date-time) |
Yes | |
static_site.region |
string |
Yes | |
static_site.replication_regions |
array of string |
Yes | |
static_site.repository_id |
string |
Yes | |
static_site.slug |
string |
Yes | |
static_site.status |
enum: draft, provisioning, active, degraded, archived, failed |
Yes | |
static_site.updated_at |
string (date-time) |
Yes |
201: Static site created
application/json
| Property | Type | Required | Description |
|---|---|---|---|
static_site |
object |
Yes | |
static_site.active_deployment_id |
string |
Yes | |
static_site.cdn_hostname |
string |
Yes | |
static_site.cdn_url |
string (uri) |
Yes | |
static_site.cname_target |
string |
Yes | |
static_site.created_at |
string (date-time) |
Yes | |
static_site.default_url |
string (uri) |
Yes | |
static_site.description |
string |
Yes | |
static_site.error_document |
string |
Yes | |
static_site.failure_message |
string |
Yes | |
static_site.hosted_app_id |
string |
Yes | |
static_site.id |
string |
Yes | |
static_site.index_document |
string |
Yes | |
static_site.name |
string |
Yes | |
static_site.organization_id |
string |
Yes | |
static_site.provisioned |
boolean |
Yes | |
static_site.provisioned_at |
string (date-time) |
Yes | |
static_site.region |
string |
Yes | |
static_site.replication_regions |
array of string |
Yes | |
static_site.repository_id |
string |
Yes | |
static_site.slug |
string |
Yes | |
static_site.status |
enum: draft, provisioning, active, degraded, archived, failed |
Yes | |
static_site.updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Static site request failed validation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
details |
array of string |
No | |
error |
string |
Yes | |
failure_message |
string |
No | |
status |
string |
No |
502: Bad gateway
POST /api/v1/static_sites/{id}/provision
Operation ID: provision_api_v1_static_site.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Provisioned static site
application/json
| Property | Type | Required | Description |
|---|---|---|---|
static_site |
object |
Yes | |
static_site.active_deployment_id |
string |
Yes | |
static_site.cdn_hostname |
string |
Yes | |
static_site.cdn_url |
string (uri) |
Yes | |
static_site.cname_target |
string |
Yes | |
static_site.created_at |
string (date-time) |
Yes | |
static_site.default_url |
string (uri) |
Yes | |
static_site.description |
string |
Yes | |
static_site.error_document |
string |
Yes | |
static_site.failure_message |
string |
Yes | |
static_site.hosted_app_id |
string |
Yes | |
static_site.id |
string |
Yes | |
static_site.index_document |
string |
Yes | |
static_site.name |
string |
Yes | |
static_site.organization_id |
string |
Yes | |
static_site.provisioned |
boolean |
Yes | |
static_site.provisioned_at |
string (date-time) |
Yes | |
static_site.region |
string |
Yes | |
static_site.replication_regions |
array of string |
Yes | |
static_site.repository_id |
string |
Yes | |
static_site.slug |
string |
Yes | |
static_site.status |
enum: draft, provisioning, active, degraded, archived, failed |
Yes | |
static_site.updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Static site request failed validation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
details |
array of string |
No | |
error |
string |
Yes | |
failure_message |
string |
No | |
status |
string |
No |
502: Bad gateway
list
GET /api/v1/organizations/{organization_id}/static_sites
Operation ID: api_v1_organization_static_sites.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes |
Responses
200: Static sites in the organization
application/json
| Property | Type | Required | Description |
|---|---|---|---|
static_sites |
array of object |
Yes | |
static_sites[].active_deployment_id |
string |
Yes | |
static_sites[].cdn_hostname |
string |
Yes | |
static_sites[].cdn_url |
string (uri) |
Yes | |
static_sites[].cname_target |
string |
Yes | |
static_sites[].created_at |
string (date-time) |
Yes | |
static_sites[].default_url |
string (uri) |
Yes | |
static_sites[].description |
string |
Yes | |
static_sites[].error_document |
string |
Yes | |
static_sites[].failure_message |
string |
Yes | |
static_sites[].hosted_app_id |
string |
Yes | |
static_sites[].id |
string |
Yes | |
static_sites[].index_document |
string |
Yes | |
static_sites[].name |
string |
Yes | |
static_sites[].organization_id |
string |
Yes | |
static_sites[].provisioned |
boolean |
Yes | |
static_sites[].provisioned_at |
string (date-time) |
Yes | |
static_sites[].region |
string |
Yes | |
static_sites[].replication_regions |
array of string |
Yes | |
static_sites[].repository_id |
string |
Yes | |
static_sites[].slug |
string |
Yes | |
static_sites[].status |
enum: draft, provisioning, active, degraded, archived, failed |
Yes | |
static_sites[].updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
load
GET /api/v1/static_sites/{id}
Operation ID: api_v1_static_site.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
patch
PATCH /api/v1/static_sites/{id}
Operation ID: patch_api_v1_static_sites_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
remove
DELETE /api/v1/static_sites/{id}
Operation ID: delete_api_v1_static_sites_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
update
PUT /api/v1/static_sites/{id}
Operation ID: put_api_v1_static_sites_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.