API

AppSecret

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}/secrets/{id}/set_value create Success
POST /api/v1/hosting/apps/{app_id}/secrets create Success
POST /api/v1/hosting/apps/{app_id}/secrets/bulk create Bulk import result summary
GET /api/v1/hosting/apps/{app_id}/secrets list List of secret metadata objects
GET /api/v1/hosting/apps/{app_id}/secrets/{id} load Secret metadata
GET /api/v1/hosting/apps/{app_id}/secrets/{id}/value load Raw secret value for the current active version
GET /api/v1/hosting/apps/{app_id}/secrets/dotenv load Dotenv-formatted secrets (KEY=value pairs)
PATCH /api/v1/hosting/apps/{app_id}/secrets/{id} patch Updated secret metadata
DELETE /api/v1/hosting/apps/{app_id}/secrets/{id} remove Success
PUT /api/v1/hosting/apps/{app_id}/secrets/{id} update Updated secret metadata

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:

app_secrets, err := client.AppSecret(nil).List(map[string]any{"app_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(app_secrets)
app_secret, err := client.AppSecret(nil).Load(map[string]any{"app_id": "example", "id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(app_secret)
created, err := client.AppSecret(nil).Create(map[string]any{"app_id": "example", "name": "example", "slug": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.AppSecret(nil).Update(map[string]any{"id": "example_id", "app_id": "example", "description": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)
patched, err := client.AppSecret(nil).Patch(map[string]any{"id": "example_id", "app_id": "example", "description": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(patched)
removed, err := client.AppSecret(nil).Remove(map[string]any{"app_id": "example", "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 app_secrets, err = client:AppSecret():list({ app_id = "example" })
local app_secret, err = client:AppSecret():load({ app_id = "example", id = "example_id" })
local created, err = client:AppSecret():create({ app_id = "example", name = "example", slug = "example" })
local updated, err = client:AppSecret():update({ id = "example_id", app_id = "example", description = "example" })
local patched, err = client:AppSecret():patch({ id = "example_id", app_id = "example", description = "example" })
local removed, err = client:AppSecret():remove({ app_id = "example", id = "example_id" })

PHP

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

$app_secrets = $client->AppSecret()->list(["app_id" => "example"]);
$app_secret = $client->AppSecret()->load(["app_id" => "example", "id" => "example_id"]);
$created = $client->AppSecret()->create(["app_id" => "example", "name" => "example", "slug" => "example"]);
$updated = $client->AppSecret()->update(["id" => "example_id", "app_id" => "example", "description" => "example"]);
$patched = $client->AppSecret()->patch(["id" => "example_id", "app_id" => "example", "description" => "example"]);
$client->AppSecret()->remove(["app_id" => "example", "id" => "example_id"]);

Python

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

app_secrets = client.AppSecret().list({"app_id": "example"})
app_secret = client.AppSecret().load({"app_id": "example", "id": "example_id"})
created = client.AppSecret().create({ "app_id": "example", "name": "example", "slug": "example" })
updated = client.AppSecret().update({"id": "example_id", "app_id": "example", "description": "example"})
patched = client.AppSecret().patch({"id": "example_id", "app_id": "example", "description": "example"})
client.AppSecret().remove({"app_id": "example", "id": "example_id"})

Ruby

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

app_secrets = client.AppSecret.list({ "app_id" => "example" })
app_secret = client.AppSecret.load({ "app_id" => "example", "id" => "example_id" })
created = client.AppSecret.create({ "app_id" => "example", "name" => "example", "slug" => "example" })
updated = client.AppSecret.update({ "id" => "example_id", "app_id" => "example", "description" => "example" })
patched = client.AppSecret.patch({ "id" => "example_id", "app_id" => "example", "description" => "example" })
client.AppSecret.remove({ "app_id" => "example", "id" => "example_id" })

TypeScript

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

const app_secrets = await client.AppSecret().list({ app_id: "example" })
const app_secret = await client.AppSecret().load({ app_id: "example", id: "example_id" })
const created = await client.AppSecret().create({ app_id: "example", name: "example", slug: "example" })
const updated = await client.AppSecret().update({ id: "example_id", app_id: "example", description: "example" })
const patched = await client.AppSecret().patch({ id: "example_id", app_id: "example", description: "example" })
await client.AppSecret().remove({ app_id: "example", id: "example_id" })

Fields

Field Type Required Description
created_at string No Created At
description one,string,null No Description
env_key one,string,null No Env Key
expose_to_build boolean No Expose To Build
has_value boolean No Has Value
hosted_app_id string Yes Hosted App Id
id string Yes Id
latest_version_number one,integer,null No Latest Version Number
name string Yes Name
organization_id string Yes Organization Id
rotation_policy one,string,null No Rotation Policy
scope_kind string Yes Scope Kind
slug string Yes Slug
status string Yes Status
updated_at string No Updated At
value string No Value
value_digest one,string,null No Value Digest
value_kind one,string,null No Value Kind

create

POST /api/v1/hosting/apps/{app_id}/secrets/{id}/set_value

Operation ID: set_value_api_v1_app_secret.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

Property Type Required Description
value string Yes
value_kind string No

Responses

200: Success

application/json

The response is object.

201: Updated secret metadata after new version

application/json

Property Type Required Description
created_at string (date-time) No
description string No
env_key string No
expose_to_build boolean No
has_value boolean No
hosted_app_id string Yes
id string Yes
latest_version_number integer No
name string Yes
organization_id string Yes
rotation_policy string No
scope_kind string Yes
slug string Yes
status string Yes
updated_at string (date-time) No
value_digest string No
value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

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

Operation ID: post_api_v1_hosting_apps_app_id_secrets.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes

Request body

application/json

Property Type Required Description
description string No
env_key string No
expose_to_build boolean No
name string Yes
rotation_policy string No
slug string Yes
value string No
value_kind string No

Responses

200: Success

application/json

The response is object.

201: Created secret metadata

application/json

Property Type Required Description
created_at string (date-time) No
description string No
env_key string No
expose_to_build boolean No
has_value boolean No
hosted_app_id string Yes
id string Yes
latest_version_number integer No
name string Yes
organization_id string Yes
rotation_policy string No
scope_kind string Yes
slug string Yes
status string Yes
updated_at string (date-time) No
value_digest string No
value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/hosting/apps/{app_id}/secrets/bulk

Operation ID: bulk_api_v1_app_secrets.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes

Request body

application/json

Property Type Required Description
dotenv string Yes
dry_run boolean No
prune boolean No

Responses

200: Bulk import result summary

application/json

The response is object.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

list

GET /api/v1/hosting/apps/{app_id}/secrets

Operation ID: api_v1_app_secrets.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes

Responses

200: List of secret metadata objects

application/json

Property Type Required Description
secrets array of object Yes
secrets[].created_at string (date-time) No
secrets[].description string No
secrets[].env_key string No
secrets[].expose_to_build boolean No
secrets[].has_value boolean No
secrets[].hosted_app_id string Yes
secrets[].id string Yes
secrets[].latest_version_number integer No
secrets[].name string Yes
secrets[].organization_id string Yes
secrets[].rotation_policy string No
secrets[].scope_kind string Yes
secrets[].slug string Yes
secrets[].status string Yes
secrets[].updated_at string (date-time) No
secrets[].value_digest string No
secrets[].value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

load

GET /api/v1/hosting/apps/{app_id}/secrets/{id}

Operation ID: api_v1_app_secret.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Secret metadata

application/json

Property Type Required Description
created_at string (date-time) No
description string No
env_key string No
expose_to_build boolean No
has_value boolean No
hosted_app_id string Yes
id string Yes
latest_version_number integer No
name string Yes
organization_id string Yes
rotation_policy string No
scope_kind string Yes
slug string Yes
status string Yes
updated_at string (date-time) No
value_digest string No
value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

GET /api/v1/hosting/apps/{app_id}/secrets/{id}/value

Operation ID: value_api_v1_app_secret.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Raw secret value for the current active version

application/json

Property Type Required Description
env_key string No
id string Yes
slug string Yes
value string Yes
value_digest string No
value_kind string Yes
version_number integer Yes
401: Unauthorized
403: Forbidden
404: No active version found
422: Unprocessable entity
502: Bad gateway

GET /api/v1/hosting/apps/{app_id}/secrets/dotenv

Operation ID: dotenv_api_v1_app_secrets.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
app_id path string Yes
environment query string No Environment id, slug or name belonging to the app.
service query string No Optional service id, slug or name. Requires an environment; applies service-specific preview overrides.

Responses

200: Dotenv-formatted secrets (KEY=value pairs)

application/json

The response is object.

text/plain

The response is string.

401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

patch

PATCH /api/v1/hosting/apps/{app_id}/secrets/{id}

Operation ID: patch_api_v1_hosting_apps_app_id_secrets_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

Property Type Required Description
description string No
env_key string No
expose_to_build boolean No
name string No
rotation_policy string No

Responses

200: Updated secret metadata

application/json

Property Type Required Description
created_at string (date-time) No
description string No
env_key string No
expose_to_build boolean No
has_value boolean No
hosted_app_id string Yes
id string Yes
latest_version_number integer No
name string Yes
organization_id string Yes
rotation_policy string No
scope_kind string Yes
slug string Yes
status string Yes
updated_at string (date-time) No
value_digest string No
value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

remove

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

Operation ID: delete_api_v1_hosting_apps_app_id_secrets_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Success

application/json

The response is object.

204: Secret deleted
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

update

PUT /api/v1/hosting/apps/{app_id}/secrets/{id}

Operation ID: put_api_v1_hosting_apps_app_id_secrets_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

Property Type Required Description
description string No
env_key string No
expose_to_build boolean No
name string No
rotation_policy string No

Responses

200: Updated secret metadata

application/json

Property Type Required Description
created_at string (date-time) No
description string No
env_key string No
expose_to_build boolean No
has_value boolean No
hosted_app_id string Yes
id string Yes
latest_version_number integer No
name string Yes
organization_id string Yes
rotation_policy string No
scope_kind string Yes
slug string Yes
status string Yes
updated_at string (date-time) No
value_digest string No
value_kind string No
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway