API

PreviewSecret

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets/{id}/rotate create Success
POST /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets create Success
DELETE /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets/{id} remove 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:

created, err := client.PreviewSecret(nil).Create(map[string]any{"app_id": "example", "preview_id": "example", "env_key": "example", "name": "example", "slug": "example", "value": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
removed, err := client.PreviewSecret(nil).Remove(map[string]any{"app_id": "example", "id": "example_id", "preview_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local created, err = client:PreviewSecret():create({ app_id = "example", preview_id = "example", env_key = "example", name = "example", slug = "example", value = "example" })
local removed, err = client:PreviewSecret():remove({ app_id = "example", id = "example_id", preview_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$created = $client->PreviewSecret()->create(["app_id" => "example", "preview_id" => "example", "env_key" => "example", "name" => "example", "slug" => "example", "value" => "example"]);
$client->PreviewSecret()->remove(["app_id" => "example", "id" => "example_id", "preview_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

created = client.PreviewSecret().create({ "app_id": "example", "preview_id": "example", "env_key": "example", "name": "example", "slug": "example", "value": "example" })
client.PreviewSecret().remove({"app_id": "example", "id": "example_id", "preview_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

created = client.PreviewSecret.create({ "app_id" => "example", "preview_id" => "example", "env_key" => "example", "name" => "example", "slug" => "example", "value" => "example" })
client.PreviewSecret.remove({ "app_id" => "example", "id" => "example_id", "preview_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const created = await client.PreviewSecret().create({ app_id: "example", preview_id: "example", env_key: "example", name: "example", slug: "example", value: "example" })
await client.PreviewSecret().remove({ app_id: "example", id: "example_id", preview_id: "example" })

Fields

Field Type Required Description
env_key string Yes Env Key
id string No Id
name string Yes Name
slug string Yes Slug
value string Yes Value

create

POST /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets/{id}/rotate

Operation ID: rotate_api_v1_app_preview_secret.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
preview_id path string Yes
id path string Yes

Request body

application/json

Property Type Required Description
value string Yes

Responses

200: Success

application/json

The response is object.

201: New preview-owned secret version

application/json

Property Type Required Description
secret object Yes
secret.available boolean Yes
secret.env_key string Yes
secret.id string Yes
secret.latest_version_number integer Yes
secret.name string Yes
secret.status string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets

Operation ID: api_v1_app_preview_secrets.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
preview_id path string Yes

Request body

application/json

Property Type Required Description
env_key string Yes
name string Yes
slug string Yes
value string Yes

Responses

200: Success

application/json

The response is object.

201: Preview-owned secret created

application/json

Property Type Required Description
secret object Yes
secret.available boolean Yes
secret.env_key string Yes
secret.id string Yes
secret.latest_version_number integer Yes
secret.name string Yes
secret.status string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

remove

DELETE /api/v1/hosting/apps/{app_id}/previews/{preview_id}/secrets/{id}

Operation ID: api_v1_app_preview_secret.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
preview_id path string Yes
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